summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv')
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/anch-bck.mkvi10
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/anch-pgr.lua11
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/anch-pos.lua1109
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/anch-pos.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/attr-col.lua1
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/attr-col.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/attr-ini.lua43
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/attr-ini.mkiv60
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/back-exp.lua224
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/back-exp.mkiv10
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/back-ini.lua32
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/back-ini.mkxl81
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/back-lua.lua354
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/back-lua.mkxl18
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/back-mps.lua205
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/back-mps.mkxl18
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/back-out.lua259
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/back-out.mkxl23
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/back-pdf.mkiv9
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/back-pdf.mkxl156
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/back-pdp.lua58
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/back-res.lua1
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/bibl-tra.mkiv13
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/blob-ini.lua12
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/blob-ini.mkiv11
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/buff-imp-nested.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/buff-ini.lua159
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/buff-ini.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/buff-par.mkvi4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/buff-ver.lua6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/buff-ver.mkiv88
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/buff-ver.mkxl1005
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/catc-act.mkiv8
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/catc-ctx.mkiv13
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/catc-def.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/catc-ini.lua8
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/catc-ini.mkiv46
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/catc-sym.mkiv16
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/char-def.lua7611
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/char-ini.lua13
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/char-ini.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/char-tex.lua161
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/char-utf.lua94
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/chem-str.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/cldf-com.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/cldf-ini.lua660
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/cldf-ini.mkiv25
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/cldf-int.lua405
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/cldf-scn.lua57
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/colo-ext.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/colo-grp.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/colo-icc.lua107
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/colo-imp-rgb.mkiv19
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/colo-ini.mkiv102
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/colo-ini.mkxl1407
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/cont-cs.mkxl21
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/cont-de.mkxl21
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/cont-en.mkxl21
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/cont-fil.mkiv5
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/cont-fr.mkxl21
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/cont-gb.mkxl21
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/cont-it.mkxl21
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/cont-log.mkiv26
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/cont-new.mkiv19
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/cont-nl.mkxl21
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/cont-pe.mkxl22
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/cont-ro.mkxl21
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/cont-run.lua118
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/cont-run.mkiv8
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/cont-yes.mkiv85
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/context-characters.lmx110
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/context-debug.lmx112
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/context-performance.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/context.lus71
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/context.mkiv18
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/context.mkxl619
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/core-con.lua628
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/core-con.mkiv74
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/core-dat.mkiv33
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/core-def.mkiv6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/core-env.lua50
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/core-env.mkiv10
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/core-ini.mkiv16
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/core-lmt.lua34
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/core-lmt.mkxl31
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/core-sys.lua10
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/core-sys.mkiv6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/core-uti.lua41
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/data-env.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/data-fil.lua8
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/data-ini.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/data-tex.lua24
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/data-tmp.lua10
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/data-use.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/driv-ini.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/driv-ini.mkxl20
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/driv-shp.lua1324
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/driv-shp.mkxl18
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/enco-ini.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/export-example.css64
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/export-example.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/file-ini.mkvi56
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/file-job.lua10
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/file-job.mkvi129
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/file-lib.mkiv (renamed from Master/texmf-dist/tex/context/base/mkiv/file-lib.mkvi)0
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/file-mod.lua110
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-cff.lua66
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-cft.lua6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-chk.lua21
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-col.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-con.lua107
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-ctx.lua654
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-def.lua5
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-dsp.lua9
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-emp.mklx256
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-fil.mklx422
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-fil.mkvi2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-gds.mkvi11
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-imp-combining.lua170
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-imp-dimensions.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-imp-effects.lua171
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-imp-italics.lua28
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-imp-math.lua50
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-imp-tracing.lua164
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-ini.mklx2563
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-ini.mkvi8
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-lib.mkvi19
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-map.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-mat.mklx500
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-mat.mkvi4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-mis.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-nod.lua136
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-ocl.lua117
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-ocm.lua874
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-ogr.lua672
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-one.lua21
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-onr.lua1
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-ota.lua116
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-otd.lua1
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-otj.lua62
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-otl.lua36
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-otr.lua117
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-ots.lua374
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-ott.lua38
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-pre.mkiv29
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-prv.lua33
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-run.mkiv16
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-sel.lua54
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-shp.lua133
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-sol.lua12
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-sty.mklx458
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-sty.mkvi9
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-sym.mklx245
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-tfm.lua36
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-tpk.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-tra.mkiv15
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-ttf.lua6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-vfc.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/good-ctx.lua25
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/good-mth.lua169
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/grph-bmp.lua6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/grph-chk.lua21
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/grph-con.lua23
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/grph-epd.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/grph-fig.mkiv5
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/grph-img.lua16
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/grph-inc.lua9
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/grph-inc.mkiv33
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/grph-pat.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/grph-rul.lua6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/grph-trf.lua126
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/grph-trf.mkiv163
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/hand-ini.mkxl111
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/l-lpeg.lua8
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/l-lua.lua6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/l-os.lua14
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/l-package.lua71
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/l-unicode.lua1
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lang-def.mkiv106
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lang-dis.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lang-exp.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lang-hyp.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lang-hyp.mkiv12
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lang-imp-serbian.lua38
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lang-ini.lua15
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lang-ini.mkiv31
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lang-ini.mkxl730
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lang-lab.mkxl390
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lang-mis.mkiv18
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lang-rep.lua365
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lang-rep.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lang-tra.lua123
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lang-tra.mkiv98
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lang-txt.lua660
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lang-url.lua10
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lang-url.mkiv11
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lang-wrd.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/libs-imp-curl.lua296
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/libs-imp-ghostscript.lua111
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/libs-imp-graphicsmagick.lua77
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/libs-imp-mujs.lua126
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/libs-imp-mujs.mkxl121
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/libs-imp-mysql.lua220
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/libs-imp-postgress.lua200
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/libs-imp-sqlite.lua187
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/libs-imp-zint.lua161
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/libs-imp-zint.mkxl64
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/libs-ini.lua31
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/libs-ini.mkxl31
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lpdf-ano.lua3
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lpdf-aux.lua5
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lpdf-col.lua10
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lpdf-emb.lua2224
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lpdf-eng.lua1
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lpdf-epa.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lpdf-fld.lua30
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lpdf-fmt.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lpdf-grp.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lpdf-img.lua1340
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lpdf-ini.lua49
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lpdf-lmt.lua2765
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lpdf-mis.lua15
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lpdf-pde.lua5
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lpdf-vfc.lua50
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/luat-cbk.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/luat-cnf.lua113
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/luat-cod.lua38
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/luat-cod.mkiv28
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/luat-env.lua8
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/luat-fio.lua1
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/luat-fmt.lua187
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/luat-ini.lua18
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/luat-ini.mkiv99
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/luat-lib.mkiv20
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/luat-log.lua795
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/luat-mac.lua131
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/luat-run.lua49
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/luat-sto.lua25
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/luat-usr.lua17
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/luat-usr.mkiv7
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lxml-aux.lua133
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lxml-css.lua10
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lxml-css.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lxml-ctx.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lxml-ini.lua232
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lxml-ini.mkiv201
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lxml-lpt.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lxml-tab.lua29
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lxml-tex.lua38
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/m-gnuplot.mkxl97
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/m-oldbibtex.mkiv9
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/math-act.lua123
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/math-ali.mkiv38
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/math-def.mkiv14
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/math-dim.lua1
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/math-fbk.lua12
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/math-fen.mkiv80
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/math-frc.lua46
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/math-frc.mkiv25
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/math-inc.lua9
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/math-ini.lua100
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/math-ini.mkiv81
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/math-map.lua1
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/math-noa.lua51
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/math-rad.mkvi60
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/math-stc.mkvi77
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/math-tag.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/math-ttv.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/math-vfu.lua16
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/meta-blb.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/meta-fig.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/meta-fnt.lua7
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/meta-imp-gamesymbols.mkxl349
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/meta-imp-mat.mkiv11
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/meta-imp-symbols.mkxl99
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/meta-imp-threesix.mkxl253
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/meta-imp-txt.mkiv15
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/meta-ini.mkiv34
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/meta-ini.mkxl1465
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/meta-lua.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/meta-mac.mkxl66
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/meta-pag.mkxl26
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mlib-cnt.lua2021
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mlib-ctx.lua37
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mlib-ctx.mkiv11
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mlib-ctx.mkxl31
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mlib-fio.lua85
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mlib-int.lua352
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mlib-lmp.lua229
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mlib-lmt.lua63
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mlib-lua.lua1318
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mlib-mat.lua137
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mlib-mpf.lua1244
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mlib-pdf.lua20
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mlib-pdf.mkxl171
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mlib-pps.lua41
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mlib-pps.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mlib-run.lua245
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mlib-scn.lua777
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mlib-svg.lua3268
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mtx-context-arrange.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mtx-context-compare.tex10
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mtx-context-meaning.tex20
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mtx-context-select.tex8
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mtx-context-timing.tex23
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mult-aux.mkiv324
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mult-aux.mkxl1170
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mult-chk.mkiv8
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mult-def.lua4862
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mult-def.mkiv6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mult-dim.mkvi16
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mult-fmt.lua338
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mult-fun.lua20
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mult-ini.lua160
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mult-ini.mkiv174
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mult-low.lua125
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mult-mes.lua3
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mult-mps.lua13
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mult-prm.lua145
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mult-sys.mkiv29
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-acc.lua7
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-aux.lua425
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-bck.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-bck.mkiv16
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-cmp.lua232
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-ext.lua30
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-fin.lua99
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-fin.mkiv5
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-fnt.lua64
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-gcm.lua96
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-ini.lua126
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-ini.mkiv17
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-ltp.lua65
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-met.lua234
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-mig.lua227
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-mig.mkiv23
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-nut.lua80
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-pag.lua30
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-pag.mkiv20
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-par.lua6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-ref.lua29
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-res.lua37
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-rul.lua5
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-rul.mkiv16
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-scn.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-ser.lua1
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-shp.lua109
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-syn.lua63
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-tex.lua9
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-tra.lua33
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-typ.lua45
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/pack-bar.mkiv12
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/pack-box.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/pack-com.mkiv83
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/pack-lyr.mkxl794
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/pack-mrl.mkiv6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/pack-obj.lua1
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/pack-ori.lua70
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/pack-ori.mkxl88
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/pack-rul.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/pack-rul.mkiv10
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/pack-rul.mkxl3089
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-bck.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-box.mkvi1
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-brk.mkiv7
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-col.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-ffl.mkiv25
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-flt.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-imp.mkiv19
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-ini.lua17
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-inj.mkvi2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-ins.lua8
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-ins.mkiv42
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-lay.mkiv15
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-lin.lua9
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-lin.mkvi37
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-mix.mkiv20
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-mul.mkiv8
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-not.mkiv17
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-one.mkiv25
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-otr.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-otr.mkvi2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-pcl.mkiv3
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-run.lua36
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-run.mkiv6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-spr.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-txt.mklx969
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-txt.mkvi15
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/phys-dim.lua106
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/phys-dim.mkiv38
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/prop-ini.mkiv64
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/publ-aut.lua6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/publ-imp-apa.mkvi40
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/publ-imp-aps.mkvi26
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/publ-imp-author.mkvi2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/publ-imp-chicago.mkvi50
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/publ-imp-cite.mkvi4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/publ-imp-commands.mkvi6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/publ-imp-default.mkvi16
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/publ-imp-definitions.mkvi10
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/publ-imp-list.mkvi8
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/publ-ini.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/publ-ini.mkiv44
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/publ-usr.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/scrn-bar.mkvi8
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/scrn-but.mkvi4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/scrn-fld.mkvi4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/scrn-ini.mkvi4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/scrn-wid.mkvi6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/scrp-cjk.lua59
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/scrp-eth.lua12
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/scrp-ini.lua251
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/scrp-ini.mkiv50
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/scrp-tib.lua31
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/sort-lan.lua46
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/spac-ali.lua3
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/spac-ali.mkiv46
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/spac-chr.lua34
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/spac-chr.mkiv9
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/spac-flr.mkiv17
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/spac-grd.mkiv8
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/spac-hor.mkiv33
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/spac-lin.mkiv61
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/spac-par.mkiv58
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/spac-prf.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/spac-prf.mkvi2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/spac-ver.lua143
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/spac-ver.mkiv114
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/spac-ver.mkxl2605
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/status-files.pdfbin28109 -> 25384 bytes
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/status-lua.pdfbin271171 -> 257025 bytes
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-con.mkvi83
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-des.mkvi4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-doc.lua5
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-flt.lua6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-flt.mkvi82
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-itm.mklx1882
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-itm.mkvi58
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-lnt.mkvi20
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-lst.lua25
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-lst.mkvi102
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-mar.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-mat.mkiv7
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-not.lua6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-not.mkvi370
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-pag.lua9
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-pag.mkiv21
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-ref.lua14
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-ref.mkvi81
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-reg.lua25
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-reg.mkiv10
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-ren.mkiv12
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-sec.mkiv50
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-syn.lua14
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-syn.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-tag.lua7
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-tag.mkiv326
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/supp-box.lua75
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/supp-box.mkiv453
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/supp-box.mkxl2952
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/supp-dir.mkiv51
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/supp-mat.mkiv45
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/supp-ran.lua19
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/supp-ran.mkiv37
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/supp-vis.mkiv84
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/symb-emj.mkiv1
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/symb-imp-cc.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/symb-imp-mis.mkiv6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/symb-imp-nav.mkiv17
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/symb-ini.lua1
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/syst-aux.lua245
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/syst-aux.mkiv1102
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/syst-aux.mkxl6587
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/syst-con.lua18
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/syst-con.mkiv10
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/syst-con.mkxl93
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/syst-fnt.mkiv39
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/syst-ini.mkiv194
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/syst-ini.mkxl1116
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/syst-lua.lua346
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/syst-lua.mkiv6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/syst-lua.mkxl100
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/syst-mac.lua9
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/syst-mes.mkiv6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/syst-pln.mkiv7
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/tabl-ltb.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/tabl-mis.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/tabl-ntb.mkiv8
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/tabl-ntb.mkxl2202
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/tabl-nte.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/tabl-tab.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/tabl-tbl.lua9
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/tabl-tbl.mkiv31
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/tabl-tbl.mkxl3022
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/tabl-xtb.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/tabl-xtb.mkvi2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/task-ini.lua16
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/toks-ini.lua233
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/toks-scn.lua236
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/toks-scn.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/toks-tra.lua293
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/toks-tra.mkiv34
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/trac-ctx.lua36
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/trac-ctx.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/trac-deb.lua158
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/trac-deb.mkiv7
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/trac-inf.lua43
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/trac-log.lua587
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/trac-set.lua75
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/trac-vis.lua366
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/trac-vis.mkiv24
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/type-ini.lua8
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/type-ini.mklx618
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-bld.lua3
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-brk.lua10
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-brk.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-cap.lua1
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-cap.mkiv9
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-chr.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-cln.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-del.mkiv16
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-dha.lua38
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-dig.lua1
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-dig.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-dir.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-drp.lua6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-drp.mkiv18
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-dua.lua14
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-dub.lua14
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-duc.lua124
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-fkr.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-fln.lua10
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-fln.mkiv8
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-itc.mkvi8
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-itm.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-krn.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-lig.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-lin.lua14
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-mar.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-ovl.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-plc.mkiv39
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-pnc.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-rep.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-rub.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-spa.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-tal.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-tal.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/unic-ini.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/util-dim.lua18
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/util-fil.lua1
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/util-lib.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/util-prs.lua38
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/util-sac.lua1
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/util-soc-imp-http.lua10
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/util-str.lua156
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/util-tab.lua9
556 files changed, 27345 insertions, 71984 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/anch-bck.mkvi b/Master/texmf-dist/tex/context/base/mkiv/anch-bck.mkvi
index 96dd0cdf54a..32e45a642b1 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/anch-bck.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/anch-bck.mkvi
@@ -265,9 +265,9 @@
% maybe we should have a resetter for such compensation struts
\def\anch_backgrounds_reset_attributes
- {\scratchcounter\attribute\snapmethodattribute
- \resetallattributes % \attribute\linenumberattribute \attributeunsetvalue
- \attribute\snapmethodattribute\scratchcounter}
+ {\scratchcounter\c_attr_snapmethod
+ \resetallattributes % \c_attr_linenumber\attributeunsetvalue
+ \c_attr_snapmethod\scratchcounter}
\def\anch_backgrounds_text_start_par % beware .. background shapes
{\endgraf % new
@@ -364,14 +364,14 @@
\def\anch_backgrounds_bpos
{\ifconditional\c_anch_backgrounds_pos_no_shape
- \attribute\textbackgroundattribute\attributeunsetvalue
+ \c_attr_textbackground\attributeunsetvalue
\bposkind\v_anch_backgrounds_text_current\plusthree
\else\ifnum\c_anch_backgrounds_pos_state=\plusone
\bposkind\v_anch_backgrounds_text_current\c_anch_backgrounds_pos_state
\clf_registerbackground{\v_anch_backgrounds_text_current}%
\else
\bposkind\v_anch_backgrounds_text_current\c_anch_backgrounds_pos_state
- \attribute\textbackgroundattribute\attributeunsetvalue
+ \c_attr_textbackground\attributeunsetvalue
\fi\fi}
% plugs into other code
diff --git a/Master/texmf-dist/tex/context/base/mkiv/anch-pgr.lua b/Master/texmf-dist/tex/context/base/mkiv/anch-pgr.lua
index be9e28c08dc..8e400cd123f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/anch-pgr.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/anch-pgr.lua
@@ -76,7 +76,7 @@ local getheight = nuts.getheight
local getdepth = nuts.getdepth
local nodecodes = nodes.nodecodes
-local localpar_code = nodecodes.localpar
+local par_code = nodecodes.par
local start_of_par = nuts.start_of_par
local insert_before = nuts.insert_before
@@ -165,7 +165,7 @@ local function flush(head,f,l,a,parent,depth)
ln = new_hlist(setlink(new_rule(65536,65536*4,0),new_kern(-65536),ln))
rn = new_hlist(setlink(new_rule(65536,0,65536*4),new_kern(-65536),rn))
end
- if getid(f) == localpar_code and start_of_par(f) then -- we need to clean this mess
+ if getid(f) == par_code and start_of_par(f) then -- we need to clean this mess
insert_after(head,f,ln)
else
head, f = insert_before(head,f,ln)
@@ -1210,7 +1210,7 @@ posregions[%s] := (%p,%p)--(%p,%p)--(%p,%p)--(%p,%p)--cycle ;
implement {
name = "fetchposboxes",
arguments = { "string", "string", "integer" },
- actions = function(tags,anchor,page) -- no caching (yet) / todo: anchor, page
+ actions = function(tags,anchor,page) -- no caching (yet) / page
local collected = jobpositions.collected
if type(tags) == "string" then
tags = utilities.parsers.settings_to_array(tags)
@@ -1222,6 +1222,9 @@ implement {
local c = collected[tag]
if c then
local r = c.r
+ if anchor ~= r then
+ r = anchor
+ end
if r then
r = collected[r]
if r then
@@ -1231,7 +1234,7 @@ implement {
local rh = r.h
local rd = r.d
local cx = c.x - rx
- local cy = c.y
+ local cy = c.y - ry
local cw = cx + c.w
local ch = cy + c.h
local cd = cy - c.d
diff --git a/Master/texmf-dist/tex/context/base/mkiv/anch-pos.lua b/Master/texmf-dist/tex/context/base/mkiv/anch-pos.lua
index 2788c9d1a55..77bf09e3923 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/anch-pos.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/anch-pos.lua
@@ -13,16 +13,19 @@ more efficient.</p>
--ldx]]--
-- plus (extra) is obsolete but we will keep it for a while
-
+--
-- maybe replace texsp by our own converter (stay at the lua end)
-- eventually mp will have large numbers so we can use sp there too
-
--- this is one of the first modules using scanners and we need to replace
--- it by implement and friends
-
+--
+-- this is one of the first modules using scanners and we need to replace it by
+-- implement and friends
+--
-- we could have namespaces, like p, page, region, columnarea, textarea but then
-- we need virtual table accessors as well as have tag/id accessors ... we don't
-- save much here (at least not now)
+--
+-- This was the last module that got rid of directly setting scanners, with a little
+-- performance degradation but not that noticeable.
local tostring, next, setmetatable, tonumber = tostring, next, setmetatable, tonumber
local sort = table.sort
@@ -38,8 +41,7 @@ local scanstring = scanners.string
local scaninteger = scanners.integer
local scandimen = scanners.dimen
-local compilescanner = tokens.compile
-local scanners = interfaces.scanners
+local implement = interfaces.implement
local commands = commands
local context = context
@@ -48,6 +50,7 @@ local ctx_latelua = context.latelua
local tex = tex
local texgetcount = tex.getcount
+local texgetinteger = tex.getintegervalue or tex.getcount
local texsetcount = tex.setcount
local texget = tex.get
local texsp = tex.sp
@@ -124,9 +127,9 @@ local nofregular = 0
local nofspecial = 0
local splitter = lpeg.splitat(":",true)
-local pagedata = { }
-local columndata = setmetatableindex("table") -- per page
-local freedata = setmetatableindex("table") -- per page
+local pagedata = { }
+local columndata = setmetatableindex("table") -- per page
+local freedata = setmetatableindex("table") -- per page
local function initializer()
tobesaved = jobpositions.tobesaved
@@ -251,7 +254,7 @@ local nofpages = nil
-- beware ... we're not sparse here as lua will reserve slots for the nilled
-local getpos, gethpos, getvpos
+local getpos, gethpos, getvpos, getrpos
function jobpositions.registerhandlers(t)
getpos = t and t.getpos or function() return 0, 0 end
@@ -280,7 +283,7 @@ local function setall(name,p,x,y,w,h,d,extra)
e = extra ~= "" and extra or nil,
r = region,
c = column,
- r2l = texgetcount("inlinelefttoright") == 1 and true or nil,
+ r2l = texgetinteger("inlinelefttoright") == 1 and true or nil,
}
end
@@ -376,19 +379,22 @@ jobpositions.set = set
jobpositions.setspec = setspec
jobpositions.get = get
-scanners.dosaveposition = compilescanner {
+implement {
+ name = "dosaveposition",
+ arguments = { "string", "integer", "dimen", "dimen" },
actions = setall, -- name p x y
- arguments = { "string", "integer", "dimen", "dimen" }
}
-scanners.dosavepositionwhd = compilescanner { -- somehow fails
+implement {
+ name = "dosavepositionwhd",
+ arguments = { "string", "integer", "dimen", "dimen", "dimen", "dimen", "dimen" },
actions = setall, -- name p x y w h d
- arguments = { "string", "integer", "dimen", "dimen", "dimen", "dimen", "dimen" }
}
-scanners.dosavepositionplus = compilescanner {
+implement {
+ name = "dosavepositionplus",
+ arguments = { "string", "integer", "dimen", "dimen", "dimen", "dimen", "dimen", "string" },
actions = setall, -- name p x y w h d extra
- arguments = { "string", "integer", "dimen", "dimen", "dimen", "dimen", "dimen", "string" }
}
-- will become private table (could also become attribute driven but too nasty
@@ -424,29 +430,41 @@ end
jobpositions.b_column = b_column
jobpositions.e_column = e_column
-scanners.bposcolumn = function() -- tag
- local tag = scanstring()
- insert(columns,tag)
- column = tag
-end
+implement {
+ name = "bposcolumn",
+ arguments = "string",
+ actions = function(tag)
+ insert(columns,tag)
+ column = tag
+ end
+}
-scanners.bposcolumnregistered = function() -- tag
- local tag = scanstring()
- insert(columns,tag)
- column = tag
- ctx_latelua { action = b_column, tag = tag }
-end
+implement {
+ name = "bposcolumnregistered",
+ arguments = "string",
+ actions = function(tag)
+ insert(columns,tag)
+ column = tag
+ ctx_latelua { action = b_column, tag = tag }
+ end
+}
-scanners.eposcolumn = function()
- remove(columns)
- column = columns[#columns]
-end
+implement {
+ name = "eposcolumn",
+ actions = function()
+ remove(columns)
+ column = columns[#columns]
+ end
+}
-scanners.eposcolumnregistered = function()
- ctx_latelua { action = e_column }
- remove(columns)
- column = columns[#columns]
-end
+implement {
+ name = "eposcolumnregistered",
+ actions = function()
+ ctx_latelua { action = e_column }
+ remove(columns)
+ column = columns[#columns]
+ end
+}
-- regions
@@ -551,167 +569,181 @@ end
local nofparagraphs = 0
-scanners.parpos = function()
- nofparagraphs = nofparagraphs + 1
- texsetcount("global","c_anch_positions_paragraph",nofparagraphs)
- local box = getbox("strutbox")
- local w, h, d = getwhd(box)
- local t = {
- p = true,
- c = true,
- r = true,
- x = true,
- y = true,
- h = h,
- d = d,
- hs = texget("hsize"), -- never 0
- }
- local leftskip = texget("leftskip",false)
- local rightskip = texget("rightskip",false)
- local hangindent = texget("hangindent")
- local hangafter = texget("hangafter")
- local parindent = texget("parindent")
- local parshape = texget("parshape")
- if leftskip ~= 0 then
- t.ls = leftskip
- end
- if rightskip ~= 0 then
- t.rs = rightskip
- end
- if hangindent ~= 0 then
- t.hi = hangindent
- end
- if hangafter ~= 1 and hangafter ~= 0 then -- can not be zero .. so it needs to be 1 if zero
- t.ha = hangafter
- end
- if parindent ~= 0 then
- t.pi = parindent
- end
- if parshape and #parshape > 0 then
- t.ps = parshape
+implement {
+ name = "parpos",
+ actions = function()
+ nofparagraphs = nofparagraphs + 1
+ texsetcount("global","c_anch_positions_paragraph",nofparagraphs)
+ local box = getbox("strutbox")
+ local w, h, d = getwhd(box)
+ local t = {
+ p = true,
+ c = true,
+ r = true,
+ x = true,
+ y = true,
+ h = h,
+ d = d,
+ hs = texget("hsize"), -- never 0
+ }
+ local leftskip = texget("leftskip",false)
+ local rightskip = texget("rightskip",false)
+ local hangindent = texget("hangindent")
+ local hangafter = texget("hangafter")
+ local parindent = texget("parindent")
+ local parshape = texget("parshape")
+ if leftskip ~= 0 then
+ t.ls = leftskip
+ end
+ if rightskip ~= 0 then
+ t.rs = rightskip
+ end
+ if hangindent ~= 0 then
+ t.hi = hangindent
+ end
+ if hangafter ~= 1 and hangafter ~= 0 then -- can not be zero .. so it needs to be 1 if zero
+ t.ha = hangafter
+ end
+ if parindent ~= 0 then
+ t.pi = parindent
+ end
+ if parshape and #parshape > 0 then
+ t.ps = parshape
+ end
+ local name = f_p_tag(nofparagraphs)
+ tobesaved[name] = t
+ ctx_latelua { action = enhance, specification = t }
end
- local name = f_p_tag(nofparagraphs)
- tobesaved[name] = t
- ctx_latelua { action = enhance, specification = t }
-end
+}
-scanners.dosetposition = function() -- name
- local name = scanstring()
- local spec = {
- p = true,
- c = column,
- r = true,
- x = true,
- y = true,
- n = nofparagraphs > 0 and nofparagraphs or nil,
- r2l = texgetcount("inlinelefttoright") == 1 or nil,
- }
- tobesaved[name] = spec
- ctx_latelua { action = enhance, specification = spec }
-end
+implement {
+ name = "dosetposition",
+ arguments = "string",
+ actions = function(name)
+ local spec = {
+ p = true,
+ c = column,
+ r = true,
+ x = true,
+ y = true,
+ n = nofparagraphs > 0 and nofparagraphs or nil,
+ r2l = texgetinteger("inlinelefttoright") == 1 or nil,
+ }
+ tobesaved[name] = spec
+ ctx_latelua { action = enhance, specification = spec }
+ end
+}
-scanners.dosetpositionwhd = function() -- name w h d extra
- local name = scanstring()
- local w = scandimen()
- local h = scandimen()
- local d = scandimen()
- local spec = {
- p = true,
- c = column,
- r = true,
- x = true,
- y = true,
- w = w ~= 0 and w or nil,
- h = h ~= 0 and h or nil,
- d = d ~= 0 and d or nil,
- n = nofparagraphs > 0 and nofparagraphs or nil,
- r2l = texgetcount("inlinelefttoright") == 1 or nil,
- }
- tobesaved[name] = spec
- ctx_latelua { action = enhance, specification = spec }
-end
+implement {
+ name = "dosetpositionwhd",
+ arguments = { "string", "dimen", "dimen", "dimen" },
+ actions = function(name,w,h,d)
+ local spec = {
+ p = true,
+ c = column,
+ r = true,
+ x = true,
+ y = true,
+ w = w ~= 0 and w or nil,
+ h = h ~= 0 and h or nil,
+ d = d ~= 0 and d or nil,
+ n = nofparagraphs > 0 and nofparagraphs or nil,
+ r2l = texgetinteger("inlinelefttoright") == 1 or nil,
+ }
+ tobesaved[name] = spec
+ ctx_latelua { action = enhance, specification = spec }
+ end
+}
-scanners.dosetpositionbox = function() -- name box
- local name = scanstring()
- local box = getbox(scaninteger())
- local w, h, d = getwhd(box)
- local spec = {
- p = true,
- c = column,
- r = true,
- x = true,
- y = true,
- w = w ~= 0 and w or nil,
- h = h ~= 0 and h or nil,
- d = d ~= 0 and d or nil,
- n = nofparagraphs > 0 and nofparagraphs or nil,
- r2l = texgetcount("inlinelefttoright") == 1 or nil,
- }
- tobesaved[name] = spec
- ctx_latelua { action = enhance, specification = spec }
-end
+implement {
+ name = "dosetpositionbox",
+ arguments = { "string", "integer" },
+ actions = function(name,n)
+ local box = getbox(n)
+ local w, h, d = getwhd(box)
+ local spec = {
+ p = true,
+ c = column,
+ r = true,
+ x = true,
+ y = true,
+ w = w ~= 0 and w or nil,
+ h = h ~= 0 and h or nil,
+ d = d ~= 0 and d or nil,
+ n = nofparagraphs > 0 and nofparagraphs or nil,
+ r2l = texgetinteger("inlinelefttoright") == 1 or nil,
+ }
+ tobesaved[name] = spec
+ ctx_latelua { action = enhance, specification = spec }
+ end
+}
-scanners.dosetpositionplus = function() -- name w h d extra
- local name = scanstring()
- local w = scandimen()
- local h = scandimen()
- local d = scandimen()
- local spec = {
- p = true,
- c = column,
- r = true,
- x = true,
- y = true,
- w = w ~= 0 and w or nil,
- h = h ~= 0 and h or nil,
- d = d ~= 0 and d or nil,
- n = nofparagraphs > 0 and nofparagraphs or nil,
- e = scanstring(),
- r2l = texgetcount("inlinelefttoright") == 1 or nil,
- }
- tobesaved[name] = spec
- ctx_latelua { action = enhance, specification = spec }
-end
+implement {
+ name = "dosetpositionplus",
+ arguments = { "string", "dimen", "dimen", "dimen" },
+ actions = function(name,w,h,d)
+ local spec = {
+ p = true,
+ c = column,
+ r = true,
+ x = true,
+ y = true,
+ w = w ~= 0 and w or nil,
+ h = h ~= 0 and h or nil,
+ d = d ~= 0 and d or nil,
+ n = nofparagraphs > 0 and nofparagraphs or nil,
+ e = scanstring(),
+ r2l = texgetinteger("inlinelefttoright") == 1 or nil,
+ }
+ tobesaved[name] = spec
+ ctx_latelua { action = enhance, specification = spec }
+ end
+}
-scanners.dosetpositionstrut = function() -- name
- local name = scanstring()
- local box = getbox("strutbox")
- local w, h, d = getwhd(box)
- local spec = {
- p = true,
- c = column,
- r = true,
- x = true,
- y = true,
- h = h ~= 0 and h or nil,
- d = d ~= 0 and d or nil,
- n = nofparagraphs > 0 and nofparagraphs or nil,
- r2l = texgetcount("inlinelefttoright") == 1 or nil,
- }
- tobesaved[name] = spec
- ctx_latelua { action = enhance, specification = spec }
-end
+implement {
+ name = "dosetpositionstrut",
+ arguments = "string",
+ actions = function(name)
+ local box = getbox("strutbox")
+ local w, h, d = getwhd(box)
+ local spec = {
+ p = true,
+ c = column,
+ r = true,
+ x = true,
+ y = true,
+ h = h ~= 0 and h or nil,
+ d = d ~= 0 and d or nil,
+ n = nofparagraphs > 0 and nofparagraphs or nil,
+ r2l = texgetinteger("inlinelefttoright") == 1 or nil,
+ }
+ tobesaved[name] = spec
+ ctx_latelua { action = enhance, specification = spec }
+ end
+}
-scanners.dosetpositionstrutkind = function() -- name
- local name = scanstring()
- local kind = scaninteger()
- local box = getbox("strutbox")
- local w, h, d = getwhd(box)
- local spec = {
- k = kind,
- p = true,
- c = column,
- r = true,
- x = true,
- y = true,
- h = h ~= 0 and h or nil,
- d = d ~= 0 and d or nil,
- n = nofparagraphs > 0 and nofparagraphs or nil,
- r2l = texgetcount("inlinelefttoright") == 1 or nil,
- }
- tobesaved[name] = spec
- ctx_latelua { action = enhance, specification = spec }
-end
+implement {
+ name = "dosetpositionstrutkind",
+ arguments = { "string", "integer" },
+ actions = function(name,kind)
+ local box = getbox("strutbox")
+ local w, h, d = getwhd(box)
+ local spec = {
+ k = kind,
+ p = true,
+ c = column,
+ r = true,
+ x = true,
+ y = true,
+ h = h ~= 0 and h or nil,
+ d = d ~= 0 and d or nil,
+ n = nofparagraphs > 0 and nofparagraphs or nil,
+ r2l = texgetinteger("inlinelefttoright") == 1 or nil,
+ }
+ tobesaved[name] = spec
+ ctx_latelua { action = enhance, specification = spec }
+ end
+}
function jobpositions.getreserved(tag,n)
if tag == v_column then
@@ -990,166 +1022,222 @@ jobpositions.columnofpos = columnofpos
-- interface
-scanners.replacepospxywhd = function() -- name page x y w h d
- collected[scanstring()] = {
- p = scaninteger(),
- x = scandimen(),
- y = scandimen(),
- w = scandimen(),
- h = scandimen(),
- d = scandimen(),
- }
-end
+implement {
+ name = "replacepospxywhd",
+ arguments = { "string", "integer", "dimen", "dimen", "dimen", "dimen", "dimen" },
+ actions = function(name,page,x,y,w,h,d)
+ collected[name] = {
+ p = page,
+ x = x,
+ y = y,
+ w = w,
+ h = h,
+ d = d,
+ }
+ end
+}
-scanners.copyposition = function() -- target source
- collected[scanstring()] = collected[scanstring()]
-end
+implement {
+ name = "copyposition",
+ arguments = "2 strings",
+ actions = function(target,source)
+ collected[target] = collected[source]
+ end
+}
-scanners.MPp = function() -- name
- local jpi = collected[scanstring()]
- if jpi then
- local p = jpi.p
- if p and p ~= true then
- context(p)
- return
+implement {
+ name = "MPp",
+ arguments = "string",
+ actions = function(name)
+ local jpi = collected[name]
+ if jpi then
+ local p = jpi.p
+ if p and p ~= true then
+ context(p)
+ return
+ end
end
+ context('0')
end
- context('0')
-end
+}
-scanners.MPx = function() -- name
- local jpi = collected[scanstring()]
- if jpi then
- local x = jpi.x
- if x and x ~= true and x ~= 0 then
- context("%.5Fpt",x*pt)
- return
+implement {
+ name = "MPx",
+ arguments = "string",
+ actions = function(name)
+ local jpi = collected[name]
+ if jpi then
+ local x = jpi.x
+ if x and x ~= true and x ~= 0 then
+ context("%.5Fpt",x*pt)
+ return
+ end
end
+ context('0pt')
end
- context('0pt')
-end
+}
-scanners.MPy = function() -- name
- local jpi = collected[scanstring()]
- if jpi then
- local y = jpi.y
- if y and y ~= true and y ~= 0 then
- context("%.5Fpt",y*pt)
- return
+implement {
+ name = "MPy",
+ arguments = "string",
+ actions = function(name)
+ local jpi = collected[name]
+ if jpi then
+ local y = jpi.y
+ if y and y ~= true and y ~= 0 then
+ context("%.5Fpt",y*pt)
+ return
+ end
end
+ context('0pt')
end
- context('0pt')
-end
+}
-scanners.MPw = function() -- name
- local jpi = collected[scanstring()]
- if jpi then
- local w = jpi.w
- if w and w ~= 0 then
- context("%.5Fpt",w*pt)
- return
+implement {
+ name = "MPw",
+ arguments = "string",
+ actions = function(name)
+ local jpi = collected[name]
+ if jpi then
+ local w = jpi.w
+ if w and w ~= 0 then
+ context("%.5Fpt",w*pt)
+ return
+ end
end
+ context('0pt')
end
- context('0pt')
-end
+}
-scanners.MPh = function() -- name
- local jpi = collected[scanstring()]
- if jpi then
- local h = jpi.h
- if h and h ~= 0 then
- context("%.5Fpt",h*pt)
- return
+implement {
+ name = "MPh",
+ arguments = "string",
+ actions = function(name)
+ local jpi = collected[name]
+ if jpi then
+ local h = jpi.h
+ if h and h ~= 0 then
+ context("%.5Fpt",h*pt)
+ return
+ end
end
+ context('0pt')
end
- context('0pt')
-end
+}
-scanners.MPd = function() -- name
- local jpi = collected[scanstring()]
- if jpi then
- local d = jpi.d
- if d and d ~= 0 then
- context("%.5Fpt",d*pt)
- return
+implement {
+ name = "MPd",
+ arguments = "string",
+ actions = function(name)
+ local jpi = collected[name]
+ if jpi then
+ local d = jpi.d
+ if d and d ~= 0 then
+ context("%.5Fpt",d*pt)
+ return
+ end
end
+ context('0pt')
end
- context('0pt')
-end
+}
-scanners.MPxy = function() -- name
- local jpi = collected[scanstring()]
- if jpi then
- context('(%.5Fpt,%.5Fpt)',
- jpi.x*pt,
- jpi.y*pt
- )
- else
- context('(0,0)')
+implement {
+ name = "MPxy",
+ arguments = "string",
+ actions = function(name)
+ local jpi = collected[name]
+ if jpi then
+ context('(%.5Fpt,%.5Fpt)',
+ jpi.x*pt,
+ jpi.y*pt
+ )
+ else
+ context('(0,0)')
+ end
end
-end
+}
-scanners.MPwhd = function() -- name
- local jpi = collected[scanstring()]
- if jpi then
- local w = jpi.w or 0
- local h = jpi.h or 0
- local d = jpi.d or 0
- if w ~= 0 or h ~= 0 or d ~= 0 then
- context("%.5Fpt,%.5Fpt,%.5Fpt",w*pt,h*pt,d*pt)
- return
+implement {
+ name = "MPwhd",
+ arguments = "string",
+ actions = function(name)
+ local jpi = collected[name]
+ if jpi then
+ local w = jpi.w or 0
+ local h = jpi.h or 0
+ local d = jpi.d or 0
+ if w ~= 0 or h ~= 0 or d ~= 0 then
+ context("%.5Fpt,%.5Fpt,%.5Fpt",w*pt,h*pt,d*pt)
+ return
+ end
end
+ context('0pt,0pt,0pt')
end
- context('0pt,0pt,0pt')
-end
+}
-scanners.MPll = function() -- name
- local jpi = collected[scanstring()]
- if jpi then
- context('(%.5Fpt,%.5Fpt)',
- jpi.x *pt,
- (jpi.y-jpi.d)*pt
- )
- else
- context('(0,0)') -- for mp only
+implement {
+ name = "MPll",
+ arguments = "string",
+ actions = function(name)
+ local jpi = collected[name]
+ if jpi then
+ context('(%.5Fpt,%.5Fpt)',
+ jpi.x *pt,
+ (jpi.y-jpi.d)*pt
+ )
+ else
+ context('(0,0)') -- for mp only
+ end
end
-end
+}
-scanners.MPlr = function() -- name
- local jpi = collected[scanstring()]
- if jpi then
- context('(%.5Fpt,%.5Fpt)',
- (jpi.x + jpi.w)*pt,
- (jpi.y - jpi.d)*pt
- )
- else
- context('(0,0)') -- for mp only
+implement {
+ name = "MPlr",
+ arguments = "string",
+ actions = function(name)
+ local jpi = collected[name]
+ if jpi then
+ context('(%.5Fpt,%.5Fpt)',
+ (jpi.x + jpi.w)*pt,
+ (jpi.y - jpi.d)*pt
+ )
+ else
+ context('(0,0)') -- for mp only
+ end
end
-end
+}
-scanners.MPur = function() -- name
- local jpi = collected[scanstring()]
- if jpi then
- context('(%.5Fpt,%.5Fpt)',
- (jpi.x + jpi.w)*pt,
- (jpi.y + jpi.h)*pt
- )
- else
- context('(0,0)') -- for mp only
+implement {
+ name = "MPur",
+ arguments = "string",
+ actions = function(name)
+ local jpi = collected[name]
+ if jpi then
+ context('(%.5Fpt,%.5Fpt)',
+ (jpi.x + jpi.w)*pt,
+ (jpi.y + jpi.h)*pt
+ )
+ else
+ context('(0,0)') -- for mp only
+ end
end
-end
+}
-scanners.MPul = function() -- name
- local jpi = collected[scanstring()]
- if jpi then
- context('(%.5Fpt,%.5Fpt)',
- jpi.x *pt,
- (jpi.y + jpi.h)*pt
- )
- else
- context('(0,0)') -- for mp only
+implement {
+ name = "MPul",
+ arguments = "string",
+ actions = function(name)
+ local jpi = collected[name]
+ if jpi then
+ context('(%.5Fpt,%.5Fpt)',
+ jpi.x *pt,
+ (jpi.y + jpi.h)*pt
+ )
+ else
+ context('(0,0)') -- for mp only
+ end
end
-end
+}
local function MPpos(id)
local jpi = collected[id]
@@ -1170,53 +1258,67 @@ local function MPpos(id)
context('0,0,0,0,0,0') -- for mp only
end
-scanners.MPpos = function() -- name
- MPpos(scanstring())
-end
+implement {
+ name = "MPpos",
+ arguments = "string",
+ actions = MPpos
+}
-scanners.MPn = function() -- name
- local jpi = collected[scanstring()]
- if jpi then
- local n = jpi.n
- if n then
- context(n)
- return
+implement {
+ name = "MPn",
+ arguments = "string",
+ actions = function(name)
+ local jpi = collected[name]
+ if jpi then
+ local n = jpi.n
+ if n then
+ context(n)
+ return
+ end
end
+ context(0)
end
- context(0)
-end
+}
-scanners.MPc = function() -- name
- local jpi = collected[scanstring()]
- if jpi then
- local c = jpi.c
- if c and c ~= true then
- context(c)
- return
+implement {
+ name = "MPc",
+ arguments = "string",
+ actions = function(name)
+ local jpi = collected[name]
+ if jpi then
+ local c = jpi.c
+ if c and c ~= true then
+ context(c)
+ return
+ end
end
+ context('0') -- okay ?
end
- context('0') -- okay ?
-end
+}
-scanners.MPr = function() -- name
- local jpi = collected[scanstring()]
- if jpi then
- local r = jpi.r
- if r and r ~= true then
- context(r)
- return
- end
- local p = jpi.p
- if p then
- context("page:" .. p)
+implement {
+ name = "MPr",
+ arguments = "string",
+ actions = function(name)
+ local jpi = collected[name]
+ if jpi then
+ local r = jpi.r
+ if r and r ~= true then
+ context(r)
+ return
+ end
+ local p = jpi.p
+ if p and p ~= true then
+ context("page:" .. p)
+ end
end
end
-end
+}
-local function MPpardata(n)
- local t = collected[n]
+local function MPpardata(id)
+ local t = collected[id]
if not t then
- local tag = f_p_tag(n)
+ local tag = f_p_tag(id)
t = collected[tag]
end
if t then
@@ -1233,157 +1335,213 @@ local function MPpardata(n)
end
end
-scanners.MPpardata = function() -- name
- MPpardata(scanstring())
-end
+implement {
+ name = "MPpardata",
+ arguments = "string",
+ actions = MPpardata
+}
-scanners.MPposset = function() -- name (special helper, used in backgrounds)
- local name = scanstring()
- local b = f_b_tag(name)
- local e = f_e_tag(name)
- local w = f_w_tag(name)
- local p = f_p_tag(getparagraph(b))
- MPpos(b) context(",") MPpos(e) context(",") MPpos(w) context(",") MPpos(p) context(",") MPpardata(p)
-end
+implement {
+ name = "MPposset",
+ arguments = "string",
+ actions = function(name)
+ local b = f_b_tag(name)
+ local e = f_e_tag(name)
+ local w = f_w_tag(name)
+ local p = f_p_tag(getparagraph(b))
+ MPpos(b) context(",") MPpos(e) context(",") MPpos(w) context(",") MPpos(p) context(",") MPpardata(p)
+ end
+}
-scanners.MPls = function() -- name
- local jpi = collected[scanstring()]
- if jpi then
- context("%.5Fpt",jpi.ls*pt)
- else
- context("0pt")
+implement {
+ name = "MPls",
+ arguments = "string",
+ actions = function(name)
+ local jpi = collected[name]
+ if jpi then
+ context("%.5Fpt",jpi.ls*pt)
+ else
+ context("0pt")
+ end
end
-end
+}
-scanners.MPrs = function() -- name
- local jpi = collected[scanstring()]
- if jpi then
- context("%.5Fpt",jpi.rs*pt)
- else
- context("0pt")
+implement {
+ name = "MPrs",
+ arguments = "string",
+ actions = function(name)
+ local jpi = collected[name]
+ if jpi then
+ context("%.5Fpt",jpi.rs*pt)
+ else
+ context("0pt")
+ end
end
-end
+}
local splitter = lpeg.tsplitat(",")
-scanners.MPplus = function() -- name n default
- local jpi = collected[scanstring()]
- local n = scaninteger()
- local default = scanstring()
- if jpi then
- local e = jpi.e
- if e then
- local split = jpi.split
- if not split then
- split = lpegmatch(splitter,jpi.e)
- jpi.split = split
+implement {
+ name = "MPplus",
+ arguments = { "string", "integer", "string" },
+ actions = function(name,n,default)
+ local jpi = collected[name]
+ if jpi then
+ local e = jpi.e
+ if e then
+ local split = jpi.split
+ if not split then
+ split = lpegmatch(splitter,jpi.e)
+ jpi.split = split
+ end
+ context(split[n] or default)
+ return
end
- context(split[n] or default)
- return
end
+ context(default)
end
- context(default)
-end
+}
-scanners.MPrest = function() -- name default
- local jpi = collected[scanstring()]
- local default = scanstring()
- context(jpi and jpi.e or default)
-end
+implement {
+ name = "MPrest",
+ arguments = { "string", "string" },
+ actions = function(name,default)
+ local jpi = collected[name]
+ context(jpi and jpi.e or default)
+ end
+}
-scanners.MPxywhd = function() -- name
- local jpi = collected[scanstring()]
- if jpi then
- context("%.5Fpt,%.5Fpt,%.5Fpt,%.5Fpt,%.5Fpt",
- jpi.x*pt,
- jpi.y*pt,
- jpi.w*pt,
- jpi.h*pt,
- jpi.d*pt
- )
- else
- context("0,0,0,0,0") -- for mp only
+implement {
+ name = "MPxywhd",
+ arguments = "string",
+ actions = function(name)
+ local jpi = collected[name]
+ if jpi then
+ context("%.5Fpt,%.5Fpt,%.5Fpt,%.5Fpt,%.5Fpt",
+ jpi.x*pt,
+ jpi.y*pt,
+ jpi.w*pt,
+ jpi.h*pt,
+ jpi.d*pt
+ )
+ else
+ context("0,0,0,0,0") -- for mp only
+ end
end
-end
+}
local doif = commands.doif
local doifelse = commands.doifelse
-scanners.doifelseposition = function() -- name
- doifelse(collected[scanstring()])
-end
-
-scanners.doifposition = function() -- name
- doif(collected[scanstring()])
-end
+implement {
+ name = "doifelseposition",
+ arguments = "string",
+ actions = function(name)
+ doifelse(collected[name])
+ end
+}
--- local ctx_iftrue = context.protected.cs.iftrue
--- local ctx_iffalse = context.protected.cs.iffalse
---
--- scanners.ifknownposition = function() -- name
--- (collected[scanstring()] and ctx_iftrue or ctx_iffalse)()
--- end
-
-scanners.doifelsepositiononpage = function() -- name page -- probably always realpageno
- local c = collected[scanstring()]
- local p = scaninteger()
- doifelse(c and c.p == p)
-end
+implement {
+ name = "doifposition",
+ arguments = "string",
+ actions = function(name)
+ doif(collected[name])
+ end
+}
-scanners.doifelseoverlapping = function() -- one two
- doifelse(overlapping(scanstring(),scanstring()))
-end
+implement {
+ name = "doifelsepositiononpage",
+ arguments = { "string", "integer" },
+ actions = function(name,p)
+ local c = collected[name]
+ doifelse(c and c.p == p)
+ end
+}
-scanners.doifelsepositionsonsamepage = function() -- list
- doifelse(onsamepage(scanstring()))
-end
+implement {
+ name = "doifelseoverlapping",
+ arguments = { "string", "string" },
+ actions = function(one,two)
+ doifelse(overlapping(one,two))
+ end
+}
-scanners.doifelsepositionsonthispage = function() -- list
- doifelse(onsamepage(scanstring(),tostring(texgetcount("realpageno"))))
-end
+implement {
+ name = "doifelsepositionsonsamepage",
+ arguments = "string",
+ actions = function(list)
+ doifelse(onsamepage(list))
+ end
+}
--- scanners.columnofpos = function()
--- context(columnofpos(scaninteger(),scandimen())
--- end
+implement {
+ name = "doifelsepositionsonthispage",
+ arguments = "string",
+ actions = function(list)
+ doifelse(onsamepage(list,tostring(texgetcount("realpageno"))))
+ end
+}
-scanners.doifelsepositionsused = function()
- doifelse(next(collected))
-end
+implement {
+ name = "doifelsepositionsused",
+ actions = function()
+ doifelse(next(collected))
+ end
+}
-scanners.markregionbox = function() -- box
- markregionbox(scaninteger())
-end
+implement {
+ name = "markregionbox",
+ arguments = "integer",
+ actions = markregionbox
+}
-scanners.setregionbox = function() -- box
- setregionbox(scaninteger())
-end
+implement {
+ name = "setregionbox",
+ arguments = "integer",
+ actions = setregionbox
+}
-scanners.markregionboxtagged = function() -- box tag
- markregionbox(scaninteger(),scanstring())
-end
+implement {
+ name = "markregionboxtagged",
+ arguments = { "integer", "string" },
+ actions = markregionbox
+}
-scanners.markregionboxtaggedn = function() -- box tag n
- markregionbox(scaninteger(),scanstring(),nil,
- nil,nil,nil,nil,nil,scaninteger())
-end
+implement {
+ name = "markregionboxtaggedn",
+ arguments = { "integer", "string", "integer" },
+ actions = function(box,tag,n)
+ markregionbox(box,tag,nil,nil,nil,nil,nil,nil,n)
+ end
+}
-scanners.setregionboxtagged = function() -- box tag
- setregionbox(scaninteger(),scanstring())
-end
+implement {
+ name = "setregionboxtagged",
+ arguments = { "integer", "string" },
+ actions = setregionbox
+}
-scanners.markregionboxcorrected = function() -- box tag
- markregionbox(scaninteger(),scanstring(),true)
-end
+implement {
+ name = "markregionboxcorrected",
+ arguments = { "integer", "string", true },
+ actions = markregionbox
+}
-scanners.markregionboxtaggedkind = function() -- box tag kind
- markregionbox(scaninteger(),scanstring(),nil,
- scaninteger(),scandimen(),scandimen(),scandimen(),scandimen())
-end
+implement {
+ name = "markregionboxtaggedkind",
+ arguments = { "integer", "string", "integer", "dimen", "dimen", "dimen", "dimen" },
+ actions = function(box,tag,n,d1,d2,d3,d4)
+ markregionbox(box,tag,nil,n,d1,d2,d3,d4)
+ end
+}
-scanners.reservedautoregiontag = function()
- nofregions = nofregions + 1
- context(f_region(nofregions))
-end
+implement {
+ name = "reservedautoregiontag",
+ actions = function()
+ nofregions = nofregions + 1
+ context(f_region(nofregions))
+ end
+}
-- statistics (at least for the moment, when testing)
@@ -1409,7 +1567,6 @@ end)
-- We support the low level positional commands too:
local newsavepos = nodes.pool.savepos
-local implement = interfaces.implement
implement { name = "savepos", actions = function() context(newsavepos()) end }
implement { name = "lastxpos", actions = function() context(gethpos()) end }
diff --git a/Master/texmf-dist/tex/context/base/mkiv/anch-pos.mkiv b/Master/texmf-dist/tex/context/base/mkiv/anch-pos.mkiv
index 2762a53c65c..772c89504d9 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/anch-pos.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/anch-pos.mkiv
@@ -296,7 +296,7 @@
{\clf_markregionbox#1\relax}
\unexpanded\def\anch_mark_flow_box#1% will be extended / renamed
- {\hpack\bgroup % \hpack
+ {\hpack\bgroup
\global\advance\c_anch_text\plusone
\clf_markregionboxtagged#1{textarea:\the\c_anch_text}%
\box#1%
diff --git a/Master/texmf-dist/tex/context/base/mkiv/attr-col.lua b/Master/texmf-dist/tex/context/base/mkiv/attr-col.lua
index 88358aeb767..9c542a94293 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/attr-col.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/attr-col.lua
@@ -445,7 +445,6 @@ function colors.setmodel(name,weightgray)
else
-- stil the same
end
-
return default
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/attr-col.mkiv b/Master/texmf-dist/tex/context/base/mkiv/attr-col.mkiv
index db4eea9e90a..c75f448e9d4 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/attr-col.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/attr-col.mkiv
@@ -17,6 +17,6 @@
\unprotect
-% We implement this elsewhere but some coce might end up here.
+% We implement this elsewhere but some code might end up here.
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/attr-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/attr-ini.lua
index 6145fa08d08..5507f2a70b8 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/attr-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/attr-ini.lua
@@ -14,32 +14,33 @@ local osexit = os.exit
symbolic names later on.</p>
--ldx]]--
-local nodes = nodes
-local context = context
-local storage = storage
-local commands = commands
+local nodes = nodes
+local context = context
+local storage = storage
+local commands = commands
-local implement = interfaces.implement
+local implement = interfaces.implement
-attributes = attributes or { }
-local attributes = attributes
+attributes = attributes or { }
+local attributes = attributes
-local sharedstorage = storage.shared
+local sharedstorage = storage.shared
-local texsetattribute = tex.setattribute
+local texsetattribute = tex.setattribute
-attributes.names = attributes.names or { }
-attributes.numbers = attributes.numbers or { }
-attributes.list = attributes.list or { }
-attributes.states = attributes.states or { }
-attributes.handlers = attributes.handlers or { }
-attributes.unsetvalue = -0x7FFFFFFF
+attributes.names = attributes.names or { }
+attributes.numbers = attributes.numbers or { }
+attributes.list = attributes.list or { }
+attributes.states = attributes.states or { }
+attributes.handlers = attributes.handlers or { }
+attributes.unsetvalue = -0x7FFFFFFF
-local currentfont = font.current
+local currentfont = font.current -- mabe nicer is attributes.current
+local currentattributes = node.current_attributes -- mabe nicer is fonts .current
-local names = attributes.names
-local numbers = attributes.numbers
-local list = attributes.list
+local names = attributes.names
+local numbers = attributes.numbers
+local list = attributes.list
storage.register("attributes/names", names, "attributes.names")
storage.register("attributes/numbers", numbers, "attributes.numbers")
@@ -127,7 +128,7 @@ local function showlist(what,list)
end
function attributes.showcurrent()
- showlist("current",node.current_attr())
+ showlist("current",currentattributes())
end
function attributes.ofnode(n)
@@ -140,7 +141,7 @@ local store = { }
function attributes.save(name)
name = name or ""
- local n = node.current_attr()
+ local n = currentattributes()
n = n and n.next
local t = { }
while n do
diff --git a/Master/texmf-dist/tex/context/base/mkiv/attr-ini.mkiv b/Master/texmf-dist/tex/context/base/mkiv/attr-ini.mkiv
index 6889f9e63ff..71c6478f8c3 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/attr-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/attr-ini.mkiv
@@ -61,55 +61,31 @@
% here public means 'visible' so it's not to be confused with 'public' at the lua end
-% \def\attr_basics_define_indeed#1[#2][#3]%
-% {\ifcsname\??attributecount#2\endcsname\else
-% \scratchcounter\clf_defineattribute{#2}{#1}\relax
-% %\writestatus\m!system{defining #1 attribute #2 with number \number\scratchcounter}%
-% \expandafter\attributedef\csname\??attributecount#2\endcsname\scratchcounter
-% \expandafter\newconstant \csname\??attributeid#2\endcsname
-% \csname\??attributeid#2\endcsname\scratchcounter
-% % some attributes are always global
-% \doifelseinset\s!global{#3}%
-% {\etoksapp\t_attr_list_global{\csname\??attributecount#2\endcsname\attributeunsetvalue}}%
-% {\etoksapp\t_attr_list_local {\csname\??attributecount#2\endcsname\attributeunsetvalue}}%
-% \doifinset\s!nomath{#3}%
-% {\etoksapp\t_attr_list_nomath{\csname\??attributecount#2\endcsname\attributeunsetvalue}}%
-% \doifinset\s!public{#3}%
-% {\expandafter\let\csname#2\s!attribute\expandafter\endcsname\csname\??attributeid#2\endcsname}%
-% \doifinset\s!pickup{#3}%
-% {\expandafter\newconstant\csname\??attributepickup#2\endcsname
-% \csname\??attributepickup#2\endcsname\attributeunsetvalue
-% \etoksapp\t_attr_list_pickup{\csname\??attributecount#2\endcsname\csname\??attributepickup#2\endcsname}%
-% \ifcsname#2\s!attribute\endcsname
-% \expandafter\edef\csname\s!pickup#2\s!attribute\endcsname
-% {\csname\??attributepickup#2\endcsname\csname\??attributecount#2\endcsname}%
-% \expandafter\edef\csname\s!forget#2\s!attribute\endcsname
-% {\csname\??attributepickup#2\endcsname\attributeunsetvalue}%
-% \fi}%
-% \fi}
+% \let\attr_prefix\??attributecount
+\def\attr_prefix{c_attr_}
\def\attr_basics_define_indeed#1[#2][#3]%
- {\ifcsname\??attributecount#2\endcsname\else
+ {\ifcsname\attr_prefix#2\endcsname\else
\scratchcounter\clf_defineattribute{#2}{#1}\relax
%\writestatus\m!system{defining #1 attribute #2 with number \number\scratchcounter}%
- \global\expandafter\attributedef\csname\??attributecount#2\endcsname\scratchcounter
+ \global\expandafter\attributedef\csname\attr_prefix#2\endcsname\scratchcounter
\global\expandafter\newconstant \csname\??attributeid#2\endcsname
\global\csname\??attributeid#2\endcsname\scratchcounter
% some attributes are always global
\doifelseinset\s!global{#3}%
- {\xtoksapp\t_attr_list_global{\csname\??attributecount#2\endcsname\attributeunsetvalue}}%
- {\xtoksapp\t_attr_list_local {\csname\??attributecount#2\endcsname\attributeunsetvalue}}%
+ {\xtoksapp\t_attr_list_global{\csname\attr_prefix#2\endcsname\attributeunsetvalue}}%
+ {\xtoksapp\t_attr_list_local {\csname\attr_prefix#2\endcsname\attributeunsetvalue}}%
\doifinset\s!nomath{#3}%
- {\xtoksapp\t_attr_list_nomath{\csname\??attributecount#2\endcsname\attributeunsetvalue}}%
+ {\xtoksapp\t_attr_list_nomath{\csname\attr_prefix#2\endcsname\attributeunsetvalue}}%
\doifinset\s!public{#3}%
{\expandafter\glet\csname#2\s!attribute\expandafter\endcsname\csname\??attributeid#2\endcsname}%
\doifinset\s!pickup{#3}%
{\global\expandafter\newconstant\csname\??attributepickup#2\endcsname
\global\csname\??attributepickup#2\endcsname\attributeunsetvalue
- \xtoksapp\t_attr_list_pickup{\csname\??attributecount#2\endcsname\csname\??attributepickup#2\endcsname}%
+ \xtoksapp\t_attr_list_pickup{\csname\attr_prefix#2\endcsname\csname\??attributepickup#2\endcsname}%
\ifcsname#2\s!attribute\endcsname
\expandafter\xdef\csname\s!pickup#2\s!attribute\endcsname
- {\csname\??attributepickup#2\endcsname\csname\??attributecount#2\endcsname}%
+ {\csname\??attributepickup#2\endcsname\csname\attr_prefix#2\endcsname}%
\expandafter\xdef\csname\s!forget#2\s!attribute\endcsname
{\csname\??attributepickup#2\endcsname\attributeunsetvalue}%
\fi}%
@@ -119,10 +95,10 @@
{\the\t_attr_list_pickup\relax}
% \unexpanded\def\pickupattribute#1%
-% {\csname\??attributecount#1\endcsname\csname\??attributepickup#1\endcsname}
+% {\csname\attr_prefix#1\endcsname\csname\??attributepickup#1\endcsname}
% \unexpanded\def\pickupattributelater#1%
-% {\csname\??attributepickup#1\endcsname\csname\??attributecount#1\endcsname}
+% {\csname\??attributepickup#1\endcsname\csname\attr_prefix#1\endcsname}
% \unexpanded\def\newattribute#1%
% {\attr_basics_define_indeed\s!public[\csstring#1][]%
@@ -134,9 +110,9 @@
% expandable so we can \edef them for speed
-\def\dosetattribute#1#2{\csname\??attributecount#1\endcsname#2\relax}
-\def\doresetattribute#1{\csname\??attributecount#1\endcsname\attributeunsetvalue}
-\def\dogetattribute #1{\number\csname\??attributecount#1\endcsname}
+\def\dosetattribute#1#2{\csname\attr_prefix#1\endcsname#2\relax}
+\def\doresetattribute#1{\csname\attr_prefix#1\endcsname\attributeunsetvalue}
+\def\dogetattribute #1{\number\csname\attr_prefix#1\endcsname}
\def\dogetattributeid#1{\number\csname\??attributeid#1\endcsname}
\let\dompattribute\gobbletwoarguments
@@ -145,8 +121,8 @@
\unexpanded\def\resetglobalattributes{\the\t_attr_list_global\attribute\zerocount\zerocount}
\unexpanded\def\resetlocalattributes {\the\t_attr_list_local \attribute\zerocount\zerocount}
\else
- \unexpanded\def\resetglobalattributes{\the\t_attr_list_global\glyphdatafield \zerocount}
- \unexpanded\def\resetlocalattributes {\the\t_attr_list_local \glyphdatafield \zerocount}
+ \unexpanded\def\resetglobalattributes{\the\t_attr_list_global\glyphdatafield\zerocount\glyphscriptfield\zerocount}
+ \unexpanded\def\resetlocalattributes {\the\t_attr_list_local \glyphdatafield\zerocount\glyphscriptfield\zerocount}
\fi
\let\resetallattributes\resetlocalattributes
@@ -163,8 +139,8 @@
%definesystemattribute [state] % nomath
\definesystemattribute [color] [public] % global
\definesystemattribute [colormodel] [public,global]
-% \definesystemattribute [skip]
-% \definesystemattribute [penalty]
+%definesystemattribute [skip]
+%definesystemattribute [penalty]
\definesystemattribute [transparency] [public]
\definesystemattribute [reference] [public]
\definesystemattribute [destination] [public]
diff --git a/Master/texmf-dist/tex/context/base/mkiv/back-exp.lua b/Master/texmf-dist/tex/context/base/mkiv/back-exp.lua
index 22822d7dde2..7a37cc94887 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/back-exp.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/back-exp.lua
@@ -44,6 +44,8 @@ local formatters = string.formatters
local todimen = number.todimen
local replacetemplate = utilities.templates.replace
+local addsuffix, joinfile, nameonly, basename, filesuffix = file.addsuffix, file.join, file.nameonly, file.basename, file.suffix
+
local trace_export = false trackers.register ("export.trace", function(v) trace_export = v end)
local trace_spacing = false trackers.register ("export.trace.spacing", function(v) trace_spacing = v end)
local trace_details = false trackers.register ("export.trace.details", function(v) trace_details = v end)
@@ -144,6 +146,7 @@ local treeroot = tree
local treehash = { }
local extras = { }
local checks = { }
+local fixes = { }
local finalizers = { }
local nofbreaks = 0
local used = { }
@@ -327,10 +330,10 @@ local styletemplate = [[
[3] = "left", ["3"] = "left", [variables.flushleft ] = "left",
}
- function wrapups.allusedstyles(basename)
+ function wrapups.allusedstyles(filename)
local result = { replacetemplate(namespacetemplate, {
what = "styles",
- filename = basename,
+ filename = filename,
namespace = contextns,
-- cssnamespaceurl = usecssnamespace and cssnamespaceurl or cssnamespacenop,
cssnamespaceurl = cssnamespaceurl,
@@ -414,27 +417,27 @@ local imagetemplate = [[
local collected = { }
local function usedname(name,page)
- if file.suffix(name) == "pdf" then
+ if filesuffix(name) == "pdf" then
-- temp hack .. we will have a remapper
if page and page > 1 then
- name = f_svgpage(file.nameonly(name),page)
+ name = f_svgpage(nameonly(name),page)
else
- name = f_svgname(file.nameonly(name))
+ name = f_svgname(nameonly(name))
end
end
local scheme = url.hasscheme(name)
if not scheme or scheme == "file" then
-- or can we just use the name ?
- return file.join("../images",file.basename(url.filename(name)))
+ return joinfile("../images",basename(url.filename(name)))
else
return name
end
end
- function wrapups.allusedimages(basename)
+ function wrapups.allusedimages(filename)
local result = { replacetemplate(namespacetemplate, {
what = "images",
- filename = basename,
+ filename = filename,
namespace = contextns,
-- cssnamespaceurl = usecssnamespace and cssnamespaceurl or "",
cssnamespaceurl = cssnamespaceurl,
@@ -551,7 +554,7 @@ do
if not less_state then
setattribute(di,"file",tex.jobname)
if included.date then
- setattribute(di,"date",backends.timestamp())
+ setattribute(di,"date",os.fulltime())
end
setattribute(di,"context",environment.version)
setattribute(di,"version",exportversion)
@@ -707,6 +710,37 @@ end
do
+ function fixes.linenumber(di,data,i)
+ local ni = data[i+1]
+ if ni then
+ if ni.data then
+ while true do
+ local d = ni.data[1]
+ if d then
+ local e = d.element
+ if e then
+ if e == "line" or e == "verbatimline" then
+ insert(d.data,1,di)
+ data[i] = false
+ return
+ else
+ ni = d
+ end
+ else
+ return
+ end
+ else
+ return
+ end
+ end
+ end
+ end
+ end
+
+end
+
+do
+
local synonyms = { }
local sortings = { }
@@ -2111,9 +2145,7 @@ do
function structurestags.setparagraph(align)
if align ~= "" then
usedparagraphs[locatedtag("paragraph")] = {
- dataset = dataset,
- tag = tag,
- align = align,
+ align = align,
}
end
end
@@ -2305,8 +2337,10 @@ do
if not p then
-- skip
elseif exportproperties == v_yes then
+ n = n + 1
r[n] = attributes(p)
else
+ n = n + 1
r[n] = properties(p)
end
end
@@ -2491,6 +2525,8 @@ do
-- skip
elseif di.skip == "ignore" then
-- skip (new)
+elseif di.tg == "ignore" then
+ -- skip (new)
elseif di.content then
if di.samepar then
prevparnumber = false
@@ -2574,9 +2610,12 @@ do
-- also tabulaterow reconstruction .. maybe better as a checker
-- i.e cell attribute
- local function collapsetree()
+ local function collapsetree(tree)
+-- for tag, trees in sortedhash(treehash) do
for tag, trees in next, treehash do
local d = trees[1].data
+-- print("!!!!!!!!",tag)
+-- inspect(trees)
if d then
local nd = #d
if nd > 0 then
@@ -2630,10 +2669,22 @@ do
end
end
+ -- local function showtree(data,when,where)
+ -- if data then
+ -- for i=1,#data do
+ -- local d = data[i]
+ -- if type(d) == "table" and d.element then
+ -- print(when,where,i,d.element,d.parnumber or 0)
+ -- end
+ -- end
+ -- end
+ -- end
+
local function indextree(tree)
local data = tree.data
if data then
local n, new = 0, { }
+ -- showtree(data,"before","index")
for i=1,#data do
local d = data[i]
if not d then
@@ -2650,22 +2701,43 @@ do
end
end
tree.data = new
+ -- showtree(new,"after","index")
end
end
local function checktree(tree)
local data = tree.data
if data then
+ -- showtree(data,"before","check")
for i=1,#data do
local d = data[i]
if type(d) == "table" then
local check = checks[d.tg]
if check then
- check(d)
+ check(d,data,i)
end
checktree(d) -- so parts can pass twice
end
end
+ -- showtree(data,"after","check")
+ end
+ end
+
+ local function fixtree(tree)
+ local data = tree.data
+ if data then
+ -- showtree(data,"before","fix")
+ for i=1,#data do
+ local d = data[i]
+ if type(d) == "table" then
+ local fix = fixes[d.tg]
+ if fix then
+ fix(d,data,i)
+ end
+ fixtree(d) -- so parts can pass twice
+ end
+ end
+ -- showtree(data,"after","fix")
end
end
@@ -2675,6 +2747,7 @@ do
wrapups.finalizetree = finalizetree
wrapups.indextree = indextree
wrapups.checktree = checktree
+ wrapups.fixtree = fixtree
end
@@ -2911,7 +2984,7 @@ local collectresults do -- too many locals otherwise
local kern_code = nodecodes.kern
local disc_code = nodecodes.disc
local whatsit_code = nodecodes.whatsit
- local localpar_code = nodecodes.localpar
+ local par_code = nodecodes.par
local userskip_code = gluecodes.userskip
local rightskip_code = gluecodes.rightskip
@@ -2986,7 +3059,7 @@ local collectresults do -- too many locals otherwise
local function collectresults(head,list,pat,pap) -- is last used (we also have currentattribute)
local p
- local localparagraph
+ local paragraph
local maybewrong
local pid
for n, id, subtype in nextnode, head do
@@ -3004,7 +3077,7 @@ local collectresults do -- too many locals otherwise
if last ~= at then
local tl = taglist[at]
local ap = getattr(n,a_taggedpar) or pap
- if localparagraph and (not ap or ap < localparagraph) then
+ if paragraph and (not ap or ap < paragraph) then
maybewrong = addtomaybe(maybewrong,c,1)
end
pushcontent()
@@ -3040,7 +3113,7 @@ local collectresults do -- too many locals otherwise
currentattribute = last
currentparagraph = ap
end
- if localparagraph and (not ap or ap < localparagraph) then
+ if paragraph and (not ap or ap < paragraph) then
maybewrong = addtomaybe(maybewrong,c,2)
end
if trace_export then
@@ -3102,17 +3175,6 @@ local collectresults do -- too many locals otherwise
end
end
end
- elseif id == disc_code then -- probably too late
- local pre, post, replace = getdisc(n)
- if keephyphens then
- if pre and not getnext(pre) and isglyph(pre) == 0xAD then -- hyphencode then
- nofcurrentcontent = nofcurrentcontent + 1
- currentcontent[nofcurrentcontent] = hyphen
- end
- end
- if replace then
- collectresults(replace,nil)
- end
elseif id == glue_code then
-- we need to distinguish between hskips and vskips
local ca = getattr(n,a_characters)
@@ -3271,6 +3333,9 @@ local collectresults do -- too many locals otherwise
elseif id == kern_code then
local kern = getkern(n)
if kern > 0 then
+local a = getattr(n,a_tagged) or pat
+local t = taglist[a]
+if not t or t.tagname ~= "ignore" then -- maybe earlier on top)
local limit = threshold
if p then
local c, f = isglyph(p)
@@ -3280,7 +3345,7 @@ local collectresults do -- too many locals otherwise
end
if kern > limit then
if last and not somespace[currentcontent[nofcurrentcontent]] then
- local a = getattr(n,a_tagged) or pat
+-- local a = getattr(n,a_tagged) or pat
if a == last then
if not somespace[currentcontent[nofcurrentcontent]] then
if trace_export then
@@ -3301,12 +3366,14 @@ local collectresults do -- too many locals otherwise
end
nofcurrentcontent = nofcurrentcontent + 1
currentcontent[nofcurrentcontent] = " "
- currentnesting = taglist[last]
+-- currentnesting = taglist[last]
+currentnesting = t
pushentry(currentnesting)
currentattribute = last
end
end
end
+end
end
elseif id == whatsit_code then
if subtype == userdefinedwhatsit_code then
@@ -3323,8 +3390,20 @@ local collectresults do -- too many locals otherwise
last = nil
currentparagraph = nil
end
- elseif not localparagraph and id == localpar_code and start_of_par(n) then
- localparagraph = getattr(n,a_taggedpar)
+ elseif not paragraph and id == par_code and start_of_par(n) then
+ paragraph = getattr(n,a_taggedpar)
+ elseif id == disc_code then
+ -- very unlikely because we stripped them
+ local pre, post, replace = getdisc(n)
+ if keephyphens then
+ if pre and not getnext(pre) and isglyph(pre) == 0xAD then -- hyphencode then
+ nofcurrentcontent = nofcurrentcontent + 1
+ currentcontent[nofcurrentcontent] = hyphen
+ end
+ end
+ if replace then
+ collectresults(replace,nil)
+ end
end
p = n
pid = id
@@ -3393,7 +3472,7 @@ local xmlpreamble = [[
return replacetemplate(xmlpreamble, {
standalone = standalone and "yes" or "no",
filename = tex.jobname,
- date = included.date and backends.timestamp(),
+ date = included.date and os.fulltime(),
contextversion = environment.version,
exportversion = exportversion,
})
@@ -3419,7 +3498,7 @@ local cssheadlink = [[
elseif cssfile == "export-example.css" then
-- ignore
elseif not done[cssfile] then
- cssfile = file.join(path,cssfile)
+ cssfile = joinfile(path,basename(cssfile))
report_export("adding css reference '%s'",cssfile)
files[#files+1] = cssfile
result[#result+1] = replacetemplate(csspreamble, { filename = cssfile })
@@ -3480,10 +3559,10 @@ local htmltemplate = [[
mixed = "inline",
}
- local function allusedelements(basename)
+ local function allusedelements(filename)
local result = { replacetemplate(namespacetemplate, {
what = "template",
- filename = basename,
+ filename = filename,
namespace = contextns,
-- cssnamespaceurl = usecssnamespace and cssnamespaceurl or "",
cssnamespaceurl = cssnamespaceurl,
@@ -3691,6 +3770,31 @@ local htmltemplate = [[
end
end
+ -- Some elements are not supported (well) in css so we need to retain them. For
+ -- instance, tablecells have no colspan so basically that renders css table div
+ -- elements quite useless. A side effect is that we nwo can have conflicts when
+ -- we mix in with other html (as there is no reset). Of course, when it eventually
+ -- gets added, there is a change then that those not using the div abstraction
+ -- will be rediculed.
+ --
+ -- a table tr td th thead tbody tfoot
+ --
+
+ local crappycss = {
+ table = "table", tabulate = "table",
+ tablehead = "thead", tabulatehead = "thead",
+ tablebody = "tbody", tabulatebody = "tbody",
+ tablefoot = "tfoot", tabulatefoot = "tfoot",
+ tablerow = "tr", tabulaterow = "tr",
+ tablecell = "td", tabulatecell = "td",
+ }
+
+ local cssmapping = false
+
+ directives.register("export.nativetags", function(v)
+ cssmapping = v and crappycss or false
+ end)
+
local function remap(specification,source,target)
local comment = nil -- share comments
for c in xmlcollected(source,"*") do
@@ -3762,11 +3866,11 @@ local htmltemplate = [[
}
end
end
- c.tg = "div"
c.at = attr
if label then
attr.label = label
end
+ c.tg = cssmapping and cssmapping[tg] or "div"
end
end
end
@@ -3774,11 +3878,6 @@ local htmltemplate = [[
-- local cssfile = nil directives.register("backend.export.css", function(v) cssfile = v end)
- local addsuffix = file.addsuffix
- local joinfile = file.join
- local nameonly = file.nameonly
- local basename = file.basename
-
local embedfile = false directives.register("export.embed",function(v) embedfile = v end)
function structurestags.finishexport()
@@ -3803,6 +3902,7 @@ local htmltemplate = [[
end
report_export("")
--
+ wrapups.fixtree(tree)
wrapups.collapsetree(tree)
wrapups.indextree(tree)
wrapups.checktree(tree)
@@ -4054,28 +4154,30 @@ local htmltemplate = [[
local metadata = structures.tags.getmetadata()
local specification = {
- name = usedname,
- identifier = os.uuid(),
- images = wrapups.uniqueusedimages(),
- imagefile = joinfile("styles",imagefilebase),
- imagepath = "images",
- stylepath = "styles",
- xmlfiles = { xmlfilebase },
- xhtmlfiles = { xhtmlfilebase },
- htmlfiles = { htmlfilebase },
- styles = cssfiles,
- htmlroot = htmlfilebase,
- language = languagenames[texgetcount("mainlanguagenumber")],
- title = validstring(finetuning.title) or validstring(identity.title),
- subtitle = validstring(finetuning.subtitle) or validstring(identity.subtitle),
- author = validstring(finetuning.author) or validstring(identity.author),
- firstpage = validstring(finetuning.firstpage),
- lastpage = validstring(finetuning.lastpage),
- metadata = metadata,
+ name = usedname,
+ identifier = os.uuid(),
+ images = wrapups.uniqueusedimages(),
+ imagefile = joinfile("styles",imagefilebase),
+ imagepath = "images",
+ stylepath = "styles",
+ xmlfiles = { xmlfilebase },
+ xhtmlfiles = { xhtmlfilebase },
+ htmlfiles = { htmlfilebase },
+ styles = cssfiles,
+ htmlroot = htmlfilebase,
+ language = languagenames[texgetcount("mainlanguagenumber")],
+ title = validstring(finetuning.title) or validstring(identity.title),
+ subtitle = validstring(finetuning.subtitle) or validstring(identity.subtitle),
+ author = validstring(finetuning.author) or validstring(identity.author),
+ firstpage = validstring(finetuning.firstpage),
+ lastpage = validstring(finetuning.lastpage),
+ metadata = metadata,
}
report_export("saving specification in %a",specificationfilename,specificationfilename)
+ xml.wipe(xmltree,"metadata") -- maybe optional
+
io.savedata(specificationfilename,table.serialize(specification,true))
-- the html export for epub is different in the sense that it uses div's instead of
diff --git a/Master/texmf-dist/tex/context/base/mkiv/back-exp.mkiv b/Master/texmf-dist/tex/context/base/mkiv/back-exp.mkiv
index 3e8469b145e..05e40469774 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/back-exp.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/back-exp.mkiv
@@ -117,7 +117,7 @@
\clf_settagconstruct
{\currentstartstop}%
{\startstopparameter\c!style}%
- \attribute\colorattribute
+ \c_attr_color
\ifvmode\plusone\else\zerocount\fi
\relax
\fi}%
@@ -129,7 +129,7 @@
\clf_settaghighlight
{\currenthighlight}%
{\highlightparameter\c!style}
- \attribute\colorattribute
+ \c_attr_color
\ifvmode\plusone\else\zerocount\fi
\relax
\fi}%
@@ -159,9 +159,9 @@
\appendtoks
\unexpanded\def\dotagsetparcounter
- {\global\advance\tagparcounter\plusone\attribute\taggedparattribute\tagparcounter}%
+ {\global\advance\tagparcounter\plusone\c_attr_taggedpar\tagparcounter}%
\unexpanded\def\doresetparcounter
- {\attribute\taggedparattribute\attributeunsetvalue}%
+ {\c_attr_taggedpar\attributeunsetvalue}%
\to \everyenableelements
\appendtoks
@@ -357,6 +357,6 @@
\ifexporting
\dostartexport % in case it is done inside \starttext
\fi
-\to \everysetupdocument
+\to \everystartdocument
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/back-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/back-ini.lua
index b0af61edcd8..d01be4a73f5 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/back-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/back-ini.lua
@@ -62,17 +62,6 @@ backends.tables = { } setmetatableindex(backends.tables, tables
backends.current = "unknown"
-local lmtx_mode = nil
-
-local function lmtxmode()
- if lmtx_mode == nil then
- lmtx_mode = CONTEXTLMTXMODE > 0 and drivers and drivers.lmtxversion
- end
- return lmtx_mode
-end
-
-codeinjections.lmtxmode = lmtxmode
-
function backends.install(what)
if type(what) == "string" then
local backend = backends[what]
@@ -100,13 +89,7 @@ end
statistics.register("used backend", function()
local bc = backends.current
if bc ~= "unknown" then
- local lmtx = lmtxmode()
- local cmnt = backends[bc].comment or "no comment"
- if lmtx then
- return format("lmtx version %0.2f, %s (%s)",lmtx,bc,cmnt)
- else
- return format("%s (%s)",bc,cmnt)
- end
+ return format("%s (%s)",bc,backends[bc].comment or "no comment")
else
return nil
end
@@ -164,10 +147,8 @@ function codeinjections.setpagedimensions(paperwidth,paperheight)
if paperheight then
paper_height = paperheight
end
- if not lmtxmode() then
- texset("global","pageheight",paper_height)
- texset("global","pagewidth", paper_width)
- end
+ texset("global","pageheight",paper_height)
+ texset("global","pagewidth", paper_width)
return paper_width, paper_height
end
@@ -178,11 +159,10 @@ end
implement {
name = "shipoutoffset",
actions = function()
- context(lmtxmode() and "0pt" or "-1in") -- the old tex offset
+ context("-1in") -- the old tex offset
end
}
-
local page_x_origin = 0
local page_y_origin = 0
@@ -207,6 +187,6 @@ implement {
-- could also be codeinjections
-function backends.noflatelua()
- return status.late_callbacks or 0
+function backends.getcallbackstate()
+ return { count = status.late_callbacks or 0 }
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/back-ini.mkxl b/Master/texmf-dist/tex/context/base/mkiv/back-ini.mkxl
deleted file mode 100644
index 4e2fa351ef0..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/back-ini.mkxl
+++ /dev/null
@@ -1,81 +0,0 @@
-%D \module
-%D [ file=back-ini,
-%D version=2009.04.15,
-%D title=\CONTEXT\ Backend Macros,
-%D subtitle=Initialization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Backend Macros / Initialization}
-
-\registerctxluafile{back-ini}{}
-
-\unprotect
-
-%D Right from the start \CONTEXT\ had a backend system based on runtime pluggable
-%D code. As most backend issues involved specials and since postprocessors had not
-%D that much in common, we ended up with a system where we could switch backend as
-%D well as output code for multiple backends at the same time.
-%D
-%D Because \LUATEX\ has the backend built in, and since some backend issues have
-%D been moved to the frontend I decided to provide new backend code for \MKIV,
-%D starting with what was actually used.
-%D
-%D At this moment \DVI\ is no longer used for advanced document output and we
-%D therefore dropped support for this format. Future versions might support more
-%D backends again, but this has a low priority.
-
-%D The exact page model depends on the backend so we just define some variables that
-%D are used. A helper at the \LUA\ end will synchronize with the internal variables.
-%D We store these in the format.
-
-\ifdefined\everybackendshipout \else \newtoks\everybackendshipout \fi
-\ifdefined\everylastbackendshipout \else \newtoks\everylastbackendshipout \fi
-\ifdefined\everybackendlastinshipout \else \newtoks\everybackendlastinshipout \fi
-
-\installcorenamespace{backend}
-
-\installsetuponlycommandhandler \??backend {backend}
-
-%D \starttyping
-%D \setupbackend[space=yes]
-%D \stoptyping
-
-\appendtoks
- \clf_setrealspaces{\backendparameter\c!space}%
-\to \everysetupbackend
-
-\appendtoks
- \ifdefined\clf_resetmapfile
- \clf_resetmapfile
- \fi
-\to \everysetupbackend
-
-%D For the moment this is an experiment (defauls is pdf, but we also
-%D have lua, json and mps).
-%D
-%D \starttyping
-%D % \setupoutput[lua]
-%D % \setupoutput[json]
-%D % \setupoutput[mps]
-%D % \setupoutput[none] % for testing only
-%D % \setupoutput[empty] % for testing only
-%D
-%D \starttext
-%D \dorecurse{1000}{
-%D {\tf \red \samplefile{tufte}} \par
-%D {\bf \green \samplefile {ward}} \par
-%D {\sl \blue \samplefile{davis}} \par
-%D }
-%D \stoptext
-%D \stoptyping
-
-\unexpanded\def\setupoutput[#1]%
- {\clf_enabledriver{#1}}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/back-lua.lua b/Master/texmf-dist/tex/context/base/mkiv/back-lua.lua
deleted file mode 100644
index 4e95d37e3fb..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/back-lua.lua
+++ /dev/null
@@ -1,354 +0,0 @@
-if not modules then modules = { } end modules ['back-lua'] = {
- 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"
-}
-
--- we can remap fonts
-
-local fontproperties = fonts.hashes.properties
-local fontparameters = fonts.hashes.parameters
-local fontshapes = fonts.hashes.shapes
-
-local starttiming = statistics.starttiming
-local stoptiming = statistics.stoptiming
-
-local bpfactor = number.dimenfactors.bp
-local texgetbox = tex.getbox
-
-local rulecodes = nodes.rulecodes
-local normalrule_code = rulecodes.normal
------ boxrule_code = rulecodes.box
------ imagerule_code = rulecodes.image
------ emptyrule_code = rulecodes.empty
------ userrule_code = rulecodes.user
------ overrule_code = rulecodes.over
------ underrule_code = rulecodes.under
------ fractionrule_code = rulecodes.fraction
------ radicalrule_code = rulecodes.radical
-local outlinerule_code = rulecodes.outline
-
--- todo : per instance
-
-local pages = { }
-local fonts = { }
-local names = { }
-local mapping = { }
-local used = { }
-local shapes = { }
-local glyphs = { }
-local buffer = { }
-local b = 0
-local converter = nil
-
-local compact = false -- true
-local shapestoo = true
-
-local x, y, d, f, c, w, h, t, r, o
-
-local function reset()
- buffer = { }
- b = 0
- t = nil
- x = nil
- y = nil
- d = nil
- f = nil
- c = nil
- w = nil
- h = nil
- r = nil
- o = nil
-end
-
-local function result()
- -- todo: we're now still in the pdf backend but need different codeinjections
- local codeinjections = backends.pdf.codeinjections
- local getvariable = codeinjections.getidentityvariable or function() end
- local jobname = environment.jobname or tex.jobname or "unknown"
- return {
- metadata = {
- unit = "bp",
- jobname = jobname,
- title = getvariable("title") or jobname,
- subject = getvariable("subject"),
- author = getvariable("author"),
- keywords = getvariable("keywords"),
- time = os.date("%Y-%m-%d %H:%M"),
- engine = environment.luatexengine .. " " .. environment.luatexversion,
- context = environment.version,
- },
- fonts = fonts,
- pages = pages,
- shapes = shapes,
- }
-end
-
--- actions
-
-local function outputfilename(driver)
- return tex.jobname .. "-output.lua"
-end
-
-local function save() -- might become a driver function that already is plugged into stopactions
- local filename = outputfilename()
- drivers.report("saving result in %a",filename)
- starttiming(drivers)
- local data = result()
- if data then
- io.savedata(filename,table.serialize(data))
- end
- stoptiming(drivers)
-end
-
-local function prepare(driver)
- converter = drivers.converters.lmtx
- luatex.registerstopactions(1,function()
- save()
- end)
-end
-
-local function initialize(driver,details)
- reset()
-end
-
-local function finalize(driver,details)
- local n = details.pagenumber
- local b = details.boundingbox
- pages[n] = {
- number = n,
- content = buffer,
- boundingbox = {
- b[1] * bpfactor,
- b[2] * bpfactor,
- b[3] * bpfactor,
- b[4] * bpfactor,
- },
- }
-end
-
-local function wrapup(driver)
-end
-
-local function cleanup(driver)
- reset()
-end
-
-local function convert(driver,boxnumber,pagenumber)
- converter(driver,texgetbox(boxnumber),"page",pagenumber)
-end
-
--- flushers
-
-local function updatefontstate(id)
- if not mapping[id] then
- local fn = #fonts + 1
- mapping[id] = fn
- local properties = fontproperties[id]
- local parameters = fontparameters[id]
- local filename = file.basename(properties.filename)
- local fontname = properties.fullname or properties.fontname
- if shapestoo then
- if not names[fontname] then
- local sn = #shapes+1
- names[fontname] = sn
- shapes[sn] = { }
- glyphs[sn] = fontshapes[id].glyphs
- end
- end
- fonts[fn] = {
- filename = filename,
- name = fontname,
- size = parameters.size * bpfactor,
- shapes = shapestoo and names[fontname] or nil,
- }
- end
-end
-
-local function flushcharacter(current, pos_h, pos_v, pos_r, font, char)
- local fnt = mapping[font]
- b = b + 1
- buffer[b] = {
- t = "glyph" ~= t and "glyph" or nil,
- f = font ~= f and fnt or nil,
- c = char ~= c and char or nil,
- x = pos_h ~= x and (pos_h * bpfactor) or nil,
- y = pos_v ~= y and (pos_v * bpfactor) or nil,
- d = pos_r ~= d and (pos_r == 1 and "r2l" or "l2r") or nil,
- }
- t = "glyph"
- f = font
- c = char
- x = pos_h
- y = pos_v
- d = pos_r
- if shapestoo then
- -- can be sped up if needed
- local sn = fonts[fnt].shapes
- local shp = shapes[sn]
- if not shp[char] then
- shp[char] = glyphs[sn][char]
- end
- end
-end
-
-local function rule(pos_h, pos_v, pos_r, size_h, size_v, rule_s, rule_o)
- b = b + 1
- buffer[b] = {
- t = "rule" ~= t and "rule" or nil,
- r = rule_s ~= r and rule_s or nil,
- o = rule_s == "outline" and rule_o ~= o and (rule_o * bpfactor) or nil,
- w = size_h ~= w and (size_h * bpfactor) or nil,
- h = size_v ~= h and (size_v * bpfactor) or nil,
- x = pos_h ~= x and (pos_h * bpfactor) or nil,
- y = pos_v ~= y and (pos_v * bpfactor) or nil,
- d = pos_r ~= d and (pos_r == 1 and "r2l" or "l2r") or nil,
- }
- t = "rule"
- w = size_h
- h = size_v
- x = pos_h
- y = pos_v
- d = pos_r
-end
-
-local function flushrule(current, pos_h, pos_v, pos_r, size_h, size_v, subtype)
- local rule_s, rule_o
- if subtype == normalrule_code then
- rule_s = "normal"
- elseif subtype == outlinerule_code then
- rule_s = "outline"
- rule_o = getdata(current)
- else
- return
- end
- return rule(pos_h, pos_v, pos_r, size_h, size_v, rule_s, rule_o)
-end
-
-local function flushsimplerule(current, pos_h, pos_v, pos_r, size_h, size_v)
- return rule(pos_h, pos_v, pos_r, size_h, size_v, "normal", nil)
-end
-
--- file stuff too
--- todo: default flushers
--- also color (via hash)
-
--- installer
-
-drivers.install {
- name = "lua",
- actions = {
- prepare = prepare,
- initialize = initialize,
- finalize = finalize,
- wrapup = wrapup,
- cleanup = cleanup,
- convert = convert,
- outputfilename = outputfilename,
- },
- flushers = {
- updatefontstate = updatefontstate,
- character = flushcharacter,
- rule = flushrule,
- }
-}
-
--- actions
-
-local function outputfilename(driver)
- return tex.jobname .. "-output.json"
-end
-
-local function save() -- might become a driver function that already is plugged into stopactions
- local filename = outputfilename()
- drivers.report("saving result in %a",filename)
- starttiming(drivers)
- local data = result()
- if data then
- if not utilities.json then
- require("util-jsn")
- end
- io.savedata(filename,utilities.json.tostring(data,not compact))
- end
- stoptiming(drivers)
-end
-
-local function prepare(driver)
- converter = drivers.converters.lmtx
- luatex.registerstopactions(1,function()
- save()
- end)
-end
-
--- installer
-
-drivers.install {
- name = "json",
- actions = {
- prepare = prepare,
- initialize = initialize,
- finalize = finalize,
- wrapup = wrapup,
- cleanup = cleanup,
- convert = convert,
- outputfilename = outputfilename,
- },
- flushers = {
- updatefontstate = updatefontstate,
- character = flushcharacter,
- rule = flushrule,
- }
-}
-
--- actions
-
-local function outputfilename(driver)
- return tex.jobname .. "-output.js"
-end
-
-local function save() -- might become a driver function that already is plugged into stopactions
- local filename = outputfilename()
- drivers.report("saving result in %a",filename)
- starttiming(drivers)
- local data = result()
- if data then
- if not utilities.json then
- require("util-jsn")
- end
- io.savedata(filename,
- "const JSON_CONTEXT = JSON.parse ( `" ..
- utilities.json.tostring(data,not compact) ..
- "` ) ;\n"
- )
- end
- stoptiming(drivers)
-end
-
-local function prepare(driver)
- converter = drivers.converters.lmtx
- luatex.registerstopactions(1,function()
- save()
- end)
-end
-
--- installer
-
-drivers.install {
- name = "js",
- actions = {
- prepare = prepare,
- initialize = initialize,
- finalize = finalize,
- wrapup = wrapup,
- cleanup = cleanup,
- convert = convert,
- outputfilename = outputfilename,
- },
- flushers = {
- updatefontstate = updatefontstate,
- character = flushcharacter,
- rule = flushrule,
- }
-}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/back-lua.mkxl b/Master/texmf-dist/tex/context/base/mkiv/back-lua.mkxl
deleted file mode 100644
index 82ba8f9f196..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/back-lua.mkxl
+++ /dev/null
@@ -1,18 +0,0 @@
-%D \module
-%D [ file=back-lua,
-%D version=2018.07.26,
-%D title=\CONTEXT\ Backend Macros,
-%D subtitle=\LUA,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\ifcase\contextlmtxmode \else
- \registerctxluafile{back-lua}{optimize}
-\fi
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/back-mps.lua b/Master/texmf-dist/tex/context/base/mkiv/back-mps.lua
deleted file mode 100644
index 96c850ed63e..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/back-mps.lua
+++ /dev/null
@@ -1,205 +0,0 @@
-if not modules then modules = { } end modules ['back-mps'] = {
- version = 1.001,
- comment = "companion to lpdf-ini.mkiv",
- author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
- copyright = "PRAGMA ADE / ConTeXt Development Team",
- license = "see context related readme files"
-}
-
-local fontproperties = fonts.hashes.properties
-local fontparameters = fonts.hashes.parameters
-
-local starttiming = statistics.starttiming
-local stoptiming = statistics.stoptiming
-
-local bpfactor = number.dimenfactors.bp
-local texgetbox = tex.getbox
-local formatters = string.formatters
-
-local rulecodes = nodes.rulecodes
-local normalrule_code = rulecodes.normal
------ boxrule_code = rulecodes.box
------ imagerule_code = rulecodes.image
------ emptyrule_code = rulecodes.empty
------ userrule_code = rulecodes.user
------ overrule_code = rulecodes.over
------ underrule_code = rulecodes.under
------ fractionrule_code = rulecodes.fraction
------ radicalrule_code = rulecodes.radical
-local outlinerule_code = rulecodes.outline
-
-local fonts = { }
-local pages = { }
-local buffer = { }
-local b = 0
-local converter = nil
-
-local function reset()
- buffer = { }
- b = 0
-end
-
-local f_font = formatters[ "\\definefont[%s][file:%s*none @ %sbp]\n" ]
-
-local f_glyph = formatters[ [[draw textext.drt("\%s\char%i\relax") shifted (%N,%N);]] ]
-local f_rule = formatters[ [[fill unitsquare xscaled %N yscaled %N shifted (%N,%N);]] ]
-local f_outline = formatters[ [[draw unitsquare xscaled %N yscaled %N shifted (%N,%N);]] ]
-
--- actions
-
-local function outputfilename(driver)
- return tex.jobname .. "-output.tex"
-end
-
-local function save() -- might become a driver function that already is plugged into stopactions
- starttiming(drivers)
- if #pages > 0 then
- local filename = outputfilename()
- drivers.report("saving result in %a",filename)
- reset()
- b = b + 1
- buffer[b] = "\\starttext\n"
- for k, v in table.sortedhash(fonts) do
- b = b + 1
- buffer[b] = f_font(v.name,v.filename,v.size)
- end
- for i=1,#pages do
- b = b + 1
- buffer[b] = pages[i]
- end
- b = b + 1
- buffer[b] = "\\stoptext\n"
- io.savedata(filename,table.concat(buffer,"",1,b))
- end
- stoptiming(drivers)
-end
-
-local function prepare(driver)
- converter = drivers.converters.lmtx
- luatex.registerstopactions(1,function()
- save()
- end)
-end
-
-local function initialize(driver,details)
- reset()
- b = b + 1
- buffer[b] = "\n\\startMPpage"
-end
-
-local function finalize(driver,details)
- b = b + 1
- buffer[b] = "\\stopMPpage\n"
- pages[details.pagenumber] = table.concat(buffer,"\n",1,b)
-end
-
-local function wrapup(driver)
-end
-
-local function cleanup(driver)
- reset()
-end
-
-local function convert(driver,boxnumber,pagenumber)
- converter(driver,texgetbox(boxnumber),"page",pagenumber)
-end
-
--- flushers
-
-local last
-
-local function updatefontstate(id)
- if fonts[id] then
- last = fonts[id].name
- else
- last = "MPSfont" .. converters.Characters(id)
- fonts[id] = {
- filename = file.basename(fontproperties[id].filename),
- size = fontparameters[id].size * bpfactor,
- name = last,
- }
- end
-end
-
-local function flushcharacter(current, pos_h, pos_v, pod_r, font, char)
- b = b + 1
- buffer[b] = f_glyph(last,char,pos_h*bpfactor,pos_v*bpfactor)
-end
-
-local function flushrule(current, pos_h, pos_v, pod_r, size_h, size_v, subtype)
- if subtype == normalrule_code then
- b = b + 1
- buffer[b] = f_rule(size_h*bpfactor,size_v*bpfactor,pos_h*bpfactor,pos_v*bpfactor)
- elseif subtype == outlinerule_code then
- b = b + 1
- buffer[b] = f_outline(size_h*bpfactor,size_v*bpfactor,pos_h*bpfactor,pos_v*bpfactor)
- end
-end
-
-local function flushsimplerule(current, pos_h, pos_v, pod_r, size_h, size_v)
- b = b + 1
- buffer[b] = f_rule(size_h*bpfactor,size_v*bpfactor,pos_h*bpfactor,pos_v*bpfactor)
-end
-
--- installer
-
-drivers.install {
- name = "mps",
- actions = {
- prepare = prepare,
- initialize = initialize,
- finalize = finalize,
- wrapup = wrapup,
- cleanup = cleanup,
- convert = convert,
- outputfilename = outputfilename,
- },
- flushers = {
- updatefontstate = updatefontstate,
- character = flushcharacter,
- rule = flushrule,
- simplerule = flushsimplerule,
- }
-}
-
--- extras
-
--- if not mp then
--- return
--- end
---
--- local mpprint = mp.print
--- local formatters = string.formatters
---
--- local f_glyph = formatters[ [[draw textext.drt("\setfontid%i\relax\char%i\relax") shifted (%N,%N);]] ]
--- local f_rule = formatters[ [[fill unitsquare xscaled %N yscaled %N shifted (%N,%N);]] ]
---
--- local current = nil
--- local size = 0
---
--- function mp.place_buffermake(box)
--- drivers.convert("mps",box)
--- current = drivers.action("mps","fetch")
--- size = #current
--- end
---
--- function mp.place_buffersize()
--- mpprint(size)
--- end
---
--- function mp.place_bufferslot(i)
--- if i > 0 and i <= size then
--- local b = buffer[i]
--- local t = b[1]
--- if t == "glyph" then
--- mpprint(f_glyph(b[2],b[3],b[4]*bpfactor,b[5]*bpfactor))
--- elseif t == "rule" then
--- mpprint(f_rule(b[2]*bpfactor,b[3]*bpfactor,b[4]*bpfactor,b[5]*bpfactor))
--- end
--- end
--- end
---
--- function mp.place_bufferwipe()
--- current = nil
--- size = 0
--- end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/back-mps.mkxl b/Master/texmf-dist/tex/context/base/mkiv/back-mps.mkxl
deleted file mode 100644
index 0a6640614aa..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/back-mps.mkxl
+++ /dev/null
@@ -1,18 +0,0 @@
-%D \module
-%D [ file=back-mps,
-%D version=2018.07.26,
-%D title=\CONTEXT\ Backend Macros,
-%D subtitle=\METAPOST,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\ifcase\contextlmtxmode \else
- \registerctxluafile{back-mps}{optimize}
-\fi
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/back-out.lua b/Master/texmf-dist/tex/context/base/mkiv/back-out.lua
deleted file mode 100644
index 5ea5aa048ac..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/back-out.lua
+++ /dev/null
@@ -1,259 +0,0 @@
-if not modules then modules = { } end modules ['back-out'] = {
- version = 1.001,
- 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"
-}
-
-local type = type
-local loadstring = loadstring
-
-local context = context
-
--- tokens.scanners.....
-
-local get = token.get_index
-local scaninteger = token.scan_int
-local scanstring = token.scan_string
-local scankeyword = token.scan_keyword
-local scantokenlist = token.scan_tokenlist
------ scancode = token.scan_code
-
-local tokentostring = token.to_string
-
-local logwriter = logs.writer
-local openfile = io.open
-local flushio = io.flush
-
-local nuts = nodes.nuts
-local tonode = nuts.tonode
-local copynode = nuts.copy
-local nodepool = nuts.pool
-
-local getdata = nuts.getdata
-
-local whatsit_code = nodes.nodecodes.whatsit
-
-local whatsitcodes = nodes.whatsitcodes
-
-local literalvalues = nodes.literalvalues
-local originliteral_code = literalvalues.origin
-local pageliteral_code = literalvalues.page
-local directliteral_code = literalvalues.direct
-local rawliteral_code = literalvalues.raw
-
-local nodeproperties = nodes.properties.data
-
-local channels = { }
-
-local register = nodepool.register
-local newnut = nuts.new
-
-local opennode = register(newnut(whatsit_code,whatsitcodes.open))
-local writenode = register(newnut(whatsit_code,whatsitcodes.write))
-local closenode = register(newnut(whatsit_code,whatsitcodes.close))
-local lateluanode = register(newnut(whatsit_code,whatsitcodes.latelua))
-local literalnode = register(newnut(whatsit_code,whatsitcodes.literal))
-local savenode = register(newnut(whatsit_code,whatsitcodes.save))
-local restorenode = register(newnut(whatsit_code,whatsitcodes.restore))
-local setmatrixnode = register(newnut(whatsit_code,whatsitcodes.setmatrix))
-
-local tomatrix = drivers.helpers.tomatrix
-
-local immediately = false -- not watertight
-
-local open_command, write_command, close_command
-
-backends = backends or { }
-
-local function openout()
- local channel = scaninteger()
- scankeyword("=") -- hack
- local filename = scanstring()
- if not immediately then
- local n = copynode(opennode)
- nodeproperties[n] = { channel = channel, filename = filename } -- action = "open"
- return context(tonode(n))
- elseif not channels[channel] then
- local handle = openfile(filename,"wb") or false
- if handle then
- channels[channel] = handle
- else
- -- error
- end
- end
- immediately = false
-end
-
-function backends.openout(n)
- local p = nodeproperties[n]
- if p then
- local handle = openfile(p.filename,"wb") or false
- if handle then
- channels[p.channel] = handle
- else
- -- error
- end
- end
-end
-
-local function write()
- local channel = scaninteger()
- if not immediately then
- local t = scantokenlist()
- local n = copynode(writenode)
- nodeproperties[n] = { channel = channel, data = t } -- action = "write"
- return context(tonode(n))
- else
- local content = scanstring()
- local handle = channels[channel]
- if handle then
- handle:write(content,"\n")
- else
- logwriter(content,"\n")
- end
- end
- immediately = false
-end
-
-function backends.writeout(n)
- local p = nodeproperties[n]
- if p then
- local handle = channels[p.channel]
- local content = tokentostring(p.data)
- if handle then
- handle:write(content,"\n")
- else
- logwriter(content,"\n")
- end
- end
-end
-
-local function closeout()
- local channel = scaninteger()
- if not immediately then
- local n = copynode(closenode)
- nodeproperties[n] = { channel = channel } -- action = "close"
- return context(tonode(n))
- else
- local handle = channels[channel]
- if handle then
- handle:close()
- channels[channel] = false
- flushio()
- else
- -- error
- end
- end
- immediately = false
-end
-
-function backends.closeout(n)
- local p = nodeproperties[n]
- if p then
- local channel = p.channel
- local handle = channels[channel]
- if handle then
- handle:close()
- channels[channel] = false
- flushio()
- else
- -- error
- end
- end
-end
-
-local function immediate()
- immediately = true
-end
-
-local noflatelua = 0
-
-local function latelua()
- local node = copynode(lateluanode)
- local name = "latelua"
- if scankeyword("name") then
- name = scanstring()
- end
- local data = scantokenlist()
- nodeproperties[node] = { name = name, data = data }
- return context(tonode(node))
-end
-
-function backends.latelua(current,pos_h,pos_v) -- todo: pass pos_h and pos_v (more efficient in lmtx)
- local p = nodeproperties[current]
- if p then
- data = p.data
- else
- data = getdata(current)
- end
- noflatelua = noflatelua + 1
- local kind = type(data)
- if kind == "table" then
- data.action(data.specification or data)
- elseif kind == "function" then
- data()
- else
- if kind ~= "string" then
- data = tokentostring(data)
- end
- if #data ~= "" then
- local code = loadstring(data)
- if code then
- code()
- end
- end
- end
-end
-
-function backends.noflatelua()
- return noflatelua
-end
-
-function nodepool.originliteral(str) local t = copynode(literalnode) nodeproperties[t] = { data = str, mode = originliteral_code } return t end
-function nodepool.pageliteral (str) local t = copynode(literalnode) nodeproperties[t] = { data = str, mode = pageliteral_code } return t end
-function nodepool.directliteral(str) local t = copynode(literalnode) nodeproperties[t] = { data = str, mode = directliteral_code } return t end
-function nodepool.rawliteral (str) local t = copynode(literalnode) nodeproperties[t] = { data = str, mode = rawliteral_code } return t end
-
-local pdfliterals = {
- [originliteral_code] = originliteral_code, [literalvalues[originliteral_code]] = originliteral_code,
- [pageliteral_code] = pageliteral_code, [literalvalues[pageliteral_code]] = pageliteral_code,
- [directliteral_code] = directliteral_code, [literalvalues[directliteral_code]] = directliteral_code,
- [rawliteral_code] = rawliteral_code, [literalvalues[rawliteral_code]] = rawliteral_code,
-}
-
-function nodepool.literal(mode,str)
- local t = copynode(literalnode)
- if str then
- nodeproperties[t] = { data = str, mode = pdfliterals[mode] or pageliteral_code }
- else
- nodeproperties[t] = { data = mode, mode = pageliteral_code }
- end
- return t
-end
-
-function nodepool.save()
- return copynode(savenode)
-end
-
-function nodepool.restore()
- return copynode(restorenode)
-end
-
-function nodepool.setmatrix(rx,sx,sy,ry,tx,ty)
- local t = copynode(setmatrixnode)
- nodeproperties[t] = { matrix = tomatrix(rx,sx,sy,ry,tx,ty) }
- return t
-end
-
-interfaces.implement { name = "immediate", actions = immediate, public = true, protected = true }
-interfaces.implement { name = "openout", actions = openout, public = true, protected = true }
-interfaces.implement { name = "write", actions = write, public = true, protected = true }
-interfaces.implement { name = "closeout", actions = closeout, public = true, protected = true }
-interfaces.implement { name = "latelua", actions = latelua, public = true, protected = true }
-interfaces.implement { name = "special", actions = scanstring, public = true, protected = true }
-
-open_command = get(token.create("openout"))
-write_command = get(token.create("write"))
-close_command = get(token.create("closeout"))
diff --git a/Master/texmf-dist/tex/context/base/mkiv/back-out.mkxl b/Master/texmf-dist/tex/context/base/mkiv/back-out.mkxl
deleted file mode 100644
index 26548a0a496..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/back-out.mkxl
+++ /dev/null
@@ -1,23 +0,0 @@
-%D \module
-%D [ file=back-out,
-%D version=2019.02.08,
-%D title=\CONTEXT\ Backend Macros,
-%D subtitle=Output,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\registerctxluafile{back-out}{}
-
-\let\normalimmediate\immediate
-\let\normalopenout \openout
-\let\normalwrite \write
-\let\normalcloseout \closeout
-\let\normallatelua \latelua
-\let\normalspecial \special
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/back-pdf.mkiv b/Master/texmf-dist/tex/context/base/mkiv/back-pdf.mkiv
index ec1c641e690..a8b157019b3 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/back-pdf.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/back-pdf.mkiv
@@ -21,6 +21,7 @@
\registerctxluafile{lpdf-nod}{}
\registerctxluafile{lpdf-eng}{optimize}
\registerctxluafile{lpdf-col}{}
+\registerctxluafile{lpdf-vfc}{}
\registerctxluafile{lpdf-xmp}{}
\registerctxluafile{lpdf-ano}{}
\registerctxluafile{lpdf-res}{}
@@ -65,9 +66,9 @@
\unexpanded\def\pdflastobj {\numexpr\clf_pdflastobj\relax}
\unexpanded\def\pdfrefobj {\clf_pdfrefobj }
-\unexpanded\def\pdfrestore {\clf_restore}
-\unexpanded\def\pdfsave {\clf_save}
-\unexpanded\def\pdfsetmatrix{\clf_setmatrix}
+\unexpanded\def\pdfrestore {\pdfextension restore}
+\unexpanded\def\pdfsave {\pdfextension save}
+\unexpanded\def\pdfsetmatrix{\pdfextension setmatrix}
\let\pdfxform \saveboxresource
\let\pdflastxform \lastsavedboxresourceindex
@@ -88,7 +89,7 @@
\appendtoks
\edef\p_file{\backendparameter{xmpfile}}%
- \ifx\p_file\empty\else
+ \ifx\empty\p_file\else
\clf_setxmpfile{\p_file}%
\fi
\to \everysetupbackend
diff --git a/Master/texmf-dist/tex/context/base/mkiv/back-pdf.mkxl b/Master/texmf-dist/tex/context/base/mkiv/back-pdf.mkxl
deleted file mode 100644
index ab65458c576..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/back-pdf.mkxl
+++ /dev/null
@@ -1,156 +0,0 @@
-%D \module
-%D [ file=back-pdf,
-%D version=2009.04.15,
-%D title=\CONTEXT\ Backend Macros,
-%D subtitle=\PDF,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-%D The less there is here, the better. After a decade it is time to remove the \type
-%D {\pdf*} ones completely. For the moment I keep them commented but even that will
-%D go away.
-
-\writestatus{loading}{ConTeXt Backend Macros / PDF}
-
-\registerctxluafile{lpdf-ini}{optimize}
-\registerctxluafile{lpdf-lmt}{optimize}
-
-\registerctxluafile{lpdf-col}{}
-\registerctxluafile{lpdf-xmp}{}
-\registerctxluafile{lpdf-ano}{}
-\registerctxluafile{lpdf-res}{}
-\registerctxluafile{lpdf-mis}{}
-\registerctxluafile{lpdf-ren}{}
-\registerctxluafile{lpdf-grp}{}
-\registerctxluafile{lpdf-wid}{}
-\registerctxluafile{lpdf-fld}{}
-\registerctxluafile{lpdf-mov}{}
-\registerctxluafile{lpdf-u3d}{} % this will become a module
-\registerctxluafile{lpdf-swf}{} % this will become a module
-\registerctxluafile{lpdf-tag}{}
-\registerctxluafile{lpdf-fmt}{}
-\registerctxluafile{lpdf-pde}{}
-\registerctxluafile{lpdf-img}{optimize}
-\registerctxluafile{lpdf-epa}{}
-\registerctxluafile{lpdf-emb}{optimize}
-\registerctxluafile{lpdf-fnt}{}
-
-\registerctxluafile{back-pdp}{}
-\registerctxluafile{back-pdf}{} % some code will move to lpdf-*
-
-\loadmarkfile{back-u3d} % this will become a module
-\loadmarkfile{back-swf} % this will become a module
-
-\unprotect
-
-%D We will minimize the number of calls to \PDF\ specific primitives and delegate
-%D all management and injection of code to the backend.
-%D
-%D Because we do a lot in \LUA\ and don't want interferences, we nil most of the
-%D \PDFTEX\ primitives. Of course one can always use the \type {\pdfvariable},
-%D \type {\pdfextension} and \type {\pdffeedback} primitives but it will probably
-%D have bad side effects.
-
-\unexpanded\def\pdfextension{\clf_pdfextension}
- \def\pdffeedback {\clf_pdffeedback}
-
-%D For the moment we keep this for tikz but hopefully it will at some point use
-%D the proper ones. Consider them obsolete:
-
-\unexpanded\def\pdfliteral {\clf_pdfliteral}
-\unexpanded\def\pdfobj {\clf_pdfobj}%
-\unexpanded\def\pdflastobj {\numexpr\clf_pdflastobj\relax}
-\unexpanded\def\pdfrefobj {\clf_pdfrefobj }
-
-\unexpanded\def\pdfrestore {\clf_restore}
-\unexpanded\def\pdfsave {\clf_save}
-\unexpanded\def\pdfsetmatrix{\clf_setmatrix}
-
- \let\pdfxform \saveboxresource
- \let\pdflastxform \lastsavedboxresourceindex
- \let\pdfrefxform \useboxresource
-
-%D Here are quick and dirty compression flippers, mostly used when testing something
-%D as one can best stick to the defaults that also adapt to specific standards.
-
-\unexpanded\def\nopdfcompression {\clf_setpdfcompression\zerocount\zerocount}
-\unexpanded\def\onlypdfobjectcompression{\clf_setpdfcompression\zerocount\plusthree}
-\unexpanded\def\maximumpdfcompression {\clf_setpdfcompression\plusnine \plusnine }
-\unexpanded\def\normalpdfcompression {\clf_setpdfcompression\plusthree\plusthree}
-
-%D PDF/X (maybe combine the two lua calls)
-
-\setupbackend
- [xmpfile=]
-
-\appendtoks
- \edef\p_file{\backendparameter{xmpfile}}%
- \ifx\p_file\empty\else
- \clf_setxmpfile{\p_file}%
- \fi
-\to \everysetupbackend
-
-%D This will change:
-
-\appendtoks
- \clf_setformat
- format {\backendparameter\c!format}%
- level {\backendparameter\c!level}%
- option {\backendparameter\c!option}%
- profile {\backendparameter\c!profile}%
- intent {\backendparameter\c!intent}%
- file {\backendparameter\c!file}%
- \relax
-\to \everysetupbackend
-
-%D These are the only official methods to add stuff to the resources. If more is
-%D needed for third party low level code, it can be added.
-
-\unexpanded\def\pdfbackendsetcatalog #1#2{\clf_lpdf_addtocatalog{#1}{#2}}
-\unexpanded\def\pdfbackendsetinfo #1#2{\clf_lpdf_addtoinfo{#1}{#2}}
-\unexpanded\def\pdfbackendsetname #1#2{\clf_lpdf_addtonames{#1}{#2}}
-
-\unexpanded\def\pdfbackendsetpageattribute #1#2{\clf_lpdf_addtopageattributes{#1}{#2}}
-\unexpanded\def\pdfbackendsetpagesattribute#1#2{\clf_lpdf_addtopagesattributes{#1}{#2}}
-\unexpanded\def\pdfbackendsetpageresource #1#2{\clf_lpdf_addtopageresources{#1}{#2}}
-
-\unexpanded\def\pdfbackendsetextgstate #1#2{\clf_lpdf_adddocumentextgstate{#1}{#2}}
-\unexpanded\def\pdfbackendsetcolorspace #1#2{\clf_lpdf_adddocumentcolorspace{#1}{#2}}
-\unexpanded\def\pdfbackendsetpattern #1#2{\clf_lpdf_adddocumentpattern{#1}{#2}}
-\unexpanded\def\pdfbackendsetshade #1#2{\clf_lpdf_adddocumentshade{#1}{#2}}
-
- \def\pdfbackendcurrentresources {\clf_lpdf_collectedresources}
- \def\pdfcolor #1{\clf_lpdf_color\numexpr\thecolorattribute{#1}\relax}
-
-%D This is a temporary hack mthat will be removed, improved or somehow can become
-%D default.
-
-\def\TransparencyHack{\setupcolors[\c!pagecolormodel=\v!auto]}
-
-%D Just in case one needs this \unknown:
-%D
-%D \starttyping
-%D text \pdfbackendactualtext{Meier}{Müller} text
-%D \stoptyping
-
-\unexpanded\def\pdfbackendactualtext#1#2% not interfaced
- {\clf_startactualtext{#2}%
- #1%
- \clf_stopactualtext}
-
-\let\pdfactualtext\pdfbackendactualtext
-
-%D Bah, this is also needed for tikz:
-
-\ifdefined\pdfsavepos\else
- \let\pdfsavepos \savepos
- \let\pdflastxpos\lastxpos
- \let\pdflastypos\lastypos
-\fi
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/back-pdp.lua b/Master/texmf-dist/tex/context/base/mkiv/back-pdp.lua
index 6111cf469b2..857f13ef239 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/back-pdp.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/back-pdp.lua
@@ -74,7 +74,8 @@ local function pdfobj()
immediate = immediate,
}
if fileobject then
- object.filename = content
+ object.file = content
+ -- object.filename = content
else
object.string = content
end
@@ -214,7 +215,7 @@ local function pdfextension()
if e then
e()
else
- report("\\pdfextension: unknown %a",w)
+ report("\\pdfextension: unsupported %a",w)
end
end
end
@@ -235,7 +236,7 @@ local function pdffeedback()
if f then
f()
else
- report("\\pdffeedback: unknown %a",w)
+ report("\\pdffeedback: unsupported %a",w)
end
end
end
@@ -248,34 +249,39 @@ end
-- linkmargin threadmargin vorigin xformmargin (tokenlists:) pageattr pageresources
-- pagesattr pkmode trailerid xformattr xformresources
--- local variables = {
--- }
---
--- local function pdfvariable()
--- local w = scanword()
--- if w then
--- local f = variables[w]
--- if f then
--- f()
--- else
--- print("invalid variable",w)
--- end
--- else
--- print("missing variable")
--- end
--- end
+local variables = {
+ minorversion = function() context(lpdf.minorversion()) end,
+ majorversion = function() context(lpdf.majorversion()) end,
+}
+
+local function pdfvariable()
+ local w = scanword()
+ if w then
+ local f = variables[w]
+ if f then
+ f()
+ else
+ report("\\pdfvariable: unsupported %a",w)
+ end
+ else
+ print("missing variable")
+ end
+end
-- kept:
implement { name = "pdfextension", actions = pdfextension }
implement { name = "pdffeedback", actions = pdffeedback }
---------- { name = "pdfvariable", actions = pdfvariable }
+implement { name = "pdfvariable", actions = pdfvariable }
-- for the moment (tikz)
-implement { name = "pdfliteral", actions = pdfliteral }
-implement { name = "pdfobj", actions = pdfobj }
-implement { name = "pdflastobj", actions = pdflastobj }
-implement { name = "pdfrefobj", actions = pdfrefobj }
---------- { name = "pdfannot", actions = pdfannot }
---------- { name = "pdfdest", actions = pdfdest }
+implement { name = "pdfliteral", actions = pdfliteral }
+implement { name = "pdfobj", actions = pdfobj }
+implement { name = "pdflastobj", actions = pdflastobj }
+implement { name = "pdfrefobj", actions = pdfrefobj }
+--------- { name = "pdfannot", actions = pdfannot }
+--------- { name = "pdfdest", actions = pdfdest }
+--------- { name = "pdfsave", actions = pdfsave }
+--------- { name = "pdfrestore", actions = pdfrestore }
+--------- { name = "pdfsetmatrix", actions = pdfsetmatrix }
diff --git a/Master/texmf-dist/tex/context/base/mkiv/back-res.lua b/Master/texmf-dist/tex/context/base/mkiv/back-res.lua
index 2ca4a5ac8b0..4ee6d15d35c 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/back-res.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/back-res.lua
@@ -19,7 +19,6 @@ local scandimension = scanners.dimension
local scanword = scanners.word
local scanwhd = scanners.whd
-local scanners = interfaces.scanners
local implement = interfaces.implement
local constants = interfaces.constants
local variables = interfaces.variables
diff --git a/Master/texmf-dist/tex/context/base/mkiv/bibl-tra.mkiv b/Master/texmf-dist/tex/context/base/mkiv/bibl-tra.mkiv
index 5389400f31b..a80a229337f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/bibl-tra.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/bibl-tra.mkiv
@@ -815,9 +815,6 @@
\doifelse{\publicationlistparameter\c!maybeyear}{\v!off}{\def\maybeyear##1{}}{\def\maybeyear##1{##1}}%
\forgetall}
-\unexpanded\def\outdented#1% move to supp-box ?
- {\hskip-\hangindent#1\relax}
-
%D The full list of publications
\unexpanded\def\completepublications
@@ -1155,9 +1152,13 @@
%D edef, and the \type{\robustdoifinsetelse} doesn't listen to
%D \type{\doglobal }
-\unexpanded\def\robustaddtocommalist#1#2% {item} \cs
- {\robustdoifelseinset{#1}#2\resetglobal
- {\dodoglobal\xdef#2{\ifx#2\empty\else#2,\fi#1}}}
+\pushoverloadmode
+
+ \unexpanded\def\robustaddtocommalist#1#2% {item} \cs
+ {\robustdoifelseinset{#1}#2\resetglobal
+ {\dodoglobal\xdef#2{\ifx#2\empty\else#2,\fi#1}}}
+
+\popoverloadmode
%D \macros{donormalbibauthoryear}
%D
diff --git a/Master/texmf-dist/tex/context/base/mkiv/blob-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/blob-ini.lua
index f825b7aa382..0b35c3b65aa 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/blob-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/blob-ini.lua
@@ -188,7 +188,11 @@ blobs.strht = strht
blobs.strdp = strdp
blobs.strhd = strhd
-implement { name = "strwd", arguments = "string", actions = { strwd, context } }
-implement { name = "strht", arguments = "string", actions = { strht, context } }
-implement { name = "strdp", arguments = "string", actions = { strdp, context } }
-implement { name = "strhd", arguments = "string", actions = { strhd, context } }
+-- upgraded
+
+local scan_hbox = tokens.scanners.hbox
+
+implement { name = "strwd", actions = function() local l = scan_hbox() context(l.width) flush_node_list(l) end }
+implement { name = "strht", actions = function() local l = scan_hbox() context(l.height) flush_node_list(l) end }
+implement { name = "strdp", actions = function() local l = scan_hbox() context(l.depth) flush_node_list(l) end }
+implement { name = "strhd", actions = function() local l = scan_hbox() context(l.height + l.depth) flush_node_list(l) end }
diff --git a/Master/texmf-dist/tex/context/base/mkiv/blob-ini.mkiv b/Master/texmf-dist/tex/context/base/mkiv/blob-ini.mkiv
index 3cee3ff2f53..dd33087f280 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/blob-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/blob-ini.mkiv
@@ -32,12 +32,13 @@
\def\dpofstring#1{\dimexpr\clf_strdp{#1}\scaledpoint\relax}
\def\hdofstring#1{\dimexpr\clf_strhd{#1}\scaledpoint\relax}
-\def\widthofstring {\the\wdofstring}
-\def\heightofstring {\the\htofstring}
-\def\depthofstring {\the\dpofstring}
-\def\heightanddepthofstring{\the\hdofstring}
+\def\widthofstring {\the\wdofstring}
+\def\heightofstring {\the\htofstring}
+\def\depthofstring {\the\dpofstring}
+\def\totalofstring {\the\hdofstring}
-\let\htdpofstring \hdofstring
+\let\heightanddepthofstring\totalofstring
+\let\htdpofstring \hdofstring
\let\hd\htdp % if yes then move this
diff --git a/Master/texmf-dist/tex/context/base/mkiv/buff-imp-nested.mkiv b/Master/texmf-dist/tex/context/base/mkiv/buff-imp-nested.mkiv
index f6a25b5f804..9a6a884f00a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/buff-imp-nested.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/buff-imp-nested.mkiv
@@ -15,7 +15,7 @@
\unprotect
-\unexpanded\def\donestedtypingstart{\bgroup\swaptypeface{}}
-\unexpanded\def\donestedtypingstop {\egroup{}}
+\permanent\protected\def\donestedtypingstart{\bgroup\swaptypeface{}}
+\permanent\protected\def\donestedtypingstop {\egroup{}}
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/buff-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/buff-ini.lua
index 5b5c4786756..4589e5498c5 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/buff-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/buff-ini.lua
@@ -42,7 +42,9 @@ local scantokencode = scanners.tokencode
local getters = tokens.getters
local gettoken = getters.token
-local scanners = interfaces.scanners
+local getcommand = token.get_command
+local getcsname = token.get_csname
+local getnextchar = token.scan_next_char or token.get_next_char
local variables = interfaces.variables
local settings_to_array = utilities.parsers.settings_to_array
@@ -375,7 +377,7 @@ local tochar = {
local experiment = false
local experiment = scantokencode and true
-function tokens.pickup(start,stop)
+local function pickup(start,stop)
local stoplist = split[stop] -- totable(stop)
local stoplength = #stoplist
local stoplast = stoplist[stoplength]
@@ -439,11 +441,11 @@ function tokens.pickup(start,stop)
-- we're skipping leading stuff, like obeyedlines and relaxes
if experiment and size > 0 then
-- we're probably in a macro
- local char = tochar[token.get_command(t)] -- could also be char(token.get_mode(t))
+ local char = tochar[getcommand(t)]
if char then
size = size + 1 ; list[size] = char
else
- local csname = token.get_csname(t)
+ local csname = getcsname(t)
if csname == stop then
stoplength = 0
break
@@ -494,6 +496,118 @@ function tokens.pickup(start,stop)
end
end
+-- -- lmtx:
+--
+-- local function pickup(start,stop)
+-- local stoplist = split[stop] -- totable(stop)
+-- local stoplength = #stoplist
+-- local stoplast = stoplist[stoplength]
+-- local startlist = split[start] -- totable(start)
+-- local startlength = #startlist
+-- local startlast = startlist[startlength]
+-- local list = { }
+-- local size = 0
+-- local depth = 0
+-- getnextchar() -- we start with a \relax
+-- while true do -- or use depth
+-- local char = getnextchar()
+-- if char then
+-- size = size + 1
+-- list[size] = char
+-- if char == stoplast and size >= stoplength then
+-- local done = true
+-- local last = size
+-- for i=stoplength,1,-1 do
+-- if stoplist[i] ~= list[last] then
+-- done = false
+-- break
+-- end
+-- last = last - 1
+-- end
+-- if done then
+-- if depth > 0 then
+-- depth = depth - 1
+-- else
+-- break
+-- end
+-- char = false -- trick: let's skip the next (start) test
+-- end
+-- end
+-- if char == startlast and size >= startlength then
+-- local done = true
+-- local last = size
+-- for i=startlength,1,-1 do
+-- if startlist[i] ~= list[last] then
+-- done = false
+-- break
+-- end
+-- last = last - 1
+-- end
+-- if done then
+-- depth = depth + 1
+-- end
+-- end
+-- else
+-- local t = gettoken()
+-- if t then
+-- -- we're skipping leading stuff, like obeyedlines and relaxes
+-- if experiment and size > 0 then
+-- -- we're probably in a macro
+-- local char = tochar[getcommand(t)]
+-- if char then
+-- size = size + 1 ; list[size] = char
+-- else
+-- local csname = getcsname(t)
+-- if csname == stop then
+-- stoplength = 0
+-- break
+-- else
+-- size = size + 1 ; list[size] = "\\"
+-- size = size + 1 ; list[size] = csname
+-- size = size + 1 ; list[size] = " "
+-- end
+-- end
+-- else
+-- -- ignore and hope for the best
+-- end
+-- else
+-- break
+-- end
+-- end
+-- end
+-- local start = 1
+-- local stop = size - stoplength - 1
+-- -- not good enough: only empty lines, but even then we miss the leading
+-- -- for verbatim
+-- --
+-- -- the next is not yet adapted to the new scanner ... we don't need lpeg here
+-- --
+-- for i=start,stop do
+-- local li = list[i]
+-- if lpegmatch(blackspace,li) then
+-- -- keep going
+-- elseif lpegmatch(eol,li) then
+-- -- okay
+-- start = i + 1
+-- else
+-- break
+-- end
+-- end
+-- for i=stop,start,-1 do
+-- if lpegmatch(whitespace,list[i]) then
+-- stop = i - 1
+-- else
+-- break
+-- end
+-- end
+-- --
+-- if start <= stop then
+-- return concat(list,"",start,stop)
+-- else
+-- return ""
+-- end
+-- end
+
-- function buffers.pickup(name,start,stop,finish,catcodes,doundent)
-- local data = tokens.pickup(start,stop)
-- if doundent or (autoundent and doundent == nil) then
@@ -505,21 +619,28 @@ end
-- commands.pickupbuffer = buffers.pickup
-scanners.pickupbuffer = function()
- local name = scanstring()
- local start = scanstring()
- local stop = scanstring()
- local finish = scanstring()
- local catcodes = scaninteger()
- local doundent = scanboolean()
- local data = tokens.pickup(start,stop)
- if doundent or (autoundent and doundent == nil) then
- data = undent(data)
- end
- buffers.assign(name,data,catcodes)
- -- context[finish]()
- context(finish)
-end
+tokens.pickup = pickup
+
+implement {
+ name = "pickupbuffer",
+ actions = function()
+ -- let's pickup all here (no arguments)
+ local name = scanstring()
+ local start = scanstring()
+ local stop = scanstring()
+ local finish = scanstring()
+ local catcodes = scaninteger()
+ local doundent = scanboolean()
+ -- could be a scanner:
+ local data = pickup(start,stop)
+ if doundent or (autoundent and doundent == nil) then
+ data = undent(data)
+ end
+ buffers.assign(name,data,catcodes)
+ -- context[finish]()
+ context(finish)
+ end
+}
local function savebuffer(list,name,prefix) -- name is optional
if not list or list == "" then
diff --git a/Master/texmf-dist/tex/context/base/mkiv/buff-ini.mkiv b/Master/texmf-dist/tex/context/base/mkiv/buff-ini.mkiv
index 8e71c9865ad..a8a120d903c 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/buff-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/buff-ini.mkiv
@@ -116,7 +116,7 @@
{\endgroup % (1)
\endgroup % (2)
#5}%
- % todo: we need to skip the first lineending which is na active character
+ % todo: we need to skip the first lineending which is an active character
% but sometimes we have something different ... this is a side effect of
% checking for optional arguments i.e. the next token is already tokenized
% and for that reason we have the \relax as well as the \string
diff --git a/Master/texmf-dist/tex/context/base/mkiv/buff-par.mkvi b/Master/texmf-dist/tex/context/base/mkiv/buff-par.mkvi
index 0ee66dd0141..a2d32c6be15 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/buff-par.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/buff-par.mkvi
@@ -65,8 +65,8 @@
\let\buff_parallel_define_saved\defineparallel
\let\buff_parallel_setup_saved \setupparallel
-\unexpanded\def\defineparallel{\dodoubleargument\buff_parallel_define}
-\unexpanded\def\setupparallel {\dotripleargument\buff_parallel_setup}
+\unexpanded\overloaded\def\defineparallel{\dodoubleargument\buff_parallel_define}
+\unexpanded\overloaded\def\setupparallel {\dotripleargument\buff_parallel_setup}
\def\buff_parallel_define[#name][#instances]%
{\buff_parallel_define_saved[#name][\c!list={#instances}]% list is internal
diff --git a/Master/texmf-dist/tex/context/base/mkiv/buff-ver.lua b/Master/texmf-dist/tex/context/base/mkiv/buff-ver.lua
index ad06dceeca3..ccb8ab0df8e 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/buff-ver.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/buff-ver.lua
@@ -588,7 +588,7 @@ end
local function realign(lines,strip) -- "yes", <number>
local n
if strip == v_yes then
- n = math.huge
+ n = 0xFFFF
for i=1, #lines do
local spaces = find(lines[i],"%S") -- can be lpeg
if not spaces then
@@ -800,7 +800,7 @@ end
-- needed in e.g. tabulate (manuals)
local fences = S([[[{]])
-local symbols = S([[!#"$%&'*()+,-./:;<=>?@[]^_`{|}~]])
+local symbols = S([[!#"$%&'*()+,-./:;<=>?@[]^_`{|}~0123456789]]) -- digits added but maybe split it
local space = S([[ ]])
local backslash = S([[\]])
local nospace = space^1/""
@@ -808,7 +808,7 @@ local endstring = P(-1)
local compactors = {
[v_all] = Cs((backslash * (1-backslash-space)^1 * nospace * (endstring+fences) + 1)^0),
- [v_absolute] = Cs((backslash * (1-symbols -space)^1 * nospace * (symbols +backslash) + 1) ^0),
+ [v_absolute] = Cs((backslash * (1-symbols -space)^1 * nospace * (symbols+backslash) + 1)^0),
[v_last] = Cs((space^1 * endstring/"" + 1)^0),
}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/buff-ver.mkiv b/Master/texmf-dist/tex/context/base/mkiv/buff-ver.mkiv
index 75ee992e41b..3cd2c91bc21 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/buff-ver.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/buff-ver.mkiv
@@ -24,7 +24,7 @@
\definesystemattribute[verbatimline][public]
\appendtoksonce
- \attribute\verbatimlineattribute\attributeunsetvalue
+ \c_attr_verbatimline\attributeunsetvalue
\to \everyforgetall
%D Initializations.
@@ -39,6 +39,7 @@
\the\everyresettypesetting
\resetfontfeature
\resetcharacterspacing
+ \resetbreakpoints
\to \everyinitializeverbatim
\unexpanded\def\setverbatimspaceskip % to be checked: must happen after font switch
@@ -178,9 +179,9 @@
\setuevalue{\e!start\currenttyping}{\buff_verbatim_typing_start{\currenttyping}}%
\setuevalue{\e!stop \currenttyping}{\buff_verbatim_typing_stop {\currenttyping}}%
\ifx\currenttypingparent\empty
- \normalexpanded{\definelinenumbering[\currenttyping]}%
+ \normalexpanded{\definelinenumbering[\currenttyping]}%
\else
- \normalexpanded{\definelinenumbering[\currenttyping][\currenttypingparent]}%
+ \normalexpanded{\definelinenumbering[\currenttyping][\currenttypingparent]}%
\fi
\to \everydefinetyping
@@ -286,10 +287,10 @@
\def\buff_verbatim_type_nop
{\buff_verbatim_left_of_type
- \futurelet\next\buff_verbatim_type_one}
+ \futurelet\nexttoken\buff_verbatim_type_one}
\def\buff_verbatim_type_one
- {\ifx\next\bgroup
+ {\ifx\nexttoken\bgroup
\expandafter\buff_verbatim_type_a
\else
\expandafter\buff_verbatim_type_two
@@ -298,10 +299,10 @@
\def\buff_verbatim_type_two
{\catcode`<=\othercatcode % old precaution
\catcode`>=\othercatcode % old precaution
- \futurelet\next\buff_verbatim_type_three}
+ \futurelet\nexttoken\buff_verbatim_type_three}
\def\buff_verbatim_type_three
- {\if\next<%
+ {\if\nexttoken<%
\expandafter\buff_verbatim_type_b
\else
\expandafter\buff_verbatim_type_c
@@ -386,7 +387,7 @@
\unexpanded\def\explicitcontrolspace {\optionalcontrolspace\allowbreak} % uses asciispace
\appendtoks
- \unexpanded\def\obeyedspace{\hskip\zeropoint\asciispacechar\hskip\zeropoint}%
+ \unexpanded\def\obeyedspace{\hskip\zeropoint\relax\asciispacechar\hskip\zeropoint\relax}%
\to \everyenableelements
\unexpanded\def\obeyhyphens
@@ -489,17 +490,6 @@
\buff_verbatim_setup_keep_together
\normalexpanded{\buff_verbatim_type_block{\e!start\currenttyping}{\e!stop\currenttyping}}}
-% \def\buff_verbatim_typing_start_yes[#1]%
-% {\typingparameter\c!before
-% \startpacked[\v!blank]%
-% \doifelseassignment{#1}
-% {\setupcurrenttyping[#1]}
-% {\doif\v!continue{#1}{\lettypingparameter\c!continue\v!yes}}%
-% \buff_verbatim_setup_line_numbering
-% \buff_verbatim_initialize_typing_one
-% \buff_verbatim_setup_keep_together
-% \normalexpanded{\buff_verbatim_type_block{\e!start\currenttyping}{\e!stop\currenttyping}}}
-
\def\buff_verbatim_typing_start_yes[#1]%
{\typingparameter\c!before
\startpacked[\v!blank]%
@@ -609,21 +599,6 @@
\setuevalue{\e!type\currenttyping\v!file}{\typefile[\currenttyping]}%
\to \everydefinetyping
-% \def\buff_verbatim_type_file[#1][#2]#3%
-% {\begingroup
-% \ifsecondargument
-% \setuptyping[#1][#2]%
-% \buff_verbatim_type_file_checked{#1}{#3}%
-% \else\iffirstargument
-% \doifelseassignment{#1}
-% {\setuptyping[\v!file][#1]%
-% \buff_verbatim_type_file_checked\v!file{#3}}
-% {\buff_verbatim_type_file_checked{#1}{#3}}%
-% \else
-% \buff_verbatim_type_file_checked\v!file{#3}%
-% \fi\fi
-% \endgroup}
-
\def\buff_verbatim_type_file[#1][#2]#3%
{\begingroup
\ifsecondargument
@@ -823,20 +798,6 @@
\setuevalue{\e!type\currenttyping\v!buffer}{\buff_verbatim_type_buffer_class{\currenttyping}}%
\to \everydefinetyping
-% \unexpanded\def\buff_verbatim_type_buffer[#1][#2]%
-% {\ifsecondargument
-% \setupcurrenttyping[#2]%
-% \processcommalist[#1]{\buff_verbatim_type_buffer_indeed\currenttyping}% [name] [settings]
-% \else\iffirstargument
-% \doifelseassignment{#1}
-% {\setupcurrenttyping[#1]%
-% \buff_verbatim_type_buffer_indeed\currenttyping\empty}% [settings]
-% {\processcommalist[#1]{\buff_verbatim_type_buffer_indeed\currenttyping}}% [name]
-% \else
-% \buff_verbatim_type_buffer_indeed\currenttyping\empty% []
-% \fi\fi
-% \endgroup}
-
\unexpanded\def\buff_verbatim_type_buffer[#1][#2]%
{\ifsecondargument
\setupcurrenttyping[#2]%
@@ -851,6 +812,7 @@
\else
\buff_verbatim_type_buffer_indeed\currenttyping\empty% []
\fi\fi
+ \useindentnextparameter\typingparameter
\endgroup
\dorechecknextindentation}
@@ -865,7 +827,9 @@
\setuptyping[#1][#3]%
\fi
\buff_verbatim_type_buffer_indeed{#1}{#2}%
- \endgroup}
+ \useindentnextparameter\typingparameter
+ \endgroup
+ \dorechecknextindentation}
\unexpanded\def\buff_verbatim_type_buffer_indeed#1#2% category name
{\edef\currenttyping{#1}%
@@ -891,8 +855,7 @@
\endofverbatimlines
\dostoptagged
\stoppacked
- \typingparameter\c!after
- \dorechecknextindentation}
+ \typingparameter\c!after}
\unexpanded\def\typeinlinebuffer
{\dontleavehmode
@@ -926,21 +889,6 @@
{\writestatus{nota bene}{\string\processbuffer\space is obsolete}%
\dodoubleempty\buff_verbatim_process}
-% \def\buff_verbatim_process[#1][#2]%
-% {\begingroup
-% \ifsecondargument
-% \setuptyping[\v!buffer][#2]%
-% \processcommalist[#1]{\buff_verbatim_process_indeed\v!buffer}% [name] [settings]
-% \else\iffirstargument
-% \doifelseassignment{#1}
-% {\setuptyping[\v!buffer][#1]%
-% \buff_verbatim_process_indeed\v!buffer\empty}% [settings]
-% {\processcommalist[#1]{\buff_verbatim_process_indeed\v!buffer}}% [name]
-% \else
-% \buff_verbatim_process_indeed\v!buffer\empty% []
-% \fi\fi
-% \endgroup}
-
\def\buff_verbatim_process[#1][#2]%
{\begingroup
\ifsecondargument
@@ -977,7 +925,7 @@
\unexpanded\def\buff_verbatim_begin_of_line
{\ifconditional\verbatimnumberinglines
\global\advance\nofverbatimlines\plusone
- \attribute\verbatimlineattribute\nofverbatimlines
+ \c_attr_verbatimline\nofverbatimlines
\fi
\noindent
\buff_verbatim_set_line_margin
@@ -991,7 +939,7 @@
\obeyedline % still needed?
\par
\ifconditional\verbatimnumberinglines
- \attribute\verbatimlineattribute\attributeunsetvalue
+ \c_attr_verbatimline\attributeunsetvalue
\fi}
\unexpanded\def\buff_verbatim_empty_line
@@ -1071,4 +1019,8 @@
\stopcontextdefinitioncode
+%D This is \type {\asciimode} without the double comment hackery:
+
+\unexpanded\def\literalmode{\setcatcodetable\txtcatcodes}
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/buff-ver.mkxl b/Master/texmf-dist/tex/context/base/mkiv/buff-ver.mkxl
deleted file mode 100644
index dec4dfb4a02..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/buff-ver.mkxl
+++ /dev/null
@@ -1,1005 +0,0 @@
-%D \module
-%D [ file=buff-ver, % was core-ver
-%D version=2000.05.09,
-%D title=\CONTEXT\ Buffer Macros,
-%D subtitle=Verbatim,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% check after-first and before-last breaks
-
-\writestatus{loading}{ConTeXt Buffer Macros / Verbatim}
-
-\registerctxluafile{buff-ver}{}
-
-\unprotect
-
-\startcontextdefinitioncode
-
-\definesystemattribute[verbatimline][public]
-
-\appendtoksonce
- \attribute\verbatimlineattribute\attributeunsetvalue
-\to \everyforgetall
-
-%D Initializations.
-
-\installcorenamespace{typinglines}
-\installcorenamespace{typingspace}
-\installcorenamespace{typingblank} % needs checking ... used?
-
-\newtoks\everyinitializeverbatim
-
-\appendtoks
- \the\everyresettypesetting
- \resetfontfeature
- \resetcharacterspacing
-\to \everyinitializeverbatim
-
-\unexpanded\def\setverbatimspaceskip % to be checked: must happen after font switch
- {\spaceskip\fontcharwd\font`x\relax
- \xspaceskip\spaceskip}
-
-\setvalue{\??typinglines\v!no }{\buff_verbatim_ignore_hyphens}
-\setvalue{\??typinglines\v!normal }{\buff_verbatim_ignore_hyphens}
-\setvalue{\??typinglines\v!yes }{\buff_verbatim_obey_breakpoints}
-\setvalue{\??typinglines\v!hyphenated}{\buff_verbatim_obey_hyphens}
-
-\setvalue{\??typingspace\v!on }{\let\obeyedspace\specialcontrolspace}
-\setvalue{\??typingspace\v!stretch }{\let\obeyedspace\specialstretchedspace}
-\setvalue{\??typingspace\v!normal }{}
-\setvalue{\??typingspace\v!fixed }{\let\obeyedspace\specialfixedspace}
-
-\setvalue{\??typingblank\v!standard }{\s_spac_whitespace_parskip}
-\setvalue{\??typingblank\v!small }{\smallskipamount}
-\setvalue{\??typingblank\v!medium }{\medskipamount}
-\setvalue{\??typingblank\v!big }{\bigskipamount}
-\setvalue{\??typingblank\v!halfline }{.5\baselineskip}
-\setvalue{\??typingblank\v!line }{\baselineskip}
-\setvalue{\??typingblank\v!none }{\zeropoint}
-
-\unexpanded\def\buff_verbatim_obey_hyphens
- {}
-
-\unexpanded\def\buff_verbatim_obey_breakpoints
- {\language\minusone % tricky as this affects the pagebuilder
- \veryraggedright}
-
-\unexpanded\def\buff_verbatim_ignore_hyphens
- {\language\minusone} % tricky as this affects the pagebuilder
-
-\def\buff_verbatim_initialize_type_one
- {\let\obeylines\ignorelines
- \edef\p_buff_option{\typeparameter\c!option}%
- \ifx\p_buff_option\v!none
- \usetypestyleandcolor\c!style\c!color
- \orelse\ifx\p_buff_option\empty
- \usetypestyleandcolor\c!style\c!color
- \else
- \usetypestyleparameter\c!style % no color
- \fi
- \setcatcodetable\vrbcatcodes}
-
-\def\buff_verbatim_initialize_type_two
- {\spaceskip.5\emwidth\relax
- \let\obeyedspace\specialobeyedspace
- \let\controlspace\specialcontrolspace
- \edef\p_buff_lines{\typeparameter\c!lines}%
- \begincsname\??typinglines\p_buff_lines\endcsname
- \edef\p_buff_space{\typeparameter\c!space}%
- \begincsname\??typingspace\p_buff_space\endcsname
- \relax\the\everyinitializeverbatim\relax}
-
-\unexpanded\def\doinitializeverbatim % for use elsewhere .. temp hack (see lxml-ini)
- {\buff_verbatim_initialize_type_one
- \buff_verbatim_initialize_type_two}
-
-\let\buff_verbatim_set_line_margin\relax
-
-\def\buff_verbatim_set_line_margin_indeed
- {\hskip\doifelseoddpage{\typingparameter\c!oddmargin}{\typingparameter\c!evenmargin}\relax}
-
-\def\buff_verbatim_initialize_typing_one
- {\usebodyfontparameter\typingparameter
- \scratchskip\typingparameter\c!oddmargin\relax
- \ifzeropt\scratchskip \else
- \let\buff_verbatim_set_line_margin\buff_verbatim_set_line_margin_indeed
- \fi
- \scratchskip\typingparameter\c!evenmargin\relax
- \ifzeropt\scratchskip \else
- \let\buff_verbatim_set_line_margin\buff_verbatim_set_line_margin_indeed
- \fi
- \ifx\buff_verbatim_set_line_margin\relax
- \doadaptleftskip{\typingparameter\c!margin}%
- \fi
- \edef\p_buff_option{\typingparameter\c!option}%
- \ifx\p_buff_option\v!none
- \usetypingstyleandcolor\c!style\c!color
- \orelse\ifx\p_buff_option\empty
- \usetypingstyleandcolor\c!style\c!color
- \else
- \usetypingstyleparameter\c!style % no color !
- \fi
- \usealignparameter\typingparameter}
-
-\def\buff_verbatim_initialize_typing_two
- {\spaceskip.5\emwidth\relax
- \let\obeyedspace\specialobeyedspace
- \let\controlspace\specialcontrolspace
- \edef\p_buff_lines{\typingparameter\c!lines}%
- \begincsname\??typinglines\p_buff_lines\endcsname
- \edef\p_buff_space{\typingparameter\c!space}%
- \begincsname\??typingspace\p_buff_space\endcsname
- \relax\the\everyinitializeverbatim\relax}
-
-%D \macros
-%D {definetype,setuptype}
-%D
-%D Specific inline verbatim commands can be defined with the following command.
-
-\installcorenamespace{type}
-
-\installcommandhandler \??type {type} \??type
-
-\appendtoks
- \setuevalue{\currenttype}{\buff_verbatim_type{\currenttype}}%
-\to \everydefinetype
-
-\appendtoks
- \buff_verbatim_initialize_visualizer{\typeparameter\c!option}%
-\to \everysetuptype
-
-%D \macros
-%D {definetyping,setuptyping}
-%D
-%D For most users the standard \type {\start}||\type {\stop}||pair will suffice, but
-%D for documentation purposes the next definition command can be of use:
-%D
-%D \starttyping
-%D \definetyping[extratyping][margin=3em]
-%D
-%D \startextratyping
-%D these extra ones are indented by 1 em
-%D \stopextratyping
-%D \stoptyping
-%D
-%D The definitions default to the standard typing values.
-
-\installcorenamespace{typing}
-
-\installcommandhandler \??typing {typing} \??typing
-
-\appendtoks
- \setuevalue{\e!start\currenttyping}{\buff_verbatim_typing_start{\currenttyping}}%
- \setuevalue{\e!stop \currenttyping}{\buff_verbatim_typing_stop {\currenttyping}}%
- \ifx\currenttypingparent\empty
- \normalexpanded{\definelinenumbering[\currenttyping]}%
- \else
- \normalexpanded{\definelinenumbering[\currenttyping][\currenttypingparent]}%
- \fi
-\to \everydefinetyping
-
-\appendtoks
- \buff_verbatim_initialize_visualizer{\typingparameter\c!option}% we can check at the tex end
-\to \everysetuptyping
-
-\def\buff_verbatim_initialize_visualizer#1%
- {\ifproductionrun\clf_loadvisualizer{#1}\fi}
-
-\unexpanded\def\doifelsevisualizer#1%
- {\clf_doifelsevisualizer{#1}}
-
-\let\doifvisualizerelse\doifelsevisualizer
-
-%D Verbatim command are very sensitive to argument processing, which is a direct
-%D result of the \CATCODES\ being fixed at reading time.
-%D
-%D Typesetting inline verbatim can be accomplished by \type {\type}, which in this
-%D sentence was typeset by saying just \type {\type {\type}}, which in turn was
-%D typeset by \unknown. Using the normal grouping characters \type {{}} is the most
-%D natural way of using this command.
-%D
-%D A second, more or less redundant, alternative is delimiting the argument with an
-%D own character. This method was implemented in the context of a publication in the
-%D \MAPS, where this way of delimiting is recognized by \LATEX\ users.
-%D
-%D The third, more original alternative, is the one using \type {<<} and \type {>>}
-%D as delimiters. This alternative can be used in situations where slanted
-%D typeseting is needed.
-%D
-%D \macros
-%D {type}
-%D
-%D We define \type {\type} as a protected command. This command has several
-%D invocations: grouped, wirt boundary characters, and with font switches.
-%D
-%D \starttyping
-%D normal: \par \type{xx<<..xx..<<xx <<xx>> >>..>>xx} \par \type<<....>> \par \type<<..<<xx>>..>> \par
-%D normal: \par \type{xx<..xx..<xx <slanted> >..>xx} \par \type{<....>} \par \type{<..<xx>..>}
-%D \setuptype[option=slanted]
-%D slanted: \par \type{xx<<..sl..<<xx <<sl>> xx>>..sl..>>xx} \par \type<<..xx..>> \par \type<<..<<sl>>..>> \par
-%D slanted: \par \type{xx<<..sl..<xx <sl> xx>..sl..>>xx} \par \type<<..xx..>> \par \type<<..<sl>..>> \par
-%D \setuptype[option=none]
-%D none: \par \type{xx<<..xx..<<xx <<xx>> >>..>>xx} \par \type<<....>> \par \type<<..<<xx>>..>> \par
-%D \stoptyping
-%D
-%D When writing the manual to \CONTEXT\ and documenting this source we needed to
-%D typeset \type {<<} and \type {>>}. Because we wanted to do this in the natural
-%D way, we've adapted the original definition a bit. This implementation went
-%D through several live cycles. The final implementation looks a bit further and
-%D treats the lone \type {<<} and \type {>>} a bit different. The \type {\null}
-%D prevents ligatures, which unfortunately turn up in Lucida fonts.
-%D
-%D The following lines show what happens when we set \type {option=commands}.
-%D
-%D \startbuffer
-%D \starttyping
-%D test//test test/BTEX \footnote{test test test}/ETEX test
-%D test//test test/BTEX \footnote{test test test}/ETEX test
-%D test test test/BTEX \bf(nota bene)/ETEX test
-%D test test test /BTEX \bf(nota bene)/ETEX test
-%D \stoptyping
-%D \stopbuffer
-%D
-%D % \bgroup\setuptyping[option=commands]\getbuffer\egroup
-%D
-%D this was keyed in as:
-%D
-%D \typebuffer
-
-% Beware, the command is supposed to do something like \framed and not manipulate
-% content i.e. it gets no argument but something b/egrouped instead:
-
-\def\buff_verbatim_left_of_type
- {\typeparameter\c!left
- \typeparameter\c!command\bgroup}
-
-\def\buff_verbatim_right_of_type
- {\egroup
- \typeparameter\c!right}
-
-\unexpanded\def\type{\buff_verbatim_type\empty}
-\unexpanded\def\typ {\buff_verbatim_typ \empty}
-
-\unexpanded\def\buff_verbatim_type#1%
- {\dontleavehmode
- \bgroup
- \edef\currenttype{#1}%
- \doifelsenextoptionalcs\buff_verbatim_type_yes\buff_verbatim_type_nop}
-
-\def\buff_verbatim_type_yes[#1]%
- {\setupcurrenttype[#1]%
- \buff_verbatim_type_nop}
-
-\def\buff_verbatim_typ#1%
- {\dontleavehmode
- \bgroup
- \edef\currenttype{#1}%
- \lettypeparameter\c!lines\v!hyphenated
- \let\specialobeyedspace\specialstretchedspace
- \doifelsenextoptionalcs\buff_verbatim_type_yes\buff_verbatim_type_nop}
-
-\def\buff_verbatim_type_nop
- {\buff_verbatim_left_of_type
- \futureexpand\bgroup\buff_verbatim_type_a\buff_verbatim_type_one}
-
-\def\buff_verbatim_type_one
- {\catcode`<=\othercatcode % old precaution
- \catcode`>=\othercatcode % old precaution
- \futureexpandis<\buff_verbatim_type_b\buff_verbatim_type_c}
-
-\def\buff_verbatim_type_three
- {\if\next<%
- \expandafter\buff_verbatim_type_b
- \else
- \expandafter\buff_verbatim_type_c
- \fi}
-
-\def\buff_verbatim_type_a
- {\buff_verbatim_initialize_type_one
- \setcatcodetable\tpacatcodes
- \buff_verbatim_type_normal}
-
-\def\buff_verbatim_type_b#1%
- {\buff_verbatim_initialize_type_one
- \setcatcodetable\tpbcatcodes
- \buff_verbatim_type_nested}
-
-\def\buff_verbatim_type_c#1%
- {\buff_verbatim_initialize_type_one
- \setcatcodetable\vrbcatcodes
- \def\next##1#1{\buff_verbatim_type_normal{##1}}%
- \next}
-
-\def\buff_verbatim_type_normal#1%
- {\buff_verbatim_initialize_type_two
- \dostarttaggedchained\t!verbatim\currenttype\??type
- \clf_type
- data {\detokenize{#1}}%
- tab {\typeparameter\c!tab}%
- method {\p_buff_option}%
- compact {\typeparameter\c!compact}% % none | all | last (all needed in tabulate etc for manuals)
- escape {\typeparameter\c!escape}% % new but rather useless imo (escaping in general is not used much)
- % nature {inline}% is default
- \relax
- \dostoptagged
- \buff_verbatim_right_of_type
- \egroup}
-
-\def\buff_verbatim_type_nested#1%
- {\buff_verbatim_initialize_type_two
- \dostarttaggedchained\t!verbatim\currenttype\??type
- \clf_type
- data {\detokenize{#1}}%
- tab {\typeparameter\c!tab}%
- method {\p_buff_option}% % extra visualizer (maybe: nested,\typeparameter\c!option)
- escape {\typeparameter\c!escape}% % new but rather useless imo (escaping in general is not used much)
- % nature {inline}% is default
- method {nested}%
- \relax
- \dostoptagged
- \buff_verbatim_right_of_type
- \egroup
- \gobbleoneargument} % grab last >
-
-%D The \type {compact} option can come in handy in the case of inline argument passing
-%D
-%D \starttyping
-%D \definetype[TeXcodeA][option=TEX]
-%D \definetype[TeXcodeB][option=TEX,compact=all]
-%D \definetype[TeXcodeC][option=TEX,compact=absolute]
-%D
-%D \def\argA#1{\TeXcodeA{{#1}}}
-%D \def\argB#1{\TeXcodeB{{#1}}}
-%D \def\argC#1{\TeXcodeC{{#1}}}
-%D \stoptyping
-
-%D \macros
-%D {obeyhyphens,obeybreakpoints}
-%D
-%D Although it's not clear from the macros, one character trait of this macros,
-%D which are build on top of the support module, is that they don't hyphenate. We
-%D therefore offer the alternative \type{\typ}. The current implementation works all
-%D right, but a decent hyphenation support of \type{\tt} text will be implemented
-%D soon.
-
-\unexpanded\def\specialfixedspace {\kern\interwordspace\relax}
-\unexpanded\def\specialobeyedspace {\hskip\interwordspace\relax} % better than spaceskip
-\unexpanded\def\specialstretchedspace {\hskip.5\interwordspace\s!plus.125\interwordspace\relax} % \interwordstretch can be zero
-\unexpanded\def\specialcontrolspace {\normalcontrolspace\allowbreak} % uses fallback
-
-\unexpanded\def\explicitfixedspace {\asciispacechar}
-\unexpanded\def\explicitobeyedspace {\asciispacechar\allowbreak}
-\unexpanded\def\explicitstretchedspace{\asciispacechar\hskip\zeropoint\s!plus.125\interwordspace\relax}%
-\unexpanded\def\explicitcontrolspace {\optionalcontrolspace\allowbreak} % uses asciispace
-
-\appendtoks
- \unexpanded\def\obeyedspace{\hskip\zeropoint\asciispacechar\hskip\zeropoint}%
-\to \everyenableelements
-
-\unexpanded\def\obeyhyphens
- {\let\obeyedspace \specialobeyedspace % maybe \specialstretchedspace
- \let\controlspace\specialcontrolspace
- \spaceskip.25\emwidth\relax} % hm a bit of stretch !
-
-\unexpanded\def\obeybreakpoints
- {\ignorehyphens
- \veryraggedright}
-
-\unexpanded\def\ignorehyphens
- {\language\minusone % extra bonus, the \null should do the job too
- \let\obeyedspace \specialobeyedspace
- \let\controlspace\specialcontrolspace
- \spaceskip.5\emwidth\relax}
-
-%D \macros
-%D {tex,arg,mat,dis,astype}
-%D
-%D Sometimes, for instance when we pass verbatim text as an argument, the fixed
-%D \CATCODES\ interfere with our wishes. An experimental implementation of character
-%D by character processing of verbatim text did overcome this limitation, but we've
-%D decided not to use that slow and sometimes troublesome solution. Instead we stick
-%D to some 'old' \CONTEXT\ macros for typesetting typical \TEX\ characters.
-
-\def\lesscharacter {<} % obsolete
-\def\morecharacter {>} % obsolete
-
-\let\texescape \textbackslash
-\let\leftargument \textbraceleft
-\let\rightargument \textbraceright
-\let\inlinemathmarker \textdollar
-\def\displaymathmarker{\textdollar\textdollar}
-
-\def\buff_verbatim_special_type#1#2#% # gobbles spaces
- {\dontleavehmode\bgroup
- \buff_verbatim_initialize_type_one
- \catcode\leftbraceasciicode \begingroupcatcode
- \catcode\rightbraceasciicode\endgroupcatcode
- #1%
- \bgroup % else wrong font for #2
- \aftergroup#2%
- \aftergroup\egroup
- \let\nexttoken}
-
-\unexpanded\def\tex{\buff_verbatim_special_type\texescape \relax}
-\unexpanded\def\arg{\buff_verbatim_special_type\leftargument \rightargument}
-\unexpanded\def\mat{\buff_verbatim_special_type\inlinemathmarker \inlinemathmarker}
-\unexpanded\def\dis{\buff_verbatim_special_type\displaymathmarker\displaymathmarker}
-
-\let\normaltexttex\tex
-\let\normaltextarg\arg
-\let\normaltextmat\mat
-\let\normaltextdis\dis
-
-\unexpanded\def\astype
- {\dontleavehmode
- \bgroup\usetypestyleandcolor\c!style\c!color\let\nexttoken}
-
-\unexpanded\def\asciistr#1% used in some old styles
- {\dontleavehmode\begingroup
- \dostarttagged\t!verbatim\empty
- \usetypestyleandcolor\c!style\c!color\detokenize{#1}%
- \dostoptagged
- \endgroup}
-
-%D The basic display verbatim commands are defined in an indirect way. As we
-%D will see, they are a specific case of a more general mechanism.
-
-\let\beginofverbatimlines\relax % hooks
-\let\endofverbatimlines \relax % hooks
-
-\unexpanded\def\buff_verbatim_typing_start#1% tricky non standard lookahead
- {\begingroup
- \edef\currenttyping{#1}%
- \obeylines
- \futureexpandis[\buff_verbatim_typing_start_yes\buff_verbatim_typing_start_nop}
-
-\unexpanded\def\buff_verbatim_setup_keep_together
- {\edef\p_keeptogether{\typingparameter\c!keeptogether}%
- \ifx\p_keeptogether\v!yes
- \settrue \c_buff_optimize_linebreaks
- \else
- \setfalse\c_buff_optimize_linebreaks
- \fi}
-
-\def\buff_verbatim_typing_start_nop
- {\typingparameter\c!before
- \startpacked[\v!blank]%
- \buff_verbatim_setup_line_numbering
- \buff_verbatim_initialize_typing_one
- \buff_verbatim_setup_keep_together
- \normalexpanded{\buff_verbatim_type_block{\e!start\currenttyping}{\e!stop\currenttyping}}}
-
-\def\buff_verbatim_typing_start_yes[#1]%
- {\typingparameter\c!before
- \startpacked[\v!blank]%
- \ifcondition\validassignment{#1}%
- \setupcurrenttyping[#1]%
- \else
- \doif\v!continue{#1}{\lettypingparameter\c!continue\v!yes}%
- \fi
- \buff_verbatim_setup_line_numbering
- \buff_verbatim_initialize_typing_one
- \buff_verbatim_setup_keep_together
- \normalexpanded{\buff_verbatim_type_block{\e!start\currenttyping}{\e!stop\currenttyping}}}
-
-\unexpanded\def\buff_verbatim_type_block#1#2%
- {\edef\p_strip{\typingparameter\c!strip}%
- \normalexpanded{\buff_pickup
- {_typing_}%
- {#1}%
- {#2}%
- {}%
- {\buff_verbatim_type_block_verbatim_indeed{#1}{#2}}%
- \ifx\p_strip\v!no\zerocount\else\plusone\fi}}
-
-\unexpanded\def\buff_verbatim_type_block_verbatim_indeed#1#2%
- {\buff_verbatim_initialize_typing_two
- \dostarttaggedchained\t!verbatimblock\currenttyping\??typing
- \beginofverbatimlines
- \dostarttagged\t!verbatimlines\empty
- \clf_typebuffer
- name {_typing_}%
- strip {\typingparameter\c!strip}%
- range {\typingparameter\c!range}%
- tab {\typingparameter\c!tab}%
- method {\p_buff_option}%
- escape {\typingparameter\c!escape}%
- nature {display}%
- \relax
- \dostoptagged
- \endofverbatimlines
- \dostoptagged
- \begincsname#2\endcsname}
-
-\unexpanded\def\buff_verbatim_typing_stop#1% hm, currenttyping
- {\stoppacked
- \typingparameter\c!after
- \useindentnextparameter\typingparameter
- \endgroup
- \dorechecknextindentation}
-
-%D Line numbering for files is combined with filtering, while display verbatim has
-%D the ability to continue.
-%D
-%D \starttyping
-%D \typefile[numbering=file,start=10,stop=12]{test.tex}
-%D
-%D \definetyping[code][numbering=line]
-%D
-%D \starttext
-%D \startcode
-%D ...
-%D ...
-%D \stopcode
-%D
-%D \startcode[start=continue]
-%D ...
-%D ...
-%D \stopcode
-%D
-%D \startcode[start=10]
-%D ...
-%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 % \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 {typefile}
-%D
-%D Typesetting files verbatim (for the moment) only supports colorization of \TEX\
-%D sources as valid option. The other setup values are inherited from display
-%D verbatim. The implementation of \type {\typefile} is straightforward:
-
-% [category] [settings] {name} % for historic reasons, all filenames are {}
-
-\unexpanded\def\typefile
- {\dodoubleempty\buff_verbatim_type_file}
-
-\appendtoks
- \setuevalue{\e!type\currenttyping\v!file}{\typefile[\currenttyping]}%
-\to \everydefinetyping
-
-\def\buff_verbatim_type_file[#1][#2]#3%
- {\begingroup
- \ifsecondargument
- \setuptyping[#1][#2]%
- \buff_verbatim_type_file_checked{#1}{#3}%
- \orelse\iffirstargument
- \ifcondition\validassignment{#1}%
- \setuptyping[\v!file][#1]%
- \buff_verbatim_type_file_checked\v!file{#3}%
- \else
- \buff_verbatim_type_file_checked{#1}{#3}%
- \fi
- \else
- \buff_verbatim_type_file_checked\v!file{#3}%
- \fi
- \useindentnextparameter\typingparameter % needs checking
- \endgroup
- \dorechecknextindentation} % needs checking
-
-\def\buff_verbatim_type_file_checked#1#2%
- {\doifelsetypingfile{#2}
- {\buff_verbatim_type_file_indeed{#1}\askedtypingfile}
- {\showmessage\m!verbatims1{#2}}}
-
-\unexpanded\def\doifelsetypingfile#1%
- {\edef\askedtypingfile{\locfilename{#1}}%
- \ifx\askedtypingfile\empty
- \edef\askedtypingfile{\locfilename{#1.tex}}% downward compatible
- \fi
- \ifx\askedtypingfile\empty
- \expandafter\secondoftwoarguments
- \else
- \expandafter\firstoftwoarguments
- \fi}
-
-\let\doiftypingfileelse\doifelsetypingfile
-
-\def\buff_verbatim_type_file_indeed#1#2% category name
- {\edef\currenttyping{#1}%
- \typingparameter\c!before
- \startpacked[\v!blank]
- \buff_verbatim_setup_line_numbering
- \buff_verbatim_initialize_typing_one
- \buff_verbatim_initialize_typing_two
- \dostarttaggedchained\t!verbatimblock\currenttyping\??typing
- \beginofverbatimlines
- \dostarttagged\t!verbatimlines\empty
- \clf_typefile
- name {#2}%
- strip {\typingparameter\c!strip}%
- range {\typingparameter\c!range}%
- regime {\currentregime}%
- tab {\typingparameter\c!tab}%
- method {\p_buff_option}%
- nature {display}%
- \relax
- \dostoptagged
- \endofverbatimlines
- \dostoptagged
- \stoppacked
- \typingparameter\c!after}
-
-%D Line numbering:
-
-\newconditional\verbatimnumberinglines
-
-\def\beginofverbatimlinenumbering
- {\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\endofverbatimlinenumbering
- {\stoplinenumbering}
-
-\def\buff_verbatim_setup_line_numbering
- {\ifdefined\startlinenumbering
- \edef\currenttypingnumbering{\typingparameter\c!numbering}%
- \ifx\currenttypingnumbering\v!file
- \setuplinenumbering[\currenttyping][\c!method=\v!file]%
- \settrue\verbatimnumberinglines
- \orelse\ifx\currenttypingnumbering\v!line
- \settrue\verbatimnumberinglines
- \else
- \setfalse\verbatimnumberinglines
- \fi
- \ifconditional\verbatimnumberinglines
- \let\beginofverbatimlines\beginofverbatimlinenumbering
- \let\endofverbatimlines \endofverbatimlinenumbering
- \fi
- \fi}
-
-%D \macros
-%D {filename}
-%D
-%D Typesetting filenames in monospaced fonts is possible with
-%D
-%D \starttyping
-%D \filename{here/there/filename.suffix}
-%D \stoptyping
-%D
-%D The definition is not that spectacular.
-
-\unexpanded\def\filename#1{{\tttf\hyphenatedfilename{#1}}}
-
-%D \macros
-%D {verbatim}
-%d
-%D And a bonus macro, an unexpanded detokenize:
-
-\unexpanded\def\verbatim#1{\detokenize{#1}}
-
-%D The setups for display verbatim and file verbatim are shared. One can adapt the
-%D extra defined typing environments, but they also default to the values below.
-%D Watch the alternative escape character.
-
-% \tttf gives problems with {\tx \type...}
-% \tt\tf does not adapt to e.g. \bf
-
-\setuptyping
- [\c!before=\blank,
- \c!after=\blank,
- %\c!keeptogether=yes, % this will become default (when tested enough)
- %\c!bodyfont=,
- %\c!color=,
- \c!space=\v!off,
- \c!lines=\v!no,
- \c!page=\v!no,
- \c!tab=\v!yes, % what is this: \s!ascii ?
- \c!option=\v!none,
- \c!text=\v!no,
- \c!style=\tt,
- \c!indentnext=\v!yes,
- \c!margin=\zeropoint,
- \c!evenmargin=\zeropoint,
- \c!oddmargin=\zeropoint,
- \c!blank=\v!line,
- %\c!escape=, % yes | no | {START,STOP} | default when yes: {BTEX,ETEX}
- \c!numbering=\v!no,
- %\c!range=,
- \c!start=1,
- %\c!stop=,
- \c!step=1,
- %\c!continue=,
- \c!strip=\v!no] % auto or number
-
-\definetyping[\v!typing]
-
-% the \zeropoint forces the number to the margin but also works ok in text
-
-\setuplinenumbering[\v!typing][\c!location=\v!left,\c!width=\zeropoint]
-
-\setuptyping [\v!file] [\s!parent=\??typing \v!typing] % we don't want \start..\stop overload
-\setuplinenumbering[\v!file] [\s!parent=\??linenumbering\v!typing]
-
-\setuptyping [\v!buffer][\s!parent=\??typing \v!file] % we don't want \start..\stop overload
-\setuplinenumbering[\v!buffer][\s!parent=\??linenumbering\v!file]
-
-%D The setups for inline verbatim default to:
-
-\setuptype
- [\c!space=\v!off,
- \c!lines=\v!no,
- %\c!color=,
- \c!style=\tt,
- %\c!option=\v!normal,
- \c!page=\v!no,
- \c!tab=\v!yes,
- \c!compact=\v!all]
-
-%D Buffers
-
-% [name] [settings] | [name] | [settings]
-
-% \unexpanded\def\typebuffer
-% {\dodoubleempty\buff_verbatim_type_buffer}
-
-\unexpanded\def\typebuffer
- {\begingroup
- \let\currenttyping\v!buffer
- \dodoubleempty\buff_verbatim_type_buffer}
-
-\unexpanded\def\buff_verbatim_type_defined_buffer
- {\dotripleempty\buff_verbatim_type_defined_buffer_indeed}
-
-\unexpanded\def\typedefinedbuffer[#1]%
- {\buff_verbatim_type_defined_buffer[\v!buffer][\thedefinedbuffer{#1}]}%
-
-\appendtoks
- \setuevalue{\e!type\currentbuffer}{\buff_verbatim_type_defined_buffer[\v!buffer][\currentdefinedbuffer]}%
-\to \everydefinebuffer
-
-\appendtoks % \e!buffer
- \setuevalue{\e!type\currenttyping\v!buffer}{\buff_verbatim_type_buffer_class{\currenttyping}}%
-\to \everydefinetyping
-
-\unexpanded\def\buff_verbatim_type_buffer[#1][#2]%
- {\ifsecondargument
- \setupcurrenttyping[#2]%
- \processcommalist[#1]{\buff_verbatim_type_buffer_indeed\currenttyping}% [name] [settings]
- \orelse\iffirstargument
- \ifcondition\validassignment{#1}%
- \setupcurrenttyping[#1]%
- \buff_verbatim_type_buffer_indeed\currenttyping\empty% [settings]
- \else
- \processcommalist[#1]{\buff_verbatim_type_buffer_indeed\currenttyping}% [name]
- \fi
- \else
- \buff_verbatim_type_buffer_indeed\currenttyping\empty% []
- \fi
- \endgroup
- \dorechecknextindentation}
-
-\unexpanded\def\buff_verbatim_type_buffer_class#1%
- {\begingroup
- \edef\currenttyping{#1}%
- \dodoubleempty\buff_verbatim_type_buffer}
-
-\unexpanded\def\buff_verbatim_type_defined_buffer_indeed[#1][#2][#3]% category name settings
- {\begingroup
- \ifthirdargument
- \setuptyping[#1][#3]%
- \fi
- \buff_verbatim_type_buffer_indeed{#1}{#2}%
- \endgroup}
-
-\unexpanded\def\buff_verbatim_type_buffer_indeed#1#2% category name
- {\edef\currenttyping{#1}%
- \typingparameter\c!before
- \startpacked[\v!blank]
- \buff_verbatim_setup_line_numbering
- \buff_verbatim_initialize_typing_one
- \buff_verbatim_initialize_typing_two
- \dostarttaggedchained\t!verbatimblock{#1}\??typing
- \beginofverbatimlines
- \dostarttagged\t!verbatimlines\empty
- \clf_typebuffer
- name {#2}%
- strip {\typingparameter\c!strip}%
- range {\typingparameter\c!range}%
- regime {\currentregime}%
- tab {\typingparameter\c!tab}%
- method {\p_buff_option}%
- escape {\typingparameter\c!escape}%
- nature {display}%
- \relax
- \dostoptagged
- \endofverbatimlines
- \dostoptagged
- \stoppacked
- \typingparameter\c!after
- \dorechecknextindentation}
-
-\unexpanded\def\typeinlinebuffer
- {\dontleavehmode
- \begingroup
- \let\buff_verbatim_type_buffer_indeed\buff_verbatim_type_buffer_indeed_inline
- \let\setupcurrenttyping\setupcurrenttype % a terrible hack but it saves code
- \let\currenttype\empty
- \dodoubleempty\buff_verbatim_type_buffer}
-
-\unexpanded\def\buff_verbatim_type_buffer_indeed_inline#1#2% category name
- {\edef\currenttype{#1}%
- \buff_verbatim_initialize_type_one
- \dostarttaggedchained\t!verbatim\currenttype\??type
- \clf_typebuffer
- name {#2}%
- strip {\v!yes}%
- regime {\currentregime}%
- method {\p_buff_option}%
- nature {inline}% is default anyway
- \relax
- \dostoptagged}
-
-% get : before/after of buffer
-% typing : before/after of typing
-% process : no before/after (special case anyway)
-
-% the next one is obsolete (bad name and used nowhere) so if it stays
-% the name will change
-
-\unexpanded\def\processbuffer
- {\writestatus{nota bene}{\string\processbuffer\space is obsolete}%
- \dodoubleempty\buff_verbatim_process}
-
-\def\buff_verbatim_process[#1][#2]%
- {\begingroup
- \ifsecondargument
- \setuptyping[\v!buffer][#2]%
- \processcommalist[#1]{\buff_verbatim_process_indeed\v!buffer}% [name] [settings]
- \orelse\iffirstargument
- \ifcondition\validassignment{#1}%
- \setuptyping[\v!buffer][#1]%
- \buff_verbatim_process_indeed\v!buffer\empty% [settings]
- \else
- \processcommalist[#1]{\buff_verbatim_process_indeed\v!buffer}% [name]
- \fi
- \else
- \buff_verbatim_process_indeed\v!buffer\empty% []
- \fi
- \endgroup}
-
-\def\buff_verbatim_process_indeed#1#2%
- {\edef\currenttyping{#1}%
- \clf_processbuffer
- name {#2}%
- strip {\typingparameter\c!strip}%
- tab {\typingparameter\c!tab}%
- % method {\p_buff_option}%
- nature {direct}%
- \relax}
-
-% so far for obsolete
-
-% line numbering, keep broken lines together
-
-\newcount\nofverbatimlines
-
-\unexpanded\def\buff_verbatim_begin_of_line
- {\ifconditional\verbatimnumberinglines
- \global\advance\nofverbatimlines\plusone
- \attribute\verbatimlineattribute\nofverbatimlines
- \fi
- \noindent
- \buff_verbatim_set_line_margin
- \the\everyline % maybe also after starttagged
- \strut % after starttagged, else break !
- \dostarttagged\t!verbatimline\empty
- }
-
-\unexpanded\def\buff_verbatim_end_of_line
- {\dostoptagged
- \obeyedline % still needed?
- \par
- \ifconditional\verbatimnumberinglines
- \attribute\verbatimlineattribute\attributeunsetvalue
- \fi}
-
-\unexpanded\def\buff_verbatim_empty_line
- {\dostoptagged
- \ifconditional\verbatimnumberinglines
- \par\strut\par % this will be an option where we use a signal instead of a strut
- \else
- \blank[\typingparameter\c!blank]%
- \fi
- \dostarttagged\t!verbatimlines\empty}
-
-% hooks:
-
-\newcount \c_buff_verbatim_noflines
-\newcount \c_buff_verbatim_current
-\newconditional\c_buff_optimize_linebreaks
-
- \def\doverbatimspace {\obeyedspace}
-
-\unexpanded\def\doinlineverbatimstart {}
-\unexpanded\def\doinlineverbatimstop {}
-\unexpanded\def\doinlineverbatimbeginline {}
-\unexpanded\def\doinlineverbatimnewline {\obeyedspace}
-\unexpanded\def\doinlineverbatimemptyline {\obeyedspace}
-
-\unexpanded\def\dodisplayverbatimstart {\advance\c_buff_verbatim_current\plusone
- \buff_verbatim_begin_of_line}
-\unexpanded\def\dodisplayverbatimstop {\buff_verbatim_end_of_line}
-\unexpanded\def\dodisplayverbatimbeginline{\advance\c_buff_verbatim_current\plusone
- \buff_verbatim_begin_of_line}
-\unexpanded\def\dodisplayverbatimnewline {\buff_verbatim_end_of_line
- \par
- \ifconditional\c_buff_optimize_linebreaks
- \buff_verbatim_inject_breaks
- \fi}
-\unexpanded\def\dodisplayverbatimemptyline{\buff_verbatim_empty_line}
-
-\unexpanded\def\buff_verbatim_inject_breaks
- {\ifnum\c_buff_verbatim_current=\plusone
- \nobreak
- \orelse\ifnum\c_buff_verbatim_noflines=\plusthree
- \nobreak
- \orelse\ifnum\c_buff_verbatim_current=\numexpr\c_buff_verbatim_noflines-\plusone\relax
- \nobreak
- \fi}
-
-\unexpanded\def\dodisplayverbatiminitialize#1%
- {\forgetparindent % maybe more
- \c_buff_verbatim_noflines#1\relax
- \c_buff_verbatim_current\zerocount}
-
-\loadmarkfile{buff-imp-default} % preloaded as otherwise spurious spaces inline due to loading
-\loadmarkfile{buff-imp-nested} % preloaded as otherwise spurious spaces inline due to loading
-\loadmarkfile{buff-imp-escaped} % for completeness
-
-%D To be considered:
-
-% \installcorenamespace{visualizer}
-%
-% \installcommandhandler \??visualizer {visualizer} \??visualizer
-%
-% \appendtoks
-% \setuevalue{\currentvisualizer}{\buff_verbatim_visualize{\currentvisualizer}}%
-% \to \everydefinevisualizer
-%
-% \unexpanded\def\buff_verbatim_visualize#1%
-% {\bgroup
-% \def\currentvisualizer{#1}%
-% \usevisualizerstyleandcolor\c!style\c!color
-% \let\next}
-
-\appendtoks
- %def\type#1{\letterbackslash\checkedstrippedcsname#1}% or maybe detokenize
- \def\type#1{\detokenize\expandafter{\csstring#1}}% or maybe detokenize
- \def\tex #1{\letterbackslash#1}%
-\to \everysimplifycommands
-
-\stopcontextdefinitioncode
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/catc-act.mkiv b/Master/texmf-dist/tex/context/base/mkiv/catc-act.mkiv
index bd1ffd38d7d..f53a14aca4a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/catc-act.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/catc-act.mkiv
@@ -23,7 +23,7 @@
\let\m_syst_catcodes_temp\empty
-\normalprotected\def\installactivecharacter#1 %
+\protected\def\installactivecharacter#1 %
{\edef\m_syst_catcodes_temp{\detokenize{#1}}%
\c_syst_catcodes_c\expandafter`\m_syst_catcodes_temp\relax % relax needed
\expandafter\startextendcatcodetable
@@ -41,7 +41,7 @@
\setnewconstant\c_syst_catcodes_hack\tildeasciicode % also defined in catc-ini.mkiv
-\normalprotected\def\defineactivecharacter #1#2 #3% uses \doifelsenumber which is not yet defined
+\protected\def\defineactivecharacter #1#2 #3% uses \doifelsenumber which is not yet defined
{\c_syst_catcodes_c\uccode\c_syst_catcodes_hack
\if#1"\uccode\c_syst_catcodes_hack\expandafter\doifelsenumber\expandafter{\string#1#2}\empty #1#2\else
\uccode\c_syst_catcodes_hack\expandafter\doifelsenumber\expandafter{\string#1#2}\empty`#1#2\fi
@@ -64,10 +64,10 @@
\def\syst_catcodes_handle_yes#1#2{#2}
\def\syst_catcodes_handle_nop#1#2{\noexpand#1}
-\normalprotected\def\makecharacteractive #1 %
+\protected\def\makecharacteractive #1 %
{\catcode`#1\activecatcode}
-\normalprotected\def\installanddefineactivecharacter #1 % #2%
+\protected\def\installanddefineactivecharacter #1 % #2%
{\normalexpanded{\noexpand\installactivecharacter \utfchar{#1} }%
\defineactivecharacter #1 }% {#2}}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/catc-ctx.mkiv b/Master/texmf-dist/tex/context/base/mkiv/catc-ctx.mkiv
index 5af8a50356f..c86201a780b 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/catc-ctx.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/catc-ctx.mkiv
@@ -125,21 +125,22 @@
\catcodetable \ctxcatcodes
\let \defaultcatcodetable \ctxcatcodes
+% \defaultcatcodetable \ctxcatcodes % also an option
% for the moment here:
-\normalprotected\def\starttexcode
+\protected\def\starttexcode
{\pushcatcodetable
\catcodetable\prtcatcodes}
-\normalprotected\def\stoptexcode
+\protected\def\stoptexcode
{\popcatcodetable}
-\normalprotected\def\startcontextcode
+\protected\def\startcontextcode
{\pushcatcodetable
\catcodetable\ctxcatcodes}
-\normalprotected\def\stopcontextcode
+\protected\def\stopcontextcode
{\popcatcodetable}
% not visible, only for special cases
@@ -169,11 +170,11 @@
\catcode\barasciicode \activecatcode
\stopcatcodetable
-\normalprotected\def\startcontextdefinitioncode
+\protected\def\startcontextdefinitioncode
{\pushcatcodetable
\catcodetable\ctdcatcodes}
-\normalprotected\def\stopcontextdefinitioncode
+\protected\def\stopcontextdefinitioncode
{\popcatcodetable}
\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/catc-def.mkiv b/Master/texmf-dist/tex/context/base/mkiv/catc-def.mkiv
index bf794f045dc..103d58194f6 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/catc-def.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/catc-def.mkiv
@@ -139,8 +139,8 @@
%D From now on we can use the protection mechanisms.
-\normalprotected\def\unprotect{\pushcatcodetable\setcatcodetable\prtcatcodes}
-\normalprotected\def\protect {\popcatcodetable}
+\protected\def\unprotect{\pushcatcodetable\setcatcodetable\prtcatcodes}
+\protected\def\protect {\popcatcodetable}
% \prependtoks \catcodetable\ctxcatcodes \to \everyjob
diff --git a/Master/texmf-dist/tex/context/base/mkiv/catc-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/catc-ini.lua
index 9241f5a1b16..4da00436b88 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/catc-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/catc-ini.lua
@@ -31,15 +31,11 @@ end
-- this only happens at runtime
-for k, v in next, numbers do
- tex[k] = v -- downward compatible
+for name, number in next, numbers do
+ tex[name] = number -- downward compatible
end
-- nasty
table.setmetatableindex(numbers,function(t,k) if type(k) == "number" then t[k] = k return k end end)
table.setmetatableindex(names, function(t,k) if type(k) == "string" then t[k] = k return k end end)
-
-commands.registercatcodetable = catcodes.register
---------.definecatcodetable = characters.define -- not yet defined
---------.setcharactercodes = characters.setcodes -- not yet defined
diff --git a/Master/texmf-dist/tex/context/base/mkiv/catc-ini.mkiv b/Master/texmf-dist/tex/context/base/mkiv/catc-ini.mkiv
index 215ec14e16c..d0b2c3e16e2 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/catc-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/catc-ini.mkiv
@@ -23,12 +23,12 @@
%D \MKII\ file. There is some overlap in code with \MKII\ but we take that
%D for granted. Also, in \MKIV\ less active characters are used.
-% \normalprotected\def\setnewconstantfromchar#1%
+% \protected\def\setnewconstantfromchar#1%
% {\expandafter\ifdefined\expandafter#1\expandafter
% \let\expandafter#1\expandafter\undefined\expandafter\fi\expandafter
% \newcount\expandafter#1\expandafter#1\the#1\relax}
%
-% \normalprotected\def\setnewconstantfromchar#1%
+% \protected\def\setnewconstantfromchar#1%
% {\begingroup
% \scratchcounter#1%
% \edef\!!stringa{\meaning#1}%
@@ -41,7 +41,7 @@
% \fi
% #1\the\scratchcounter\relax}}
%
-% \normalprotected\def\setnewconstantfromchar#1%
+% \protected\def\setnewconstantfromchar#1%
% {\begingroup
% \edef\!!stringa{\meaning#1}%
% \expandafter\chardef\expandafter#1\the#1%
@@ -53,7 +53,7 @@
% \fi
% #1\the#1\relax}}
%
-% \normalprotected\def\setnewconstantfromchar#1%
+% \protected\def\setnewconstantfromchar#1%
% {\scratchcounter#1\let#1\undefined\newcount#1#1\scratchcounter}
\def\promote#1{\scratchcounter#1\let#1\undefined\newcount#1#1\scratchcounter}
@@ -134,13 +134,13 @@
% rather special and used in writing to file: \let\par\outputnewlinechar
-% \normalprotected\def\initializenewlinechar % operating system dependent
+% \protected\def\initializenewlinechar % operating system dependent
% {\begingroup
% \newlinechar\newlineasciicode
% \xdef\outputnewlinechar{^^J}%
% \endgroup}
-\normalprotected\def\initializenewlinechar % operating system dependent
+\protected\def\initializenewlinechar % operating system dependent
{\begingroup
\letcharcode\newlineasciicode\relax
\newlinechar\newlineasciicode
@@ -153,7 +153,7 @@
%
% \def\??catcodelet {1>>} % let : \let
% \def\??catcodedef {2>>} % def : \def
-% \def\??catcodeued {3>>} % ued : \unexpanded\def
+% \def\??catcodeued {3>>} % ued : \protected\def
% \def\??catcodeget {4>>} % \meaning
%
% \def\??catcodetablet{5>>}
@@ -161,7 +161,7 @@
\installsystemnamespace {catcodelet} % let : \let
\installsystemnamespace {catcodedef} % def : \def
-\installsystemnamespace {catcodeued} % ued : \unexpanded\def
+\installsystemnamespace {catcodeued} % ued : \protected\def
\installsystemnamespace {catcodeget} % \meaning
\installsystemnamespace {catcodetablet}
@@ -172,12 +172,12 @@
\newcount\c_syst_catcodes_b
\newcount\c_syst_catcodes_c
-\normalprotected\def\newcatcodetable#1% we could move the cctdefcounter to lua
+\protected\def\newcatcodetable#1% we could move the cctdefcounter to lua
{\global\advance\c_syst_catcodes_n\plusone
\expandafter\xdef\csname\??catcodetablen\number\c_syst_catcodes_n\endcsname{\string#1}% logging
\newconstant#1%
#1\c_syst_catcodes_n
- \ctxcommand{registercatcodetable("\expandafter\gobbleoneargument\string#1",\number#1)}}
+ \ctxlua{catcodes.register("\expandafter\gobbleoneargument\string#1",\number#1)}}
\newtoks \everysetdefaultcatcodes
@@ -188,7 +188,7 @@
\catcode\commentasciicode \othercatcode
\catcode\delasciicode \othercatcode}
-\normalprotected\def\startcatcodetable#1#2\stopcatcodetable
+\protected\def\startcatcodetable#1#2\stopcatcodetable
{\begingroup
\catcodetable\inicatcodes
\the\everysetdefaultcatcodes
@@ -198,7 +198,7 @@
\let\stopcatcodetable\relax
-\normalprotected\def\startextendcatcodetable#1#2\stopextendcatcodetable
+\protected\def\startextendcatcodetable#1#2\stopextendcatcodetable
{\begingroup
\catcodetable#1\relax
\globaldefs\plusone
@@ -208,14 +208,14 @@
\let\stopextendcatcodetable\relax
-\normalprotected\def\permitcircumflexescape % to be used grouped
+\protected\def\permitcircumflexescape % to be used grouped
{\catcode\circumflexasciicode\superscriptcatcode}
\let\permitcaretescape\permitcircumflexescape
% ==
%
-% \normalprotected\def\startextendcatcodetable#1#2\stopextendcatcodetable
+% \protected\def\startextendcatcodetable#1#2\stopextendcatcodetable
% {\bgroup
% \scratchcounter\the\catcodetable
% \catcodetable #1 #2
@@ -277,7 +277,7 @@
\def\syst_catcodes_ued_c % only first time
{\expandafter\gdef\csname\??catcodeued\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\expandafter\endcsname
\expandafter##\expandafter1\expandafter
- {\expandafter\normalprotected\expandafter\def\csname\??catcodeget\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname{##1}}%
+ {\expandafter\protected\expandafter\def\csname\??catcodeget\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname{##1}}%
\syst_catcodes_reinstate_unexpanded
\csname\??catcodeued\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname}
@@ -294,7 +294,7 @@
{\begingroup % and the selector has been lost
\uccode\c_syst_catcodes_hack\c_syst_catcodes_b
\catcode\uccode\c_syst_catcodes_hack\activecatcode
- \uppercase{\normalprotected\xdef~{\noexpand\catcodecommand{\number\c_syst_catcodes_b}}}%
+ \uppercase{\protected\xdef~{\noexpand\catcodecommand{\number\c_syst_catcodes_b}}}%
\endgroup}
%D This can be used when a direct definition has been done and the selector has been
@@ -310,7 +310,7 @@
%
% \def\syst_catcodes_reinstate_unexpanded
% {\begingroup
-% \normalprotected\edef\next{\noexpand\catcodecommand{\number\c_syst_catcodes_b}}%
+% \protected\edef\next{\noexpand\catcodecommand{\number\c_syst_catcodes_b}}%
% \global\letcharcode\c_syst_catcodes_b\next
% \endgroup}
@@ -337,12 +337,12 @@
\newcount\c_syst_catcodes_level
-\normalprotected\def\pushcatcodetable
+\protected\def\pushcatcodetable
{\advance\c_syst_catcodes_level\plusone
\syst_catcodes_trace_push
\expandafter\chardef\csname\??catcodetablet\number\c_syst_catcodes_level\endcsname\currentcatcodetable}
-\normalprotected\def\popcatcodetable
+\protected\def\popcatcodetable
{\ifcase\c_syst_catcodes_level
\syst_catcodes_trace_nesting_error
\else
@@ -351,19 +351,19 @@
\advance\c_syst_catcodes_level\minusone
\fi}
-\normalprotected\def\syst_catcodes_trace_nesting_error
+\protected\def\syst_catcodes_trace_nesting_error
{\immediate\write\statuswrite{}%
\immediate\write\statuswrite{Fatal error: catcode push/pop mismatch. Fix this! (restore level: \number\c_syst_catcodes_level)}\wait\end
\immediate\write\statuswrite{}}
-\normalprotected\def\restorecatcodes % takes previous level
+\protected\def\restorecatcodes % takes previous level
{\ifnum\c_syst_catcodes_level>\plusone
\expandafter\catcodetable\csname\??catcodetablet\number\numexpr\c_syst_catcodes_level-1\relax\endcsname
\fi}
% \newtoks\everycatcodetable
-\normalprotected\def\setcatcodetable#1%
+\protected\def\setcatcodetable#1%
{\catcodetable#1%
% \the\everycatcodetable
\syst_catcodes_trace_set}
@@ -374,7 +374,7 @@
%D \tracecatcodetables
%D \stoptyping
-\normalprotected\def\tracecatcodetables
+\protected\def\tracecatcodetables
{\def\syst_catcodes_trace_set {\syst_catcodes_trace{set \catcodetablename\space at \number\c_syst_catcodes_level}}%
\def\syst_catcodes_trace_push{\syst_catcodes_trace{push \catcodetablename\space from \syst_catcodes_prev\space at \number\c_syst_catcodes_level}}%
\def\syst_catcodes_trace_pop {\syst_catcodes_trace{pop \catcodetablename\space to \syst_catcodes_prev\space at \number\c_syst_catcodes_level}}}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/catc-sym.mkiv b/Master/texmf-dist/tex/context/base/mkiv/catc-sym.mkiv
index 5cda010fe38..abe9191d990 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/catc-sym.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/catc-sym.mkiv
@@ -79,13 +79,13 @@
%D them for convenience and compatibility. Some old engine code
%D has been removed.
-\normalprotected\def\uncatcodespecials {\setcatcodetable\nilcatcodes \uncatcodespacetokens}
-\normalprotected\def\setnaturalcatcodes {\setcatcodetable\nilcatcodes}
-\normalprotected\def\setnormalcatcodes {\setcatcodetable\ctxcatcodes} % maybe \texcatcodes
-\normalprotected\def\uncatcodecharacters {\setcatcodetable\nilcatcodes} % was fast version, gone now
-\normalprotected\def\uncatcodeallcharacters{\setcatcodetable\nilcatcodes} % was slow one, with restore
+\protected\def\uncatcodespecials {\setcatcodetable\nilcatcodes \uncatcodespacetokens}
+\protected\def\setnaturalcatcodes {\setcatcodetable\nilcatcodes}
+\protected\def\setnormalcatcodes {\setcatcodetable\ctxcatcodes} % maybe \texcatcodes
+\protected\def\uncatcodecharacters {\setcatcodetable\nilcatcodes} % was fast version, gone now
+\protected\def\uncatcodeallcharacters{\setcatcodetable\nilcatcodes} % was slow one, with restore
-\normalprotected\def\uncatcodespacetokens
+\protected\def\uncatcodespacetokens
{\catcode\spaceasciicode \spacecatcode
\catcode\tabasciicode \spacecatcode
\catcode\formfeedasciicode \endoflinecatcode
@@ -101,10 +101,10 @@
\newtoks\everyverbosechacters
-\normalprotected\def\setverbosecscharacter#1%
+\protected\def\setverbosecscharacter#1%
{\edef#1{\string#1}}
-\normalprotected\def\setverbosecscharacters
+\protected\def\setverbosecscharacters
{\the\everyverbosechacters}
\bgroup
diff --git a/Master/texmf-dist/tex/context/base/mkiv/char-def.lua b/Master/texmf-dist/tex/context/base/mkiv/char-def.lua
index 953d33f4a0e..7a04e869d19 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/char-def.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/char-def.lua
@@ -429,7 +429,6 @@ characters.data={
direction="on",
linebreak="al",
mathclass="binary",
- mathname="ast",
mathsymbol=0x2217,
synonyms={ "star" },
unicodeslot=0x2A,
@@ -1676,6 +1675,7 @@ characters.data={
description="NO-BREAK SPACE",
direction="cs",
linebreak="gl",
+ mongolian="nj",
specials={ "nobreak", 0x20 },
synonyms={ "nbsp", "non-breaking space" },
unicodeslot=0xA0,
@@ -2351,6 +2351,7 @@ characters.data={
lccode=0xF8,
linebreak="al",
shcode=0x4F,
+ specials={ "with", 0x4F, 0x2F },
synonyms={ "latin capital letter o slash" },
unicodeslot=0xD8,
},
@@ -2748,6 +2749,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x6F,
+ specials={ "with", 0x6F, 0x2F },
synonyms={ "latin small letter o slash" },
uccode=0xD8,
unicodeslot=0xF8,
@@ -3040,6 +3042,7 @@ characters.data={
lccode=0x111,
linebreak="al",
shcode=0x44,
+ specials={ "with", 0x44, 0x2F },
unicodeslot=0x110,
},
{
@@ -3051,6 +3054,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x64,
+ specials={ "with", 0x64, 0x2F },
uccode=0x110,
unicodeslot=0x111,
},
@@ -3306,6 +3310,7 @@ characters.data={
lccode=0x127,
linebreak="al",
shcode=0x48,
+ specials={ "with", 0x48, 0x2F },
unicodeslot=0x126,
},
{
@@ -3317,6 +3322,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x68,
+ specials={ "with", 0x68, 0x2F },
uccode=0x126,
unicodeslot=0x127,
},
@@ -3633,6 +3639,7 @@ characters.data={
lccode=0x142,
linebreak="al",
shcode=0x4C,
+ specials={ "with", 0x4C, 0x2F },
unicodeslot=0x141,
},
{
@@ -3644,6 +3651,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x6C,
+ specials={ "with", 0x6C, 0x2F },
uccode=0x141,
unicodeslot=0x142,
},
@@ -4078,6 +4086,7 @@ characters.data={
lccode=0x167,
linebreak="al",
shcode=0x54,
+ specials={ "with", 0x54, 0x2F },
unicodeslot=0x166,
},
{
@@ -4089,6 +4098,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x74,
+ specials={ "with", 0x74, 0x2F },
uccode=0x166,
unicodeslot=0x167,
},
@@ -4388,6 +4398,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x62,
+ specials={ "with", 0x62, 0x2F },
uccode=0x243,
unicodeslot=0x180,
},
@@ -4400,6 +4411,7 @@ characters.data={
lccode=0x253,
linebreak="al",
shcode=0x42,
+ specials={ "with", 0x42, 0x1FA9D },
unicodeslot=0x181,
},
{
@@ -4458,6 +4470,7 @@ characters.data={
lccode=0x188,
linebreak="al",
shcode=0x43,
+ specials={ "with", 0x43, 0x1FA9D },
unicodeslot=0x187,
},
{
@@ -4468,6 +4481,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x63,
+ specials={ "with", 0x63, 0x1FA9D },
uccode=0x187,
unicodeslot=0x188,
},
@@ -4490,6 +4504,7 @@ characters.data={
lccode=0x257,
linebreak="al",
shcode=0x44,
+ specials={ "with", 0x44, 0x1FA9D },
unicodeslot=0x18A,
},
{
@@ -4559,6 +4574,7 @@ characters.data={
lccode=0x192,
linebreak="al",
shcode=0x46,
+ specials={ "with", 0x46, 0x1FA9D },
unicodeslot=0x191,
},
{
@@ -4569,6 +4585,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x66,
+ specials={ "with", 0x66, 0x1FA9D },
synonyms={ "florin currency symbol", "folder", "function symbol", "latin small letter script f" },
uccode=0x191,
unicodeslot=0x192,
@@ -4582,6 +4599,7 @@ characters.data={
lccode=0x260,
linebreak="al",
shcode=0x47,
+ specials={ "with", 0x47, 0x1FA9D },
unicodeslot=0x193,
},
{
@@ -4620,6 +4638,7 @@ characters.data={
lccode=0x268,
linebreak="al",
shcode=0x49,
+ specials={ "with", 0x49, 0x2F },
synonyms={ "latin capital letter i bar" },
unicodeslot=0x197,
},
@@ -4632,6 +4651,7 @@ characters.data={
lccode=0x199,
linebreak="al",
shcode=0x4B,
+ specials={ "with", 0x4B, 0x1FA9D },
unicodeslot=0x198,
},
{
@@ -4642,6 +4662,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x6B,
+ specials={ "with", 0x6B, 0x1FA9D },
uccode=0x198,
unicodeslot=0x199,
},
@@ -4758,6 +4779,7 @@ characters.data={
lccode=0x1A5,
linebreak="al",
shcode=0x50,
+ specials={ "with", 0x50, 0x1FA9D },
unicodeslot=0x1A4,
},
{
@@ -4768,6 +4790,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x70,
+ specials={ "with", 0x70, 0x1FA9D },
uccode=0x1A4,
unicodeslot=0x1A5,
},
@@ -4833,6 +4856,7 @@ characters.data={
lccode=0x1AD,
linebreak="al",
shcode=0x54,
+ specials={ "with", 0x54, 0x1FA9D },
unicodeslot=0x1AC,
},
{
@@ -4843,6 +4867,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x74,
+ specials={ "with", 0x74, 0x1FA9D },
uccode=0x1AC,
unicodeslot=0x1AD,
},
@@ -4892,12 +4917,13 @@ characters.data={
{
adobename="Vhook",
category="lu",
- contextname="Uhook",
+ contextname="Vhook",
description="LATIN CAPITAL LETTER V WITH HOOK",
direction="l",
lccode=0x28B,
linebreak="al",
shcode=0x56,
+ specials={ "with", 0x56, 0x1FA9D },
synonyms={ "latin capital letter script v" },
unicodeslot=0x1B2,
},
@@ -4910,6 +4936,7 @@ characters.data={
lccode=0x1B4,
linebreak="al",
shcode=0x59,
+ specials={ "with", 0x59, 0x1FA9D },
unicodeslot=0x1B3,
},
{
@@ -4920,6 +4947,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x79,
+ specials={ "with", 0x79, 0x1FA9D },
uccode=0x1B3,
unicodeslot=0x1B4,
},
@@ -4932,6 +4960,7 @@ characters.data={
lccode=0x1B6,
linebreak="al",
shcode=0x5A,
+ specials={ "with", 0x5A, 0x2F },
unicodeslot=0x1B5,
},
{
@@ -4942,6 +4971,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x7A,
+ specials={ "with", 0x7A, 0x2F },
synonyms={ "latin small letter z bar" },
uccode=0x1B5,
unicodeslot=0x1B6,
@@ -5014,6 +5044,7 @@ characters.data={
description="LATIN LETTER INVERTED GLOTTAL STOP WITH STROKE",
direction="l",
linebreak="al",
+ specials={ "with", 0x296, 0x2F },
unicodeslot=0x1BE,
},
{
@@ -5465,6 +5496,7 @@ characters.data={
lccode=0x1E5,
linebreak="al",
shcode=0x47,
+ specials={ "with", 0x47, 0x2F },
unicodeslot=0x1E4,
},
{
@@ -5475,6 +5507,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x67,
+ specials={ "with", 0x67, 0x2F },
uccode=0x1E4,
unicodeslot=0x1E5,
},
@@ -6191,6 +6224,7 @@ characters.data={
lccode=0x225,
linebreak="al",
shcode=0x5A,
+ specials={ "with", 0x5A, 0x1FA9D },
unicodeslot=0x224,
},
{
@@ -6200,6 +6234,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x7A,
+ specials={ "with", 0x7A, 0x1FA9D },
uccode=0x224,
unicodeslot=0x225,
},
@@ -6414,6 +6449,7 @@ characters.data={
lccode=0x2C65,
linebreak="al",
shcode=0x41,
+ specials={ "with", 0x41, 0x2F },
unicodeslot=0x23A,
},
{
@@ -6424,6 +6460,7 @@ characters.data={
lccode=0x23C,
linebreak="al",
shcode=0x43,
+ specials={ "with", 0x43, 0x2F },
unicodeslot=0x23B,
},
{
@@ -6433,6 +6470,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x63,
+ specials={ "with", 0x63, 0x2F },
uccode=0x23B,
unicodeslot=0x23C,
},
@@ -6494,6 +6532,7 @@ characters.data={
lccode=0x180,
linebreak="al",
shcode=0x42,
+ specials={ "with", 0x42, 0x2F },
unicodeslot=0x243,
},
{
@@ -6519,6 +6558,7 @@ characters.data={
lccode=0x247,
linebreak="al",
shcode=0x45,
+ specials={ "with", 0x45, 0x2F },
unicodeslot=0x246,
},
{
@@ -6527,6 +6567,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x65,
+ specials={ "with", 0x65, 0x2F },
uccode=0x246,
unicodeslot=0x247,
},
@@ -6537,6 +6578,7 @@ characters.data={
lccode=0x249,
linebreak="al",
shcode=0x4A,
+ specials={ "with", 0x4A, 0x2F },
unicodeslot=0x248,
},
{
@@ -6545,6 +6587,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x6A,
+ specials={ "with", 0x6A, 0x2F },
uccode=0x248,
unicodeslot=0x249,
},
@@ -6572,6 +6615,7 @@ characters.data={
lccode=0x24D,
linebreak="al",
shcode=0x52,
+ specials={ "with", 0x52, 0x2F },
unicodeslot=0x24C,
},
{
@@ -6580,6 +6624,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x72,
+ specials={ "with", 0x72, 0x2F },
uccode=0x24C,
unicodeslot=0x24D,
},
@@ -6590,6 +6635,7 @@ characters.data={
lccode=0x24F,
linebreak="al",
shcode=0x59,
+ specials={ "with", 0x59, 0x2F },
unicodeslot=0x24E,
},
{
@@ -6598,6 +6644,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x79,
+ specials={ "with", 0x79, 0x2F },
uccode=0x24E,
unicodeslot=0x24F,
},
@@ -6635,6 +6682,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x62,
+ specials={ "with", 0x62, 0x1FA9D },
uccode=0x181,
unicodeslot=0x253,
},
@@ -6677,6 +6725,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x64,
+ specials={ "with", 0x64, 0x1FA9D },
uccode=0x18A,
unicodeslot=0x257,
},
@@ -6706,6 +6755,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x259,
+ specials={ "with", 0x259, 0x1FA9D },
unicodeslot=0x25A,
},
{
@@ -6732,6 +6782,7 @@ characters.data={
description="LATIN SMALL LETTER REVERSED OPEN E WITH HOOK",
direction="l",
linebreak="al",
+ specials={ "with", 0x25C, 0x1FA9D },
unicodeslot=0x25D,
},
{
@@ -6750,6 +6801,7 @@ characters.data={
description="LATIN SMALL LETTER DOTLESS J WITH STROKE",
direction="l",
linebreak="al",
+ specials={ "with", 0x237, 0x2F },
unicodeslot=0x25F,
},
{
@@ -6759,6 +6811,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x67,
+ specials={ "with", 0x67, 0x1FA9D },
uccode=0x193,
unicodeslot=0x260,
},
@@ -6811,6 +6864,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x68,
+ specials={ "with", 0x68, 0x1FA9D },
unicodeslot=0x266,
},
{
@@ -6819,6 +6873,7 @@ characters.data={
description="LATIN SMALL LETTER HENG WITH HOOK",
direction="l",
linebreak="al",
+ specials={ "with", 0xA727, 0x1FA9D },
unicodeslot=0x267,
},
{
@@ -6828,6 +6883,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x69,
+ specials={ "with", 0x69, 0x2F },
uccode=0x197,
unicodeslot=0x268,
},
@@ -6907,6 +6963,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x6D,
+ specials={ "with", 0x6D, 0x1FA9D },
unicodeslot=0x271,
},
{
@@ -6990,6 +7047,7 @@ characters.data={
description="LATIN SMALL LETTER TURNED R WITH HOOK",
direction="l",
linebreak="al",
+ specials={ "with", 0x279, 0x1FA9D },
unicodeslot=0x27B,
},
{
@@ -7051,6 +7109,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x73,
+ specials={ "with", 0x73, 0x1FA9D },
unicodeslot=0x282,
},
{
@@ -7130,6 +7189,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x76,
+ specials={ "with", 0x76, 0x1FA9D },
synonyms={ "latin small letter script v" },
uccode=0x1B2,
unicodeslot=0x28B,
@@ -7268,6 +7328,7 @@ characters.data={
description="LATIN LETTER SMALL CAPITAL G WITH HOOK",
direction="l",
linebreak="al",
+ specials={ "with", 0x262, 0x1FA9D },
unicodeslot=0x29B,
},
{
@@ -7308,6 +7369,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x71,
+ specials={ "with", 0x71, 0x1FA9D },
unicodeslot=0x2A0,
},
{
@@ -7316,6 +7378,7 @@ characters.data={
description="LATIN LETTER GLOTTAL STOP WITH STROKE",
direction="l",
linebreak="al",
+ specials={ "with", 0x294, 0x2F },
unicodeslot=0x2A1,
},
{
@@ -10545,7 +10608,6 @@ characters.data={
direction="l",
linebreak="al",
mathclass="ordinary",
- mathname="varkappa",
specials={ "compat", 0x3BA },
uccode=0x39A,
unicodeslot=0x3F0,
@@ -12231,6 +12293,7 @@ characters.data={
lccode=0x493,
linebreak="al",
shcode=0x413,
+ specials={ "with", 0x413, 0x2F },
unicodeslot=0x492,
},
[0x493]={
@@ -12241,6 +12304,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x433,
+ specials={ "with", 0x433, 0x2F },
uccode=0x492,
unicodeslot=0x493,
},
@@ -12363,6 +12427,7 @@ characters.data={
lccode=0x49F,
linebreak="al",
shcode=0x41A,
+ specials={ "with", 0x41A, 0x2F },
unicodeslot=0x49E,
},
[0x49F]={
@@ -12373,6 +12438,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x43A,
+ specials={ "with", 0x43A, 0x2F },
uccode=0x49E,
unicodeslot=0x49F,
},
@@ -12552,6 +12618,7 @@ characters.data={
direction="l",
lccode=0x4B1,
linebreak="al",
+ specials={ "with", 0x4AE, 0x2F },
unicodeslot=0x4B0,
},
[0x4B1]={
@@ -12561,6 +12628,7 @@ characters.data={
description="CYRILLIC SMALL LETTER STRAIGHT U WITH STROKE",
direction="l",
linebreak="al",
+ specials={ "with", 0x4AF, 0x2F },
uccode=0x4B0,
unicodeslot=0x4B1,
},
@@ -12753,6 +12821,7 @@ characters.data={
lccode=0x4C4,
linebreak="al",
shcode=0x41A,
+ specials={ "with", 0x41A, 0x1FA9D },
unicodeslot=0x4C3,
},
[0x4C4]={
@@ -12763,6 +12832,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x43A,
+ specials={ "with", 0x43A, 0x1FA9D },
uccode=0x4C3,
unicodeslot=0x4C4,
},
@@ -12795,6 +12865,7 @@ characters.data={
lccode=0x4C8,
linebreak="al",
shcode=0x41D,
+ specials={ "with", 0x41D, 0x1FA9D },
unicodeslot=0x4C7,
},
[0x4C8]={
@@ -12805,6 +12876,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x43D,
+ specials={ "with", 0x43D, 0x1FA9D },
uccode=0x4C7,
unicodeslot=0x4C8,
},
@@ -13379,6 +13451,7 @@ characters.data={
lccode=0x4FD,
linebreak="al",
shcode=0x425,
+ specials={ "with", 0x425, 0x1FA9D },
unicodeslot=0x4FC,
},
[0x4FD]={
@@ -13387,6 +13460,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x445,
+ specials={ "with", 0x445, 0x1FA9D },
uccode=0x4FC,
unicodeslot=0x4FD,
},
@@ -13397,6 +13471,7 @@ characters.data={
lccode=0x4FF,
linebreak="al",
shcode=0x425,
+ specials={ "with", 0x425, 0x2F },
unicodeslot=0x4FE,
},
[0x4FF]={
@@ -13405,6 +13480,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x445,
+ specials={ "with", 0x445, 0x2F },
uccode=0x4FE,
unicodeslot=0x4FF,
},
@@ -13559,6 +13635,7 @@ characters.data={
lccode=0x513,
linebreak="al",
shcode=0x41B,
+ specials={ "with", 0x41B, 0x1FA9D },
unicodeslot=0x512,
},
[0x513]={
@@ -13567,6 +13644,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x43B,
+ specials={ "with", 0x43B, 0x1FA9D },
uccode=0x512,
unicodeslot=0x513,
},
@@ -20037,7 +20115,7 @@ characters.data={
unicodeslot=0x855,
},
[0x856]={
- arabic="u",
+ arabic="r",
category="lo",
description="MANDAIC LETTER DUSHENNA",
direction="r",
@@ -20045,7 +20123,7 @@ characters.data={
unicodeslot=0x856,
},
[0x857]={
- arabic="u",
+ arabic="r",
category="lo",
description="MANDAIC LETTER KAD",
direction="r",
@@ -20053,7 +20131,7 @@ characters.data={
unicodeslot=0x857,
},
[0x858]={
- arabic="u",
+ arabic="r",
category="lo",
description="MANDAIC LETTER AIN",
direction="r",
@@ -20411,6 +20489,86 @@ characters.data={
linebreak="al",
unicodeslot=0x8BD,
},
+ [0x8BE]={
+ arabic="d",
+ category="lo",
+ description="ARABIC LETTER PEH WITH SMALL V",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x8BE,
+ },
+ [0x8BF]={
+ arabic="d",
+ category="lo",
+ description="ARABIC LETTER TEH WITH SMALL V",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x8BF,
+ },
+ [0x8C0]={
+ arabic="d",
+ category="lo",
+ description="ARABIC LETTER TTEH WITH SMALL V",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x8C0,
+ },
+ [0x8C1]={
+ arabic="d",
+ category="lo",
+ description="ARABIC LETTER TCHEH WITH SMALL V",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x8C1,
+ },
+ [0x8C2]={
+ arabic="d",
+ category="lo",
+ description="ARABIC LETTER KEHEH WITH SMALL V",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x8C2,
+ },
+ [0x8C3]={
+ arabic="d",
+ category="lo",
+ description="ARABIC LETTER GHAIN WITH THREE DOTS ABOVE",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x8C3,
+ },
+ [0x8C4]={
+ arabic="d",
+ category="lo",
+ description="ARABIC LETTER AFRICAN QAF WITH THREE DOTS ABOVE",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x8C4,
+ },
+ [0x8C5]={
+ arabic="d",
+ category="lo",
+ description="ARABIC LETTER JEEM WITH THREE DOTS ABOVE",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x8C5,
+ },
+ [0x8C6]={
+ arabic="d",
+ category="lo",
+ description="ARABIC LETTER JEEM WITH THREE DOTS BELOW",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x8C6,
+ },
+ [0x8C7]={
+ arabic="d",
+ category="lo",
+ description="ARABIC LETTER LAM WITH SMALL ARABIC LETTER TAH ABOVE",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x8C7,
+ },
[0x8D3]={
category="mn",
combining=0xDC,
@@ -25018,6 +25176,14 @@ characters.data={
linebreak="cm",
unicodeslot=0xB4D,
},
+ [0xB55]={
+ category="mn",
+ comment="todo: indic check",
+ description="ORIYA SIGN OVERLINE",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0xB55,
+ },
[0xB56]={
category="mn",
description="ORIYA AI LENGTH MARK",
@@ -27458,6 +27624,14 @@ characters.data={
linebreak="cm",
unicodeslot=0xD03,
},
+ [0xD04]={
+ category="lo",
+ comment="todo: indic check",
+ description="MALAYALAM LETTER VEDIC ANUSVARA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0xD04,
+ },
[0xD05]={
category="lo",
description="MALAYALAM LETTER A",
@@ -28399,6 +28573,13 @@ characters.data={
linebreak="al",
unicodeslot=0xD7F,
},
+ [0xD81]={
+ category="mn",
+ description="SINHALA SIGN CANDRABINDU",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0xD81,
+ },
[0xD82]={
category="mc",
description="SINHALA SIGN ANUSVARAYA",
@@ -45799,6 +45980,7 @@ characters.data={
description="MONGOLIAN BIRGA",
direction="on",
linebreak="al",
+ mongolian="nj",
unicodeslot=0x1800,
},
[0x1801]={
@@ -45806,6 +45988,7 @@ characters.data={
description="MONGOLIAN ELLIPSIS",
direction="on",
linebreak="al",
+ mongolian="nj",
unicodeslot=0x1801,
},
[0x1802]={
@@ -45813,6 +45996,7 @@ characters.data={
description="MONGOLIAN COMMA",
direction="on",
linebreak="ex",
+ mongolian="nj",
unicodeslot=0x1802,
},
[0x1803]={
@@ -45820,6 +46004,7 @@ characters.data={
description="MONGOLIAN FULL STOP",
direction="on",
linebreak="ex",
+ mongolian="nj",
unicodeslot=0x1803,
},
[0x1804]={
@@ -45827,6 +46012,7 @@ characters.data={
description="MONGOLIAN COLON",
direction="on",
linebreak="ba",
+ mongolian="nj",
unicodeslot=0x1804,
},
[0x1805]={
@@ -45834,6 +46020,7 @@ characters.data={
description="MONGOLIAN FOUR DOTS",
direction="on",
linebreak="ba",
+ mongolian="nj",
unicodeslot=0x1805,
},
[0x1806]={
@@ -45842,6 +46029,7 @@ characters.data={
description="MONGOLIAN TODO SOFT HYPHEN",
direction="on",
linebreak="bb",
+ mongolian="nj",
unicodeslot=0x1806,
},
[0x1807]={
@@ -45850,6 +46038,7 @@ characters.data={
description="MONGOLIAN SIBE SYLLABLE BOUNDARY MARKER",
direction="on",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1807,
},
[0x1808]={
@@ -45857,6 +46046,7 @@ characters.data={
description="MONGOLIAN MANCHU COMMA",
direction="on",
linebreak="ex",
+ mongolian="nj",
unicodeslot=0x1808,
},
[0x1809]={
@@ -45864,6 +46054,7 @@ characters.data={
description="MONGOLIAN MANCHU FULL STOP",
direction="on",
linebreak="ex",
+ mongolian="nj",
unicodeslot=0x1809,
},
[0x180A]={
@@ -45872,6 +46063,7 @@ characters.data={
description="MONGOLIAN NIRUGU",
direction="on",
linebreak="al",
+ mongolian="jc",
unicodeslot=0x180A,
},
[0x180B]={
@@ -45879,6 +46071,7 @@ characters.data={
description="MONGOLIAN FREE VARIATION SELECTOR ONE",
direction="nsm",
linebreak="cm",
+ mongolian="t",
synonyms={ "fvs1" },
unicodeslot=0x180B,
},
@@ -45887,6 +46080,7 @@ characters.data={
description="MONGOLIAN FREE VARIATION SELECTOR TWO",
direction="nsm",
linebreak="cm",
+ mongolian="t",
unicodeslot=0x180C,
},
[0x180D]={
@@ -45894,6 +46088,7 @@ characters.data={
description="MONGOLIAN FREE VARIATION SELECTOR THREE",
direction="nsm",
linebreak="cm",
+ mongolian="t",
unicodeslot=0x180D,
},
[0x180E]={
@@ -45902,6 +46097,7 @@ characters.data={
description="MONGOLIAN VOWEL SEPARATOR",
direction="bn",
linebreak="gl",
+ mongolian="nj",
unicodeslot=0x180E,
},
[0x1810]={
@@ -45909,6 +46105,7 @@ characters.data={
description="MONGOLIAN DIGIT ZERO",
direction="l",
linebreak="nu",
+ mongolian="nj",
unicodeslot=0x1810,
},
[0x1811]={
@@ -45916,6 +46113,7 @@ characters.data={
description="MONGOLIAN DIGIT ONE",
direction="l",
linebreak="nu",
+ mongolian="nj",
unicodeslot=0x1811,
},
[0x1812]={
@@ -45923,6 +46121,7 @@ characters.data={
description="MONGOLIAN DIGIT TWO",
direction="l",
linebreak="nu",
+ mongolian="nj",
unicodeslot=0x1812,
},
[0x1813]={
@@ -45930,6 +46129,7 @@ characters.data={
description="MONGOLIAN DIGIT THREE",
direction="l",
linebreak="nu",
+ mongolian="nj",
unicodeslot=0x1813,
},
[0x1814]={
@@ -45937,6 +46137,7 @@ characters.data={
description="MONGOLIAN DIGIT FOUR",
direction="l",
linebreak="nu",
+ mongolian="nj",
unicodeslot=0x1814,
},
[0x1815]={
@@ -45944,6 +46145,7 @@ characters.data={
description="MONGOLIAN DIGIT FIVE",
direction="l",
linebreak="nu",
+ mongolian="nj",
unicodeslot=0x1815,
},
[0x1816]={
@@ -45951,6 +46153,7 @@ characters.data={
description="MONGOLIAN DIGIT SIX",
direction="l",
linebreak="nu",
+ mongolian="nj",
unicodeslot=0x1816,
},
[0x1817]={
@@ -45958,6 +46161,7 @@ characters.data={
description="MONGOLIAN DIGIT SEVEN",
direction="l",
linebreak="nu",
+ mongolian="nj",
unicodeslot=0x1817,
},
[0x1818]={
@@ -45965,6 +46169,7 @@ characters.data={
description="MONGOLIAN DIGIT EIGHT",
direction="l",
linebreak="nu",
+ mongolian="nj",
unicodeslot=0x1818,
},
[0x1819]={
@@ -45972,6 +46177,7 @@ characters.data={
description="MONGOLIAN DIGIT NINE",
direction="l",
linebreak="nu",
+ mongolian="nj",
unicodeslot=0x1819,
},
[0x1820]={
@@ -45980,6 +46186,7 @@ characters.data={
description="MONGOLIAN LETTER A",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1820,
variants={
[0x180B]="second form",
@@ -45992,6 +46199,7 @@ characters.data={
description="MONGOLIAN LETTER E",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1821,
variants={
[0x180B]="second form",
@@ -46003,6 +46211,7 @@ characters.data={
description="MONGOLIAN LETTER I",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1822,
variants={
[0x180B]="second form",
@@ -46014,6 +46223,7 @@ characters.data={
description="MONGOLIAN LETTER O",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1823,
variants={
[0x180B]="second form",
@@ -46025,6 +46235,7 @@ characters.data={
description="MONGOLIAN LETTER U",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1824,
variants={
[0x180B]="second form",
@@ -46036,6 +46247,7 @@ characters.data={
description="MONGOLIAN LETTER OE",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1825,
variants={
[0x180B]="second form",
@@ -46048,6 +46260,7 @@ characters.data={
description="MONGOLIAN LETTER UE",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1826,
variants={
[0x180B]="second form",
@@ -46060,6 +46273,7 @@ characters.data={
description="MONGOLIAN LETTER EE",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1827,
},
[0x1828]={
@@ -46068,6 +46282,7 @@ characters.data={
description="MONGOLIAN LETTER NA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1828,
variants={
[0x180B]="second form",
@@ -46081,6 +46296,7 @@ characters.data={
description="MONGOLIAN LETTER ANG",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1829,
},
[0x182A]={
@@ -46089,6 +46305,7 @@ characters.data={
description="MONGOLIAN LETTER BA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x182A,
variants={
[0x180B]="alternative form",
@@ -46100,6 +46317,7 @@ characters.data={
description="MONGOLIAN LETTER PA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x182B,
},
[0x182C]={
@@ -46108,6 +46326,7 @@ characters.data={
description="MONGOLIAN LETTER QA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x182C,
variants={
[0x180B]="second form",
@@ -46121,6 +46340,7 @@ characters.data={
description="MONGOLIAN LETTER GA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x182D,
variants={
[0x180B]="second form",
@@ -46134,6 +46354,7 @@ characters.data={
description="MONGOLIAN LETTER MA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x182E,
},
[0x182F]={
@@ -46142,6 +46363,7 @@ characters.data={
description="MONGOLIAN LETTER LA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x182F,
},
[0x1830]={
@@ -46150,6 +46372,7 @@ characters.data={
description="MONGOLIAN LETTER SA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1830,
variants={
[0x180B]="second form",
@@ -46162,6 +46385,7 @@ characters.data={
description="MONGOLIAN LETTER SHA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1831,
},
[0x1832]={
@@ -46170,6 +46394,7 @@ characters.data={
description="MONGOLIAN LETTER TA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1832,
variants={
[0x180B]="second form",
@@ -46181,6 +46406,7 @@ characters.data={
description="MONGOLIAN LETTER DA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1833,
variants={
[0x180B]="second form",
@@ -46192,6 +46418,7 @@ characters.data={
description="MONGOLIAN LETTER CHA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1834,
},
[0x1835]={
@@ -46200,6 +46427,7 @@ characters.data={
description="MONGOLIAN LETTER JA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1835,
variants={
[0x180B]="second form",
@@ -46211,6 +46439,7 @@ characters.data={
description="MONGOLIAN LETTER YA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1836,
variants={
[0x180B]="second form",
@@ -46223,6 +46452,7 @@ characters.data={
description="MONGOLIAN LETTER RA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1837,
},
[0x1838]={
@@ -46231,6 +46461,7 @@ characters.data={
description="MONGOLIAN LETTER WA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1838,
variants={
[0x180B]="second form",
@@ -46242,6 +46473,7 @@ characters.data={
description="MONGOLIAN LETTER FA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1839,
},
[0x183A]={
@@ -46250,6 +46482,7 @@ characters.data={
description="MONGOLIAN LETTER KA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x183A,
},
[0x183B]={
@@ -46258,6 +46491,7 @@ characters.data={
description="MONGOLIAN LETTER KHA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x183B,
},
[0x183C]={
@@ -46266,6 +46500,7 @@ characters.data={
description="MONGOLIAN LETTER TSA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x183C,
},
[0x183D]={
@@ -46274,6 +46509,7 @@ characters.data={
description="MONGOLIAN LETTER ZA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x183D,
},
[0x183E]={
@@ -46282,6 +46518,7 @@ characters.data={
description="MONGOLIAN LETTER HAA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x183E,
},
[0x183F]={
@@ -46290,6 +46527,7 @@ characters.data={
description="MONGOLIAN LETTER ZRA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x183F,
},
[0x1840]={
@@ -46298,6 +46536,7 @@ characters.data={
description="MONGOLIAN LETTER LHA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1840,
},
[0x1841]={
@@ -46306,6 +46545,7 @@ characters.data={
description="MONGOLIAN LETTER ZHI",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1841,
},
[0x1842]={
@@ -46314,6 +46554,7 @@ characters.data={
description="MONGOLIAN LETTER CHI",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1842,
},
[0x1843]={
@@ -46322,6 +46563,7 @@ characters.data={
description="MONGOLIAN LETTER TODO LONG VOWEL SIGN",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1843,
},
[0x1844]={
@@ -46330,6 +46572,7 @@ characters.data={
description="MONGOLIAN LETTER TODO E",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1844,
variants={
[0x180B]="second form",
@@ -46341,6 +46584,7 @@ characters.data={
description="MONGOLIAN LETTER TODO I",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1845,
variants={
[0x180B]="second form",
@@ -46352,6 +46596,7 @@ characters.data={
description="MONGOLIAN LETTER TODO O",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1846,
variants={
[0x180B]="second form",
@@ -46363,6 +46608,7 @@ characters.data={
description="MONGOLIAN LETTER TODO U",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1847,
variants={
[0x180B]="second form",
@@ -46375,6 +46621,7 @@ characters.data={
description="MONGOLIAN LETTER TODO OE",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1848,
variants={
[0x180B]="second form",
@@ -46386,6 +46633,7 @@ characters.data={
description="MONGOLIAN LETTER TODO UE",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1849,
variants={
[0x180B]="second form",
@@ -46397,6 +46645,7 @@ characters.data={
description="MONGOLIAN LETTER TODO ANG",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x184A,
},
[0x184B]={
@@ -46405,6 +46654,7 @@ characters.data={
description="MONGOLIAN LETTER TODO BA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x184B,
},
[0x184C]={
@@ -46413,6 +46663,7 @@ characters.data={
description="MONGOLIAN LETTER TODO PA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x184C,
},
[0x184D]={
@@ -46421,6 +46672,7 @@ characters.data={
description="MONGOLIAN LETTER TODO QA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x184D,
variants={
[0x180B]="feminine form",
@@ -46432,6 +46684,7 @@ characters.data={
description="MONGOLIAN LETTER TODO GA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x184E,
variants={
[0x180B]="second form",
@@ -46443,6 +46696,7 @@ characters.data={
description="MONGOLIAN LETTER TODO MA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x184F,
},
[0x1850]={
@@ -46451,6 +46705,7 @@ characters.data={
description="MONGOLIAN LETTER TODO TA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1850,
},
[0x1851]={
@@ -46459,6 +46714,7 @@ characters.data={
description="MONGOLIAN LETTER TODO DA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1851,
},
[0x1852]={
@@ -46467,6 +46723,7 @@ characters.data={
description="MONGOLIAN LETTER TODO CHA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1852,
},
[0x1853]={
@@ -46475,6 +46732,7 @@ characters.data={
description="MONGOLIAN LETTER TODO JA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1853,
},
[0x1854]={
@@ -46483,6 +46741,7 @@ characters.data={
description="MONGOLIAN LETTER TODO TSA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1854,
},
[0x1855]={
@@ -46491,6 +46750,7 @@ characters.data={
description="MONGOLIAN LETTER TODO YA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1855,
},
[0x1856]={
@@ -46499,6 +46759,7 @@ characters.data={
description="MONGOLIAN LETTER TODO WA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1856,
},
[0x1857]={
@@ -46507,6 +46768,7 @@ characters.data={
description="MONGOLIAN LETTER TODO KA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1857,
},
[0x1858]={
@@ -46515,6 +46777,7 @@ characters.data={
description="MONGOLIAN LETTER TODO GAA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1858,
},
[0x1859]={
@@ -46523,6 +46786,7 @@ characters.data={
description="MONGOLIAN LETTER TODO HAA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1859,
},
[0x185A]={
@@ -46531,6 +46795,7 @@ characters.data={
description="MONGOLIAN LETTER TODO JIA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x185A,
},
[0x185B]={
@@ -46539,6 +46804,7 @@ characters.data={
description="MONGOLIAN LETTER TODO NIA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x185B,
},
[0x185C]={
@@ -46547,6 +46813,7 @@ characters.data={
description="MONGOLIAN LETTER TODO DZA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x185C,
},
[0x185D]={
@@ -46555,6 +46822,7 @@ characters.data={
description="MONGOLIAN LETTER SIBE E",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x185D,
variants={
[0x180B]="second form",
@@ -46566,6 +46834,7 @@ characters.data={
description="MONGOLIAN LETTER SIBE I",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x185E,
variants={
[0x180B]="second form",
@@ -46578,6 +46847,7 @@ characters.data={
description="MONGOLIAN LETTER SIBE IY",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x185F,
},
[0x1860]={
@@ -46586,6 +46856,7 @@ characters.data={
description="MONGOLIAN LETTER SIBE UE",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1860,
variants={
[0x180B]="second form",
@@ -46597,6 +46868,7 @@ characters.data={
description="MONGOLIAN LETTER SIBE U",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1861,
},
[0x1862]={
@@ -46605,6 +46877,7 @@ characters.data={
description="MONGOLIAN LETTER SIBE ANG",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1862,
},
[0x1863]={
@@ -46613,6 +46886,7 @@ characters.data={
description="MONGOLIAN LETTER SIBE KA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1863,
variants={
[0x180B]="second form",
@@ -46624,6 +46898,7 @@ characters.data={
description="MONGOLIAN LETTER SIBE GA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1864,
},
[0x1865]={
@@ -46632,6 +46907,7 @@ characters.data={
description="MONGOLIAN LETTER SIBE HA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1865,
},
[0x1866]={
@@ -46640,6 +46916,7 @@ characters.data={
description="MONGOLIAN LETTER SIBE PA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1866,
},
[0x1867]={
@@ -46648,6 +46925,7 @@ characters.data={
description="MONGOLIAN LETTER SIBE SHA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1867,
},
[0x1868]={
@@ -46656,6 +46934,7 @@ characters.data={
description="MONGOLIAN LETTER SIBE TA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1868,
variants={
[0x180B]="second form",
@@ -46668,6 +46947,7 @@ characters.data={
description="MONGOLIAN LETTER SIBE DA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1869,
variants={
[0x180B]="second form",
@@ -46679,6 +46959,7 @@ characters.data={
description="MONGOLIAN LETTER SIBE JA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x186A,
},
[0x186B]={
@@ -46687,6 +46968,7 @@ characters.data={
description="MONGOLIAN LETTER SIBE FA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x186B,
},
[0x186C]={
@@ -46695,6 +46977,7 @@ characters.data={
description="MONGOLIAN LETTER SIBE GAA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x186C,
},
[0x186D]={
@@ -46703,6 +46986,7 @@ characters.data={
description="MONGOLIAN LETTER SIBE HAA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x186D,
},
[0x186E]={
@@ -46711,6 +46995,7 @@ characters.data={
description="MONGOLIAN LETTER SIBE TSA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x186E,
},
[0x186F]={
@@ -46719,6 +47004,7 @@ characters.data={
description="MONGOLIAN LETTER SIBE ZA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x186F,
variants={
[0x180B]="second form",
@@ -46730,6 +47016,7 @@ characters.data={
description="MONGOLIAN LETTER SIBE RAA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1870,
},
[0x1871]={
@@ -46738,6 +47025,7 @@ characters.data={
description="MONGOLIAN LETTER SIBE CHA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1871,
},
[0x1872]={
@@ -46746,6 +47034,7 @@ characters.data={
description="MONGOLIAN LETTER SIBE ZHA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1872,
},
[0x1873]={
@@ -46754,6 +47043,7 @@ characters.data={
description="MONGOLIAN LETTER MANCHU I",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1873,
variants={
[0x180B]="second form",
@@ -46767,6 +47057,7 @@ characters.data={
description="MONGOLIAN LETTER MANCHU KA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1874,
variants={
[0x180B]="second form",
@@ -46780,6 +47071,7 @@ characters.data={
description="MONGOLIAN LETTER MANCHU RA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1875,
},
[0x1876]={
@@ -46788,6 +47080,7 @@ characters.data={
description="MONGOLIAN LETTER MANCHU FA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1876,
variants={
[0x180B]="second form",
@@ -46799,6 +47092,7 @@ characters.data={
description="MONGOLIAN LETTER MANCHU ZHA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1877,
},
[0x1878]={
@@ -46807,6 +47101,7 @@ characters.data={
description="MONGOLIAN LETTER CHA WITH TWO DOTS",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1878,
},
[0x1880]={
@@ -46815,6 +47110,7 @@ characters.data={
description="MONGOLIAN LETTER ALI GALI ANUSVARA ONE",
direction="l",
linebreak="al",
+ mongolian="nj",
unicodeslot=0x1880,
variants={
[0x180B]="second form",
@@ -46826,6 +47122,7 @@ characters.data={
description="MONGOLIAN LETTER ALI GALI VISARGA ONE",
direction="l",
linebreak="al",
+ mongolian="nj",
unicodeslot=0x1881,
variants={
[0x180B]="second form",
@@ -46837,6 +47134,7 @@ characters.data={
description="MONGOLIAN LETTER ALI GALI DAMARU",
direction="l",
linebreak="al",
+ mongolian="nj",
unicodeslot=0x1882,
},
[0x1883]={
@@ -46845,6 +47143,7 @@ characters.data={
description="MONGOLIAN LETTER ALI GALI UBADAMA",
direction="l",
linebreak="al",
+ mongolian="nj",
unicodeslot=0x1883,
},
[0x1884]={
@@ -46853,6 +47152,7 @@ characters.data={
description="MONGOLIAN LETTER ALI GALI INVERTED UBADAMA",
direction="l",
linebreak="al",
+ mongolian="nj",
unicodeslot=0x1884,
},
[0x1885]={
@@ -46861,6 +47161,7 @@ characters.data={
description="MONGOLIAN LETTER ALI GALI BALUDA",
direction="nsm",
linebreak="cm",
+ mongolian="t",
unicodeslot=0x1885,
},
[0x1886]={
@@ -46869,6 +47170,7 @@ characters.data={
description="MONGOLIAN LETTER ALI GALI THREE BALUDA",
direction="nsm",
linebreak="cm",
+ mongolian="t",
unicodeslot=0x1886,
},
[0x1887]={
@@ -46877,6 +47179,7 @@ characters.data={
description="MONGOLIAN LETTER ALI GALI A",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1887,
variants={
[0x180B]="second form",
@@ -46890,6 +47193,7 @@ characters.data={
description="MONGOLIAN LETTER ALI GALI I",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1888,
variants={
[0x180B]="second form",
@@ -46901,6 +47205,7 @@ characters.data={
description="MONGOLIAN LETTER ALI GALI KA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1889,
},
[0x188A]={
@@ -46909,6 +47214,7 @@ characters.data={
description="MONGOLIAN LETTER ALI GALI NGA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x188A,
variants={
[0x180B]="second form",
@@ -46920,6 +47226,7 @@ characters.data={
description="MONGOLIAN LETTER ALI GALI CA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x188B,
},
[0x188C]={
@@ -46928,6 +47235,7 @@ characters.data={
description="MONGOLIAN LETTER ALI GALI TTA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x188C,
},
[0x188D]={
@@ -46936,6 +47244,7 @@ characters.data={
description="MONGOLIAN LETTER ALI GALI TTHA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x188D,
},
[0x188E]={
@@ -46944,6 +47253,7 @@ characters.data={
description="MONGOLIAN LETTER ALI GALI DDA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x188E,
},
[0x188F]={
@@ -46952,6 +47262,7 @@ characters.data={
description="MONGOLIAN LETTER ALI GALI NNA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x188F,
},
[0x1890]={
@@ -46960,6 +47271,7 @@ characters.data={
description="MONGOLIAN LETTER ALI GALI TA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1890,
},
[0x1891]={
@@ -46968,6 +47280,7 @@ characters.data={
description="MONGOLIAN LETTER ALI GALI DA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1891,
},
[0x1892]={
@@ -46976,6 +47289,7 @@ characters.data={
description="MONGOLIAN LETTER ALI GALI PA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1892,
},
[0x1893]={
@@ -46984,6 +47298,7 @@ characters.data={
description="MONGOLIAN LETTER ALI GALI PHA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1893,
},
[0x1894]={
@@ -46992,6 +47307,7 @@ characters.data={
description="MONGOLIAN LETTER ALI GALI SSA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1894,
},
[0x1895]={
@@ -47000,6 +47316,7 @@ characters.data={
description="MONGOLIAN LETTER ALI GALI ZHA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1895,
},
[0x1896]={
@@ -47008,6 +47325,7 @@ characters.data={
description="MONGOLIAN LETTER ALI GALI ZA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1896,
},
[0x1897]={
@@ -47016,6 +47334,7 @@ characters.data={
description="MONGOLIAN LETTER ALI GALI AH",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1897,
},
[0x1898]={
@@ -47024,6 +47343,7 @@ characters.data={
description="MONGOLIAN LETTER TODO ALI GALI TA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1898,
},
[0x1899]={
@@ -47032,6 +47352,7 @@ characters.data={
description="MONGOLIAN LETTER TODO ALI GALI ZHA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x1899,
},
[0x189A]={
@@ -47040,6 +47361,7 @@ characters.data={
description="MONGOLIAN LETTER MANCHU ALI GALI GHA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x189A,
},
[0x189B]={
@@ -47048,6 +47370,7 @@ characters.data={
description="MONGOLIAN LETTER MANCHU ALI GALI NGA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x189B,
},
[0x189C]={
@@ -47056,6 +47379,7 @@ characters.data={
description="MONGOLIAN LETTER MANCHU ALI GALI CA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x189C,
},
[0x189D]={
@@ -47064,6 +47388,7 @@ characters.data={
description="MONGOLIAN LETTER MANCHU ALI GALI JHA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x189D,
},
[0x189E]={
@@ -47072,6 +47397,7 @@ characters.data={
description="MONGOLIAN LETTER MANCHU ALI GALI TTA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x189E,
},
[0x189F]={
@@ -47080,6 +47406,7 @@ characters.data={
description="MONGOLIAN LETTER MANCHU ALI GALI DDHA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x189F,
},
[0x18A0]={
@@ -47088,6 +47415,7 @@ characters.data={
description="MONGOLIAN LETTER MANCHU ALI GALI TA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x18A0,
},
[0x18A1]={
@@ -47096,6 +47424,7 @@ characters.data={
description="MONGOLIAN LETTER MANCHU ALI GALI DHA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x18A1,
},
[0x18A2]={
@@ -47104,6 +47433,7 @@ characters.data={
description="MONGOLIAN LETTER MANCHU ALI GALI SSA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x18A2,
},
[0x18A3]={
@@ -47112,6 +47442,7 @@ characters.data={
description="MONGOLIAN LETTER MANCHU ALI GALI CYA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x18A3,
},
[0x18A4]={
@@ -47120,6 +47451,7 @@ characters.data={
description="MONGOLIAN LETTER MANCHU ALI GALI ZHA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x18A4,
},
[0x18A5]={
@@ -47128,6 +47460,7 @@ characters.data={
description="MONGOLIAN LETTER MANCHU ALI GALI ZA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x18A5,
},
[0x18A6]={
@@ -47136,6 +47469,7 @@ characters.data={
description="MONGOLIAN LETTER ALI GALI HALF U",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x18A6,
},
[0x18A7]={
@@ -47144,6 +47478,7 @@ characters.data={
description="MONGOLIAN LETTER ALI GALI HALF YA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x18A7,
},
[0x18A8]={
@@ -47152,6 +47487,7 @@ characters.data={
description="MONGOLIAN LETTER MANCHU ALI GALI BHA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x18A8,
},
[0x18A9]={
@@ -47160,6 +47496,7 @@ characters.data={
description="MONGOLIAN LETTER ALI GALI DAGALGA",
direction="nsm",
linebreak="cm",
+ mongolian="t",
unicodeslot=0x18A9,
},
[0x18AA]={
@@ -47168,6 +47505,7 @@ characters.data={
description="MONGOLIAN LETTER MANCHU ALI GALI LHA",
direction="l",
linebreak="al",
+ mongolian="d",
unicodeslot=0x18AA,
},
[0x18B0]={
@@ -50419,6 +50757,22 @@ characters.data={
linebreak="cm",
unicodeslot=0x1ABE,
},
+ [0x1ABF]={
+ category="mn",
+ combining=0xDC,
+ description="COMBINING LATIN SMALL LETTER W BELOW",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1ABF,
+ },
+ [0x1AC0]={
+ category="mn",
+ combining=0xDC,
+ description="COMBINING LATIN SMALL LETTER TURNED W BELOW",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1AC0,
+ },
[0x1B00]={
category="mn",
description="BALINESE SIGN ULU RICEM",
@@ -53846,6 +54200,7 @@ characters.data={
description="LATIN LETTER SMALL CAPITAL L WITH STROKE",
direction="l",
linebreak="al",
+ specials={ "with", 0x29F, 0x2F },
unicodeslot=0x1D0C,
},
[0x1D0D]={
@@ -53895,6 +54250,7 @@ characters.data={
description="LATIN SMALL LETTER SIDEWAYS O WITH STROKE",
direction="l",
linebreak="al",
+ specials={ "with", 0x1D11, 0x2F },
unicodeslot=0x1D13,
},
[0x1D14]={
@@ -54703,6 +55059,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x269,
+ specials={ "with", 0x269, 0x2F },
unicodeslot=0x1D7C,
},
[0x1D7D]={
@@ -54711,6 +55068,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x70,
+ specials={ "with", 0x70, 0x2F },
uccode=0x2C63,
unicodeslot=0x1D7D,
},
@@ -54727,6 +55085,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x28A,
+ specials={ "with", 0x28A, 0x2F },
unicodeslot=0x1D7F,
},
[0x1D80]={
@@ -58517,7 +58876,6 @@ characters.data={
[0x1EF6]={
adobename="Yhookabove",
category="lu",
- contextname="Yhook",
description="LATIN CAPITAL LETTER Y WITH HOOK ABOVE",
direction="l",
lccode=0x1EF7,
@@ -58529,7 +58887,6 @@ characters.data={
[0x1EF7]={
adobename="yhookabove",
category="ll",
- contextname="yhook",
description="LATIN SMALL LETTER Y WITH HOOK ABOVE",
direction="l",
linebreak="al",
@@ -60490,7 +60847,7 @@ characters.data={
},
[0x1FBB]={
category="lu",
- contextname="greekAlphatonos",
+ comment="conflict: greekAlphatonos",
description="GREEK CAPITAL LETTER ALPHA WITH OXIA",
direction="l",
lccode=0x1F71,
@@ -60620,7 +60977,7 @@ characters.data={
},
[0x1FC9]={
category="lu",
- contextname="greekEpsilontonos",
+ comment="conflict: greekEpsilontonos",
description="GREEK CAPITAL LETTER EPSILON WITH OXIA",
direction="l",
lccode=0x1F73,
@@ -60642,7 +60999,7 @@ characters.data={
},
[0x1FCB]={
category="lu",
- contextname="greekEtatonos",
+ comment="conflict: greekEtatonos",
description="GREEK CAPITAL LETTER ETA WITH OXIA",
direction="l",
lccode=0x1F75,
@@ -60673,7 +61030,7 @@ characters.data={
},
[0x1FCE]={
category="sk",
- contextname="greekpsilitonos",
+ comment="conflict: greekpsilitonos",
description="GREEK PSILI AND OXIA",
direction="on",
linebreak="al",
@@ -60723,7 +61080,7 @@ characters.data={
},
[0x1FD3]={
category="ll",
- contextname="greekiotadialytikatonos",
+ comment="conflict: greekiotadialytikatonos",
description="GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA",
direction="l",
linebreak="al",
@@ -60786,7 +61143,7 @@ characters.data={
},
[0x1FDB]={
category="lu",
- contextname="greekIotatonos",
+ comment="conflict: greekIotatonos",
description="GREEK CAPITAL LETTER IOTA WITH OXIA",
direction="l",
lccode=0x1F77,
@@ -60806,7 +61163,7 @@ characters.data={
},
[0x1FDE]={
category="sk",
- contextname="greekdasiatonos",
+ comment="conflict: greekdasiatonos",
description="GREEK DASIA AND OXIA",
direction="on",
linebreak="al",
@@ -60856,7 +61213,7 @@ characters.data={
},
[0x1FE3]={
category="ll",
- contextname="greekupsilondialytikatonos",
+ comment="conflict: greekupsilondialytikatonos",
description="GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA",
direction="l",
linebreak="al",
@@ -60940,7 +61297,7 @@ characters.data={
},
[0x1FEB]={
category="lu",
- contextname="greekUpsilontonos",
+ comment="conflict: greekUpsilontonos",
description="GREEK CAPITAL LETTER UPSILON WITH OXIA",
direction="l",
lccode=0x1F7B,
@@ -60971,7 +61328,7 @@ characters.data={
},
[0x1FEE]={
category="sk",
- contextname="greekdialytikatonos",
+ comment="conflict: greekdialytikatonos",
description="GREEK DIALYTIKA AND OXIA",
direction="on",
linebreak="al",
@@ -61051,7 +61408,7 @@ characters.data={
},
[0x1FF9]={
category="lu",
- contextname="greekOmicrontonos",
+ comment="conflict: greekOmicrontonos",
description="GREEK CAPITAL LETTER OMICRON WITH OXIA",
direction="l",
lccode=0x1F79,
@@ -61073,7 +61430,7 @@ characters.data={
},
[0x1FFB]={
category="lu",
- contextname="greekOmegatonos",
+ comment="conflict: greekOmegatonos",
description="GREEK CAPITAL LETTER OMEGA WITH OXIA",
direction="l",
lccode=0x1F7D,
@@ -61234,6 +61591,7 @@ characters.data={
description="ZERO WIDTH NON-JOINER",
direction="bn",
linebreak="cm",
+ mongolian="nj",
synonyms={ "zwnj" },
unicodeslot=0x200C,
},
@@ -61245,6 +61603,7 @@ characters.data={
description="ZERO WIDTH JOINER",
direction="bn",
linebreak="zwj",
+ mongolian="nj",
synonyms={ "zwj" },
unicodeslot=0x200D,
},
@@ -61273,6 +61632,7 @@ characters.data={
description="HYPHEN",
direction="on",
linebreak="ba",
+ mongolian="nj",
unicodeslot=0x2010,
},
[0x2011]={
@@ -61280,6 +61640,7 @@ characters.data={
description="NON-BREAKING HYPHEN",
direction="on",
linebreak="gl",
+ mongolian="nj",
specials={ "nobreak", 0x2010 },
unicodeslot=0x2011,
},
@@ -61290,6 +61651,7 @@ characters.data={
description="FIGURE DASH",
direction="on",
linebreak="ba",
+ mongolian="nj",
unicodeslot=0x2012,
},
[0x2013]={
@@ -61300,6 +61662,7 @@ characters.data={
description="EN DASH",
direction="on",
linebreak="ba",
+ mongolian="nj",
unicodeslot=0x2013,
},
[0x2014]={
@@ -61310,6 +61673,7 @@ characters.data={
description="EM DASH",
direction="on",
linebreak="b2",
+ mongolian="nj",
unicodeslot=0x2014,
},
[0x2015]={
@@ -61622,6 +61986,7 @@ characters.data={
description="NARROW NO-BREAK SPACE",
direction="cs",
linebreak="gl",
+ mongolian="nj",
specials={ "nobreak", 0x20 },
synonyms={ "nnbsp" },
unicodeslot=0x202F,
@@ -62928,10 +63293,6 @@ characters.data={
linebreak="cm",
mathspec={
{
- class="default",
- name="bigcircle",
- },
- {
class="binary",
name="bigcircle",
},
@@ -64936,7 +65297,7 @@ characters.data={
[0x21B5]={
adobename="carriagereturn",
category="so",
- contextname="carriagereturn",
+ comment="conflict: carriagereturn",
description="DOWNWARDS ARROW WITH CORNER LEFTWARDS",
direction="on",
linebreak="al",
@@ -70777,6 +71138,7 @@ characters.data={
[0x2423]={
adobename="blank",
category="so",
+ contextname="textcontrolspace",
description="OPEN BOX",
direction="on",
linebreak="al",
@@ -74224,6 +74586,7 @@ characters.data={
description="DOTTED CIRCLE",
direction="on",
linebreak="al",
+ mongolian="nj",
unicodeslot=0x25CC,
},
[0x25CD]={
@@ -81657,7 +82020,7 @@ characters.data={
},
{
class="open",
- name="rlointerval",
+ name="llointerval",
},
{
class="close",
@@ -85575,6 +85938,13 @@ characters.data={
linebreak="al",
unicodeslot=0x2B95,
},
+ [0x2B97]={
+ category="so",
+ description="SYMBOL FOR TYPE A ELECTRONICS",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x2B97,
+ },
[0x2B98]={
category="so",
description="THREE-D TOP-LIGHTED LEFTWARDS EQUILATERAL ARROWHEAD",
@@ -87091,6 +87461,7 @@ characters.data={
lccode=0x1D7D,
linebreak="al",
shcode=0x50,
+ specials={ "with", 0x50, 0x2F },
unicodeslot=0x2C63,
},
[0x2C64]={
@@ -87108,6 +87479,7 @@ characters.data={
direction="l",
linebreak="al",
shcode=0x61,
+ specials={ "with", 0x61, 0x2F },
uccode=0x23A,
unicodeslot=0x2C65,
},
@@ -87186,6 +87558,7 @@ characters.data={
description="LATIN CAPITAL LETTER M WITH HOOK",
direction="l",
linebreak="al",
+ specials={ "with", 0x4D, 0x1FA9D },
unicodeslot=0x2C6E,
},
[0x2C6F]={
@@ -87214,6 +87587,7 @@ characters.data={
description="LATIN CAPITAL LETTER W WITH HOOK",
direction="l",
linebreak="al",
+ specials={ "with", 0x57, 0x1FA9D },
unicodeslot=0x2C72,
},
[0x2C73]={
@@ -87221,6 +87595,7 @@ characters.data={
description="LATIN SMALL LETTER W WITH HOOK",
direction="l",
linebreak="al",
+ specials={ "with", 0x77, 0x1FA9D },
unicodeslot=0x2C73,
},
[0x2C74]={
@@ -90400,6 +90775,27 @@ characters.data={
linebreak="ba",
unicodeslot=0x2E4F,
},
+ [0x2E50]={
+ category="so",
+ description="CROSS PATTY WITH RIGHT CROSSBAR",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x2E50,
+ },
+ [0x2E51]={
+ category="so",
+ description="CROSS PATTY WITH LEFT CROSSBAR",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x2E51,
+ },
+ [0x2E52]={
+ category="po",
+ description="TIRONIAN SIGN CAPITAL ET",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x2E52,
+ },
[0x2E80]={
category="so",
cjkwd="w",
@@ -97916,6 +98312,46 @@ characters.data={
linebreak="id",
unicodeslot=0x31BA,
},
+ [0x31BB]={
+ category="lo",
+ cjkwd="w",
+ description="BOPOMOFO FINAL LETTER G",
+ direction="l",
+ linebreak="id",
+ unicodeslot=0x31BB,
+ },
+ [0x31BC]={
+ category="lo",
+ cjkwd="w",
+ description="BOPOMOFO LETTER GW",
+ direction="l",
+ linebreak="id",
+ unicodeslot=0x31BC,
+ },
+ [0x31BD]={
+ category="lo",
+ cjkwd="w",
+ description="BOPOMOFO LETTER KW",
+ direction="l",
+ linebreak="id",
+ unicodeslot=0x31BD,
+ },
+ [0x31BE]={
+ category="lo",
+ cjkwd="w",
+ description="BOPOMOFO LETTER OE",
+ direction="l",
+ linebreak="id",
+ unicodeslot=0x31BE,
+ },
+ [0x31BF]={
+ category="lo",
+ cjkwd="w",
+ description="BOPOMOFO LETTER AH",
+ direction="l",
+ linebreak="id",
+ unicodeslot=0x31BF,
+ },
[0x31C0]={
category="so",
cjkwd="w",
@@ -117468,6 +117904,7 @@ characters.data={
description="LATIN CAPITAL LETTER CUATRILLO WITH COMMA",
direction="l",
linebreak="al",
+ specials={ "with", 0xA72C, 0x2C },
unicodeslot=0xA72E,
},
[0xA72F]={
@@ -117475,6 +117912,7 @@ characters.data={
description="LATIN SMALL LETTER CUATRILLO WITH COMMA",
direction="l",
linebreak="al",
+ specials={ "with", 0xA72D, 0x2C },
unicodeslot=0xA72F,
},
[0xA730]={
@@ -117552,6 +117990,7 @@ characters.data={
description="LATIN CAPITAL LETTER AV WITH HORIZONTAL BAR",
direction="l",
linebreak="al",
+ specials={ "with", 0xA738, 0x2015 },
unicodeslot=0xA73A,
},
[0xA73B]={
@@ -117559,6 +117998,7 @@ characters.data={
description="LATIN SMALL LETTER AV WITH HORIZONTAL BAR",
direction="l",
linebreak="al",
+ specials={ "with", 0xA739, 0x2015 },
unicodeslot=0xA73B,
},
[0xA73C]={
@@ -117594,6 +118034,7 @@ characters.data={
description="LATIN CAPITAL LETTER K WITH STROKE",
direction="l",
linebreak="al",
+ specials={ "with", 0x4B, 0x2F },
unicodeslot=0xA740,
},
[0xA741]={
@@ -117601,6 +118042,7 @@ characters.data={
description="LATIN SMALL LETTER K WITH STROKE",
direction="l",
linebreak="al",
+ specials={ "with", 0x6B, 0x2F },
unicodeslot=0xA741,
},
[0xA742]={
@@ -117846,6 +118288,7 @@ characters.data={
description="LATIN CAPITAL LETTER THORN WITH STROKE",
direction="l",
linebreak="al",
+ specials={ "with", 0xDE, 0x2F },
unicodeslot=0xA764,
},
[0xA765]={
@@ -117853,6 +118296,7 @@ characters.data={
description="LATIN SMALL LETTER THORN WITH STROKE",
direction="l",
linebreak="al",
+ specials={ "with", 0xFE, 0x2F },
unicodeslot=0xA765,
},
[0xA766]={
@@ -118211,6 +118655,7 @@ characters.data={
description="LATIN CAPITAL LETTER F WITH STROKE",
direction="l",
linebreak="al",
+ specials={ "with", 0x46, 0x2F },
unicodeslot=0xA798,
},
[0xA799]={
@@ -118218,6 +118663,7 @@ characters.data={
description="LATIN SMALL LETTER F WITH STROKE",
direction="l",
linebreak="al",
+ specials={ "with", 0x66, 0x2F },
unicodeslot=0xA799,
},
[0xA79A]={
@@ -118337,6 +118783,7 @@ characters.data={
description="LATIN CAPITAL LETTER H WITH HOOK",
direction="l",
linebreak="al",
+ specials={ "with", 0x48, 0x1FA9D },
unicodeslot=0xA7AA,
},
[0xA7AB]={
@@ -118435,6 +118882,7 @@ characters.data={
description="LATIN CAPITAL LETTER U WITH STROKE",
direction="l",
linebreak="al",
+ specials={ "with", 0x55, 0x2F },
unicodeslot=0xA7B8,
},
[0xA7B9]={
@@ -118442,6 +118890,7 @@ characters.data={
description="LATIN SMALL LETTER U WITH STROKE",
direction="l",
linebreak="al",
+ specials={ "with", 0x75, 0x2F },
unicodeslot=0xA7B9,
},
[0xA7BA]={
@@ -118512,6 +118961,7 @@ characters.data={
description="LATIN CAPITAL LETTER S WITH HOOK",
direction="l",
linebreak="al",
+ specials={ "with", 0x53, 0x1FA9D },
unicodeslot=0xA7C5,
},
[0xA7C6]={
@@ -118521,6 +118971,48 @@ characters.data={
linebreak="al",
unicodeslot=0xA7C6,
},
+ [0xA7C7]={
+ category="lu",
+ description="LATIN CAPITAL LETTER D WITH SHORT STROKE OVERLAY",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0xA7C7,
+ },
+ [0xA7C8]={
+ category="ll",
+ description="LATIN SMALL LETTER D WITH SHORT STROKE OVERLAY",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0xA7C8,
+ },
+ [0xA7C9]={
+ category="lu",
+ description="LATIN CAPITAL LETTER S WITH SHORT STROKE OVERLAY",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0xA7C9,
+ },
+ [0xA7CA]={
+ category="ll",
+ description="LATIN SMALL LETTER S WITH SHORT STROKE OVERLAY",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0xA7CA,
+ },
+ [0xA7F5]={
+ category="lu",
+ description="LATIN CAPITAL LETTER REVERSED HALF H",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0xA7F5,
+ },
+ [0xA7F6]={
+ category="ll",
+ description="LATIN SMALL LETTER REVERSED HALF H",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0xA7F6,
+ },
[0xA7F7]={
category="lo",
description="LATIN EPIGRAPHIC LETTER SIDEWAYS I",
@@ -118895,6 +119387,14 @@ characters.data={
linebreak="al",
unicodeslot=0xA82B,
},
+ [0xA82C]={
+ category="mn",
+ combining=0x9,
+ description="SYLOTI NAGRI SIGN ALTERNATE HASANTA",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0xA82C,
+ },
[0xA830]={
category="no",
description="NORTH INDIC FRACTION ONE QUARTER",
@@ -123824,6 +124324,7 @@ characters.data={
description="LATIN SMALL LETTER L WITH INVERTED LAZY S",
direction="l",
linebreak="al",
+ specials={ "with", 0x6C, 0x223E },
unicodeslot=0xAB37,
},
[0xAB38]={
@@ -123873,6 +124374,7 @@ characters.data={
description="LATIN SMALL LETTER BLACKLETTER O WITH STROKE",
direction="l",
linebreak="al",
+ specials={ "with", 0xAB3D, 0x2F },
unicodeslot=0xAB3E,
},
[0xAB3F]={
@@ -123880,6 +124382,7 @@ characters.data={
description="LATIN SMALL LETTER OPEN O WITH STROKE",
direction="l",
linebreak="al",
+ specials={ "with", 0x254, 0x2F },
unicodeslot=0xAB3F,
},
[0xAB40]={
@@ -123894,6 +124397,7 @@ characters.data={
description="LATIN SMALL LETTER TURNED OE WITH STROKE",
direction="l",
linebreak="al",
+ specials={ "with", 0x1D14, 0x2F },
unicodeslot=0xAB41,
},
[0xAB42]={
@@ -123915,6 +124419,7 @@ characters.data={
description="LATIN SMALL LETTER TURNED O OPEN-O WITH STROKE",
direction="l",
linebreak="al",
+ specials={ "with", 0xAB43, 0x2F },
unicodeslot=0xAB44,
},
[0xAB45]={
@@ -123971,6 +124476,7 @@ characters.data={
description="LATIN SMALL LETTER SCRIPT R WITH RING",
direction="l",
linebreak="al",
+ specials={ "with", 0xAB4B, 0x1F48D },
unicodeslot=0xAB4C,
},
[0xAB4D]={
@@ -124166,6 +124672,35 @@ characters.data={
linebreak="al",
unicodeslot=0xAB67,
},
+ [0xAB68]={
+ category="ll",
+ description="LATIN SMALL LETTER TURNED R WITH MIDDLE TILDE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0xAB68,
+ },
+ [0xAB69]={
+ category="lm",
+ description="MODIFIER LETTER SMALL TURNED W",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x28D },
+ unicodeslot=0xAB69,
+ },
+ [0xAB6A]={
+ category="sk",
+ description="MODIFIER LETTER LEFT TACK",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0xAB6A,
+ },
+ [0xAB6B]={
+ category="sk",
+ description="MODIFIER LETTER RIGHT TACK",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0xAB6B,
+ },
[0xAB70]={
category="ll",
description="CHEROKEE SMALL LETTER A",
@@ -135366,7 +135901,7 @@ characters.data={
},
[0xFDF9]={
category="lo",
- contextname="arabicsalla",
+ comment="conflict: arabicsalla",
description="ARABIC LIGATURE SALLA ISOLATED FORM",
direction="al",
linebreak="al",
@@ -142326,6 +142861,13 @@ characters.data={
linebreak="al",
unicodeslot=0x1019B,
},
+ [0x1019C]={
+ category="so",
+ description="ASCIA SYMBOL",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1019C,
+ },
[0x101A0]={
category="so",
description="GREEK SYMBOL TAU RHO",
@@ -156340,6 +156882,337 @@ characters.data={
linebreak="al",
unicodeslot=0x10E7E,
},
+ [0x10E80]={
+ category="lo",
+ description="YEZIDI LETTER ELIF",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10E80,
+ },
+ [0x10E81]={
+ category="lo",
+ description="YEZIDI LETTER BE",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10E81,
+ },
+ [0x10E82]={
+ category="lo",
+ description="YEZIDI LETTER PE",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10E82,
+ },
+ [0x10E83]={
+ category="lo",
+ description="YEZIDI LETTER PHE",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10E83,
+ },
+ [0x10E84]={
+ category="lo",
+ description="YEZIDI LETTER THE",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10E84,
+ },
+ [0x10E85]={
+ category="lo",
+ description="YEZIDI LETTER SE",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10E85,
+ },
+ [0x10E86]={
+ category="lo",
+ description="YEZIDI LETTER CIM",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10E86,
+ },
+ [0x10E87]={
+ category="lo",
+ description="YEZIDI LETTER CHIM",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10E87,
+ },
+ [0x10E88]={
+ category="lo",
+ description="YEZIDI LETTER CHHIM",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10E88,
+ },
+ [0x10E89]={
+ category="lo",
+ description="YEZIDI LETTER HHA",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10E89,
+ },
+ [0x10E8A]={
+ category="lo",
+ description="YEZIDI LETTER XA",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10E8A,
+ },
+ [0x10E8B]={
+ category="lo",
+ description="YEZIDI LETTER DAL",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10E8B,
+ },
+ [0x10E8C]={
+ category="lo",
+ description="YEZIDI LETTER ZAL",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10E8C,
+ },
+ [0x10E8D]={
+ category="lo",
+ description="YEZIDI LETTER RA",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10E8D,
+ },
+ [0x10E8E]={
+ category="lo",
+ description="YEZIDI LETTER RHA",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10E8E,
+ },
+ [0x10E8F]={
+ category="lo",
+ description="YEZIDI LETTER ZA",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10E8F,
+ },
+ [0x10E90]={
+ category="lo",
+ description="YEZIDI LETTER JA",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10E90,
+ },
+ [0x10E91]={
+ category="lo",
+ description="YEZIDI LETTER SIN",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10E91,
+ },
+ [0x10E92]={
+ category="lo",
+ description="YEZIDI LETTER SHIN",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10E92,
+ },
+ [0x10E93]={
+ category="lo",
+ description="YEZIDI LETTER SAD",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10E93,
+ },
+ [0x10E94]={
+ category="lo",
+ description="YEZIDI LETTER DAD",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10E94,
+ },
+ [0x10E95]={
+ category="lo",
+ description="YEZIDI LETTER TA",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10E95,
+ },
+ [0x10E96]={
+ category="lo",
+ description="YEZIDI LETTER ZE",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10E96,
+ },
+ [0x10E97]={
+ category="lo",
+ description="YEZIDI LETTER EYN",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10E97,
+ },
+ [0x10E98]={
+ category="lo",
+ description="YEZIDI LETTER XHEYN",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10E98,
+ },
+ [0x10E99]={
+ category="lo",
+ description="YEZIDI LETTER FA",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10E99,
+ },
+ [0x10E9A]={
+ category="lo",
+ description="YEZIDI LETTER VA",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10E9A,
+ },
+ [0x10E9B]={
+ category="lo",
+ description="YEZIDI LETTER VA ALTERNATE FORM",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10E9B,
+ },
+ [0x10E9C]={
+ category="lo",
+ description="YEZIDI LETTER QAF",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10E9C,
+ },
+ [0x10E9D]={
+ category="lo",
+ description="YEZIDI LETTER KAF",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10E9D,
+ },
+ [0x10E9E]={
+ category="lo",
+ description="YEZIDI LETTER KHAF",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10E9E,
+ },
+ [0x10E9F]={
+ category="lo",
+ description="YEZIDI LETTER GAF",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10E9F,
+ },
+ [0x10EA0]={
+ category="lo",
+ description="YEZIDI LETTER LAM",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10EA0,
+ },
+ [0x10EA1]={
+ category="lo",
+ description="YEZIDI LETTER MIM",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10EA1,
+ },
+ [0x10EA2]={
+ category="lo",
+ description="YEZIDI LETTER NUN",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10EA2,
+ },
+ [0x10EA3]={
+ category="lo",
+ description="YEZIDI LETTER UM",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10EA3,
+ },
+ [0x10EA4]={
+ category="lo",
+ description="YEZIDI LETTER WAW",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10EA4,
+ },
+ [0x10EA5]={
+ category="lo",
+ description="YEZIDI LETTER OW",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10EA5,
+ },
+ [0x10EA6]={
+ category="lo",
+ description="YEZIDI LETTER EW",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10EA6,
+ },
+ [0x10EA7]={
+ category="lo",
+ description="YEZIDI LETTER HAY",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10EA7,
+ },
+ [0x10EA8]={
+ category="lo",
+ description="YEZIDI LETTER YOT",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10EA8,
+ },
+ [0x10EA9]={
+ category="lo",
+ description="YEZIDI LETTER ET",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10EA9,
+ },
+ [0x10EAB]={
+ category="mn",
+ combining=0xE6,
+ description="YEZIDI COMBINING HAMZA MARK",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x10EAB,
+ },
+ [0x10EAC]={
+ category="mn",
+ combining=0xE6,
+ description="YEZIDI COMBINING MADDA MARK",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x10EAC,
+ },
+ [0x10EAD]={
+ category="pd",
+ description="YEZIDI HYPHENATION MARK",
+ direction="r",
+ linebreak="ba",
+ unicodeslot=0x10EAD,
+ },
+ [0x10EB0]={
+ category="lo",
+ description="YEZIDI LETTER LAM WITH DOT ABOVE",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10EB0,
+ },
+ [0x10EB1]={
+ category="lo",
+ description="YEZIDI LETTER YOT WITH CIRCUMFLEX ABOVE",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10EB1,
+ },
[0x10F00]={
category="lo",
description="OLD SOGDIAN LETTER ALEPH",
@@ -156951,6 +157824,230 @@ characters.data={
linebreak="al",
unicodeslot=0x10F59,
},
+ [0x10FB0]={
+ arabic="d",
+ category="lo",
+ description="CHORASMIAN LETTER ALEPH",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10FB0,
+ },
+ [0x10FB1]={
+ arabic="u",
+ category="lo",
+ description="CHORASMIAN LETTER SMALL ALEPH",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10FB1,
+ },
+ [0x10FB2]={
+ arabic="d",
+ category="lo",
+ description="CHORASMIAN LETTER BETH",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10FB2,
+ },
+ [0x10FB3]={
+ arabic="d",
+ category="lo",
+ description="CHORASMIAN LETTER GIMEL",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10FB3,
+ },
+ [0x10FB4]={
+ arabic="r",
+ category="lo",
+ description="CHORASMIAN LETTER DALETH",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10FB4,
+ },
+ [0x10FB5]={
+ arabic="r",
+ category="lo",
+ description="CHORASMIAN LETTER HE",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10FB5,
+ },
+ [0x10FB6]={
+ arabic="r",
+ category="lo",
+ description="CHORASMIAN LETTER WAW",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10FB6,
+ },
+ [0x10FB7]={
+ arabic="u",
+ category="lo",
+ description="CHORASMIAN LETTER CURLED WAW",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10FB7,
+ },
+ [0x10FB8]={
+ arabic="d",
+ category="lo",
+ description="CHORASMIAN LETTER ZAYIN",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10FB8,
+ },
+ [0x10FB9]={
+ arabic="r",
+ category="lo",
+ description="CHORASMIAN LETTER HETH",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10FB9,
+ },
+ [0x10FBA]={
+ arabic="r",
+ category="lo",
+ description="CHORASMIAN LETTER YODH",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10FBA,
+ },
+ [0x10FBB]={
+ arabic="d",
+ category="lo",
+ description="CHORASMIAN LETTER KAPH",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10FBB,
+ },
+ [0x10FBC]={
+ arabic="d",
+ category="lo",
+ description="CHORASMIAN LETTER LAMEDH",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10FBC,
+ },
+ [0x10FBD]={
+ arabic="r",
+ category="lo",
+ description="CHORASMIAN LETTER MEM",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10FBD,
+ },
+ [0x10FBE]={
+ arabic="d",
+ category="lo",
+ description="CHORASMIAN LETTER NUN",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10FBE,
+ },
+ [0x10FBF]={
+ arabic="d",
+ category="lo",
+ description="CHORASMIAN LETTER SAMEKH",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10FBF,
+ },
+ [0x10FC0]={
+ arabic="u",
+ category="lo",
+ description="CHORASMIAN LETTER AYIN",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10FC0,
+ },
+ [0x10FC1]={
+ arabic="d",
+ category="lo",
+ description="CHORASMIAN LETTER PE",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10FC1,
+ },
+ [0x10FC2]={
+ arabic="r",
+ category="lo",
+ description="CHORASMIAN LETTER RESH",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10FC2,
+ },
+ [0x10FC3]={
+ arabic="r",
+ category="lo",
+ description="CHORASMIAN LETTER SHIN",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10FC3,
+ },
+ [0x10FC4]={
+ arabic="d",
+ category="lo",
+ description="CHORASMIAN LETTER TAW",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10FC4,
+ },
+ [0x10FC5]={
+ arabic="u",
+ category="no",
+ description="CHORASMIAN NUMBER ONE",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10FC5,
+ },
+ [0x10FC6]={
+ arabic="u",
+ category="no",
+ description="CHORASMIAN NUMBER TWO",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10FC6,
+ },
+ [0x10FC7]={
+ arabic="u",
+ category="no",
+ description="CHORASMIAN NUMBER THREE",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10FC7,
+ },
+ [0x10FC8]={
+ arabic="u",
+ category="no",
+ description="CHORASMIAN NUMBER FOUR",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10FC8,
+ },
+ [0x10FC9]={
+ arabic="r",
+ category="no",
+ description="CHORASMIAN NUMBER TEN",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10FC9,
+ },
+ [0x10FCA]={
+ arabic="d",
+ category="no",
+ description="CHORASMIAN NUMBER TWENTY",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10FCA,
+ },
+ [0x10FCB]={
+ arabic="l",
+ category="no",
+ description="CHORASMIAN NUMBER ONE HUNDRED",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10FCB,
+ },
[0x10FE0]={
category="lo",
description="ELYMAIC LETTER ALEPH",
@@ -159095,6 +160192,13 @@ characters.data={
linebreak="cm",
unicodeslot=0x11146,
},
+ [0x11147]={
+ category="lo",
+ description="CHAKMA LETTER VAA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11147,
+ },
[0x11150]={
category="lo",
description="MAHAJANI LETTER A",
@@ -159917,6 +161021,20 @@ characters.data={
linebreak="al",
unicodeslot=0x111CD,
},
+ [0x111CE]={
+ category="mc",
+ description="SHARADA VOWEL SIGN PRISHTHAMATRA E",
+ direction="l",
+ linebreak="cm",
+ unicodeslot=0x111CE,
+ },
+ [0x111CF]={
+ category="mn",
+ description="SHARADA SIGN INVERTED CANDRABINDU",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x111CF,
+ },
[0x111D0]={
category="nd",
description="SHARADA DIGIT ZERO",
@@ -162607,6 +163725,13 @@ characters.data={
linebreak="nu",
unicodeslot=0x11459,
},
+ [0x1145A]={
+ category="po",
+ description="NEWA DOUBLE COMMA",
+ direction="l",
+ linebreak="ba",
+ unicodeslot=0x1145A,
+ },
[0x1145B]={
category="po",
description="NEWA PLACEHOLDER MARK",
@@ -162636,6 +163761,20 @@ characters.data={
linebreak="al",
unicodeslot=0x1145F,
},
+ [0x11460]={
+ category="lo",
+ description="NEWA SIGN JIHVAMULIYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11460,
+ },
+ [0x11461]={
+ category="lo",
+ description="NEWA SIGN UPADHMANIYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11461,
+ },
[0x11480]={
category="lo",
description="TIRHUTA ANJI",
@@ -164422,6 +165561,7 @@ characters.data={
description="MONGOLIAN BIRGA WITH ORNAMENT",
direction="on",
linebreak="bb",
+ mongolian="nj",
unicodeslot=0x11660,
},
[0x11661]={
@@ -164429,6 +165569,7 @@ characters.data={
description="MONGOLIAN ROTATED BIRGA",
direction="on",
linebreak="bb",
+ mongolian="nj",
unicodeslot=0x11661,
},
[0x11662]={
@@ -164436,6 +165577,7 @@ characters.data={
description="MONGOLIAN DOUBLE BIRGA WITH ORNAMENT",
direction="on",
linebreak="bb",
+ mongolian="nj",
unicodeslot=0x11662,
},
[0x11663]={
@@ -164443,6 +165585,7 @@ characters.data={
description="MONGOLIAN TRIPLE BIRGA WITH ORNAMENT",
direction="on",
linebreak="bb",
+ mongolian="nj",
unicodeslot=0x11663,
},
[0x11664]={
@@ -164450,6 +165593,7 @@ characters.data={
description="MONGOLIAN BIRGA WITH DOUBLE ORNAMENT",
direction="on",
linebreak="bb",
+ mongolian="nj",
unicodeslot=0x11664,
},
[0x11665]={
@@ -164457,6 +165601,7 @@ characters.data={
description="MONGOLIAN ROTATED BIRGA WITH ORNAMENT",
direction="on",
linebreak="bb",
+ mongolian="nj",
unicodeslot=0x11665,
},
[0x11666]={
@@ -164464,6 +165609,7 @@ characters.data={
description="MONGOLIAN ROTATED BIRGA WITH DOUBLE ORNAMENT",
direction="on",
linebreak="bb",
+ mongolian="nj",
unicodeslot=0x11666,
},
[0x11667]={
@@ -164471,6 +165617,7 @@ characters.data={
description="MONGOLIAN INVERTED BIRGA",
direction="on",
linebreak="bb",
+ mongolian="nj",
unicodeslot=0x11667,
},
[0x11668]={
@@ -164478,6 +165625,7 @@ characters.data={
description="MONGOLIAN INVERTED BIRGA WITH DOUBLE ORNAMENT",
direction="on",
linebreak="bb",
+ mongolian="nj",
unicodeslot=0x11668,
},
[0x11669]={
@@ -164485,6 +165633,7 @@ characters.data={
description="MONGOLIAN SWIRL BIRGA",
direction="on",
linebreak="bb",
+ mongolian="nj",
unicodeslot=0x11669,
},
[0x1166A]={
@@ -164492,6 +165641,7 @@ characters.data={
description="MONGOLIAN SWIRL BIRGA WITH ORNAMENT",
direction="on",
linebreak="bb",
+ mongolian="nj",
unicodeslot=0x1166A,
},
[0x1166B]={
@@ -164499,6 +165649,7 @@ characters.data={
description="MONGOLIAN SWIRL BIRGA WITH DOUBLE ORNAMENT",
direction="on",
linebreak="bb",
+ mongolian="nj",
unicodeslot=0x1166B,
},
[0x1166C]={
@@ -164506,6 +165657,7 @@ characters.data={
description="MONGOLIAN TURNED SWIRL BIRGA WITH DOUBLE ORNAMENT",
direction="on",
linebreak="bb",
+ mongolian="nj",
unicodeslot=0x1166C,
},
[0x11680]={
@@ -166396,6 +167548,514 @@ characters.data={
linebreak="al",
unicodeslot=0x118FF,
},
+ [0x11900]={
+ category="lo",
+ description="DIVES AKURU LETTER A",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11900,
+ },
+ [0x11901]={
+ category="lo",
+ description="DIVES AKURU LETTER AA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11901,
+ },
+ [0x11902]={
+ category="lo",
+ description="DIVES AKURU LETTER I",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11902,
+ },
+ [0x11903]={
+ category="lo",
+ description="DIVES AKURU LETTER II",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11903,
+ },
+ [0x11904]={
+ category="lo",
+ description="DIVES AKURU LETTER U",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11904,
+ },
+ [0x11905]={
+ category="lo",
+ description="DIVES AKURU LETTER UU",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11905,
+ },
+ [0x11906]={
+ category="lo",
+ description="DIVES AKURU LETTER E",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11906,
+ },
+ [0x11909]={
+ category="lo",
+ description="DIVES AKURU LETTER O",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11909,
+ },
+ [0x1190C]={
+ category="lo",
+ description="DIVES AKURU LETTER KA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1190C,
+ },
+ [0x1190D]={
+ category="lo",
+ description="DIVES AKURU LETTER KHA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1190D,
+ },
+ [0x1190E]={
+ category="lo",
+ description="DIVES AKURU LETTER GA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1190E,
+ },
+ [0x1190F]={
+ category="lo",
+ description="DIVES AKURU LETTER GHA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1190F,
+ },
+ [0x11910]={
+ category="lo",
+ description="DIVES AKURU LETTER NGA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11910,
+ },
+ [0x11911]={
+ category="lo",
+ description="DIVES AKURU LETTER CA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11911,
+ },
+ [0x11912]={
+ category="lo",
+ description="DIVES AKURU LETTER CHA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11912,
+ },
+ [0x11913]={
+ category="lo",
+ description="DIVES AKURU LETTER JA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11913,
+ },
+ [0x11915]={
+ category="lo",
+ description="DIVES AKURU LETTER NYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11915,
+ },
+ [0x11916]={
+ category="lo",
+ description="DIVES AKURU LETTER TTA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11916,
+ },
+ [0x11918]={
+ category="lo",
+ description="DIVES AKURU LETTER DDA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11918,
+ },
+ [0x11919]={
+ category="lo",
+ description="DIVES AKURU LETTER DDHA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11919,
+ },
+ [0x1191A]={
+ category="lo",
+ description="DIVES AKURU LETTER NNA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1191A,
+ },
+ [0x1191B]={
+ category="lo",
+ description="DIVES AKURU LETTER TA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1191B,
+ },
+ [0x1191C]={
+ category="lo",
+ description="DIVES AKURU LETTER THA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1191C,
+ },
+ [0x1191D]={
+ category="lo",
+ description="DIVES AKURU LETTER DA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1191D,
+ },
+ [0x1191E]={
+ category="lo",
+ description="DIVES AKURU LETTER DHA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1191E,
+ },
+ [0x1191F]={
+ category="lo",
+ description="DIVES AKURU LETTER NA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1191F,
+ },
+ [0x11920]={
+ category="lo",
+ description="DIVES AKURU LETTER PA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11920,
+ },
+ [0x11921]={
+ category="lo",
+ description="DIVES AKURU LETTER PHA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11921,
+ },
+ [0x11922]={
+ category="lo",
+ description="DIVES AKURU LETTER BA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11922,
+ },
+ [0x11923]={
+ category="lo",
+ description="DIVES AKURU LETTER BHA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11923,
+ },
+ [0x11924]={
+ category="lo",
+ description="DIVES AKURU LETTER MA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11924,
+ },
+ [0x11925]={
+ category="lo",
+ description="DIVES AKURU LETTER YA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11925,
+ },
+ [0x11926]={
+ category="lo",
+ description="DIVES AKURU LETTER YYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11926,
+ },
+ [0x11927]={
+ category="lo",
+ description="DIVES AKURU LETTER RA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11927,
+ },
+ [0x11928]={
+ category="lo",
+ description="DIVES AKURU LETTER LA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11928,
+ },
+ [0x11929]={
+ category="lo",
+ description="DIVES AKURU LETTER VA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11929,
+ },
+ [0x1192A]={
+ category="lo",
+ description="DIVES AKURU LETTER SHA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1192A,
+ },
+ [0x1192B]={
+ category="lo",
+ description="DIVES AKURU LETTER SSA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1192B,
+ },
+ [0x1192C]={
+ category="lo",
+ description="DIVES AKURU LETTER SA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1192C,
+ },
+ [0x1192D]={
+ category="lo",
+ description="DIVES AKURU LETTER HA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1192D,
+ },
+ [0x1192E]={
+ category="lo",
+ description="DIVES AKURU LETTER LLA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1192E,
+ },
+ [0x1192F]={
+ category="lo",
+ description="DIVES AKURU LETTER ZA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1192F,
+ },
+ [0x11930]={
+ category="mc",
+ description="DIVES AKURU VOWEL SIGN AA",
+ direction="l",
+ linebreak="cm",
+ unicodeslot=0x11930,
+ },
+ [0x11931]={
+ category="mc",
+ description="DIVES AKURU VOWEL SIGN I",
+ direction="l",
+ linebreak="cm",
+ unicodeslot=0x11931,
+ },
+ [0x11932]={
+ category="mc",
+ description="DIVES AKURU VOWEL SIGN II",
+ direction="l",
+ linebreak="cm",
+ unicodeslot=0x11932,
+ },
+ [0x11933]={
+ category="mc",
+ description="DIVES AKURU VOWEL SIGN U",
+ direction="l",
+ linebreak="cm",
+ unicodeslot=0x11933,
+ },
+ [0x11934]={
+ category="mc",
+ description="DIVES AKURU VOWEL SIGN UU",
+ direction="l",
+ linebreak="cm",
+ unicodeslot=0x11934,
+ },
+ [0x11935]={
+ category="mc",
+ description="DIVES AKURU VOWEL SIGN E",
+ direction="l",
+ linebreak="cm",
+ unicodeslot=0x11935,
+ },
+ [0x11937]={
+ category="mc",
+ description="DIVES AKURU VOWEL SIGN AI",
+ direction="l",
+ linebreak="cm",
+ unicodeslot=0x11937,
+ },
+ [0x11938]={
+ category="mc",
+ description="DIVES AKURU VOWEL SIGN O",
+ direction="l",
+ linebreak="cm",
+ specials={ "char", 0x11935, 0x11930 },
+ unicodeslot=0x11938,
+ },
+ [0x1193B]={
+ category="mn",
+ description="DIVES AKURU SIGN ANUSVARA",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1193B,
+ },
+ [0x1193C]={
+ category="mn",
+ description="DIVES AKURU SIGN CANDRABINDU",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1193C,
+ },
+ [0x1193D]={
+ category="mc",
+ combining=0x9,
+ description="DIVES AKURU SIGN HALANTA",
+ direction="l",
+ linebreak="cm",
+ unicodeslot=0x1193D,
+ },
+ [0x1193E]={
+ category="mn",
+ combining=0x9,
+ description="DIVES AKURU VIRAMA",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1193E,
+ },
+ [0x1193F]={
+ category="lo",
+ description="DIVES AKURU PREFIXED NASAL SIGN",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1193F,
+ },
+ [0x11940]={
+ category="mc",
+ description="DIVES AKURU MEDIAL YA",
+ direction="l",
+ linebreak="cm",
+ unicodeslot=0x11940,
+ },
+ [0x11941]={
+ category="lo",
+ description="DIVES AKURU INITIAL RA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11941,
+ },
+ [0x11942]={
+ category="mc",
+ description="DIVES AKURU MEDIAL RA",
+ direction="l",
+ linebreak="cm",
+ unicodeslot=0x11942,
+ },
+ [0x11943]={
+ category="mn",
+ combining=0x7,
+ description="DIVES AKURU SIGN NUKTA",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x11943,
+ },
+ [0x11944]={
+ category="po",
+ description="DIVES AKURU DOUBLE DANDA",
+ direction="l",
+ linebreak="ba",
+ unicodeslot=0x11944,
+ },
+ [0x11945]={
+ category="po",
+ description="DIVES AKURU GAP FILLER",
+ direction="l",
+ linebreak="ba",
+ unicodeslot=0x11945,
+ },
+ [0x11946]={
+ category="po",
+ description="DIVES AKURU END OF TEXT MARK",
+ direction="l",
+ linebreak="ba",
+ unicodeslot=0x11946,
+ },
+ [0x11950]={
+ category="nd",
+ description="DIVES AKURU DIGIT ZERO",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x11950,
+ },
+ [0x11951]={
+ category="nd",
+ description="DIVES AKURU DIGIT ONE",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x11951,
+ },
+ [0x11952]={
+ category="nd",
+ description="DIVES AKURU DIGIT TWO",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x11952,
+ },
+ [0x11953]={
+ category="nd",
+ description="DIVES AKURU DIGIT THREE",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x11953,
+ },
+ [0x11954]={
+ category="nd",
+ description="DIVES AKURU DIGIT FOUR",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x11954,
+ },
+ [0x11955]={
+ category="nd",
+ description="DIVES AKURU DIGIT FIVE",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x11955,
+ },
+ [0x11956]={
+ category="nd",
+ description="DIVES AKURU DIGIT SIX",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x11956,
+ },
+ [0x11957]={
+ category="nd",
+ description="DIVES AKURU DIGIT SEVEN",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x11957,
+ },
+ [0x11958]={
+ category="nd",
+ description="DIVES AKURU DIGIT EIGHT",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x11958,
+ },
+ [0x11959]={
+ category="nd",
+ description="DIVES AKURU DIGIT NINE",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x11959,
+ },
[0x119A0]={
category="lo",
description="NANDINAGARI LETTER A",
@@ -170640,6 +172300,13 @@ characters.data={
linebreak="al",
unicodeslot=0x11EF8,
},
+ [0x11FB0]={
+ category="lo",
+ description="LISU LETTER YHA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11FB0,
+ },
[0x11FC0]={
category="no",
description="TAMIL FRACTION ONE THREE-HUNDRED-AND-TWENTIETH",
@@ -198427,6 +200094,32 @@ characters.data={
linebreak="ns",
unicodeslot=0x16FE3,
},
+ [0x16FE4]={
+ category="mn",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT FILLER",
+ direction="nsm",
+ linebreak="gl",
+ unicodeslot=0x16FE4,
+ },
+ [0x16FF0]={
+ category="mc",
+ cjkwd="w",
+ combining=0x6,
+ description="VIETNAMESE ALTERNATE READING MARK CA",
+ direction="l",
+ linebreak="cm",
+ unicodeslot=0x16FF0,
+ },
+ [0x16FF1]={
+ category="mc",
+ cjkwd="w",
+ combining=0x6,
+ description="VIETNAMESE ALTERNATE READING MARK NHAY",
+ direction="l",
+ linebreak="cm",
+ unicodeslot=0x16FF1,
+ },
[0x18800]={
category="lo",
cjkwd="w",
@@ -204467,6 +206160,3870 @@ characters.data={
linebreak="id",
unicodeslot=0x18AF2,
},
+ [0x18AF3]={
+ category="lo",
+ cjkwd="w",
+ description="TANGUT COMPONENT-756",
+ direction="l",
+ linebreak="id",
+ unicodeslot=0x18AF3,
+ },
+ [0x18AF4]={
+ category="lo",
+ cjkwd="w",
+ description="TANGUT COMPONENT-757",
+ direction="l",
+ linebreak="id",
+ unicodeslot=0x18AF4,
+ },
+ [0x18AF5]={
+ category="lo",
+ cjkwd="w",
+ description="TANGUT COMPONENT-758",
+ direction="l",
+ linebreak="id",
+ unicodeslot=0x18AF5,
+ },
+ [0x18AF6]={
+ category="lo",
+ cjkwd="w",
+ description="TANGUT COMPONENT-759",
+ direction="l",
+ linebreak="id",
+ unicodeslot=0x18AF6,
+ },
+ [0x18AF7]={
+ category="lo",
+ cjkwd="w",
+ description="TANGUT COMPONENT-760",
+ direction="l",
+ linebreak="id",
+ unicodeslot=0x18AF7,
+ },
+ [0x18AF8]={
+ category="lo",
+ cjkwd="w",
+ description="TANGUT COMPONENT-761",
+ direction="l",
+ linebreak="id",
+ unicodeslot=0x18AF8,
+ },
+ [0x18AF9]={
+ category="lo",
+ cjkwd="w",
+ description="TANGUT COMPONENT-762",
+ direction="l",
+ linebreak="id",
+ unicodeslot=0x18AF9,
+ },
+ [0x18AFA]={
+ category="lo",
+ cjkwd="w",
+ description="TANGUT COMPONENT-763",
+ direction="l",
+ linebreak="id",
+ unicodeslot=0x18AFA,
+ },
+ [0x18AFB]={
+ category="lo",
+ cjkwd="w",
+ description="TANGUT COMPONENT-764",
+ direction="l",
+ linebreak="id",
+ unicodeslot=0x18AFB,
+ },
+ [0x18AFC]={
+ category="lo",
+ cjkwd="w",
+ description="TANGUT COMPONENT-765",
+ direction="l",
+ linebreak="id",
+ unicodeslot=0x18AFC,
+ },
+ [0x18AFD]={
+ category="lo",
+ cjkwd="w",
+ description="TANGUT COMPONENT-766",
+ direction="l",
+ linebreak="id",
+ unicodeslot=0x18AFD,
+ },
+ [0x18AFE]={
+ category="lo",
+ cjkwd="w",
+ description="TANGUT COMPONENT-767",
+ direction="l",
+ linebreak="id",
+ unicodeslot=0x18AFE,
+ },
+ [0x18AFF]={
+ category="lo",
+ cjkwd="w",
+ description="TANGUT COMPONENT-768",
+ direction="l",
+ linebreak="id",
+ unicodeslot=0x18AFF,
+ },
+ [0x18B00]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B00",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B00,
+ },
+ [0x18B01]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B01",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B01,
+ },
+ [0x18B02]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B02",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B02,
+ },
+ [0x18B03]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B03",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B03,
+ },
+ [0x18B04]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B04",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B04,
+ },
+ [0x18B05]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B05",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B05,
+ },
+ [0x18B06]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B06",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B06,
+ },
+ [0x18B07]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B07",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B07,
+ },
+ [0x18B08]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B08",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B08,
+ },
+ [0x18B09]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B09",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B09,
+ },
+ [0x18B0A]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B0A",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B0A,
+ },
+ [0x18B0B]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B0B",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B0B,
+ },
+ [0x18B0C]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B0C",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B0C,
+ },
+ [0x18B0D]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B0D",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B0D,
+ },
+ [0x18B0E]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B0E",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B0E,
+ },
+ [0x18B0F]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B0F",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B0F,
+ },
+ [0x18B10]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B10",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B10,
+ },
+ [0x18B11]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B11",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B11,
+ },
+ [0x18B12]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B12",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B12,
+ },
+ [0x18B13]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B13",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B13,
+ },
+ [0x18B14]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B14",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B14,
+ },
+ [0x18B15]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B15",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B15,
+ },
+ [0x18B16]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B16",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B16,
+ },
+ [0x18B17]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B17",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B17,
+ },
+ [0x18B18]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B18",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B18,
+ },
+ [0x18B19]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B19",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B19,
+ },
+ [0x18B1A]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B1A",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B1A,
+ },
+ [0x18B1B]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B1B",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B1B,
+ },
+ [0x18B1C]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B1C",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B1C,
+ },
+ [0x18B1D]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B1D",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B1D,
+ },
+ [0x18B1E]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B1E",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B1E,
+ },
+ [0x18B1F]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B1F",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B1F,
+ },
+ [0x18B20]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B20",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B20,
+ },
+ [0x18B21]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B21",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B21,
+ },
+ [0x18B22]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B22",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B22,
+ },
+ [0x18B23]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B23",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B23,
+ },
+ [0x18B24]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B24",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B24,
+ },
+ [0x18B25]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B25",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B25,
+ },
+ [0x18B26]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B26",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B26,
+ },
+ [0x18B27]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B27",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B27,
+ },
+ [0x18B28]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B28",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B28,
+ },
+ [0x18B29]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B29",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B29,
+ },
+ [0x18B2A]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B2A",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B2A,
+ },
+ [0x18B2B]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B2B",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B2B,
+ },
+ [0x18B2C]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B2C",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B2C,
+ },
+ [0x18B2D]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B2D",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B2D,
+ },
+ [0x18B2E]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B2E",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B2E,
+ },
+ [0x18B2F]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B2F",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B2F,
+ },
+ [0x18B30]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B30",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B30,
+ },
+ [0x18B31]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B31",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B31,
+ },
+ [0x18B32]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B32",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B32,
+ },
+ [0x18B33]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B33",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B33,
+ },
+ [0x18B34]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B34",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B34,
+ },
+ [0x18B35]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B35",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B35,
+ },
+ [0x18B36]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B36",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B36,
+ },
+ [0x18B37]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B37",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B37,
+ },
+ [0x18B38]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B38",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B38,
+ },
+ [0x18B39]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B39",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B39,
+ },
+ [0x18B3A]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B3A",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B3A,
+ },
+ [0x18B3B]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B3B",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B3B,
+ },
+ [0x18B3C]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B3C",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B3C,
+ },
+ [0x18B3D]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B3D",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B3D,
+ },
+ [0x18B3E]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B3E",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B3E,
+ },
+ [0x18B3F]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B3F",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B3F,
+ },
+ [0x18B40]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B40",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B40,
+ },
+ [0x18B41]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B41",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B41,
+ },
+ [0x18B42]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B42",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B42,
+ },
+ [0x18B43]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B43",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B43,
+ },
+ [0x18B44]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B44",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B44,
+ },
+ [0x18B45]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B45",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B45,
+ },
+ [0x18B46]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B46",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B46,
+ },
+ [0x18B47]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B47",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B47,
+ },
+ [0x18B48]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B48",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B48,
+ },
+ [0x18B49]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B49",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B49,
+ },
+ [0x18B4A]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B4A",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B4A,
+ },
+ [0x18B4B]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B4B",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B4B,
+ },
+ [0x18B4C]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B4C",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B4C,
+ },
+ [0x18B4D]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B4D",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B4D,
+ },
+ [0x18B4E]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B4E",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B4E,
+ },
+ [0x18B4F]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B4F",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B4F,
+ },
+ [0x18B50]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B50",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B50,
+ },
+ [0x18B51]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B51",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B51,
+ },
+ [0x18B52]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B52",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B52,
+ },
+ [0x18B53]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B53",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B53,
+ },
+ [0x18B54]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B54",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B54,
+ },
+ [0x18B55]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B55",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B55,
+ },
+ [0x18B56]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B56",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B56,
+ },
+ [0x18B57]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B57",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B57,
+ },
+ [0x18B58]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B58",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B58,
+ },
+ [0x18B59]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B59",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B59,
+ },
+ [0x18B5A]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B5A",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B5A,
+ },
+ [0x18B5B]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B5B",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B5B,
+ },
+ [0x18B5C]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B5C",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B5C,
+ },
+ [0x18B5D]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B5D",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B5D,
+ },
+ [0x18B5E]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B5E",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B5E,
+ },
+ [0x18B5F]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B5F",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B5F,
+ },
+ [0x18B60]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B60",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B60,
+ },
+ [0x18B61]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B61",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B61,
+ },
+ [0x18B62]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B62",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B62,
+ },
+ [0x18B63]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B63",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B63,
+ },
+ [0x18B64]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B64",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B64,
+ },
+ [0x18B65]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B65",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B65,
+ },
+ [0x18B66]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B66",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B66,
+ },
+ [0x18B67]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B67",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B67,
+ },
+ [0x18B68]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B68",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B68,
+ },
+ [0x18B69]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B69",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B69,
+ },
+ [0x18B6A]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B6A",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B6A,
+ },
+ [0x18B6B]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B6B",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B6B,
+ },
+ [0x18B6C]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B6C",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B6C,
+ },
+ [0x18B6D]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B6D",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B6D,
+ },
+ [0x18B6E]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B6E",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B6E,
+ },
+ [0x18B6F]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B6F",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B6F,
+ },
+ [0x18B70]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B70",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B70,
+ },
+ [0x18B71]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B71",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B71,
+ },
+ [0x18B72]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B72",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B72,
+ },
+ [0x18B73]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B73",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B73,
+ },
+ [0x18B74]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B74",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B74,
+ },
+ [0x18B75]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B75",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B75,
+ },
+ [0x18B76]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B76",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B76,
+ },
+ [0x18B77]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B77",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B77,
+ },
+ [0x18B78]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B78",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B78,
+ },
+ [0x18B79]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B79",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B79,
+ },
+ [0x18B7A]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B7A",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B7A,
+ },
+ [0x18B7B]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B7B",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B7B,
+ },
+ [0x18B7C]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B7C",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B7C,
+ },
+ [0x18B7D]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B7D",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B7D,
+ },
+ [0x18B7E]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B7E",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B7E,
+ },
+ [0x18B7F]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B7F",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B7F,
+ },
+ [0x18B80]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B80",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B80,
+ },
+ [0x18B81]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B81",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B81,
+ },
+ [0x18B82]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B82",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B82,
+ },
+ [0x18B83]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B83",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B83,
+ },
+ [0x18B84]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B84",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B84,
+ },
+ [0x18B85]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B85",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B85,
+ },
+ [0x18B86]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B86",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B86,
+ },
+ [0x18B87]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B87",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B87,
+ },
+ [0x18B88]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B88",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B88,
+ },
+ [0x18B89]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B89",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B89,
+ },
+ [0x18B8A]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B8A",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B8A,
+ },
+ [0x18B8B]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B8B",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B8B,
+ },
+ [0x18B8C]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B8C",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B8C,
+ },
+ [0x18B8D]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B8D",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B8D,
+ },
+ [0x18B8E]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B8E",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B8E,
+ },
+ [0x18B8F]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B8F",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B8F,
+ },
+ [0x18B90]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B90",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B90,
+ },
+ [0x18B91]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B91",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B91,
+ },
+ [0x18B92]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B92",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B92,
+ },
+ [0x18B93]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B93",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B93,
+ },
+ [0x18B94]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B94",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B94,
+ },
+ [0x18B95]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B95",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B95,
+ },
+ [0x18B96]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B96",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B96,
+ },
+ [0x18B97]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B97",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B97,
+ },
+ [0x18B98]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B98",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B98,
+ },
+ [0x18B99]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B99",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B99,
+ },
+ [0x18B9A]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B9A",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B9A,
+ },
+ [0x18B9B]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B9B",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B9B,
+ },
+ [0x18B9C]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B9C",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B9C,
+ },
+ [0x18B9D]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B9D",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B9D,
+ },
+ [0x18B9E]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B9E",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B9E,
+ },
+ [0x18B9F]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18B9F",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18B9F,
+ },
+ [0x18BA0]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BA0",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BA0,
+ },
+ [0x18BA1]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BA1",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BA1,
+ },
+ [0x18BA2]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BA2",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BA2,
+ },
+ [0x18BA3]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BA3",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BA3,
+ },
+ [0x18BA4]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BA4",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BA4,
+ },
+ [0x18BA5]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BA5",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BA5,
+ },
+ [0x18BA6]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BA6",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BA6,
+ },
+ [0x18BA7]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BA7",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BA7,
+ },
+ [0x18BA8]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BA8",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BA8,
+ },
+ [0x18BA9]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BA9",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BA9,
+ },
+ [0x18BAA]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BAA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BAA,
+ },
+ [0x18BAB]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BAB",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BAB,
+ },
+ [0x18BAC]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BAC",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BAC,
+ },
+ [0x18BAD]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BAD",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BAD,
+ },
+ [0x18BAE]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BAE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BAE,
+ },
+ [0x18BAF]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BAF",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BAF,
+ },
+ [0x18BB0]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BB0",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BB0,
+ },
+ [0x18BB1]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BB1",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BB1,
+ },
+ [0x18BB2]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BB2",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BB2,
+ },
+ [0x18BB3]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BB3",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BB3,
+ },
+ [0x18BB4]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BB4",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BB4,
+ },
+ [0x18BB5]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BB5",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BB5,
+ },
+ [0x18BB6]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BB6",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BB6,
+ },
+ [0x18BB7]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BB7",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BB7,
+ },
+ [0x18BB8]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BB8",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BB8,
+ },
+ [0x18BB9]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BB9",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BB9,
+ },
+ [0x18BBA]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BBA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BBA,
+ },
+ [0x18BBB]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BBB",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BBB,
+ },
+ [0x18BBC]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BBC",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BBC,
+ },
+ [0x18BBD]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BBD",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BBD,
+ },
+ [0x18BBE]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BBE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BBE,
+ },
+ [0x18BBF]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BBF",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BBF,
+ },
+ [0x18BC0]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BC0",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BC0,
+ },
+ [0x18BC1]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BC1",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BC1,
+ },
+ [0x18BC2]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BC2",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BC2,
+ },
+ [0x18BC3]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BC3",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BC3,
+ },
+ [0x18BC4]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BC4",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BC4,
+ },
+ [0x18BC5]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BC5",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BC5,
+ },
+ [0x18BC6]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BC6",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BC6,
+ },
+ [0x18BC7]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BC7",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BC7,
+ },
+ [0x18BC8]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BC8",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BC8,
+ },
+ [0x18BC9]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BC9",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BC9,
+ },
+ [0x18BCA]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BCA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BCA,
+ },
+ [0x18BCB]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BCB",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BCB,
+ },
+ [0x18BCC]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BCC",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BCC,
+ },
+ [0x18BCD]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BCD",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BCD,
+ },
+ [0x18BCE]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BCE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BCE,
+ },
+ [0x18BCF]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BCF",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BCF,
+ },
+ [0x18BD0]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BD0",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BD0,
+ },
+ [0x18BD1]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BD1",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BD1,
+ },
+ [0x18BD2]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BD2",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BD2,
+ },
+ [0x18BD3]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BD3",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BD3,
+ },
+ [0x18BD4]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BD4",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BD4,
+ },
+ [0x18BD5]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BD5",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BD5,
+ },
+ [0x18BD6]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BD6",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BD6,
+ },
+ [0x18BD7]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BD7",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BD7,
+ },
+ [0x18BD8]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BD8",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BD8,
+ },
+ [0x18BD9]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BD9",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BD9,
+ },
+ [0x18BDA]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BDA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BDA,
+ },
+ [0x18BDB]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BDB",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BDB,
+ },
+ [0x18BDC]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BDC",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BDC,
+ },
+ [0x18BDD]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BDD",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BDD,
+ },
+ [0x18BDE]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BDE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BDE,
+ },
+ [0x18BDF]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BDF",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BDF,
+ },
+ [0x18BE0]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BE0",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BE0,
+ },
+ [0x18BE1]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BE1",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BE1,
+ },
+ [0x18BE2]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BE2",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BE2,
+ },
+ [0x18BE3]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BE3",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BE3,
+ },
+ [0x18BE4]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BE4",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BE4,
+ },
+ [0x18BE5]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BE5",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BE5,
+ },
+ [0x18BE6]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BE6",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BE6,
+ },
+ [0x18BE7]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BE7",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BE7,
+ },
+ [0x18BE8]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BE8",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BE8,
+ },
+ [0x18BE9]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BE9",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BE9,
+ },
+ [0x18BEA]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BEA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BEA,
+ },
+ [0x18BEB]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BEB",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BEB,
+ },
+ [0x18BEC]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BEC",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BEC,
+ },
+ [0x18BED]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BED",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BED,
+ },
+ [0x18BEE]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BEE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BEE,
+ },
+ [0x18BEF]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BEF",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BEF,
+ },
+ [0x18BF0]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BF0",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BF0,
+ },
+ [0x18BF1]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BF1",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BF1,
+ },
+ [0x18BF2]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BF2",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BF2,
+ },
+ [0x18BF3]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BF3",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BF3,
+ },
+ [0x18BF4]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BF4",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BF4,
+ },
+ [0x18BF5]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BF5",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BF5,
+ },
+ [0x18BF6]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BF6",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BF6,
+ },
+ [0x18BF7]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BF7",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BF7,
+ },
+ [0x18BF8]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BF8",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BF8,
+ },
+ [0x18BF9]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BF9",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BF9,
+ },
+ [0x18BFA]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BFA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BFA,
+ },
+ [0x18BFB]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BFB",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BFB,
+ },
+ [0x18BFC]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BFC",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BFC,
+ },
+ [0x18BFD]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BFD",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BFD,
+ },
+ [0x18BFE]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BFE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BFE,
+ },
+ [0x18BFF]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18BFF",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18BFF,
+ },
+ [0x18C00]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C00",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C00,
+ },
+ [0x18C01]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C01",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C01,
+ },
+ [0x18C02]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C02",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C02,
+ },
+ [0x18C03]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C03",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C03,
+ },
+ [0x18C04]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C04",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C04,
+ },
+ [0x18C05]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C05",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C05,
+ },
+ [0x18C06]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C06",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C06,
+ },
+ [0x18C07]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C07",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C07,
+ },
+ [0x18C08]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C08",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C08,
+ },
+ [0x18C09]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C09",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C09,
+ },
+ [0x18C0A]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C0A",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C0A,
+ },
+ [0x18C0B]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C0B",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C0B,
+ },
+ [0x18C0C]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C0C",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C0C,
+ },
+ [0x18C0D]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C0D",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C0D,
+ },
+ [0x18C0E]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C0E",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C0E,
+ },
+ [0x18C0F]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C0F",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C0F,
+ },
+ [0x18C10]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C10",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C10,
+ },
+ [0x18C11]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C11",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C11,
+ },
+ [0x18C12]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C12",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C12,
+ },
+ [0x18C13]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C13",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C13,
+ },
+ [0x18C14]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C14",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C14,
+ },
+ [0x18C15]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C15",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C15,
+ },
+ [0x18C16]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C16",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C16,
+ },
+ [0x18C17]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C17",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C17,
+ },
+ [0x18C18]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C18",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C18,
+ },
+ [0x18C19]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C19",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C19,
+ },
+ [0x18C1A]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C1A",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C1A,
+ },
+ [0x18C1B]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C1B",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C1B,
+ },
+ [0x18C1C]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C1C",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C1C,
+ },
+ [0x18C1D]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C1D",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C1D,
+ },
+ [0x18C1E]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C1E",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C1E,
+ },
+ [0x18C1F]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C1F",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C1F,
+ },
+ [0x18C20]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C20",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C20,
+ },
+ [0x18C21]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C21",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C21,
+ },
+ [0x18C22]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C22",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C22,
+ },
+ [0x18C23]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C23",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C23,
+ },
+ [0x18C24]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C24",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C24,
+ },
+ [0x18C25]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C25",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C25,
+ },
+ [0x18C26]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C26",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C26,
+ },
+ [0x18C27]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C27",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C27,
+ },
+ [0x18C28]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C28",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C28,
+ },
+ [0x18C29]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C29",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C29,
+ },
+ [0x18C2A]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C2A",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C2A,
+ },
+ [0x18C2B]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C2B",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C2B,
+ },
+ [0x18C2C]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C2C",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C2C,
+ },
+ [0x18C2D]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C2D",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C2D,
+ },
+ [0x18C2E]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C2E",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C2E,
+ },
+ [0x18C2F]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C2F",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C2F,
+ },
+ [0x18C30]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C30",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C30,
+ },
+ [0x18C31]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C31",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C31,
+ },
+ [0x18C32]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C32",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C32,
+ },
+ [0x18C33]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C33",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C33,
+ },
+ [0x18C34]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C34",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C34,
+ },
+ [0x18C35]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C35",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C35,
+ },
+ [0x18C36]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C36",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C36,
+ },
+ [0x18C37]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C37",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C37,
+ },
+ [0x18C38]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C38",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C38,
+ },
+ [0x18C39]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C39",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C39,
+ },
+ [0x18C3A]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C3A",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C3A,
+ },
+ [0x18C3B]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C3B",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C3B,
+ },
+ [0x18C3C]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C3C",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C3C,
+ },
+ [0x18C3D]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C3D",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C3D,
+ },
+ [0x18C3E]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C3E",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C3E,
+ },
+ [0x18C3F]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C3F",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C3F,
+ },
+ [0x18C40]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C40",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C40,
+ },
+ [0x18C41]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C41",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C41,
+ },
+ [0x18C42]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C42",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C42,
+ },
+ [0x18C43]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C43",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C43,
+ },
+ [0x18C44]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C44",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C44,
+ },
+ [0x18C45]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C45",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C45,
+ },
+ [0x18C46]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C46",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C46,
+ },
+ [0x18C47]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C47",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C47,
+ },
+ [0x18C48]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C48",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C48,
+ },
+ [0x18C49]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C49",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C49,
+ },
+ [0x18C4A]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C4A",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C4A,
+ },
+ [0x18C4B]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C4B",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C4B,
+ },
+ [0x18C4C]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C4C",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C4C,
+ },
+ [0x18C4D]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C4D",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C4D,
+ },
+ [0x18C4E]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C4E",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C4E,
+ },
+ [0x18C4F]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C4F",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C4F,
+ },
+ [0x18C50]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C50",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C50,
+ },
+ [0x18C51]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C51",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C51,
+ },
+ [0x18C52]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C52",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C52,
+ },
+ [0x18C53]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C53",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C53,
+ },
+ [0x18C54]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C54",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C54,
+ },
+ [0x18C55]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C55",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C55,
+ },
+ [0x18C56]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C56",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C56,
+ },
+ [0x18C57]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C57",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C57,
+ },
+ [0x18C58]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C58",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C58,
+ },
+ [0x18C59]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C59",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C59,
+ },
+ [0x18C5A]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C5A",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C5A,
+ },
+ [0x18C5B]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C5B",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C5B,
+ },
+ [0x18C5C]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C5C",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C5C,
+ },
+ [0x18C5D]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C5D",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C5D,
+ },
+ [0x18C5E]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C5E",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C5E,
+ },
+ [0x18C5F]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C5F",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C5F,
+ },
+ [0x18C60]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C60",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C60,
+ },
+ [0x18C61]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C61",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C61,
+ },
+ [0x18C62]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C62",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C62,
+ },
+ [0x18C63]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C63",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C63,
+ },
+ [0x18C64]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C64",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C64,
+ },
+ [0x18C65]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C65",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C65,
+ },
+ [0x18C66]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C66",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C66,
+ },
+ [0x18C67]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C67",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C67,
+ },
+ [0x18C68]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C68",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C68,
+ },
+ [0x18C69]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C69",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C69,
+ },
+ [0x18C6A]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C6A",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C6A,
+ },
+ [0x18C6B]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C6B",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C6B,
+ },
+ [0x18C6C]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C6C",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C6C,
+ },
+ [0x18C6D]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C6D",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C6D,
+ },
+ [0x18C6E]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C6E",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C6E,
+ },
+ [0x18C6F]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C6F",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C6F,
+ },
+ [0x18C70]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C70",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C70,
+ },
+ [0x18C71]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C71",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C71,
+ },
+ [0x18C72]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C72",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C72,
+ },
+ [0x18C73]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C73",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C73,
+ },
+ [0x18C74]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C74",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C74,
+ },
+ [0x18C75]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C75",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C75,
+ },
+ [0x18C76]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C76",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C76,
+ },
+ [0x18C77]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C77",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C77,
+ },
+ [0x18C78]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C78",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C78,
+ },
+ [0x18C79]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C79",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C79,
+ },
+ [0x18C7A]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C7A",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C7A,
+ },
+ [0x18C7B]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C7B",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C7B,
+ },
+ [0x18C7C]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C7C",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C7C,
+ },
+ [0x18C7D]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C7D",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C7D,
+ },
+ [0x18C7E]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C7E",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C7E,
+ },
+ [0x18C7F]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C7F",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C7F,
+ },
+ [0x18C80]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C80",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C80,
+ },
+ [0x18C81]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C81",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C81,
+ },
+ [0x18C82]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C82",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C82,
+ },
+ [0x18C83]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C83",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C83,
+ },
+ [0x18C84]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C84",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C84,
+ },
+ [0x18C85]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C85",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C85,
+ },
+ [0x18C86]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C86",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C86,
+ },
+ [0x18C87]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C87",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C87,
+ },
+ [0x18C88]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C88",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C88,
+ },
+ [0x18C89]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C89",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C89,
+ },
+ [0x18C8A]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C8A",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C8A,
+ },
+ [0x18C8B]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C8B",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C8B,
+ },
+ [0x18C8C]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C8C",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C8C,
+ },
+ [0x18C8D]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C8D",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C8D,
+ },
+ [0x18C8E]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C8E",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C8E,
+ },
+ [0x18C8F]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C8F",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C8F,
+ },
+ [0x18C90]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C90",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C90,
+ },
+ [0x18C91]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C91",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C91,
+ },
+ [0x18C92]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C92",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C92,
+ },
+ [0x18C93]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C93",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C93,
+ },
+ [0x18C94]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C94",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C94,
+ },
+ [0x18C95]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C95",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C95,
+ },
+ [0x18C96]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C96",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C96,
+ },
+ [0x18C97]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C97",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C97,
+ },
+ [0x18C98]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C98",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C98,
+ },
+ [0x18C99]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C99",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C99,
+ },
+ [0x18C9A]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C9A",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C9A,
+ },
+ [0x18C9B]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C9B",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C9B,
+ },
+ [0x18C9C]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C9C",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C9C,
+ },
+ [0x18C9D]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C9D",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C9D,
+ },
+ [0x18C9E]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C9E",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C9E,
+ },
+ [0x18C9F]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18C9F",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18C9F,
+ },
+ [0x18CA0]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CA0",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CA0,
+ },
+ [0x18CA1]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CA1",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CA1,
+ },
+ [0x18CA2]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CA2",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CA2,
+ },
+ [0x18CA3]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CA3",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CA3,
+ },
+ [0x18CA4]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CA4",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CA4,
+ },
+ [0x18CA5]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CA5",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CA5,
+ },
+ [0x18CA6]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CA6",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CA6,
+ },
+ [0x18CA7]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CA7",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CA7,
+ },
+ [0x18CA8]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CA8",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CA8,
+ },
+ [0x18CA9]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CA9",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CA9,
+ },
+ [0x18CAA]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CAA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CAA,
+ },
+ [0x18CAB]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CAB",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CAB,
+ },
+ [0x18CAC]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CAC",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CAC,
+ },
+ [0x18CAD]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CAD",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CAD,
+ },
+ [0x18CAE]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CAE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CAE,
+ },
+ [0x18CAF]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CAF",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CAF,
+ },
+ [0x18CB0]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CB0",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CB0,
+ },
+ [0x18CB1]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CB1",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CB1,
+ },
+ [0x18CB2]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CB2",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CB2,
+ },
+ [0x18CB3]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CB3",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CB3,
+ },
+ [0x18CB4]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CB4",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CB4,
+ },
+ [0x18CB5]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CB5",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CB5,
+ },
+ [0x18CB6]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CB6",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CB6,
+ },
+ [0x18CB7]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CB7",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CB7,
+ },
+ [0x18CB8]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CB8",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CB8,
+ },
+ [0x18CB9]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CB9",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CB9,
+ },
+ [0x18CBA]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CBA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CBA,
+ },
+ [0x18CBB]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CBB",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CBB,
+ },
+ [0x18CBC]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CBC",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CBC,
+ },
+ [0x18CBD]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CBD",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CBD,
+ },
+ [0x18CBE]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CBE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CBE,
+ },
+ [0x18CBF]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CBF",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CBF,
+ },
+ [0x18CC0]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CC0",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CC0,
+ },
+ [0x18CC1]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CC1",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CC1,
+ },
+ [0x18CC2]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CC2",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CC2,
+ },
+ [0x18CC3]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CC3",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CC3,
+ },
+ [0x18CC4]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CC4",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CC4,
+ },
+ [0x18CC5]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CC5",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CC5,
+ },
+ [0x18CC6]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CC6",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CC6,
+ },
+ [0x18CC7]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CC7",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CC7,
+ },
+ [0x18CC8]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CC8",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CC8,
+ },
+ [0x18CC9]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CC9",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CC9,
+ },
+ [0x18CCA]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CCA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CCA,
+ },
+ [0x18CCB]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CCB",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CCB,
+ },
+ [0x18CCC]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CCC",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CCC,
+ },
+ [0x18CCD]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CCD",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CCD,
+ },
+ [0x18CCE]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CCE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CCE,
+ },
+ [0x18CCF]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CCF",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CCF,
+ },
+ [0x18CD0]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CD0",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CD0,
+ },
+ [0x18CD1]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CD1",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CD1,
+ },
+ [0x18CD2]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CD2",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CD2,
+ },
+ [0x18CD3]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CD3",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CD3,
+ },
+ [0x18CD4]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CD4",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CD4,
+ },
+ [0x18CD5]={
+ category="lo",
+ cjkwd="w",
+ description="KHITAN SMALL SCRIPT CHARACTER-18CD5",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x18CD5,
+ },
[0x1B000]={
category="lo",
cjkwd="w",
@@ -236575,6 +242132,27 @@ characters.data={
linebreak="ai",
unicodeslot=0x1F10C,
},
+ [0x1F10D]={
+ category="so",
+ description="CIRCLED ZERO WITH SLASH",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1F10D,
+ },
+ [0x1F10E]={
+ category="so",
+ description="CIRCLED ANTICLOCKWISE ARROW",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1F10E,
+ },
+ [0x1F10F]={
+ category="so",
+ description="CIRCLED DOLLAR SIGN WITH OVERLAID BACKSLASH",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1F10F,
+ },
[0x1F110]={
category="so",
cjkwd="a",
@@ -237382,6 +242960,27 @@ characters.data={
specials={ "super", 0x4D, 0x52 },
unicodeslot=0x1F16C,
},
+ [0x1F16D]={
+ category="so",
+ description="CIRCLED CC",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1F16D,
+ },
+ [0x1F16E]={
+ category="so",
+ description="CIRCLED C WITH OVERLAID BACKSLASH",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1F16E,
+ },
+ [0x1F16F]={
+ category="so",
+ description="CIRCLED HUMAN FIGURE",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1F16F,
+ },
[0x1F170]={
category="so",
cjkwd="a",
@@ -237875,6 +243474,13 @@ characters.data={
linebreak="ai",
unicodeslot=0x1F1AC,
},
+ [0x1F1AD]={
+ category="so",
+ description="MASK WORK SYMBOL",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1F1AD,
+ },
[0x1F1E6]={
category="so",
description="REGIONAL INDICATOR SYMBOL LETTER A",
@@ -246328,6 +251934,22 @@ characters.data={
linebreak="id",
unicodeslot=0x1F6D5,
},
+ [0x1F6D6]={
+ category="so",
+ cjkwd="w",
+ description="HUT",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1F6D6,
+ },
+ [0x1F6D7]={
+ category="so",
+ cjkwd="w",
+ description="ELEVATOR",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1F6D7,
+ },
[0x1F6E0]={
category="so",
description="HAMMER AND WRENCH",
@@ -246514,6 +252136,22 @@ characters.data={
linebreak="id",
unicodeslot=0x1F6FA,
},
+ [0x1F6FB]={
+ category="so",
+ cjkwd="w",
+ description="PICKUP TRUCK",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1F6FB,
+ },
+ [0x1F6FC]={
+ category="so",
+ cjkwd="w",
+ description="ROLLER SKATE",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1F6FC,
+ },
[0x1F700]={
category="so",
description="ALCHEMICAL SYMBOL FOR QUINTESSENCE",
@@ -249082,6 +254720,20 @@ characters.data={
linebreak="al",
unicodeslot=0x1F8AD,
},
+ [0x1F8B0]={
+ category="so",
+ description="ARROW POINTING UPWARDS THEN NORTH WEST",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1F8B0,
+ },
+ [0x1F8B1]={
+ category="so",
+ description="ARROW POINTING RIGHTWARDS THEN CURVING SOUTH WEST",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1F8B1,
+ },
[0x1F900]={
category="so",
description="CIRCLED CROSS FORMEE WITH FOUR DOTS",
@@ -249166,6 +254818,14 @@ characters.data={
linebreak="al",
unicodeslot=0x1F90B,
},
+ [0x1F90C]={
+ category="so",
+ cjkwd="w",
+ description="PINCHED FINGERS",
+ direction="on",
+ linebreak="eb",
+ unicodeslot=0x1F90C,
+ },
[0x1F90D]={
category="so",
cjkwd="w",
@@ -249539,7 +255199,6 @@ characters.data={
},
[0x1F93B]={
category="so",
- cjkwd="w",
description="MODERN PENTATHLON",
direction="on",
linebreak="id",
@@ -249627,7 +255286,6 @@ characters.data={
},
[0x1F946]={
category="so",
- cjkwd="w",
description="RIFLE",
direction="on",
linebreak="id",
@@ -249981,6 +255639,14 @@ characters.data={
linebreak="id",
unicodeslot=0x1F971,
},
+ [0x1F972]={
+ category="so",
+ cjkwd="w",
+ description="SMILING FACE WITH TEAR",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1F972,
+ },
[0x1F973]={
category="so",
cjkwd="w",
@@ -250013,6 +255679,23 @@ characters.data={
linebreak="id",
unicodeslot=0x1F976,
},
+ [0x1F977]={
+ category="so",
+ cjkwd="w",
+ description="NINJA",
+ direction="on",
+ linebreak="eb",
+ unicodeslot=0x1F977,
+ },
+ [0x1F978]={
+ category="so",
+ cjkwd="w",
+ description="DISGUISED FACE",
+ direction="on",
+ linebreak="id",
+ synonyms={ "face with groucho glasses" },
+ unicodeslot=0x1F978,
+ },
[0x1F97A]={
category="so",
cjkwd="w",
@@ -250342,6 +256025,22 @@ characters.data={
linebreak="id",
unicodeslot=0x1F9A2,
},
+ [0x1F9A3]={
+ category="so",
+ cjkwd="w",
+ description="MAMMOTH",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1F9A3,
+ },
+ [0x1F9A4]={
+ category="so",
+ cjkwd="w",
+ description="DODO",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1F9A4,
+ },
[0x1F9A5]={
category="so",
cjkwd="w",
@@ -250390,6 +256089,30 @@ characters.data={
linebreak="id",
unicodeslot=0x1F9AA,
},
+ [0x1F9AB]={
+ category="so",
+ cjkwd="w",
+ description="BEAVER",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1F9AB,
+ },
+ [0x1F9AC]={
+ category="so",
+ cjkwd="w",
+ description="BISON",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1F9AC,
+ },
+ [0x1F9AD]={
+ category="so",
+ cjkwd="w",
+ description="SEAL",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1F9AD,
+ },
[0x1F9AE]={
category="so",
cjkwd="w",
@@ -250622,6 +256345,14 @@ characters.data={
linebreak="id",
unicodeslot=0x1F9CA,
},
+ [0x1F9CB]={
+ category="so",
+ cjkwd="w",
+ description="BUBBLE TEA",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1F9CB,
+ },
[0x1F9CD]={
category="so",
cjkwd="w",
@@ -251748,6 +257479,14 @@ characters.data={
linebreak="id",
unicodeslot=0x1FA73,
},
+ [0x1FA74]={
+ category="so",
+ cjkwd="w",
+ description="THONG SANDAL",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FA74,
+ },
[0x1FA78]={
category="so",
cjkwd="w",
@@ -251796,6 +257535,38 @@ characters.data={
linebreak="id",
unicodeslot=0x1FA82,
},
+ [0x1FA83]={
+ category="so",
+ cjkwd="w",
+ description="BOOMERANG",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FA83,
+ },
+ [0x1FA84]={
+ category="so",
+ cjkwd="w",
+ description="MAGIC WAND",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FA84,
+ },
+ [0x1FA85]={
+ category="so",
+ cjkwd="w",
+ description="PINATA",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FA85,
+ },
+ [0x1FA86]={
+ category="so",
+ cjkwd="w",
+ description="NESTING DOLLS",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FA86,
+ },
[0x1FA90]={
category="so",
cjkwd="w",
@@ -251844,6 +257615,1788 @@ characters.data={
linebreak="id",
unicodeslot=0x1FA95,
},
+ [0x1FA96]={
+ category="so",
+ cjkwd="w",
+ description="MILITARY HELMET",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FA96,
+ },
+ [0x1FA97]={
+ category="so",
+ cjkwd="w",
+ description="ACCORDION",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FA97,
+ },
+ [0x1FA98]={
+ category="so",
+ cjkwd="w",
+ description="LONG DRUM",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FA98,
+ },
+ [0x1FA99]={
+ category="so",
+ cjkwd="w",
+ description="COIN",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FA99,
+ },
+ [0x1FA9A]={
+ category="so",
+ cjkwd="w",
+ description="CARPENTRY SAW",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FA9A,
+ },
+ [0x1FA9B]={
+ category="so",
+ cjkwd="w",
+ description="SCREWDRIVER",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FA9B,
+ },
+ [0x1FA9C]={
+ category="so",
+ cjkwd="w",
+ description="LADDER",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FA9C,
+ },
+ [0x1FA9D]={
+ category="so",
+ cjkwd="w",
+ description="HOOK",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FA9D,
+ },
+ [0x1FA9E]={
+ category="so",
+ cjkwd="w",
+ description="MIRROR",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FA9E,
+ },
+ [0x1FA9F]={
+ category="so",
+ cjkwd="w",
+ description="WINDOW",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FA9F,
+ },
+ [0x1FAA0]={
+ category="so",
+ cjkwd="w",
+ description="PLUNGER",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAA0,
+ },
+ [0x1FAA1]={
+ category="so",
+ cjkwd="w",
+ description="SEWING NEEDLE",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAA1,
+ },
+ [0x1FAA2]={
+ category="so",
+ cjkwd="w",
+ description="KNOT",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAA2,
+ },
+ [0x1FAA3]={
+ category="so",
+ cjkwd="w",
+ description="BUCKET",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAA3,
+ },
+ [0x1FAA4]={
+ category="so",
+ cjkwd="w",
+ description="MOUSE TRAP",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAA4,
+ },
+ [0x1FAA5]={
+ category="so",
+ cjkwd="w",
+ description="TOOTHBRUSH",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAA5,
+ },
+ [0x1FAA6]={
+ category="so",
+ cjkwd="w",
+ description="HEADSTONE",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAA6,
+ },
+ [0x1FAA7]={
+ category="so",
+ cjkwd="w",
+ description="PLACARD",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAA7,
+ },
+ [0x1FAA8]={
+ category="so",
+ cjkwd="w",
+ description="ROCK",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAA8,
+ },
+ [0x1FAB0]={
+ category="so",
+ cjkwd="w",
+ description="FLY",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAB0,
+ },
+ [0x1FAB1]={
+ category="so",
+ cjkwd="w",
+ description="WORM",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAB1,
+ },
+ [0x1FAB2]={
+ category="so",
+ cjkwd="w",
+ description="BEETLE",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAB2,
+ },
+ [0x1FAB3]={
+ category="so",
+ cjkwd="w",
+ description="COCKROACH",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAB3,
+ },
+ [0x1FAB4]={
+ category="so",
+ cjkwd="w",
+ description="POTTED PLANT",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAB4,
+ },
+ [0x1FAB5]={
+ category="so",
+ cjkwd="w",
+ description="WOOD",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAB5,
+ },
+ [0x1FAB6]={
+ category="so",
+ cjkwd="w",
+ description="FEATHER",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAB6,
+ },
+ [0x1FAC0]={
+ category="so",
+ cjkwd="w",
+ description="ANATOMICAL HEART",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAC0,
+ },
+ [0x1FAC1]={
+ category="so",
+ cjkwd="w",
+ description="LUNGS",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAC1,
+ },
+ [0x1FAC2]={
+ category="so",
+ cjkwd="w",
+ description="PEOPLE HUGGING",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAC2,
+ },
+ [0x1FAD0]={
+ category="so",
+ cjkwd="w",
+ description="BLUEBERRIES",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAD0,
+ },
+ [0x1FAD1]={
+ category="so",
+ cjkwd="w",
+ description="BELL PEPPER",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAD1,
+ },
+ [0x1FAD2]={
+ category="so",
+ cjkwd="w",
+ description="OLIVE",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAD2,
+ },
+ [0x1FAD3]={
+ category="so",
+ cjkwd="w",
+ description="FLATBREAD",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAD3,
+ },
+ [0x1FAD4]={
+ category="so",
+ cjkwd="w",
+ description="TAMALE",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAD4,
+ },
+ [0x1FAD5]={
+ category="so",
+ cjkwd="w",
+ description="FONDUE",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAD5,
+ },
+ [0x1FAD6]={
+ category="so",
+ cjkwd="w",
+ description="TEAPOT",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAD6,
+ },
+ [0x1FB00]={
+ category="so",
+ description="BLOCK SEXTANT-1",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB00,
+ },
+ [0x1FB01]={
+ category="so",
+ description="BLOCK SEXTANT-2",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB01,
+ },
+ [0x1FB02]={
+ category="so",
+ description="BLOCK SEXTANT-12",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB02,
+ },
+ [0x1FB03]={
+ category="so",
+ description="BLOCK SEXTANT-3",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB03,
+ },
+ [0x1FB04]={
+ category="so",
+ description="BLOCK SEXTANT-13",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB04,
+ },
+ [0x1FB05]={
+ category="so",
+ description="BLOCK SEXTANT-23",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB05,
+ },
+ [0x1FB06]={
+ category="so",
+ description="BLOCK SEXTANT-123",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB06,
+ },
+ [0x1FB07]={
+ category="so",
+ description="BLOCK SEXTANT-4",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB07,
+ },
+ [0x1FB08]={
+ category="so",
+ description="BLOCK SEXTANT-14",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB08,
+ },
+ [0x1FB09]={
+ category="so",
+ description="BLOCK SEXTANT-24",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB09,
+ },
+ [0x1FB0A]={
+ category="so",
+ description="BLOCK SEXTANT-124",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB0A,
+ },
+ [0x1FB0B]={
+ category="so",
+ description="BLOCK SEXTANT-34",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB0B,
+ },
+ [0x1FB0C]={
+ category="so",
+ description="BLOCK SEXTANT-134",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB0C,
+ },
+ [0x1FB0D]={
+ category="so",
+ description="BLOCK SEXTANT-234",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB0D,
+ },
+ [0x1FB0E]={
+ category="so",
+ description="BLOCK SEXTANT-1234",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB0E,
+ },
+ [0x1FB0F]={
+ category="so",
+ description="BLOCK SEXTANT-5",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB0F,
+ },
+ [0x1FB10]={
+ category="so",
+ description="BLOCK SEXTANT-15",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB10,
+ },
+ [0x1FB11]={
+ category="so",
+ description="BLOCK SEXTANT-25",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB11,
+ },
+ [0x1FB12]={
+ category="so",
+ description="BLOCK SEXTANT-125",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB12,
+ },
+ [0x1FB13]={
+ category="so",
+ description="BLOCK SEXTANT-35",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB13,
+ },
+ [0x1FB14]={
+ category="so",
+ description="BLOCK SEXTANT-235",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB14,
+ },
+ [0x1FB15]={
+ category="so",
+ description="BLOCK SEXTANT-1235",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB15,
+ },
+ [0x1FB16]={
+ category="so",
+ description="BLOCK SEXTANT-45",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB16,
+ },
+ [0x1FB17]={
+ category="so",
+ description="BLOCK SEXTANT-145",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB17,
+ },
+ [0x1FB18]={
+ category="so",
+ description="BLOCK SEXTANT-245",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB18,
+ },
+ [0x1FB19]={
+ category="so",
+ description="BLOCK SEXTANT-1245",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB19,
+ },
+ [0x1FB1A]={
+ category="so",
+ description="BLOCK SEXTANT-345",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB1A,
+ },
+ [0x1FB1B]={
+ category="so",
+ description="BLOCK SEXTANT-1345",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB1B,
+ },
+ [0x1FB1C]={
+ category="so",
+ description="BLOCK SEXTANT-2345",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB1C,
+ },
+ [0x1FB1D]={
+ category="so",
+ description="BLOCK SEXTANT-12345",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB1D,
+ },
+ [0x1FB1E]={
+ category="so",
+ description="BLOCK SEXTANT-6",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB1E,
+ },
+ [0x1FB1F]={
+ category="so",
+ description="BLOCK SEXTANT-16",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB1F,
+ },
+ [0x1FB20]={
+ category="so",
+ description="BLOCK SEXTANT-26",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB20,
+ },
+ [0x1FB21]={
+ category="so",
+ description="BLOCK SEXTANT-126",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB21,
+ },
+ [0x1FB22]={
+ category="so",
+ description="BLOCK SEXTANT-36",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB22,
+ },
+ [0x1FB23]={
+ category="so",
+ description="BLOCK SEXTANT-136",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB23,
+ },
+ [0x1FB24]={
+ category="so",
+ description="BLOCK SEXTANT-236",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB24,
+ },
+ [0x1FB25]={
+ category="so",
+ description="BLOCK SEXTANT-1236",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB25,
+ },
+ [0x1FB26]={
+ category="so",
+ description="BLOCK SEXTANT-46",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB26,
+ },
+ [0x1FB27]={
+ category="so",
+ description="BLOCK SEXTANT-146",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB27,
+ },
+ [0x1FB28]={
+ category="so",
+ description="BLOCK SEXTANT-1246",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB28,
+ },
+ [0x1FB29]={
+ category="so",
+ description="BLOCK SEXTANT-346",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB29,
+ },
+ [0x1FB2A]={
+ category="so",
+ description="BLOCK SEXTANT-1346",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB2A,
+ },
+ [0x1FB2B]={
+ category="so",
+ description="BLOCK SEXTANT-2346",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB2B,
+ },
+ [0x1FB2C]={
+ category="so",
+ description="BLOCK SEXTANT-12346",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB2C,
+ },
+ [0x1FB2D]={
+ category="so",
+ description="BLOCK SEXTANT-56",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB2D,
+ },
+ [0x1FB2E]={
+ category="so",
+ description="BLOCK SEXTANT-156",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB2E,
+ },
+ [0x1FB2F]={
+ category="so",
+ description="BLOCK SEXTANT-256",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB2F,
+ },
+ [0x1FB30]={
+ category="so",
+ description="BLOCK SEXTANT-1256",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB30,
+ },
+ [0x1FB31]={
+ category="so",
+ description="BLOCK SEXTANT-356",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB31,
+ },
+ [0x1FB32]={
+ category="so",
+ description="BLOCK SEXTANT-1356",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB32,
+ },
+ [0x1FB33]={
+ category="so",
+ description="BLOCK SEXTANT-2356",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB33,
+ },
+ [0x1FB34]={
+ category="so",
+ description="BLOCK SEXTANT-12356",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB34,
+ },
+ [0x1FB35]={
+ category="so",
+ description="BLOCK SEXTANT-456",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB35,
+ },
+ [0x1FB36]={
+ category="so",
+ description="BLOCK SEXTANT-1456",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB36,
+ },
+ [0x1FB37]={
+ category="so",
+ description="BLOCK SEXTANT-2456",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB37,
+ },
+ [0x1FB38]={
+ category="so",
+ description="BLOCK SEXTANT-12456",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB38,
+ },
+ [0x1FB39]={
+ category="so",
+ description="BLOCK SEXTANT-3456",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB39,
+ },
+ [0x1FB3A]={
+ category="so",
+ description="BLOCK SEXTANT-13456",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB3A,
+ },
+ [0x1FB3B]={
+ category="so",
+ description="BLOCK SEXTANT-23456",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB3B,
+ },
+ [0x1FB3C]={
+ category="so",
+ description="LOWER LEFT BLOCK DIAGONAL LOWER MIDDLE LEFT TO LOWER CENTRE",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB3C,
+ },
+ [0x1FB3D]={
+ category="so",
+ description="LOWER LEFT BLOCK DIAGONAL LOWER MIDDLE LEFT TO LOWER RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB3D,
+ },
+ [0x1FB3E]={
+ category="so",
+ description="LOWER LEFT BLOCK DIAGONAL UPPER MIDDLE LEFT TO LOWER CENTRE",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB3E,
+ },
+ [0x1FB3F]={
+ category="so",
+ description="LOWER LEFT BLOCK DIAGONAL UPPER MIDDLE LEFT TO LOWER RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB3F,
+ },
+ [0x1FB40]={
+ category="so",
+ description="LOWER LEFT BLOCK DIAGONAL UPPER LEFT TO LOWER CENTRE",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB40,
+ },
+ [0x1FB41]={
+ category="so",
+ description="LOWER RIGHT BLOCK DIAGONAL UPPER MIDDLE LEFT TO UPPER CENTRE",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB41,
+ },
+ [0x1FB42]={
+ category="so",
+ description="LOWER RIGHT BLOCK DIAGONAL UPPER MIDDLE LEFT TO UPPER RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB42,
+ },
+ [0x1FB43]={
+ category="so",
+ description="LOWER RIGHT BLOCK DIAGONAL LOWER MIDDLE LEFT TO UPPER CENTRE",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB43,
+ },
+ [0x1FB44]={
+ category="so",
+ description="LOWER RIGHT BLOCK DIAGONAL LOWER MIDDLE LEFT TO UPPER RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB44,
+ },
+ [0x1FB45]={
+ category="so",
+ description="LOWER RIGHT BLOCK DIAGONAL LOWER LEFT TO UPPER CENTRE",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB45,
+ },
+ [0x1FB46]={
+ category="so",
+ description="LOWER RIGHT BLOCK DIAGONAL LOWER MIDDLE LEFT TO UPPER MIDDLE RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB46,
+ },
+ [0x1FB47]={
+ category="so",
+ description="LOWER RIGHT BLOCK DIAGONAL LOWER CENTRE TO LOWER MIDDLE RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB47,
+ },
+ [0x1FB48]={
+ category="so",
+ description="LOWER RIGHT BLOCK DIAGONAL LOWER LEFT TO LOWER MIDDLE RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB48,
+ },
+ [0x1FB49]={
+ category="so",
+ description="LOWER RIGHT BLOCK DIAGONAL LOWER CENTRE TO UPPER MIDDLE RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB49,
+ },
+ [0x1FB4A]={
+ category="so",
+ description="LOWER RIGHT BLOCK DIAGONAL LOWER LEFT TO UPPER MIDDLE RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB4A,
+ },
+ [0x1FB4B]={
+ category="so",
+ description="LOWER RIGHT BLOCK DIAGONAL LOWER CENTRE TO UPPER RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB4B,
+ },
+ [0x1FB4C]={
+ category="so",
+ description="LOWER LEFT BLOCK DIAGONAL UPPER CENTRE TO UPPER MIDDLE RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB4C,
+ },
+ [0x1FB4D]={
+ category="so",
+ description="LOWER LEFT BLOCK DIAGONAL UPPER LEFT TO UPPER MIDDLE RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB4D,
+ },
+ [0x1FB4E]={
+ category="so",
+ description="LOWER LEFT BLOCK DIAGONAL UPPER CENTRE TO LOWER MIDDLE RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB4E,
+ },
+ [0x1FB4F]={
+ category="so",
+ description="LOWER LEFT BLOCK DIAGONAL UPPER LEFT TO LOWER MIDDLE RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB4F,
+ },
+ [0x1FB50]={
+ category="so",
+ description="LOWER LEFT BLOCK DIAGONAL UPPER CENTRE TO LOWER RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB50,
+ },
+ [0x1FB51]={
+ category="so",
+ description="LOWER LEFT BLOCK DIAGONAL UPPER MIDDLE LEFT TO LOWER MIDDLE RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB51,
+ },
+ [0x1FB52]={
+ category="so",
+ description="UPPER RIGHT BLOCK DIAGONAL LOWER MIDDLE LEFT TO LOWER CENTRE",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB52,
+ },
+ [0x1FB53]={
+ category="so",
+ description="UPPER RIGHT BLOCK DIAGONAL LOWER MIDDLE LEFT TO LOWER RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB53,
+ },
+ [0x1FB54]={
+ category="so",
+ description="UPPER RIGHT BLOCK DIAGONAL UPPER MIDDLE LEFT TO LOWER CENTRE",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB54,
+ },
+ [0x1FB55]={
+ category="so",
+ description="UPPER RIGHT BLOCK DIAGONAL UPPER MIDDLE LEFT TO LOWER RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB55,
+ },
+ [0x1FB56]={
+ category="so",
+ description="UPPER RIGHT BLOCK DIAGONAL UPPER LEFT TO LOWER CENTRE",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB56,
+ },
+ [0x1FB57]={
+ category="so",
+ description="UPPER LEFT BLOCK DIAGONAL UPPER MIDDLE LEFT TO UPPER CENTRE",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB57,
+ },
+ [0x1FB58]={
+ category="so",
+ description="UPPER LEFT BLOCK DIAGONAL UPPER MIDDLE LEFT TO UPPER RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB58,
+ },
+ [0x1FB59]={
+ category="so",
+ description="UPPER LEFT BLOCK DIAGONAL LOWER MIDDLE LEFT TO UPPER CENTRE",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB59,
+ },
+ [0x1FB5A]={
+ category="so",
+ description="UPPER LEFT BLOCK DIAGONAL LOWER MIDDLE LEFT TO UPPER RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB5A,
+ },
+ [0x1FB5B]={
+ category="so",
+ description="UPPER LEFT BLOCK DIAGONAL LOWER LEFT TO UPPER CENTRE",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB5B,
+ },
+ [0x1FB5C]={
+ category="so",
+ description="UPPER LEFT BLOCK DIAGONAL LOWER MIDDLE LEFT TO UPPER MIDDLE RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB5C,
+ },
+ [0x1FB5D]={
+ category="so",
+ description="UPPER LEFT BLOCK DIAGONAL LOWER CENTRE TO LOWER MIDDLE RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB5D,
+ },
+ [0x1FB5E]={
+ category="so",
+ description="UPPER LEFT BLOCK DIAGONAL LOWER LEFT TO LOWER MIDDLE RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB5E,
+ },
+ [0x1FB5F]={
+ category="so",
+ description="UPPER LEFT BLOCK DIAGONAL LOWER CENTRE TO UPPER MIDDLE RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB5F,
+ },
+ [0x1FB60]={
+ category="so",
+ description="UPPER LEFT BLOCK DIAGONAL LOWER LEFT TO UPPER MIDDLE RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB60,
+ },
+ [0x1FB61]={
+ category="so",
+ description="UPPER LEFT BLOCK DIAGONAL LOWER CENTRE TO UPPER RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB61,
+ },
+ [0x1FB62]={
+ category="so",
+ description="UPPER RIGHT BLOCK DIAGONAL UPPER CENTRE TO UPPER MIDDLE RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB62,
+ },
+ [0x1FB63]={
+ category="so",
+ description="UPPER RIGHT BLOCK DIAGONAL UPPER LEFT TO UPPER MIDDLE RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB63,
+ },
+ [0x1FB64]={
+ category="so",
+ description="UPPER RIGHT BLOCK DIAGONAL UPPER CENTRE TO LOWER MIDDLE RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB64,
+ },
+ [0x1FB65]={
+ category="so",
+ description="UPPER RIGHT BLOCK DIAGONAL UPPER LEFT TO LOWER MIDDLE RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB65,
+ },
+ [0x1FB66]={
+ category="so",
+ description="UPPER RIGHT BLOCK DIAGONAL UPPER CENTRE TO LOWER RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB66,
+ },
+ [0x1FB67]={
+ category="so",
+ description="UPPER RIGHT BLOCK DIAGONAL UPPER MIDDLE LEFT TO LOWER MIDDLE RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB67,
+ },
+ [0x1FB68]={
+ category="so",
+ description="UPPER AND RIGHT AND LOWER TRIANGULAR THREE QUARTERS BLOCK",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB68,
+ },
+ [0x1FB69]={
+ category="so",
+ description="LEFT AND LOWER AND RIGHT TRIANGULAR THREE QUARTERS BLOCK",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB69,
+ },
+ [0x1FB6A]={
+ category="so",
+ description="UPPER AND LEFT AND LOWER TRIANGULAR THREE QUARTERS BLOCK",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB6A,
+ },
+ [0x1FB6B]={
+ category="so",
+ description="LEFT AND UPPER AND RIGHT TRIANGULAR THREE QUARTERS BLOCK",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB6B,
+ },
+ [0x1FB6C]={
+ category="so",
+ description="LEFT TRIANGULAR ONE QUARTER BLOCK",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB6C,
+ },
+ [0x1FB6D]={
+ category="so",
+ description="UPPER TRIANGULAR ONE QUARTER BLOCK",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB6D,
+ },
+ [0x1FB6E]={
+ category="so",
+ description="RIGHT TRIANGULAR ONE QUARTER BLOCK",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB6E,
+ },
+ [0x1FB6F]={
+ category="so",
+ description="LOWER TRIANGULAR ONE QUARTER BLOCK",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB6F,
+ },
+ [0x1FB70]={
+ category="so",
+ description="VERTICAL ONE EIGHTH BLOCK-2",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB70,
+ },
+ [0x1FB71]={
+ category="so",
+ description="VERTICAL ONE EIGHTH BLOCK-3",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB71,
+ },
+ [0x1FB72]={
+ category="so",
+ description="VERTICAL ONE EIGHTH BLOCK-4",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB72,
+ },
+ [0x1FB73]={
+ category="so",
+ description="VERTICAL ONE EIGHTH BLOCK-5",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB73,
+ },
+ [0x1FB74]={
+ category="so",
+ description="VERTICAL ONE EIGHTH BLOCK-6",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB74,
+ },
+ [0x1FB75]={
+ category="so",
+ description="VERTICAL ONE EIGHTH BLOCK-7",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB75,
+ },
+ [0x1FB76]={
+ category="so",
+ description="HORIZONTAL ONE EIGHTH BLOCK-2",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB76,
+ },
+ [0x1FB77]={
+ category="so",
+ description="HORIZONTAL ONE EIGHTH BLOCK-3",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB77,
+ },
+ [0x1FB78]={
+ category="so",
+ description="HORIZONTAL ONE EIGHTH BLOCK-4",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB78,
+ },
+ [0x1FB79]={
+ category="so",
+ description="HORIZONTAL ONE EIGHTH BLOCK-5",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB79,
+ },
+ [0x1FB7A]={
+ category="so",
+ description="HORIZONTAL ONE EIGHTH BLOCK-6",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB7A,
+ },
+ [0x1FB7B]={
+ category="so",
+ description="HORIZONTAL ONE EIGHTH BLOCK-7",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB7B,
+ },
+ [0x1FB7C]={
+ category="so",
+ description="LEFT AND LOWER ONE EIGHTH BLOCK",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB7C,
+ },
+ [0x1FB7D]={
+ category="so",
+ description="LEFT AND UPPER ONE EIGHTH BLOCK",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB7D,
+ },
+ [0x1FB7E]={
+ category="so",
+ description="RIGHT AND UPPER ONE EIGHTH BLOCK",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB7E,
+ },
+ [0x1FB7F]={
+ category="so",
+ description="RIGHT AND LOWER ONE EIGHTH BLOCK",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB7F,
+ },
+ [0x1FB80]={
+ category="so",
+ description="UPPER AND LOWER ONE EIGHTH BLOCK",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB80,
+ },
+ [0x1FB81]={
+ category="so",
+ description="HORIZONTAL ONE EIGHTH BLOCK-1358",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB81,
+ },
+ [0x1FB82]={
+ category="so",
+ description="UPPER ONE QUARTER BLOCK",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB82,
+ },
+ [0x1FB83]={
+ category="so",
+ description="UPPER THREE EIGHTHS BLOCK",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB83,
+ },
+ [0x1FB84]={
+ category="so",
+ description="UPPER FIVE EIGHTHS BLOCK",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB84,
+ },
+ [0x1FB85]={
+ category="so",
+ description="UPPER THREE QUARTERS BLOCK",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB85,
+ },
+ [0x1FB86]={
+ category="so",
+ description="UPPER SEVEN EIGHTHS BLOCK",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB86,
+ },
+ [0x1FB87]={
+ category="so",
+ description="RIGHT ONE QUARTER BLOCK",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB87,
+ },
+ [0x1FB88]={
+ category="so",
+ description="RIGHT THREE EIGHTHS BLOCK",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB88,
+ },
+ [0x1FB89]={
+ category="so",
+ description="RIGHT FIVE EIGHTHS BLOCK",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB89,
+ },
+ [0x1FB8A]={
+ category="so",
+ description="RIGHT THREE QUARTERS BLOCK",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB8A,
+ },
+ [0x1FB8B]={
+ category="so",
+ description="RIGHT SEVEN EIGHTHS BLOCK",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB8B,
+ },
+ [0x1FB8C]={
+ category="so",
+ description="LEFT HALF MEDIUM SHADE",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB8C,
+ },
+ [0x1FB8D]={
+ category="so",
+ description="RIGHT HALF MEDIUM SHADE",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB8D,
+ },
+ [0x1FB8E]={
+ category="so",
+ description="UPPER HALF MEDIUM SHADE",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB8E,
+ },
+ [0x1FB8F]={
+ category="so",
+ description="LOWER HALF MEDIUM SHADE",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB8F,
+ },
+ [0x1FB90]={
+ category="so",
+ description="INVERSE MEDIUM SHADE",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB90,
+ },
+ [0x1FB91]={
+ category="so",
+ description="UPPER HALF BLOCK AND LOWER HALF INVERSE MEDIUM SHADE",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB91,
+ },
+ [0x1FB92]={
+ category="so",
+ description="UPPER HALF INVERSE MEDIUM SHADE AND LOWER HALF BLOCK",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB92,
+ },
+ [0x1FB94]={
+ category="so",
+ description="LEFT HALF INVERSE MEDIUM SHADE AND RIGHT HALF BLOCK",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB94,
+ },
+ [0x1FB95]={
+ category="so",
+ description="CHECKER BOARD FILL",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB95,
+ },
+ [0x1FB96]={
+ category="so",
+ description="INVERSE CHECKER BOARD FILL",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB96,
+ },
+ [0x1FB97]={
+ category="so",
+ description="HEAVY HORIZONTAL FILL",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB97,
+ },
+ [0x1FB98]={
+ category="so",
+ description="UPPER LEFT TO LOWER RIGHT FILL",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB98,
+ },
+ [0x1FB99]={
+ category="so",
+ description="UPPER RIGHT TO LOWER LEFT FILL",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB99,
+ },
+ [0x1FB9A]={
+ category="so",
+ description="UPPER AND LOWER TRIANGULAR HALF BLOCK",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB9A,
+ },
+ [0x1FB9B]={
+ category="so",
+ description="LEFT AND RIGHT TRIANGULAR HALF BLOCK",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB9B,
+ },
+ [0x1FB9C]={
+ category="so",
+ description="UPPER LEFT TRIANGULAR MEDIUM SHADE",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB9C,
+ },
+ [0x1FB9D]={
+ category="so",
+ description="UPPER RIGHT TRIANGULAR MEDIUM SHADE",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB9D,
+ },
+ [0x1FB9E]={
+ category="so",
+ description="LOWER RIGHT TRIANGULAR MEDIUM SHADE",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB9E,
+ },
+ [0x1FB9F]={
+ category="so",
+ description="LOWER LEFT TRIANGULAR MEDIUM SHADE",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FB9F,
+ },
+ [0x1FBA0]={
+ category="so",
+ description="BOX DRAWINGS LIGHT DIAGONAL UPPER CENTRE TO MIDDLE LEFT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBA0,
+ },
+ [0x1FBA1]={
+ category="so",
+ description="BOX DRAWINGS LIGHT DIAGONAL UPPER CENTRE TO MIDDLE RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBA1,
+ },
+ [0x1FBA2]={
+ category="so",
+ description="BOX DRAWINGS LIGHT DIAGONAL MIDDLE LEFT TO LOWER CENTRE",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBA2,
+ },
+ [0x1FBA3]={
+ category="so",
+ description="BOX DRAWINGS LIGHT DIAGONAL MIDDLE RIGHT TO LOWER CENTRE",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBA3,
+ },
+ [0x1FBA4]={
+ category="so",
+ description="BOX DRAWINGS LIGHT DIAGONAL UPPER CENTRE TO MIDDLE LEFT TO LOWER CENTRE",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBA4,
+ },
+ [0x1FBA5]={
+ category="so",
+ description="BOX DRAWINGS LIGHT DIAGONAL UPPER CENTRE TO MIDDLE RIGHT TO LOWER CENTRE",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBA5,
+ },
+ [0x1FBA6]={
+ category="so",
+ description="BOX DRAWINGS LIGHT DIAGONAL MIDDLE LEFT TO LOWER CENTRE TO MIDDLE RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBA6,
+ },
+ [0x1FBA7]={
+ category="so",
+ description="BOX DRAWINGS LIGHT DIAGONAL MIDDLE LEFT TO UPPER CENTRE TO MIDDLE RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBA7,
+ },
+ [0x1FBA8]={
+ category="so",
+ description="BOX DRAWINGS LIGHT DIAGONAL UPPER CENTRE TO MIDDLE LEFT AND MIDDLE RIGHT TO LOWER CENTRE",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBA8,
+ },
+ [0x1FBA9]={
+ category="so",
+ description="BOX DRAWINGS LIGHT DIAGONAL UPPER CENTRE TO MIDDLE RIGHT AND MIDDLE LEFT TO LOWER CENTRE",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBA9,
+ },
+ [0x1FBAA]={
+ category="so",
+ description="BOX DRAWINGS LIGHT DIAGONAL UPPER CENTRE TO MIDDLE RIGHT TO LOWER CENTRE TO MIDDLE LEFT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBAA,
+ },
+ [0x1FBAB]={
+ category="so",
+ description="BOX DRAWINGS LIGHT DIAGONAL UPPER CENTRE TO MIDDLE LEFT TO LOWER CENTRE TO MIDDLE RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBAB,
+ },
+ [0x1FBAC]={
+ category="so",
+ description="BOX DRAWINGS LIGHT DIAGONAL MIDDLE LEFT TO UPPER CENTRE TO MIDDLE RIGHT TO LOWER CENTRE",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBAC,
+ },
+ [0x1FBAD]={
+ category="so",
+ description="BOX DRAWINGS LIGHT DIAGONAL MIDDLE RIGHT TO UPPER CENTRE TO MIDDLE LEFT TO LOWER CENTRE",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBAD,
+ },
+ [0x1FBAE]={
+ category="so",
+ description="BOX DRAWINGS LIGHT DIAGONAL DIAMOND",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBAE,
+ },
+ [0x1FBAF]={
+ category="so",
+ description="BOX DRAWINGS LIGHT HORIZONTAL WITH VERTICAL STROKE",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBAF,
+ },
+ [0x1FBB0]={
+ category="so",
+ description="ARROWHEAD-SHAPED POINTER",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBB0,
+ },
+ [0x1FBB1]={
+ category="so",
+ description="INVERSE CHECK MARK",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBB1,
+ },
+ [0x1FBB2]={
+ category="so",
+ description="LEFT HALF RUNNING MAN",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBB2,
+ },
+ [0x1FBB3]={
+ category="so",
+ description="RIGHT HALF RUNNING MAN",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBB3,
+ },
+ [0x1FBB4]={
+ category="so",
+ description="INVERSE DOWNWARDS ARROW WITH TIP LEFTWARDS",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBB4,
+ },
+ [0x1FBB5]={
+ category="so",
+ description="LEFTWARDS ARROW AND UPPER AND LOWER ONE EIGHTH BLOCK",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBB5,
+ },
+ [0x1FBB6]={
+ category="so",
+ description="RIGHTWARDS ARROW AND UPPER AND LOWER ONE EIGHTH BLOCK",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBB6,
+ },
+ [0x1FBB7]={
+ category="so",
+ description="DOWNWARDS ARROW AND RIGHT ONE EIGHTH BLOCK",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBB7,
+ },
+ [0x1FBB8]={
+ category="so",
+ description="UPWARDS ARROW AND RIGHT ONE EIGHTH BLOCK",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBB8,
+ },
+ [0x1FBB9]={
+ category="so",
+ description="LEFT HALF FOLDER",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBB9,
+ },
+ [0x1FBBA]={
+ category="so",
+ description="RIGHT HALF FOLDER",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBBA,
+ },
+ [0x1FBBB]={
+ category="so",
+ description="VOIDED GREEK CROSS",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBBB,
+ },
+ [0x1FBBC]={
+ category="so",
+ description="RIGHT OPEN SQUARED DOT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBBC,
+ },
+ [0x1FBBD]={
+ category="so",
+ description="NEGATIVE DIAGONAL CROSS",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBBD,
+ },
+ [0x1FBBE]={
+ category="so",
+ description="NEGATIVE DIAGONAL MIDDLE RIGHT TO LOWER CENTRE",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBBE,
+ },
+ [0x1FBBF]={
+ category="so",
+ description="NEGATIVE DIAGONAL DIAMOND",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBBF,
+ },
+ [0x1FBC0]={
+ category="so",
+ description="WHITE HEAVY SALTIRE WITH ROUNDED CORNERS",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBC0,
+ },
+ [0x1FBC1]={
+ category="so",
+ description="LEFT THIRD WHITE RIGHT POINTING INDEX",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBC1,
+ },
+ [0x1FBC2]={
+ category="so",
+ description="MIDDLE THIRD WHITE RIGHT POINTING INDEX",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBC2,
+ },
+ [0x1FBC3]={
+ category="so",
+ description="RIGHT THIRD WHITE RIGHT POINTING INDEX",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBC3,
+ },
+ [0x1FBC4]={
+ category="so",
+ description="NEGATIVE SQUARED QUESTION MARK",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBC4,
+ },
+ [0x1FBC5]={
+ category="so",
+ description="STICK FIGURE",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBC5,
+ },
+ [0x1FBC6]={
+ category="so",
+ description="STICK FIGURE WITH ARMS RAISED",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBC6,
+ },
+ [0x1FBC7]={
+ category="so",
+ description="STICK FIGURE LEANING LEFT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBC7,
+ },
+ [0x1FBC8]={
+ category="so",
+ description="STICK FIGURE LEANING RIGHT",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBC8,
+ },
+ [0x1FBC9]={
+ category="so",
+ description="STICK FIGURE WITH DRESS",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBC9,
+ },
+ [0x1FBCA]={
+ category="so",
+ description="WHITE UP-POINTING CHEVRON",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1FBCA,
+ },
+ [0x1FBF0]={
+ category="nd",
+ description="SEGMENTED DIGIT ZERO",
+ direction="en",
+ linebreak="nu",
+ specials={ "font", 0x30 },
+ unicodeslot=0x1FBF0,
+ },
+ [0x1FBF1]={
+ category="nd",
+ description="SEGMENTED DIGIT ONE",
+ direction="en",
+ linebreak="nu",
+ specials={ "font", 0x31 },
+ unicodeslot=0x1FBF1,
+ },
+ [0x1FBF2]={
+ category="nd",
+ description="SEGMENTED DIGIT TWO",
+ direction="en",
+ linebreak="nu",
+ specials={ "font", 0x32 },
+ unicodeslot=0x1FBF2,
+ },
+ [0x1FBF3]={
+ category="nd",
+ description="SEGMENTED DIGIT THREE",
+ direction="en",
+ linebreak="nu",
+ specials={ "font", 0x33 },
+ unicodeslot=0x1FBF3,
+ },
+ [0x1FBF4]={
+ category="nd",
+ description="SEGMENTED DIGIT FOUR",
+ direction="en",
+ linebreak="nu",
+ specials={ "font", 0x34 },
+ unicodeslot=0x1FBF4,
+ },
+ [0x1FBF5]={
+ category="nd",
+ description="SEGMENTED DIGIT FIVE",
+ direction="en",
+ linebreak="nu",
+ specials={ "font", 0x35 },
+ unicodeslot=0x1FBF5,
+ },
+ [0x1FBF6]={
+ category="nd",
+ description="SEGMENTED DIGIT SIX",
+ direction="en",
+ linebreak="nu",
+ specials={ "font", 0x36 },
+ unicodeslot=0x1FBF6,
+ },
+ [0x1FBF7]={
+ category="nd",
+ description="SEGMENTED DIGIT SEVEN",
+ direction="en",
+ linebreak="nu",
+ specials={ "font", 0x37 },
+ unicodeslot=0x1FBF7,
+ },
+ [0x1FBF8]={
+ category="nd",
+ description="SEGMENTED DIGIT EIGHT",
+ direction="en",
+ linebreak="nu",
+ specials={ "font", 0x38 },
+ unicodeslot=0x1FBF8,
+ },
+ [0x1FBF9]={
+ category="nd",
+ description="SEGMENTED DIGIT NINE",
+ direction="en",
+ linebreak="nu",
+ specials={ "font", 0x39 },
+ unicodeslot=0x1FBF9,
+ },
[0x2F800]={
category="lo",
cjkwd="w",
diff --git a/Master/texmf-dist/tex/context/base/mkiv/char-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/char-ini.lua
index 1d202c8d42d..ac31dbfc60c 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/char-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/char-ini.lua
@@ -192,7 +192,6 @@ insert(characters.ranges,{
end,
})
-
local blocks = allocate {
["adlam"] = { first = 0x1E900, last = 0x1E95F, description = "Adlam" },
["aegeannumbers"] = { first = 0x10100, last = 0x1013F, description = "Aegean Numbers" },
@@ -236,6 +235,7 @@ local blocks = allocate {
["cherokee"] = { first = 0x013A0, last = 0x013FF, otf="cher", description = "Cherokee" },
["cherokeesupplement"] = { first = 0x0AB70, last = 0x0ABBF, description = "Cherokee Supplement" },
["chesssymbols"] = { first = 0x1FA00, last = 0x1FA6F, description = "Chess Symbols" },
+ ["chorasmian"] = { first = 0x10FB0, last = 0x10FDF, description = "Chorasmian" },
["cjkcompatibility"] = { first = 0x03300, last = 0x033FF, otf="hang", description = "CJK Compatibility" },
["cjkcompatibilityforms"] = { first = 0x0FE30, last = 0x0FE4F, otf="hang", description = "CJK Compatibility Forms" },
["cjkcompatibilityideographs"] = { first = 0x0F900, last = 0x0FAFF, otf="hang", description = "CJK Compatibility Ideographs" },
@@ -250,6 +250,7 @@ local blocks = allocate {
["cjkunifiedideographsextensiond"] = { first = 0x2B740, last = 0x2B81F, description = "CJK Unified Ideographs Extension D" },
["cjkunifiedideographsextensione"] = { first = 0x2B820, last = 0x2CEAF, description = "CJK Unified Ideographs Extension E" },
["cjkunifiedideographsextensionf"] = { first = 0x2CEB0, last = 0x2EBEF, description = "CJK Unified Ideographs Extension F" },
+ ["cjkunifiedideographsextensiong"] = { first = 0x30000, last = 0x3134F, description = "CJK Unified Ideographs Extension G" },
["combiningdiacriticalmarks"] = { first = 0x00300, last = 0x0036F, description = "Combining Diacritical Marks" },
["combiningdiacriticalmarksextended"] = { first = 0x01AB0, last = 0x01AFF, description = "Combining Diacritical Marks Extended" },
["combiningdiacriticalmarksforsymbols"] = { first = 0x020D0, last = 0x020FF, description = "Combining Diacritical Marks for Symbols" },
@@ -298,6 +299,7 @@ local blocks = allocate {
-- ["digitsthai"] = { first = 0x00E50, last = 0x00E59, math = true },
-- ["digitstibetan"] = { first = 0x00F20, last = 0x00F29, math = true },
["dingbats"] = { first = 0x02700, last = 0x027BF, description = "Dingbats" },
+ ["divesakuru"] = { first = 0x11900, last = 0x1195F, description = "Dives Akuru" },
["dogra"] = { first = 0x11800, last = 0x1184F, description = "Dogra" },
["dominotiles"] = { first = 0x1F030, last = 0x1F09F, description = "Domino Tiles" },
["duployan"] = { first = 0x1BC00, last = 0x1BC9F, description = "Duployan" },
@@ -361,6 +363,7 @@ local blocks = allocate {
["katakanaphoneticextensions"] = { first = 0x031F0, last = 0x031FF, otf="kana", description = "Katakana Phonetic Extensions" },
["kayahli"] = { first = 0x0A900, last = 0x0A92F, description = "Kayah Li" },
["kharoshthi"] = { first = 0x10A00, last = 0x10A5F, otf="khar", description = "Kharoshthi" },
+ ["khitansmallscript"] = { first = 0x18B00, last = 0x18CFF, description = "Khitan Small Script" },
["khmer"] = { first = 0x01780, last = 0x017FF, otf="khmr", description = "Khmer" },
["khmersymbols"] = { first = 0x019E0, last = 0x019FF, otf="khmr", description = "Khmer Symbols" },
["khojki"] = { first = 0x11200, last = 0x1124F, description = "Khojki" },
@@ -380,6 +383,7 @@ local blocks = allocate {
["linearbideograms"] = { first = 0x10080, last = 0x100FF, otf="linb", description = "Linear B Ideograms" },
["linearbsyllabary"] = { first = 0x10000, last = 0x1007F, otf="linb", description = "Linear B Syllabary" },
["lisu"] = { first = 0x0A4D0, last = 0x0A4FF, description = "Lisu" },
+ ["lisusupplement"] = { first = 0x11FB0, last = 0x11FBF, description = "Lisu Supplement" },
["lowercasebold"] = { first = 0x1D41A, last = 0x1D433, math = true },
["lowercaseboldfraktur"] = { first = 0x1D586, last = 0x1D59F, math = true },
["lowercasebolditalic"] = { first = 0x1D482, last = 0x1D49B, math = true },
@@ -504,6 +508,7 @@ local blocks = allocate {
["suttonsignwriting"] = { first = 0x1D800, last = 0x1DAAF, description = "Sutton SignWriting" },
["sylotinagri"] = { first = 0x0A800, last = 0x0A82F, otf="sylo", description = "Syloti Nagri" },
["symbolsandpictographsextendeda"] = { first = 0x1FA70, last = 0x1FAFF, description = "Symbols and Pictographs Extended-A" },
+ ["symbolsforlegacycomputing"] = { first = 0x1FB00, last = 0x1FBFF, description = "Symbols for Legacy Computing" },
["syriac"] = { first = 0x00700, last = 0x0074F, otf="syrc", description = "Syriac" },
["syriacsupplement"] = { first = 0x00860, last = 0x0086F, description = "Syriac Supplement" },
["tagalog"] = { first = 0x01700, last = 0x0171F, otf="tglg", description = "Tagalog" },
@@ -517,6 +522,7 @@ local blocks = allocate {
["tamil"] = { first = 0x00B80, last = 0x00BFF, otf="taml", description = "Tamil" },
["tamilsupplement"] = { first = 0x11FC0, last = 0x11FFF, description = "Tamil Supplement" },
["tangut"] = { first = 0x17000, last = 0x187FF, description = "Tangut" },
+ ["tangutsupplement"] = { first = 0x18D00, last = 0x18D8F, description = "Tangut Supplement" },
["tangutcomponents"] = { first = 0x18800, last = 0x18AFF, description = "Tangut Components" },
["telugu"] = { first = 0x00C00, last = 0x00C7F, otf="telu", description = "Telugu" },
["thaana"] = { first = 0x00780, last = 0x007BF, otf="thaa", description = "Thaana" },
@@ -555,6 +561,7 @@ local blocks = allocate {
["verticalforms"] = { first = 0x0FE10, last = 0x0FE1F, description = "Vertical Forms" },
["wancho"] = { first = 0x1E2C0, last = 0x1E2FF, description = "Wancho" },
["warangciti"] = { first = 0x118A0, last = 0x118FF, description = "Warang Citi" },
+ ["yezidi"] = { first = 0x10E80, last = 0x10EBF, description = "Yezidi" },
["yijinghexagramsymbols"] = { first = 0x04DC0, last = 0x04DFF, otf="yi", description = "Yijing Hexagram Symbols" },
["yiradicals"] = { first = 0x0A490, last = 0x0A4CF, otf="yi", description = "Yi Radicals" },
["yisyllables"] = { first = 0x0A000, last = 0x0A48F, otf="yi", description = "Yi Syllables" },
@@ -755,11 +762,11 @@ local is_spacing = allocate ( tohash {
} )
local is_mark = allocate ( tohash {
- "mn", "ms",
+ "mn", "ms", -- "mn", "mc",
} )
local is_punctuation = allocate ( tohash {
- "pc","pd","ps","pe","pi","pf","po",
+ "pc", "pd", "ps", "pe", "pi", "pf", "po",
} )
local is_symbol = allocate ( tohash {
diff --git a/Master/texmf-dist/tex/context/base/mkiv/char-ini.mkiv b/Master/texmf-dist/tex/context/base/mkiv/char-ini.mkiv
index 5979b86854d..aa3d31ba831 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/char-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/char-ini.mkiv
@@ -125,6 +125,8 @@
\clf_setactivecatcodes\notcatcodes
\clf_setactivecatcodes\prtcatcodes
+\clf_setcharacternames\ctxcatcodes
+
\def\chardescription#1{\clf_chardescription#1\relax}
% experiment (watch out: this is global and very font dependent when used with
diff --git a/Master/texmf-dist/tex/context/base/mkiv/char-tex.lua b/Master/texmf-dist/tex/context/base/mkiv/char-tex.lua
index b361a9a0776..7f544b14784 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/char-tex.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/char-tex.lua
@@ -573,88 +573,68 @@ if not csletters then
local traditional = sfstate == "traditional"
for u, chr in next, data do -- will move up
- local fallback = chr.fallback
- if fallback then
- contextsprint("{\\catcode",u,"=13\\unexpanded\\gdef ",utfchar(u),"{\\checkedchar{",u,"}{",fallback,"}}}")
- activated[#activated+1] = u
- else
- local contextname = chr.contextname
- local category = chr.category
- local isletter = is_letter[category]
- if contextname then
- if is_character[category] then
- if chr.unicodeslot < 128 then
- if isletter then
- local c = utfchar(u)
- texsetmacro(contextname,c)
- csletters[c] = u
- else
- texsetchar(contextname,u)
- end
- else
- local c = utfchar(u)
- texsetmacro(contextname,c)
- if isletter and u >= 32 and u <= 65536 then
- csletters[c] = u
- end
- end
- --
+ local contextname = chr.contextname
+ local category = chr.category
+ local isletter = is_letter[category]
+ if contextname then
+ if is_character[category] then
+ if chr.unicodeslot < 128 then
if isletter then
- local lc = chr.lccode
- local uc = chr.uccode
- if not lc then
- chr.lccode = u
- lc = u
- elseif type(lc) == "table" then
- lc = u
- end
- if not uc then
- chr.uccode = u
- uc = u
- elseif type(uc) == "table" then
- uc = u
- end
- texsetlccode(u,lc,uc)
- if traditional and category == "lu" then
- texsetsfcode(code,999)
- end
+ local c = utfchar(u)
+ csletters[c] = u
end
- --
- elseif is_command[category] and not forbidden[u] then
- -- contextsprint("{\\catcode",u,"=13\\unexpanded\\gdef ",utfchar(u),"{\\",contextname,"}}")
- -- activated[#activated+1] = u
+ else
local c = utfchar(u)
- texsetmacro(contextname,c)
- elseif is_mark[category] then
- texsetlccode(u,u,u) -- for hyphenation
- end
- -- elseif isletter and u >= 32 and u <= 65536 then
- elseif isletter then
- csletters[utfchar(u)] = u
- --
- local lc, uc = chr.lccode, chr.uccode
- if not lc then
- chr.lccode = u
- lc = u
- elseif type(lc) == "table" then
- lc = u
- end
- if not uc then
- chr.uccode = u
- uc = u
- elseif type(uc) == "table" then
- uc = u
+ if isletter and u >= 32 and u <= 65536 then
+ csletters[c] = u
+ end
end
- texsetlccode(u,lc,uc)
- if traditional and category == "lu" then
- texsetsfcode(code,999)
+ if isletter then
+ local lc = chr.lccode
+ local uc = chr.uccode
+ if not lc then
+ chr.lccode = u
+ lc = u
+ elseif type(lc) == "table" then
+ lc = u
+ end
+ if not uc then
+ chr.uccode = u
+ uc = u
+ elseif type(uc) == "table" then
+ uc = u
+ end
+ texsetlccode(u,lc,uc)
+ if traditional and category == "lu" then
+ texsetsfcode(code,999)
+ end
end
- --
+ elseif is_command[category] and not forbidden[u] then
+ -- skip
elseif is_mark[category] then
- --
texsetlccode(u,u,u) -- for hyphenation
- --
end
+ elseif isletter then
+ csletters[utfchar(u)] = u
+ local lc, uc = chr.lccode, chr.uccode
+ if not lc then
+ chr.lccode = u
+ lc = u
+ elseif type(lc) == "table" then
+ lc = u
+ end
+ if not uc then
+ chr.uccode = u
+ uc = u
+ elseif type(uc) == "table" then
+ uc = u
+ end
+ texsetlccode(u,lc,uc)
+ if traditional and category == "lu" then
+ texsetsfcode(code,999)
+ end
+ elseif is_mark[category] then
+ texsetlccode(u,u,u) -- for hyphenation
end
end
@@ -690,6 +670,29 @@ if not csletters then
storage.register("characters/csletters", csletters, "characters.csletters")
end
+ function characters.setcharacternames(ctt)
+ for u, chr in next, data do -- will move up
+ local contextname = chr.contextname
+ local category = chr.category
+ local isletter = is_letter[category]
+ if contextname then
+ if is_character[category] then
+ if chr.unicodeslot < 128 then
+ if isletter then
+ texsetmacro(contextname,utfchar(u),"immutable")
+ else
+ texsetchar(contextname,u,"immutable")
+ end
+ else
+ texsetmacro(contextname,utfchar(u),"immutable")
+ end
+ elseif is_command[category] and not forbidden[u] then
+ texsetmacro(contextname,utfchar(u),"immutable")
+ end
+ end
+ end
+ end
+
else
mark(csletters)
end
@@ -826,9 +829,13 @@ end
-- entities.gt = utfchar(characters.activeoffset + utfbyte(">"))
-- end
-implement { name = "setlettercatcodes", scope = "private", actions = characters.setlettercatcodes, arguments = "integer" }
-implement { name = "setactivecatcodes", scope = "private", actions = characters.setactivecatcodes, arguments = "integer" }
---------- { name = "setcharactercodes", scope = "private", actions = characters.setcodes }
+if characters.setcharacternames then -- only in ini mode
+
+ implement { name = "setlettercatcodes", scope = "private", actions = characters.setlettercatcodes, arguments = "integer" }
+ implement { name = "setactivecatcodes", scope = "private", actions = characters.setactivecatcodes, arguments = "integer" }
+ implement { name = "setcharacternames", scope = "private", actions = characters.setcharacternames, arguments = "integer" }
+
+end
-- experiment (some can move to char-ini.lua)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/char-utf.lua b/Master/texmf-dist/tex/context/base/mkiv/char-utf.lua
index fb47b5208ce..7d8ca219b63 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/char-utf.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/char-utf.lua
@@ -86,33 +86,40 @@ characters.decomposed = decomposed
local graphemes = characters.graphemes
local collapsed = characters.collapsed
+local combined = characters.combined
local mathlists = characters.mathlists
if graphemes then
mark(graphemes)
mark(collapsed)
+ mark(combined)
mark(mathlists)
else
graphemes = allocate()
collapsed = allocate()
+ combined = allocate()
mathlists = allocate()
characters.graphemes = graphemes
characters.collapsed = collapsed
+ characters.combined = combined
characters.mathlists = mathlists
local function backtrack(v,last,target)
local vs = v.specials
- if vs and #vs == 3 and vs[1] == "char" then
- local one = vs[2]
- local two = vs[3]
- local first = utfchar(one)
- local second = utfchar(two) .. last
- collapsed[first..second] = target
- backtrack(data[one],second,target)
+ if vs and #vs == 3 then
+ local kind = vs[1]
+ if kind == "char" or kind == "with" then
+ local one = vs[2]
+ local two = vs[3]
+ local first = utfchar(one)
+ local second = utfchar(two) .. last
+ collapsed[first..second] = target
+ backtrack(data[one],second,target)
+ end
end
end
@@ -141,28 +148,39 @@ else
if vs then
local kind = vs[1]
local size = #vs
- if kind == "char" and size == 3 then -- what if more than 3
- --
- local one = vs[2]
- local two = vs[3]
- local first = utfchar(one)
- local second = utfchar(two)
- local combination = utfchar(unicode)
- --
- collapsed[first..second] = combination
- backtrack(data[one],second,combination)
- -- sort of obsolete:
- local cgf = graphemes[first]
- if not cgf then
- cgf = { [second] = combination }
- graphemes[first] = cgf
- else
- cgf[second] = combination
+ if kind == "char" then
+ if size == 3 then
+ local one = vs[2]
+ local two = vs[3]
+ local first = utfchar(one)
+ local second = utfchar(two)
+ local combination = utfchar(unicode)
+ --
+ collapsed[first..second] = combination
+ backtrack(data[one],second,combination)
+ -- sort of obsolete:
+ local cgf = graphemes[first]
+ if not cgf then
+ cgf = { [second] = combination }
+ graphemes[first] = cgf
+ else
+ cgf[second] = combination
+ end
+ end
+ if size > 2 and (v.mathclass or v.mathspec) then
+ setlist(unicode,vs,2,"specials")
+ end
+ elseif kind == "with" then
+ if size == 3 then
+ combined[utfchar(vs[2])..utfchar(vs[3])] = utfchar(unicode)
+ end
+ elseif kind == "compat" then
+ if size == 3 then
+ combined[utfchar(vs[2])..utfchar(vs[3])] = utfchar(unicode)
+ end
+ if size > 2 and (v.mathclass or v.mathspec) then
+ setlist(unicode,vs,2,"specials")
end
- --
- end
- if (kind == "char" or kind == "compat") and (size > 2) and (v.mathclass or v.mathspec) then
- setlist(unicode,vs,2,"specials")
end
end
local ml = v.mathlist
@@ -182,6 +200,7 @@ else
if storage then
storage.register("characters/graphemes", graphemes, "characters.graphemes")
storage.register("characters/collapsed", collapsed, "characters.collapsed")
+ storage.register("characters/combined", combined, "characters.combined")
storage.register("characters/mathlists", mathlists, "characters.mathlists")
end
@@ -226,6 +245,25 @@ function utffilters.collapse(str,filename)
end
end
+local p_combine = nil -- only for tex
+
+local function prepare()
+ local tree = utfchartabletopattern(combined)
+ p_combine = Cs((tree/combined + p_utf8character)^0)
+end
+
+function utffilters.combine(str) -- not in files
+ -- we could merge collapse into combine ... maybe
+ if not p_combine then
+ prepare()
+ end
+ if not str or str == "" or #str == 1 then
+ return str
+ else
+ return lpegmatch(p_combine,str) or str
+ end
+end
+
local p_decompose = nil
local function prepare()
diff --git a/Master/texmf-dist/tex/context/base/mkiv/chem-str.mkiv b/Master/texmf-dist/tex/context/base/mkiv/chem-str.mkiv
index 71b104e4791..17c80472e5b 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/chem-str.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/chem-str.mkiv
@@ -449,7 +449,7 @@
\egroup}
\appendtoks
- \let|\chemicalbar % \SR{N|NH}
+ \let |\chemicalbar % \SR{N|NH}
\let \+\chemicaloxidationplus
\let \-\chemicaloxidationminus
\let \[\chemicalforeveropen
diff --git a/Master/texmf-dist/tex/context/base/mkiv/cldf-com.mkiv b/Master/texmf-dist/tex/context/base/mkiv/cldf-com.mkiv
index a1e4428724c..7a8f7bf5c0d 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/cldf-com.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/cldf-com.mkiv
@@ -14,6 +14,6 @@
\writestatus{loading}{ConTeXt Lua Documents / Functions}
\registerctxluafile{cldf-com}{}
-\registerctxluafile{cldf-ver}{}
+%registerctxluafile{cldf-ver}{}
\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/cldf-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/cldf-ini.lua
index e22de5a5b80..bb5a058a530 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/cldf-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/cldf-ini.lua
@@ -26,7 +26,7 @@ if not modules then modules = { } end modules ['cldf-ini'] = {
-- 0.651 local foo = getcount("ctxcatcodes")
-- 0.408 local foo = getcount(ctxcatcodes) -- local ctxcatcodes = tex.iscount("ctxcatcodes")
--- maybe:  (escape) or 0x2061 (apply function) or 0x2394 (software function ⎔)
+-- maybe:  (escape) or 0x2061 (apply function) or 0x2394 (software function ⎔) (old)
-- note : tex.print == line with endlinechar appended
-- todo : context("%bold{total: }%s",total)
-- todo : context.documentvariable("title")
@@ -58,6 +58,20 @@ if not modules then modules = { } end modules ['cldf-ini'] = {
-- time (for the better or worse). There have been no fundamental changes for many years
-- and performance has not changed much either.
+-- The code here has evolved over time, and was already present in the early versions of
+-- mkiv. However, it got adapted when feature were added to luatex, like the ability to
+-- "print" nodes and later tokens. We use to have control over the method used (if only
+-- for testing) but the older code has been removed now. The history is in the archives.
+-- These were the controls:
+
+-- local tokenflushmode = true
+-- local nodeflushmode = true
+-- local scannerdefmode = true
+-- local maxflushnodeindex = 0x10FFFF - 1
+
+-- In earlier experiments a function tables was referred to as lua.calls and the primitive
+-- \luafunctions was \luacall and we used our own implementation of a function table (more
+-- indirectness).
local format, stripstring = string.format, string.strip
local next, type, tostring, tonumber, unpack, select, rawset = next, type, tostring, tonumber, unpack, select, rawset
@@ -83,10 +97,6 @@ local tex = tex
local texsprint = tex.sprint -- just appended (no space,eol treatment)
local texprint = tex.print -- each arg a separate line (not last in directlua)
----- texwrite = tex.write -- all 'space' and 'character'
-local texgetcount = tex.getcount
-
--- local function texsprint(...) print("sprint",...) tex.sprint(...) end
--- local function texprint (...) print("print", ...) tex.print (...) end
local isnode = node.is_node
local writenode = node.write
@@ -99,6 +109,19 @@ local newtoken = token.new
local createtoken = token.create
local setluatoken = token.set_lua
+local isprintable = tex.isprintable or function(n)
+ return n and (type(n) == "string" or isnode(n) or istoken(n))
+end
+
+if tex.runlocal then
+ -- obselete names
+ tex.runtoks = tex.runlocal
+ tex.quittoks = tex.quitlocal
+else
+ tex.runlocal = tex.runtoks
+ tex.quitlocal = tex.quittoks
+end
+
local catcodenumbers = catcodes.numbers
local ctxcatcodes = catcodenumbers.ctxcatcodes
@@ -118,45 +141,35 @@ local report_cld = logs.reporter("cld","stack")
local processlines = true -- experiments.register("context.processlines", function(v) processlines = v end)
-local tokenflushmode = true
-local nodeflushmode = true
-local scannerdefmode = true
-local maxflushnodeindex = 0x10FFFF - 1
-
--- tokenflushmode = false
--- nodeflushmode = false
--- scannerdefmode = false
+local trialtypesetting = function() return false end
--- In earlier experiments a function tables was referred to as lua.calls and the
--- primitive \luafunctions was \luacall and we used our own implementation of
--- a function table (more indirectness).
-
-local trialtypesettingstate = createtoken("trialtypesettingstate").index
-
-function context.trialtypesetting()
- return texgetcount(trialtypesettingstate) ~= 0
+function context.settrialtypesettingmethod(f)
+ trialtypesetting = f
+ context.trialtypesetting = f
end
+context.trialtypesetting = function() return trialtypesetting() end -- can be aliased !
+
local knownfunctions = (lua.getfunctionstable or lua.get_functions_table)(true)
local showstackusage = false
trackers.register("context.stack",function(v) showstackusage = v end)
-local freed, nofused, noffreed = { }, 0, 0
+local freed = { }
+local nofused = 0
+local noffreed = 0
local usedstack = function()
return nofused, noffreed
end
local flushfunction = function(slot,arg)
- if arg() then
+ if arg() or trialtypesetting() then
-- keep
- elseif texgetcount(trialtypesettingstate) == 0 then
+ else
noffreed = noffreed + 1
freed[noffreed] = slot
knownfunctions[slot] = false
- else
- -- keep
end
end
@@ -176,13 +189,13 @@ local storefunction = function(arg)
end
local flushnode = function(slot,arg)
- if texgetcount(trialtypesettingstate) == 0 then
+ if trialtypesetting() then
+ writenode(copynodelist(arg))
+ else
writenode(arg)
noffreed = noffreed + 1
freed[noffreed] = slot
knownfunctions[slot] = false
- else
- writenode(copynodelist(arg))
end
end
@@ -208,11 +221,11 @@ local initex = environment.initex
storage.register("storage/storedfunctions", storedfunctions, "storage.storedfunctions")
local f_resolve = nil
-local p_resolve = ((1-lpegP("."))^1 / function(s) f_resolve = f_resolve[s] end * lpegP(".")^0)^1
+local p_resolve = ((1-lpegP("."))^1 / function(s) f_resolve = f_resolve[s] end * lpegP(".")^0)^1
local function resolvestoredfunction(str)
if type(str) == "string" then
- f_resolve = global
+ f_resolve = global -- namespace
lpegmatch(p_resolve,str)
return f_resolve
else
@@ -257,9 +270,11 @@ else
end
end
-local registerfunction = function(f,direct) -- either f=code or f=namespace,direct=name
- local slot, func
- if noffreed > 0 then
+local registerfunction = function(f,direct,slot) -- either f=code or f=namespace,direct=name
+ local func
+ if slot then
+ -- already used
+ elseif noffreed > 0 then
slot = freed[noffreed]
freed[noffreed] = nil
noffreed = noffreed - 1
@@ -269,12 +284,8 @@ local registerfunction = function(f,direct) -- either f=code or f=namespace,dire
end
if direct then
if initex then
- func = function(...)
- expose(slot,f,...)
- end
- if initex then
- storedfunctions[slot] = f
- end
+ func = function(...) expose(slot,f,...) end
+ storedfunctions[slot] = f
else
func = resolvestoredfunction(f)
end
@@ -357,73 +368,109 @@ do
end
--- so far
-
--- The next hack is a convenient way to define scanners at the Lua end and
--- get them available at the TeX end. There is some dirty magic needed to
--- prevent overload during format loading.
+-- The next hack is a convenient way to define scanners at the Lua end and get them
+-- available at the TeX end. There is some dirty magic needed to prevent overload
+-- during format loading. Nowadays we prefer to use the slightly less efficient way
+-- of defining interfaces using the implementer. There is a little more overhead in
+-- defining as well as runtime overhead, but we accept that.
-- interfaces.scanners.foo = function() context("[%s]",tokens.scanners.string()) end : \scan_foo
-interfaces.storedscanners = interfaces.storedscanners or { }
-local storedscanners = interfaces.storedscanners
+local storedscanners = interfaces.storedscanners or { }
+local namesofscanners = interfaces.namesofscanners or { }
+local interfacescanners = { }
+local privatenamespace = "clf_"
+
+interfaces.storedscanners = storedscanners
+interfaces.namesofscanners = namesofscanners
storage.register("interfaces/storedscanners", storedscanners, "interfaces.storedscanners")
-local interfacescanners = setmetatablenewindex(function(t,k,v)
- rawset(t,k,v)
- if storedscanners[k] then
- -- report_cld("warning: scanner %a is already set (mode 1a)",k)
- -- os.exit()
- -- \scan_<k> is already in the format
- -- report_cld("using interface scanner: %s",k)
- elseif scannerdefmode then
- -- report_cld("installing interface scanner: %s (mode 1b)",k)
- -- local n = registerfunction(interfaces.scanners[k],true)
- local n = registerfunction("interfaces.scanners."..k,true)
- storedscanners[k] = n
- local name = "clf_" .. k
- setluatoken(name,n,"global") -- todo : protected and "protected" or ""
- else
- -- report_cld("installing interface scanner: %s (mode 1c)",k)
- storedscanners[k] = true
- context("\\installctxscanner{clf_%s}{interfaces.scanners.%s}",k,k)
+-- local function registerscanner(name,action,protected,public,usage) -- todo: combine value and condition
+-- rawset(interfacescanners,name,action)
+-- local n = storedscanners[name]
+-- n = registerfunction("interfaces.scanners."..name,true,n)
+-- storedscanners[name] = n
+-- namesofscanners[n] = name
+-- name = public and name or (privatenamespace .. name)
+-- -- print(">>",name,protected and "protected" or "",usage or "macro")
+-- setluatoken(name,n,"global",protected and "protected" or "",usage or "macro")
+-- end
+
+-- todo: bitmap
+
+local registerscanner if CONTEXTLMTXMODE > 0 then
+
+ -- always permanent but we can consider to obey permanent==false
+
+ local function toflags(specification)
+ local protected = specification.protected and "protected" -- or ""
+ local usage = specification.usage
+ if usage == "value" then
+ return "global", "value", "permanent", protected
+ elseif usage == "condition" then
+ return "global", "conditional", "permanent", protected
+ elseif specification.frozen then
+ return "global", "frozen", protected
+ elseif specification.permanent == false or specification.onlyonce then -- for now onlyonce here
+ return "global", protected
+ else
+ return "global", "permanent", protected
+ end
end
- -- rawset(t,k,v)
-end)
-function interfaces.registerscanner(name,action,protected,public,call)
- rawset(interfacescanners,name,action)
- if storedscanners[name] then
- -- report_cld("warning: scanner %a is already set (mode 2a)",name)
- -- os.exit()
- -- \scan_<k> is already in the format
- -- report_cld("using interface scanner: %s",k)
- elseif scannerdefmode then
- -- report_cld("installing interface scanner: %s (mode 2b)",name)
- -- local n = registerfunction(action,true) -- todo
- local n = registerfunction("interfaces.scanners."..name,true)
+ registerscanner = function(name,action,specification)
+ rawset(interfacescanners,name,action)
+ local n = registerfunction("interfaces.scanners."..name,true,storedscanners[name])
storedscanners[name] = n
- local name = public and name or ("clf_" .. name)
- setluatoken(name,n,"global",protected and "protected" or "")
- else
- storedscanners[name] = true
- -- report_cld("installing interface scanner: %s (mode 2c)",name)
- context("\\install%sctxscanner{%s%s}{interfaces.scanners.%s}",
- protected and "protected" or "",
- public and "" or "clf_",
- name,
- name
- )
- end
- -- rawset(interfacescanners,name,action)
+ namesofscanners[n] = name
+ name = specification.public and name or (privatenamespace .. name)
+ setluatoken(name,n,toflags(specification))
+ end
+
+else
+
+ registerscanner = function(name,action,specification)
+ rawset(interfacescanners,name,action)
+ local n = storedscanners[name]
+ n = registerfunction("interfaces.scanners."..name,true,n)
+ storedscanners[name] = n
+ namesofscanners[n] = name
+ name = specification.public and name or (privatenamespace .. name)
+ setluatoken(name,n,"global",specification.protected and "protected" or "")
+ end
+
+end
+
+interfaces.registerscanner = registerscanner
+
+function interfaces.knownscanner(name)
+ return interfacescanners[name]
+end
+
+function interfaces.nameofscanner(slot)
+ return namesofscanners[slot] or slot
+end
+
+if CONTEXTLMTXMODE > 0 then
+
+ callback.register("show_lua_call", function(what, slot)
+ local name = namesofscanners[slot]
+ -- return name and formatters["%s: \\%s, slot: %i"](what,name,slot) or ""
+ return name and formatters["%s \\%s"](what,name) or ""
+ end)
+
end
+setmetatablenewindex(interfacescanners, function(t,k,v)
+ report_cld("don't register scanner %a directly",k)
+ -- registerscanner(k,v)
+end)
+
interfaces.scanners = storage.mark(interfacescanners)
-interfaces._ = interfaces.scanners
context.functions = {
- register = registerfunction,
+ register = function(qualifiedname) return registerfunction(qualifiedname) end, -- only one argument
unregister = unregisterfunction,
reserve = reservefunction,
known = knownfunctions,
@@ -448,7 +495,7 @@ function commands.ctxresetter(name) -- to be checked
return function()
if storedscanners[name] then
rawset(interfacescanners,name,dummy)
- context.resetctxscanner("clf_" .. name)
+ context.resetctxscanner(privatenamespace .. name)
end
end
end
@@ -540,25 +587,11 @@ local endstripper = beginstripper * lpegP(-1)
local justaspace = space * lpegCc("")
local justanewline = newline * lpegCc("")
-local function n_content(s)
- flush(contentcatcodes,s)
-end
-
-local function n_verbose(s)
- flush(vrbcatcodes,s)
-end
-
-local function n_endofline()
- flush(currentcatcodes," \r")
-end
-
-local function n_emptyline()
- flushdirect(currentcatcodes,"\r")
-end
-
-local function n_simpleline()
- flush(currentcatcodes," \r")
-end
+local function n_content (s) flush (contentcatcodes,s ) end
+local function n_verbose (s) flush (vrbcatcodes, s ) end
+local function n_endofline () flush (currentcatcodes," \r") end
+local function n_emptyline () flushdirect(currentcatcodes,"\r" ) end
+local function n_simpleline() flush (currentcatcodes," \r") end
local n_exception = ""
@@ -646,7 +679,7 @@ function context.newverbosehandler(specification) -- a special variant for e.g.
specification = specification or { }
--
local f_line = specification.line or function() flushdirect("\r") end
- local f_space = specification.space or function() flush(" ") end
+ local f_space = specification.space or function() flush (" ") end
local f_content = specification.content or n_verbose
local f_before = specification.before
local f_after = specification.after
@@ -700,20 +733,6 @@ function context.printlines(str,raw) -- todo: see if via file is useable
end
end
--- function context.printtable(t,separator) -- todo: see if via file is useable
--- if separator == nil or separator == true then
--- separator = "\r"
--- elseif separator == "" then
--- separator = false
--- end
--- for i=1,#t do
--- context(t[i]) -- we need to go through catcode handling
--- if separator then
--- context(separator)
--- end
--- end
--- end
-
function context.printtable(t,separator) -- todo: see if via file is useable
if separator == nil or separator == true then
separator = "\r"
@@ -730,24 +749,7 @@ end
local containseol = patterns.containseol
-local s_cldl_option_b = "[\\cldl"
-local s_cldl_option_f = "[\\cldl" -- add space (not needed)
-local s_cldl_option_e = "]"
-local s_cldl_option_s = "\\cldl"
------ s_cldl_option_d = "\\cldd"
-local s_cldl_option_d = s_cldl_option_s
-local s_cldl_argument_b = "{\\cldl"
-local s_cldl_argument_f = "{\\cldl "
-local s_cldl_argument_e = "}"
-
--- local s_cldl_option_b = "["
--- local s_cldl_option_f = "" -- add space (not needed)
--- local s_cldl_option_s = ""
--- local s_cldl_argument_b = "{"
--- local s_cldl_argument_f = "{ "
-
-local t_cldl_luafunction = newtoken("luafunctioncall",0)
-local lua_expandable_call_token_code = token.command_id and token.command_id("lua_expandable_call")
+local lua_call_code = tokens.commands.lua_expandable_call or tokens.commands.lua_call
local sortedhashindeed = false
@@ -756,17 +758,12 @@ directives.register("context.sorthash",function(v)
end)
local function writer(parent,command,...) -- already optimized before call
-
if type(command) == "string" then -- for now
flush(currentcatcodes,command) -- todo: ctx|prt|texcatcodes
else
flush(command) -- todo: ctx|prt|texcatcodes
end
-
local direct = false
- -- local t = { ... }
- -- for i=1,#t do
- -- local ti = t[i]
for i=1,select("#",...) do
local ti = select(i,...)
if direct then
@@ -849,15 +846,7 @@ local function writer(parent,command,...) -- already optimized before call
local tj = ti[1]
if type(tj) == "function" then
tj = storefunction(tj)
- if tokenflushmode then
- -- if newtoken then
- flush(currentcatcodes,"[",newtoken(tj,lua_expandable_call_token_code),"]")
- -- else
- -- flush(currentcatcodes,"[",t_cldl_luafunction,tj,"]")
- -- end
- else
- flush(currentcatcodes,s_cldl_option_b,tj,s_cldl_option_e)
- end
+ flush(currentcatcodes,"[",newtoken(tj,lua_call_code),"]")
else
flush(currentcatcodes,"[",tj,"]")
end
@@ -867,15 +856,7 @@ local function writer(parent,command,...) -- already optimized before call
local tj = ti[j]
if type(tj) == "function" then
tj = storefunction(tj)
- if tokenflushmode then
- -- if newtoken then
- flush(currentcatcodes,"[",newtoken(tj,lua_expandable_call_token_code),j == tn and "]" or ",")
- -- else
- -- flush(currentcatcodes,"[",t_cldl_luafunction,tj,j == tn and "]" or ",")
- -- end
- else
- flush(currentcatcodes,s_cldl_option_s,tj,j == tn and "]" or ",")
- end
+ flush(currentcatcodes,"[",newtoken(tj,lua_call_code),j == tn and "]" or ",")
else
if j == tn then
flush(currentcatcodes,tj,"]")
@@ -888,15 +869,7 @@ local function writer(parent,command,...) -- already optimized before call
elseif typ == "function" then
-- todo: ctx|prt|texcatcodes
ti = storefunction(ti)
- if tokenflushmode then
- -- if newtoken then
- flush(currentcatcodes,"{",newtoken(ti,lua_expandable_call_token_code),"}")
- -- else
- -- flush(currentcatcodes,"{",t_cldl_luafunction,ti,"}")
- -- end
- else
- flush(currentcatcodes,s_cldl_argument_f,ti,s_cldl_argument_e)
- end
+ flush(currentcatcodes,"{",newtoken(ti,lua_call_code),"}")
elseif typ == "boolean" then
if ti then
flushdirect(currentcatcodes,"\r")
@@ -905,123 +878,58 @@ local function writer(parent,command,...) -- already optimized before call
end
elseif typ == "thread" then
report_context("coroutines not supported as we cannot yield across boundaries")
- elseif isnode(ti) then -- slow | why {} here ?
- if nodeflushmode then
- local n = tonut(ti)
- if n <= maxflushnodeindex then
- flush(currentcatcodes,"{",ti,"}")
- else
- flush(currentcatcodes,s_cldl_argument_b,storenode(ti),s_cldl_argument_e)
- end
+ -- elseif isnode(ti) or istoken(ti) then
+ elseif isprintable(ti) then
+ flush(currentcatcodes,"{",ti,"}")
+ else
+ local s = tostring(ti)
+ if s then
+ flushdirect(currentcatcodes,s)
else
- flush(currentcatcodes,s_cldl_argument_b,storenode(ti),s_cldl_argument_e)
+ report_context("error: %a gets a weird argument %a",command,ti)
end
- else
- report_context("error: %a gets a weird argument %a",command,ti)
end
--- else
--- local n = isnode(ti)
--- if n then
--- if nodeflushmode and n <= maxflushnodeindex then
--- flush(ti)
--- else
--- flush(currentcatcodes,s_cldl_argument_b,storenode(ti),s_cldl_argument_e)
--- end
--- else
--- report_context("error: %a gets a weird argument %a",command,ti)
--- end
--- end
+ -- else
+ -- local n = isnode(ti)
+ -- if n then
+ -- flush(ti)
+ -- else
+ -- report_context("error: %a gets a weird argument %a",command,ti)
+ -- end
end
end
end
-local core
-
-if tokenflushmode then -- combine them
+local toks = tokens.cache
+context.tokenizedcs = toks
- local toks = tokens.cache
-
- context.tokenizedcs = toks
-
- core = setmetatableindex(function(parent,k)
- local t
- local f = function(first,...)
- if not t then
- t = toks[k]
- end
- if first == nil then
- flush(t)
- else
- return writer(context,t,first,...)
- end
+local core = setmetatableindex(function(parent,k)
+ local t
+ local f = function(first,...)
+ if not t then
+ t = toks[k]
end
- parent[k] = f
- return f
- end)
-
--- core = setmetatableindex(function(parent,k)
--- local t
--- local f = function(first,...)
--- if not t then
--- t = toks[k]
--- end
--- local f = function(first,...)
--- if first == nil then
--- flush(t)
--- else
--- return writer(context,t,first,...)
--- end
--- end
--- parent[k] = f
--- if first == nil then
--- flush(t)
--- else
--- return writer(context,t,first,...)
--- end
--- end
--- parent[k] = f
--- return f
--- end)
-
- core.cs = setmetatableindex(function(parent,k)
- local t
- local f = function()
- if not t then
- t = toks[k]
- end
+ if first == nil then
flush(t)
+ else
+ return writer(context,t,first,...)
end
- parent[k] = f
- return f
- end)
-
-else
-
- context.tokenizedcs = false
-
- core = setmetatableindex(function(parent,k)
- local c = "\\" .. k
- local f = function(first,...)
- if first == nil then
- flush(currentcatcodes,c)
- else
- return writer(context,c,first,...)
- end
- end
- parent[k] = f
- return f
- end)
+ end
+ parent[k] = f
+ return f
+end)
- core.cs = setmetatableindex(function(parent,k)
- local c = "\\" .. k -- tostring(k)
- local f = function()
- flush(currentcatcodes,c)
+core.cs = setmetatableindex(function(parent,k)
+ local t
+ local f = function()
+ if not t then
+ t = toks[k]
end
- parent[k] = f
- return f
- end)
-
-end
+ flush(t)
+ end
+ parent[k] = f
+ return f
+end)
local indexer = function(parent,k)
if type(k) == "string" then
@@ -1117,15 +1025,7 @@ local caller = function(parent,f,a,...)
elseif typ == "function" then
-- ignored: a ...
f = storefunction(f)
- if tokenflushmode then
- -- if newtoken then
- flush(currentcatcodes,"{",newtoken(f,lua_expandable_call_token_code),"}")
- -- else
- -- flush(currentcatcodes,"{",t_cldl_luafunction,f,"}")
- -- end
- else
- flush(currentcatcodes,s_cldl_argument_b,f,s_cldl_argument_e) -- todo: ctx|prt|texcatcodes
- end
+ flush(currentcatcodes,"{",newtoken(f,lua_call_code),"}")
elseif typ == "boolean" then
if f then
if a ~= nil then
@@ -1143,43 +1043,31 @@ local caller = function(parent,f,a,...)
end
elseif typ == "thread" then
report_context("coroutines not supported as we cannot yield across boundaries")
- elseif isnode(f) then -- slow
- if nodeflushmode then
- local n = tonut(f)
- if n <= maxflushnodeindex then
- flush(f)
- else
- flush(currentcatcodes,s_cldl_option_s,storenode(f)," ")
- end
+ -- elseif isnode(f) or istoken(f) then
+ elseif isprintable(f) then
+ flush(f)
+ else
+ local s = tostring(f)
+ if s then
+ flushdirect(currentcatcodes,s)
else
- flush(currentcatcodes,s_cldl_option_s,storenode(f)," ")
+ report_context("error: %a gets a weird argument %a","context",f)
end
- else
- report_context("error: %a gets a weird argument %a","context",f)
end
--- else
--- local n = isnode(f)
--- if n then
--- if nodeflushmode and n <= maxflushnodeindex then
--- flush(f)
--- else
--- flush(currentcatcodes,s_cldl_option_s,storenode(f)," ")
--- end
--- else
--- report_context("error: %a gets a weird argument %a","context",f)
--- end
--- end
+ -- else
+ -- local n = isnode(f)
+ -- if n then
+ -- flush(f)
+ -- else
+ -- report_context("error: %a gets a weird argument %a","context",f)
+ -- end
end
end
context.nodes = { -- todo
store = storenode,
flush = function(n)
- if nodeflushmode and tonut(n) <= maxflushnodeindex then
- flush(n)
- else
- flush(currentcatcodes,d and s_cldl_option_d or s_cldl_option_s,storenode(n)," ")
- end
+ flush(n)
end,
}
@@ -1188,11 +1076,7 @@ context.nuts = { -- todo
return storenode(tonut(n))
end,
flush = function(n,d)
- if nodeflushmode and n <= maxflushnodeindex then
- flush(tonode(n))
- else
- flush(currentcatcodes,d and s_cldl_option_d or s_cldl_option_s,storenode(tonode(n))," ")
- end
+ flush(tonode(n))
end,
}
@@ -1252,23 +1136,30 @@ statistics.register("traced context", function()
end
end)
+-- The cmd names were synchronized with the normal call cmd names.
+
+local luacalls = { -- luatex luametatex
+ lua_expandable_call = true, -- normal
+ lua_call = true, -- protected normal
+ lua_protected_call = true, -- protected
+}
+
local function userdata(argument)
if isnode(argument) then
return formatters["<< %s node %i>>"](nodes.nodecodes[argument.id],tonut(argument))
- end
- if istoken(argument) then
+ elseif istoken(argument) then
local csname = argument.csname
if csname then
-- return formatters["<<\\%s>>"](csname)
return formatters["\\%s"](csname)
end
- local cmdname = argument.cmdname
- if cmdname == "lua_expandable_call" or cmdname == "lua_call" then
+ if luacall[argument.cmdname] then
return "<<function>>" -- argument.mode
end
return "<<token>>"
+ else
+ return "<<userdata>>"
end
- return "<<userdata>>"
end
@@ -1630,22 +1521,7 @@ function context.newindexer(catcodes,cmdcodes)
contentcatcodes = savedcatcodes
end
- if tokenflushmode then
-
- handler.cs = core.cs
-
- else
-
- handler.cs = setmetatableindex(function(parent,k)
- local c = "\\" .. k -- tostring(k)
- local f = function()
- flush(cmdcodes,c)
- end
- parent[k] = f
- return f
- end)
-
- end
+ handler.cs = core.cs
setmetatableindex(handler,indexer)
setmetatablecall (handler,caller)
@@ -1665,23 +1541,6 @@ do
-- formatted.command([catcodes,]format[,...])
--- local function formattedflush(parent,c,catcodes,fmt,...)
--- if type(catcodes) == "number" then
--- if fmt then
--- local result
--- pushcatcodes(catcodes)
--- result = writer(parent,c,formatters[fmt](...))
--- popcatcodes()
--- return result
--- else
--- -- no need to change content catcodes
--- return writer(parent,c)
--- end
--- else
--- return writer(parent,c,formatters[catcodes](fmt,...))
--- end
--- end
-
local function formattedflush(parent,c,catcodes,fmt,...)
if not catcodes then
return writer(parent,c)
@@ -1698,51 +1557,26 @@ do
end
end
- local indexer
-
- if tokenflushmode then -- combine them
-
- local toks = tokens.cache
+ local toks = tokens.cache
- indexer = function(parent,k)
- if type(k) == "string" then
- local t
- local f = function(first,...)
- if not t then
- t = toks[k]
- end
- if first == nil then
- flush(t)
- else
- return formattedflush(parent,t,first,...)
- end
+ local indexer = function(parent,k)
+ if type(k) == "string" then
+ local t
+ local f = function(first,...)
+ if not t then
+ t = toks[k]
end
- parent[k] = f
- return f
- else
- return context -- catch
- end
- end
-
- else
-
- indexer = function(parent,k)
- if type(k) == "string" then
- local c = "\\" .. k
- local f = function(first,...)
- if first == nil then
- flush(currentcatcodes,c)
- else
- return formattedflush(parent,c,first,...)
- end
+ if first == nil then
+ flush(t)
+ else
+ return formattedflush(parent,t,first,...)
end
- parent[k] = f
- return f
- else
- return context -- catch
end
+ parent[k] = f
+ return f
+ else
+ return context -- catch
end
-
end
-- formatted([catcodes,]format[,...])
@@ -1947,3 +1781,25 @@ end
-- function context.template(template,variables)
-- context(replace(template,variables))
-- end
+
+do
+
+ -- not the best namespace -- some day maybe texs a la nodes and tokens .. also,
+ -- we already have tex.modes so we need a different name
+
+ local modelevels = tex.getmodevalues()
+ local t = table.keys(modelevels)
+ tex.modelevels = table.swapped(modelevels,modelevels) -- utilities.storage.allocate()
+
+ for i=1,#t do local k = t[i] modelevels[-k] = modelevels[k] end
+
+ if CONTEXTLMTXMODE > 0 then
+
+ -- also elsewhere
+
+ local flagcodes = tex.getflagvalues()
+ tex.flagcodes = table.swapped(flagcodes,flagcodes) -- utilities.storage.allocate()
+
+ end
+
+end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/cldf-ini.mkiv b/Master/texmf-dist/tex/context/base/mkiv/cldf-ini.mkiv
index 29fb15d6883..70c9c12e34c 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/cldf-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/cldf-ini.mkiv
@@ -1,8 +1,8 @@
%D \module
-%D [ file=cldf-ini,
-%D version=2010.10.19,,
-%D title=\CONTEXT\ \LUA\ Document Functions,
-%D subtitle=Initialization,
+%D [ file=cldf-int,
+%D version=2019.01.01,
+%D title=\CONTEXT\ Data Macros,
+%D subtitle=Integer,
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
@@ -15,10 +15,9 @@
\newcount\trialtypesettingstate % gets aliased at the Lua end
-\registerctxluafile{cldf-ini}{}
+\registerctxluafile{cldf-ini}{autosuffix}
-%D With each new update of \MKIV\ we can join Within Temptation in
-%D singing:
+%D With each new update of \MKIV\ we can join Within Temptation in singing:
%D
%D \startbuffer
%D \startluacode
@@ -50,11 +49,11 @@
% \catcodetable\ctxcatcodes \catcode`^=\superscriptcatcode\catcode1=\activecatcode \glet^^A=\cldf
% \catcodetable\ctxcatcodes \catcode`^=\superscriptcatcode\catcode2=\activecatcode \glet^^B=\cldn
-\normalprotected\def\cldprocessfile#1{\directlua{context.runfile("#1")}}
- \def\cldloadfile #1{\directlua{context.loadfile("#1")}}
- \def\cldloadviafile#1{\directlua{context.loadviafile("#1")}}
- \def\cldcontext #1{\directlua{context(#1)}}
- \def\cldcommand #1{\directlua{context.#1}}
- % \def\cldverbatim #1{\directlua{context.verbatim.#1}} % maybe make verbatim global
+\protected\def\cldprocessfile#1{\directlua{context.runfile("#1")}}
+ \def\cldloadfile #1{\directlua{context.loadfile("#1")}}
+ \def\cldloadviafile#1{\directlua{context.loadviafile("#1")}}
+ \def\cldcontext #1{\directlua{context(#1)}}
+ \def\cldcommand #1{\directlua{context.#1}}
+ % \def\cldverbatim #1{\directlua{context.verbatim.#1}} % maybe make verbatim global
\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/cldf-int.lua b/Master/texmf-dist/tex/context/base/mkiv/cldf-int.lua
index 86420f422b1..39a4eb335ef 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/cldf-int.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/cldf-int.lua
@@ -1,330 +1,173 @@
if not modules then modules = { } end modules ['cldf-int'] = {
version = 1.001,
- comment = "companion to mult-clm.mkiv",
+ comment = "companion to cldf-int.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
}
--- another experiment
--- needs upgrading
--- needs checking
--- todo: multilingual
+-- another experiment, won't change etc ... mkiv stuff .. used?
-local format, byte = string.format, string.byte
local insert, remove, concat = table.insert, table.remove, table.concat
local unpack, type = unpack or table.unpack, type
-local catcodenumbers = catcodes.numbers
-
-local ctxcatcodes = catcodenumbers.ctxcatcodes
-local vrbcatcodes = catcodenumbers.vrbcatcodes
-
+local ctxcatcodes = catcodes.numbers.ctxcatcodes
local context = context
local contextsprint = context.sprint
local trace_define = false trackers.register("context.define", function(v) trace_define = v end)
interfaces = interfaces or { }
-local implement = interfaces.implement
local estart = interfaces.elements.start
local estop = interfaces.elements.stop
-if CONTEXTLMTXMODE > 0 then
+_clmh_ = utilities.parsers.settings_to_hash
+_clma_ = utilities.parsers.settings_to_array
+_clmn_ = tonumber
- local scanners = tokens.scanners
- local shortcuts = tokens.shortcuts
+local starters, stoppers, macros, stack = { }, { }, { }, { }
- local scanpeek = scanners.peek
- local scankey = scanners.key
- local scanvalue = scanners.value
- local scanskip = scanners.skip
+local checkers = {
+ [0] = "",
+ "\\dosingleempty",
+ "\\dodoubleempty",
+ "\\dotripleempty",
+ "\\doquadrupleempty",
+ "\\doquintupleempty",
+ "\\dosixtupleempty",
+}
- local open = byte('[')
- local close = byte(']')
- local equal = byte('=')
- local comma = byte(',')
+function _clmm_(name,...)
+ macros[name](...)
+end
- function scanhash(scanners)
- if scanpeek() == open then
- local data = { }
- scanskip()
- while true do
- local c = scanpeek()
- if c == comma then
- scanskip()
- elseif c == close then
- scanskip()
- break
- else
- local key = scankey(equal)
- if key then
- if scanpeek() == equal then
- scanskip()
- if scanners then
- local scanner = scanners[key]
- if scanner then
- data[key] = scanner()
- else
- data[key] = scanvalue(comma,close) or ""
- end
- else
- data[key] = scanvalue(comma,close) or ""
- end
- else
- break
- end
- else
- break
- end
- end
- end
- return data
- end
- end
+function _clmb_(name,...)
+ local sn = stack[name]
+ insert(sn,{...})
+ starters[name](...)
+end
- function scanarray()
- if scanpeek() == open then
- local data = { }
- local d = 0
- scanskip()
- while true do
- local c = scanpeek()
- if c == comma then
- scanskip()
- elseif c == close then
- scanskip()
- break
- else
- local v = scanvalue(comma,close) or ""
- d = d + 1
- data[d] = v
- end
- end
- return data
- end
+function _clme_(name)
+ local sn = stack[name]
+ local sv = remove(sn)
+ if sv then
+ stoppers[name](unpack(sv))
+ else
+ -- nesting error
end
+end
- shortcuts.scanhash = scanhash
- shortcuts.scanarray = scanarray
-
- scanners.hash = scanhash
- scanners.array = scanarray
+-- this is a bit old definition ... needs to be modernized
- local function remap(arguments)
- -- backward compatibility
- if type(arguments) == "table" then
- for i=1,#arguments do
- local a = arguments[i]
- if type(a) == "table" then
- local t = a[2]
- arguments[i] = t == "list" and "array" or t
- end
- end
- return arguments
- end
+function interfaces.definecommand(name,specification) -- name is optional
+ if type(name) == "table" then
+ specification = name
+ name = specification.name
end
-
- function interfaces.definecommand(name,specification) -- name is optional
- if type(name) == "table" then
- specification = name
- name = specification.name
- end
- if name and specification then
- local environment = specification.environment
- local arguments = remap(specification.arguments)
+ 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
- local starter = specification.starter
- local stopper = specification.stopper
- if starter and stopper then
- implement {
- name = estart .. name,
- arguments = arguments,
- public = true,
- protected = true,
- actions = starter,
- }
- implement {
- name = estop .. name,
- public = true,
- protected = true,
- actions = stopper,
- }
- else
- -- message
- end
+ contextsprint(ctxcatcodes,"\\setuvalue{",estart,name,"}{\\ctxlua{_clmb_('",name,"')}}")
+ contextsprint(ctxcatcodes,"\\setuvalue{",estop, name,"}{\\ctxlua{_clme_('",name,"')}}")
end
if not environment or environment == "both" then
- local macro = specification.macro
- if macro then
- implement {
- name = name,
- arguments = arguments,
- public = true,
- protected = true,
- actions = macro,
- }
- else
- -- message
- end
+ contextsprint(ctxcatcodes,"\\setuvalue{", name,"}{\\ctxlua{_clmm_('",name,"')}}")
end
else
- -- message
- end
- end
-
-
-else
-
- _clmh_ = utilities.parsers.settings_to_hash
- _clma_ = utilities.parsers.settings_to_array
-
- local starters, stoppers, macros, stack = { }, { }, { }, { }
-
- local checkers = {
- [0] = "",
- "\\dosingleempty",
- "\\dodoubleempty",
- "\\dotripleempty",
- "\\doquadrupleempty",
- "\\doquintupleempty",
- "\\dosixtupleempty",
- }
-
- function _clmm_(name,...)
- macros[name](...)
- end
-
- function _clmb_(name,...)
- local sn = stack[name]
- insert(sn,{...})
- starters[name](...)
- end
-
- function _clme_(name)
- local sn = stack[name]
- local sv = remove(sn)
- if sv then
- stoppers[name](unpack(sv))
- else
- -- nesting error
- end
- end
-
- _clmn_ = tonumber
-
- local estart = interfaces.elements.start
- local estop = interfaces.elements.stop
-
- -- this is a bit old definition ... needs to be modernized
-
- function interfaces.definecommand(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
- contextsprint(ctxcatcodes,"\\setuvalue{",estart,name,"}{\\ctxlua{_clmb_('",name,"')}}")
- contextsprint(ctxcatcodes,"\\setuvalue{",estop, name,"}{\\ctxlua{_clme_('",name,"')}}")
- end
- if not environment or environment == "both" then
- contextsprint(ctxcatcodes,"\\setuvalue{", name,"}{\\ctxlua{_clmm_('",name,"')}}")
- end
- else
- -- we could flush immediate but tracing is bad then
- stack[name] = { }
- local opt = 0
- local done = false
- local snippets = { } -- we can reuse it
- local mkivdo = "\\mkivdo" .. name -- maybe clddo
- snippets[#snippets+1] = "\\def"
- snippets[#snippets+1] = mkivdo
- for i=1,na do
- local a = arguments[i]
- local variant = a[1]
- if variant == "option" then
- snippets[#snippets+1] = "[#"
- snippets[#snippets+1] = i
- snippets[#snippets+1] = "]"
- if not done then
- opt = opt + 1
- end
- else
- done = true -- no more optional checking after this
- snippets[#snippets+1] = "#"
- snippets[#snippets+1] = i
+ -- we could flush immediate but tracing is bad then
+ stack[name] = { }
+ local opt = 0
+ local done = false
+ local snippets = { } -- we can reuse it
+ local mkivdo = "\\mkivdo" .. name -- maybe clddo
+ snippets[#snippets+1] = "\\def"
+ snippets[#snippets+1] = mkivdo
+ for i=1,na do
+ local a = arguments[i]
+ local variant = a[1]
+ if variant == "option" then
+ snippets[#snippets+1] = "[#"
+ snippets[#snippets+1] = i
+ snippets[#snippets+1] = "]"
+ if not done then
+ opt = opt + 1
end
- end
- if environment then
- snippets[#snippets+1] = "{\\ctxlua{_clmb_('"
- snippets[#snippets+1] = name
- snippets[#snippets+1] = "'"
else
- snippets[#snippets+1] = "{\\ctxlua{_clmm_('"
- snippets[#snippets+1] = name
- snippets[#snippets+1] = "'"
- end
- for i=1,na do
- local a = arguments[i]
- local variant = a[2]
- if variant == "list" then
- snippets[#snippets+1] = ",_clma_([==[#"
- snippets[#snippets+1] = i
- snippets[#snippets+1] = "]==])"
- elseif variant == "hash" then
- snippets[#snippets+1] = ",_clmh_([==[#"
- snippets[#snippets+1] = i
- snippets[#snippets+1] = "]==])"
- elseif variant == "number" then
- snippets[#snippets+1] = ",_clmn_([==[#"
- snippets[#snippets+1] = i
- snippets[#snippets+1] = "]==])"
- else
- snippets[#snippets+1] = ",[==[#"
- snippets[#snippets+1] = i
- snippets[#snippets+1] = "]==]"
- end
- end
- snippets[#snippets+1] = ")}}"
- contextsprint(ctxcatcodes,unpack(snippets))
- if environment then
- -- needs checking
- contextsprint(ctxcatcodes,"\\setuvalue{",estart,name,"}{",checkers[opt],mkivdo,"}")
- contextsprint(ctxcatcodes,"\\setuvalue{",estop, name,"}{\\ctxlua{_clme_('",name,"')}}")
- end
- if not environment or environment == "both" then
- contextsprint(ctxcatcodes,"\\setuvalue{", name,"}{",checkers[opt],mkivdo,"}")
+ done = true -- no more optional checking after this
+ snippets[#snippets+1] = "#"
+ snippets[#snippets+1] = i
end
end
if environment then
- starters[name] = specification.starter
- stoppers[name] = specification.stopper
+ snippets[#snippets+1] = "{\\ctxlua{_clmb_('"
+ snippets[#snippets+1] = name
+ snippets[#snippets+1] = "'"
else
- macros[name] = specification.macro
+ snippets[#snippets+1] = "{\\ctxlua{_clmm_('"
+ snippets[#snippets+1] = name
+ snippets[#snippets+1] = "'"
+ end
+ for i=1,na do
+ local a = arguments[i]
+ local variant = a[2]
+ if variant == "list" then
+ snippets[#snippets+1] = ",_clma_([==[#"
+ snippets[#snippets+1] = i
+ snippets[#snippets+1] = "]==])"
+ elseif variant == "hash" then
+ snippets[#snippets+1] = ",_clmh_([==[#"
+ snippets[#snippets+1] = i
+ snippets[#snippets+1] = "]==])"
+ elseif variant == "number" then
+ snippets[#snippets+1] = ",_clmn_([==[#"
+ snippets[#snippets+1] = i
+ snippets[#snippets+1] = "]==])"
+ else
+ snippets[#snippets+1] = ",[==[#"
+ snippets[#snippets+1] = i
+ snippets[#snippets+1] = "]==]"
+ end
+ end
+ snippets[#snippets+1] = ")}}"
+ contextsprint(ctxcatcodes,unpack(snippets))
+ if environment then
+ -- needs checking
+ contextsprint(ctxcatcodes,"\\setuvalue{",estart,name,"}{",checkers[opt],mkivdo,"}")
+ contextsprint(ctxcatcodes,"\\setuvalue{",estop, name,"}{\\ctxlua{_clme_('",name,"')}}")
end
+ if not environment or environment == "both" then
+ contextsprint(ctxcatcodes,"\\setuvalue{", 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 interfaces.tolist(t)
- local r = { }
- for i=1,#t do
- r[i] = t[i]
- end
- local n = #r
- for k,v in table.sortedhash(t) do
- if type(k) ~= "number" then
- n = n + 1
- r[n] = k .. "=" .. v
+ if t then
+ local r = { }
+ for i=1,#t do
+ r[i] = t[i]
+ end
+ local n = #r
+ for k,v in table.sortedhash(t) do
+ if type(k) ~= "number" then
+ n = n + 1
+ r[n] = k .. "=" .. v
+ end
end
+ return concat(r,", ")
+ else
+ return ""
end
- return concat(r,", ")
end
-- \startluacode
@@ -358,9 +201,9 @@ end
-- context.startnarrower()
-- end
--
--- local function stopmore(opt_1)
+-- local function stopmore()
-- context.stopnarrower()
--- context("stop more, options: %s",interfaces.tolist(opt_1))
+-- context("stop more")
-- context.stopnarrower()
-- end
--
diff --git a/Master/texmf-dist/tex/context/base/mkiv/cldf-scn.lua b/Master/texmf-dist/tex/context/base/mkiv/cldf-scn.lua
index d0b16e034fa..84b2957ab0b 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/cldf-scn.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/cldf-scn.lua
@@ -8,32 +8,35 @@ if not modules then modules = { } end modules ['cldf-scn'] = {
local load, type, tostring = load, type, tostring
-local formatters = string.formatters
-local char = string.char
-local concat = table.concat
+local formatters = string.formatters
+local char = string.char
+local concat = table.concat
-local lpegmatch = lpeg.match
-local p_unquoted = lpeg.Cs(lpeg.patterns.unquoted)
+local lpegmatch = lpeg.match
+local p_unquoted = lpeg.Cs(lpeg.patterns.unquoted)
-local f_action_f = formatters["action%s(%s)"]
-local f_action_s = formatters["local action%s = action[%s]"]
-local f_command = formatters["local action = tokens._action\n%\nt\nreturn function(%s) return %s end"]
+local f_action_f = formatters["action%s(%s)"]
+local f_action_s = formatters["local action%s = action[%s]"]
+local f_command = formatters["local action = tokens._action\n%\nt\nreturn function(%s) return %s end"]
-local interfaces = interfaces
-local commands = commands
-local scanners = interfaces.scanners
-local register = interfaces.registerscanner
+local interfaces = interfaces
+local commands = commands
+local register = interfaces.registerscanner
+local knownscanner = interfaces.knownscanner
-local compile = tokens.compile or function() end
-local presets = tokens.presets
+local compile = tokens.compile or function() end
+local presets = tokens.presets
-local dummy = function() end
+local dummy = function() end
-local report = logs.reporter("interfaces","implementor")
+local report = logs.reporter("interfaces","implementor")
function interfaces.implement(specification)
+ local name = specification.name
+ if name == "" then
+ name = nil
+ end
local actions = specification.actions
- local name = specification.name
local arguments = specification.arguments
local private = specification.scope == "private"
local onlyonce = specification.onlyonce
@@ -45,9 +48,6 @@ function interfaces.implement(specification)
end
return
end
- if name == "" then
- name = nil
- end
local p = arguments and presets[arguments]
if p then
arguments = p
@@ -74,11 +74,11 @@ function interfaces.implement(specification)
if not name then
return scanner
end
- if scanners[name] and not specification.overload then
- report("warning: 'scanners.%s' is redefined",name)
+ if knownscanner(name) and not specification.overload then
+ report("warning: interface scanner %a is overloaded",name)
end
- -- scanners[name] = scanner -- we now use:
- register(name,scanner,specification.protected,specification.public,specification.call)
+ -- register(name,scanner,specification.protected,specification.public,specification.usage)
+ register(name,scanner,specification)
if private then
return
end
@@ -161,12 +161,3 @@ interfaces.defined = tokens.defined
interfaces.setmacro = tokens.setters.macro
interfaces.setcount = tokens.setters.count
interfaces.setdimen = tokens.setters.dimen
-
-interfaces.strings = table.setmetatableindex(function(t,k)
- local v = { }
- for i=1,k do
- v[i] = "string"
- end
- t[k] = v
- return v
-end)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/colo-ext.mkiv b/Master/texmf-dist/tex/context/base/mkiv/colo-ext.mkiv
index 98aaaa8aa04..90ee1174259 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/colo-ext.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/colo-ext.mkiv
@@ -47,7 +47,7 @@
\installcorenamespace{colorintent}
\unexpanded\def\registercolorintent#1#2% \relax is needed !
- {\setevalue{\??colorintent#1}{\attribute\colorintentattribute\clf_registercolorintent{#2}\relax}}
+ {\setevalue{\??colorintent#1}{\c_attr_colorintent\clf_registercolorintent{#2}\relax}}
\unexpanded\def\colo_intents_set
{\clf_enablecolorintents
@@ -59,7 +59,7 @@
\installattributestack\colorintentattribute
-\setevalue{\??colorintent\v!none}{\attribute\colorintentattribute\attributeunsetvalue} % or reset? used at all?
+\setevalue{\??colorintent\v!none}{\c_attr_colorintent\attributeunsetvalue} % or reset? used at all?
\unexpanded\def\startcolorintent[#1]%
{\pushattribute\colorintentattribute
diff --git a/Master/texmf-dist/tex/context/base/mkiv/colo-grp.mkiv b/Master/texmf-dist/tex/context/base/mkiv/colo-grp.mkiv
index fddf65c79fe..a1b3333cc02 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/colo-grp.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/colo-grp.mkiv
@@ -68,8 +68,8 @@
{\doifelseinstring{:}{#2}
{\colo_groups_define_normal[#1][\v!rgb][#2]}
{\doloop % inherited
- {\ifcsname\??colorgroup#2:\recurselevel\endcsname
- \setevalue{\??colorgroup#1:\recurselevel}{\csname\??colorgroup#2:\recurselevel\endcsname}%
+ {\ifcsname#2:##1\endcsname
+ \definecolor[#1:##1][#2:##1]%
\else
\exitloop
\fi}}}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/colo-icc.lua b/Master/texmf-dist/tex/context/base/mkiv/colo-icc.lua
index 06a913e1728..f523e870e91 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/colo-icc.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/colo-icc.lua
@@ -119,3 +119,110 @@ function colors.iccprofile(filename,verbose)
report_colors("profile %a loaded",fullname)
return profile, true
end
+
+-- This is just some fun stuff I decided to check out when I was making sure that
+-- the 2020 metafun manual could be processed with lmtx 2021. Color conversion has
+-- been part of ConTeXt from the start but it has been extended to the less commonly
+-- used color spaces. We already do some CIE but didn't have lab converters to play
+-- with (although I had some MetaPost done for a friend long ago). So, when we moved
+-- to lmtx it made sense to also move some into the core. When searching for info
+-- I ran into some formulas for lab/xyz: http://www.easyrgb.com/en/math.php and
+-- http://www.brucelindbloom.com/ are useful resources. I didn't touch existing
+-- code (as it works ok).
+--
+-- local illuminants = { -- 2=CIE 1931 10=CIE 1964
+-- A = { [2] = { 109.850, 100, 35.585 }, [10] = { 111.144, 100, 35.200 } }, -- incandescent/tungsten
+-- B = { [2] = { 99.093, 100, 85.313 }, [10] = { 99.178, 100, 84.349 } }, -- old direct sunlight at noon
+-- C = { [2] = { 98.074, 100, 118.232 }, [10] = { 97.285, 100, 116.145 } }, -- old daylight
+-- D50 = { [2] = { 96.422, 100, 82.521 }, [10] = { 96.720, 100, 81.427 } }, -- icc profile pcs
+-- D55 = { [2] = { 95.682, 100, 92.149 }, [10] = { 95.799, 100, 90.926 } }, -- mid-morning daylight
+-- D65 = { [2] = { 95.047, 100, 108.883 }, [10] = { 94.811, 100, 107.304 } }, -- daylight, srgb, adobe-rgb
+-- D75 = { [2] = { 94.972, 100, 122.638 }, [10] = { 94.416, 100, 120.641 } }, -- north sky daylight
+-- E = { [2] = { 100.000, 100, 100.000 }, [10] = { 100.000, 100, 100.000 } }, -- equal energy
+-- F1 = { [2] = { 92.834, 100, 103.665 }, [10] = { 94.791, 100, 103.191 } }, -- daylight fluorescent
+-- F2 = { [2] = { 99.187, 100, 67.395 }, [10] = { 103.280, 100, 69.026 } }, -- cool fluorescent
+-- F3 = { [2] = { 103.754, 100, 49.861 }, [10] = { 108.968, 100, 51.965 } }, -- white fluorescent
+-- F4 = { [2] = { 109.147, 100, 38.813 }, [10] = { 114.961, 100, 40.963 } }, -- warm white fluorescent
+-- F5 = { [2] = { 90.872, 100, 98.723 }, [10] = { 93.369, 100, 98.636 } }, -- daylight fluorescent
+-- F6 = { [2] = { 97.309, 100, 60.191 }, [10] = { 102.148, 100, 62.074 } }, -- lite white fluorescent
+-- F7 = { [2] = { 95.044, 100, 108.755 }, [10] = { 95.792, 100, 107.687 } }, -- daylight fluorescent, d65 simulator
+-- F8 = { [2] = { 96.413, 100, 82.333 }, [10] = { 97.115, 100, 81.135 } }, -- sylvania f40, d50 simulator
+-- F9 = { [2] = { 100.365, 100, 67.868 }, [10] = { 102.116, 100, 67.826 } }, -- cool white fluorescent
+-- F10 = { [2] = { 96.174, 100, 81.712 }, [10] = { 99.001, 100, 83.134 } }, -- ultralume 50, philips tl85
+-- F11 = { [2] = { 100.966, 100, 64.370 }, [10] = { 103.866, 100, 65.627 } }, -- ultralume 40, philips tl84
+-- F12 = { [2] = { 108.046, 100, 39.228 }, [10] = { 111.428, 100, 40.353 } }, -- ultralume 30, philips tl83
+-- }
+--
+-- local D65 = illuminants.D65
+-- local D652 = { 95.047, 100, 108.883 }
+--
+-- local function labref(illuminate,observer)
+-- local r = illuminants[illuminant or "D65"] or D65
+-- return r[observer or 2] or r[2] or D652
+-- end
+--
+-- This is hardly useful but nice for metafun demos:
+
+local D652 = { 95.047, 100, 108.883 }
+
+local function xyztolab(x,y,z,mapping)
+ if not mapping then
+ mapping = D652
+ end
+ x = x / mapping[1]
+ y = y / mapping[2]
+ z = z / mapping[3]
+ x = (x > 0.008856) and x^(1/3) or (7.787 * x) + (16/116)
+ y = (y > 0.008856) and y^(1/3) or (7.787 * y) + (16/116)
+ z = (z > 0.008856) and z^(1/3) or (7.787 * z) + (16/116)
+ return
+ 116 * y - 16,
+ 500 * (x - y),
+ 200 * (y - z)
+end
+
+local function labtoxyz(l,a,b,mapping)
+ if not mapping then
+ mapping = D652
+ end
+ local y = (l + 16) / 116
+ local x = a / 500 + y
+ local z = y - b / 200
+ return
+ mapping[1] * ((x^3 > 0.008856) and x^3 or (x - 16/116) / 7.787),
+ mapping[2] * ((y^3 > 0.008856) and y^3 or (y - 16/116) / 7.787),
+ mapping[3] * ((z^3 > 0.008856) and z^3 or (z - 16/116) / 7.787)
+end
+
+local function xyztorgb(x,y,z) -- D65/2°
+ local r = (x * 3.2404542 + y * -1.5371385 + z * -0.4985314) / 100
+ local g = (x * -0.9692660 + y * 1.8760108 + z * 0.0415560) / 100
+ local b = (x * 0.0556434 + y * -0.2040259 + z * 1.0572252) / 100
+ r = (r > 0.0031308) and (1.055 * r^(1/2.4) - 0.055) or (12.92 * r)
+ g = (g > 0.0031308) and (1.055 * g^(1/2.4) - 0.055) or (12.92 * g)
+ b = (b > 0.0031308) and (1.055 * b^(1/2.4) - 0.055) or (12.92 * b)
+ if r < 0 then r = 0 elseif r > 1 then r = 1 end
+ if g < 0 then g = 0 elseif g > 1 then g = 1 end
+ if b < 0 then b = 0 elseif b > 1 then b = 1 end
+ return r, g, b
+end
+
+local function rgbtoxyz(r,g,b)
+ r = 100 * ((r > 0.04045) and ((r + 0.055)/1.055)^2.4 or (r / 12.92))
+ g = 100 * ((g > 0.04045) and ((g + 0.055)/1.055)^2.4 or (g / 12.92))
+ b = 100 * ((b > 0.04045) and ((b + 0.055)/1.055)^2.4 or (b / 12.92))
+ return
+ r * 0.4124 + g * 0.3576 + b * 0.1805,
+ r * 0.2126 + g * 0.7152 + b * 0.0722,
+ r * 0.0193 + g * 0.1192 + b * 0.9505
+end
+
+local function labtorgb(l,a,b,mapping)
+ return xyztorgb(labtoxyz(l,a,b,mapping))
+end
+
+colors.xyztolab = xyztolab
+colors.labtoxyz = labtoxyz
+colors.xyztorgb = xyztorgb
+colors.rgbtoxyz = rgbtoxyz
+colors.labtorgb = labtorgb
diff --git a/Master/texmf-dist/tex/context/base/mkiv/colo-imp-rgb.mkiv b/Master/texmf-dist/tex/context/base/mkiv/colo-imp-rgb.mkiv
index 85122cb4448..ab11ae99637 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/colo-imp-rgb.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/colo-imp-rgb.mkiv
@@ -35,12 +35,19 @@
% adapted per 2011.10.28
-\definecolor [lightred] [r=1, g=0, b=0]
-\definecolor [lightgreen] [r=0, g=1, b=0]
-\definecolor [lightblue] [r=0, g=0, b=1]
-\definecolor [lightcyan] [r=0, g=1, b=1]
-\definecolor [lightmagenta] [r=1, g=0, b=1]
-\definecolor [lightyellow] [r=1, g=1, b=0]
+% \definecolor [lightred] [r=1, g=0, b=0]
+% \definecolor [lightgreen] [r=0, g=1, b=0]
+% \definecolor [lightblue] [r=0, g=0, b=1]
+% \definecolor [lightcyan] [r=0, g=1, b=1]
+% \definecolor [lightmagenta] [r=1, g=0, b=1]
+% \definecolor [lightyellow] [r=1, g=1, b=0]
+
+\definecolor [lightred] [r=1, g=0.5, b=0.5] % [.5(red,white)]
+\definecolor [lightgreen] [r=0.5, g=1, b=0.5] % [.5(green,white)]
+\definecolor [lightblue] [r=0.5, g=0.5, b=1] % [.5(blue,white)]
+\definecolor [lightcyan] [r=0.5, g=1, b=1] % [.5(cyan,white)]
+\definecolor [lightmagenta] [r=1, g=0.5, b=1] % [.5(magenta,white)]
+\definecolor [lightyellow] [r=1, g=1, b=0.5] % [.5(yellow,white)]
\definecolor [middlered] [r=.8, g=0, b=0]
\definecolor [middlegreen] [r=0, g=.8, b=0]
diff --git a/Master/texmf-dist/tex/context/base/mkiv/colo-ini.mkiv b/Master/texmf-dist/tex/context/base/mkiv/colo-ini.mkiv
index c489635deca..d031c4bfe44 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/colo-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/colo-ini.mkiv
@@ -144,7 +144,7 @@
\edef\currenttransparencyname{#1}%
% the \relax catches a non existent csname
\ifx\currenttransparencyname\v!reset
- \attribute\transparencyattribute\attributeunsetvalue
+ \c_attr_transparency\attributeunsetvalue
\else
\begincsname\??transparencysetter\currenttransparencyname\endcsname\relax
\fi
@@ -154,7 +154,7 @@
{\begingroup
\edef\currenttransparencyname{#1}%
\ifx\currenttransparencyname\v!reset
- \attribute\transparencyattribute\attributeunsetvalue
+ \c_attr_transparency\attributeunsetvalue
\else
\begincsname\??transparencysetter\currenttransparencyname\endcsname\relax
\fi}
@@ -257,7 +257,7 @@
{\begingroup
\colo_helpers_activate{#1}%
\normalexpanded{\endgroup\edef\noexpand#2%
- {\ifnum\attribute\colorattribute=\attributeunsetvalue\else\number\attribute\colorattribute\fi}}}
+ {\ifnum\c_attr_color=\attributeunsetvalue\else\number\c_attr_color\fi}}}
\let\grey\graycolor % these macros are only used in tracing
@@ -354,9 +354,9 @@
\unexpanded\def\pushcolor[#1]%
{\global\advance\c_colo_nesting\plusone
\expandafter\edef\csname\??colorstack\number\c_colo_nesting\endcsname
- {\attribute\colormodelattribute \the\attribute\colormodelattribute
- \attribute\colorattribute \the\attribute\colorattribute
- \attribute\transparencyattribute\the\attribute\transparencyattribute
+ {\c_attr_colormodel \the\c_attr_colormodel
+ \c_attr_color \the\c_attr_color
+ \c_attr_transparency\the\c_attr_transparency
\relax}% stack
\colo_helpers_activate{#1}}
@@ -370,12 +370,12 @@
\newcount\c_colo_saved_attribute_transparency
\unexpanded\def\savecolor
- {\c_colo_saved_attribute_color \attribute\colorattribute
- \c_colo_saved_attribute_transparency\attribute\transparencyattribute}
+ {\c_colo_saved_attribute_color \c_attr_color
+ \c_colo_saved_attribute_transparency\c_attr_transparency}
\unexpanded\def\restorecolor
- {\attribute\colorattribute \c_colo_saved_attribute_color
- \attribute\transparencyattribute\c_colo_saved_attribute_transparency}
+ {\c_attr_color \c_colo_saved_attribute_color
+ \c_attr_transparency\c_colo_saved_attribute_transparency}
%D In this documentation we will not go into too much details on palets. Curious
%D users can find more information on this topic in \from[use of color].
@@ -491,15 +491,6 @@
\expandafter\colo_palets_define_a
\fi}
-% \unexpanded\def\colo_palets_define_a[#1][#2][#3]%
-% {\colo_palet_prepare{#1}%
-% \doifelseassignment{#2}
-% {\setevalue{\??colorpaletspecification#1}{#2}%
-% \processcommalist[#2]{\colo_palets_define_one{#1}}}
-% {\ifcsname\??colorpaletspecification#2\endcsname
-% \normalexpanded{\colo_palets_define[#1][\lastnamedcs]}%
-% \fi}}
-
\unexpanded\def\colo_palets_define_a[#1][#2][#3]%
{\colo_palet_prepare{#1}%
\ifcondition\validassignment{#2}%
@@ -517,11 +508,6 @@
\colo_palet_extend{#2}%
\colo_palets_define_assign{#1}{#2}{#3}}
-% \def\colo_palets_define_one#1#2% get rid of { }
-% {\doifelseassignment{#2} % catch empty entries
-% {\colo_palets_define_two{#1}[#2]}
-% {\colo_palets_define_three{#1}{#2}}}
-
\def\colo_palets_define_one#1#2% get rid of { }
{\ifcondition\validassignment{#2}% catch empty entries
\colo_palets_define_two{#1}[#2]%
@@ -558,21 +544,6 @@
\unexpanded\def\setuppalet
{\dosingleempty\colo_palets_setup}
-% \def\colo_palets_setup[#1]%
-% {\edef\currentcolorpalet{#1}%
-% \ifx\currentcolorpalet\empty
-% % seems to be a reset
-% \let\currentcolorprefix\empty
-% \else\ifcsname\??paletlist\currentcolorpalet\endcsname
-% \edef\currentcolorprefix{#1:}%
-% \else
-% \colo_helpers_show_message\m!colors7\currentcolorpalet
-% \let\currentcolorpalet\empty
-% \let\currentcolorprefix\empty
-% \fi\fi
-% \the\everysetuppalet
-% \colo_helpers_initialize_maintextcolor}
-
% \newtoks\t_colo_prefix % used in mp interface
\def\colo_palets_setup[#1]%
@@ -678,10 +649,10 @@
% {\edef#1{\negatedcolorcomponent{#1}}}
\unexpanded\def\negatecolorcomponent#1% #1 = \macro
- {\edef#1{\clf_negatecolorcomponent{#1}}}
+ {\edef#1{\clf_negatedcolorcomponent{#1}}}
\def\negatedcolorcomponent#1%
- {\clf_negatecolorcomponent{#1}}
+ {\clf_negatedcolorcomponent{#1}}
%D \macros
%D {MPcolor}
@@ -859,15 +830,15 @@
\unexpanded\def\deactivatecolor % sort of public but a bad name
{\let\currentcolorname\s!black
- \attribute\colorattribute\attributeunsetvalue
- \attribute\transparencyattribute\attributeunsetvalue}
+ \c_attr_color \attributeunsetvalue
+ \c_attr_transparency\attributeunsetvalue}
% todo: check if color is overloading a non-color command
% \let\colo_basics_synchronize\gobbleoneargument % used in mp interface
% \let\colo_basics_inherit \gobbletwoarguments % used in mp interface
-\def\colo_basics_allocate#1% todo: use a chardef instead
+\def\colo_basics_allocate#1%
{\expandafter\newcount\csname\??colornumber#1\endcsname
\clf_synccolorcount{#1}\c_syst_last_allocated_count}
@@ -1136,9 +1107,8 @@
%D \stopregistercolor
%D \stoptyping
-\let\maintextcolor \empty
-\def\defaulttextcolor {black}
-\def\s!themaintextcolor{themaintextcolor}
+\let\maintextcolor \empty
+\def\defaulttextcolor{black}
\unexpanded\def\inheritmaintextcolor
{\ifx\maintextcolor\empty\else\colo_helpers_activate\maintextcolor\fi}
@@ -1208,18 +1178,6 @@
\fi
\to \everysetupcolors
-% \def\colo_palets_define_set#1#2#3%
-% {\doifelseassignment{#3}% \definepalet[test][xx={y=.4}]
-% {\colo_palets_define_assign}%
-% {\ifcsname\??colorsetter#3\endcsname
-% % \definepalet[test][xx=green]
-% \expandafter\colo_palets_define_inherit
-% \else
-% % not entered when making format
-% \expandafter\colo_palets_define_undefine
-% \fi}%
-% {#1}{#2}{#3}}
-
\def\colo_palets_define_set#1#2#3%
{\ifcondition\validassignment{#3}% \definepalet[test][xx={y=.4}]
\expandafter\colo_palets_define_assign
@@ -1252,8 +1210,8 @@
\colo_helpers_set_value{\??transparencysetter #1:#2}{\colo_helpers_inherited_direct_ts{\??colorpalet#1:#2}}%
\colo_helpers_set_value{\??transparencyattribute#1:#2}{\colo_helpers_inherited_direct_ta{\??colorpalet#1:#2}}}
-\setvalue{\??colorattribute currentcolor}{\the\attribute\colorattribute} % for mpcolor
-\setvalue{\??transparencyattribute currentcolor}{\the\attribute\transparencyattribute} % for mpcolor
+\setvalue{\??colorattribute currentcolor}{\the\c_attr_color} % for mpcolor
+\setvalue{\??transparencyattribute currentcolor}{\the\c_attr_transparency} % for mpcolor
%def\colo_helpers_inherited_current_ca#1{\csname\??colorattribute \ifcsname\??colorattribute \currentcolorprefix#1\endcsname\currentcolorprefix#1\else\ifcsname\??colorattribute #1\endcsname#1\fi\fi\endcsname}
%def\colo_helpers_inherited_current_cs#1{\csname\??colorsetter \ifcsname\??colorsetter \currentcolorprefix#1\endcsname\currentcolorprefix#1\else\ifcsname\??colorsetter #1\endcsname#1\fi\fi\endcsname}
@@ -1267,10 +1225,10 @@
%D Low level defs:
-\unexpanded\def\colordefalc#1#2{\setevalue{\??colorattribute #1}{#2}\setvalue {\??colorsetter #1}{\attribute\colorattribute #2 }}
-\unexpanded\def\colordefagc#1#2{\setxvalue{\??colorattribute #1}{#2}\setgvalue{\??colorsetter #1}{\attribute\colorattribute #2 }} % was not g
-\unexpanded\def\colordefalt#1#2{\setevalue{\??transparencyattribute#1}{#2}\setvalue {\??transparencysetter#1}{\attribute\transparencyattribute#2 }}
-\unexpanded\def\colordefagt#1#2{\setxvalue{\??transparencyattribute#1}{#2}\setgvalue{\??transparencysetter#1}{\attribute\transparencyattribute#2 }}
+\unexpanded\def\colordefalc#1#2{\setevalue{\??colorattribute #1}{#2}\setvalue {\??colorsetter #1}{\c_attr_color #2 }}
+\unexpanded\def\colordefagc#1#2{\setxvalue{\??colorattribute #1}{#2}\setgvalue{\??colorsetter #1}{\c_attr_color #2 }} % was not g
+\unexpanded\def\colordefalt#1#2{\setevalue{\??transparencyattribute#1}{#2}\setvalue {\??transparencysetter#1}{\c_attr_transparency#2 }}
+\unexpanded\def\colordefagt#1#2{\setxvalue{\??transparencyattribute#1}{#2}\setgvalue{\??transparencysetter#1}{\c_attr_transparency#2 }}
\unexpanded\def\colordefflc#1#2{\setvalue {\??colorattribute #1}{\colo_helpers_inherited_current_ca{#2}}\setvalue {\??colorsetter #1}{\colo_helpers_inherited_current_cs{#2}}}
\unexpanded\def\colordeffgc#1#2{\setgvalue{\??colorattribute #1}{\colo_helpers_inherited_current_ca{#2}}\setvalue {\??colorsetter #1}{\colo_helpers_inherited_current_cs{#2}}}
@@ -1308,13 +1266,13 @@
\def\MPcolor#1%
{\clf_mpcolor
- \attribute\colormodelattribute
+ \c_attr_colormodel
\colo_helpers_inherited_current_ca{#1} %
\colo_helpers_inherited_current_ta{#1} }
\def\MPcoloronly#1%
{\clf_mpcolor
- \attribute\colormodelattribute
+ \c_attr_colormodel
\colo_helpers_inherited_current_ca{#1} %
\zerocount}
@@ -1326,11 +1284,11 @@
\def\MPoptions#1%
{\clf_mpoptions
- \attribute\colormodelattribute
+ \c_attr_colormodel
\colo_helpers_inherited_current_ca{#1} %
\colo_helpers_inherited_current_ta{#1} }
-\def\thecolormodelattribute {\the\attribute\colormodelattribute}
+\def\thecolormodelattribute {\the\c_attr_colormodel}
%def\thecolorattribute #1{\number\csname\??colorattribute \ifcsname\??colorattribute \currentcolorprefix#1\endcsname\currentcolorprefix#1\else\ifcsname\??colorattribute #1\endcsname#1\fi\fi\endcsname}
%def\thetransparencyattribute#1{\number\csname\??transparencyattribute\ifcsname\??transparencyattribute\currentcolorprefix#1\endcsname\currentcolorprefix#1\else\ifcsname\??transparencyattribute#1\endcsname#1\fi\fi\endcsname}
@@ -1380,7 +1338,11 @@
% \normal added else fails in metafun manual (leaders do a hard scan)
-\unexpanded\def\forcecolorhack{\leaders\hrule\hskip\zeropoint\relax} % relax is needed !
+% \unexpanded\def\forcecolorhack{\leaders\hrule\hskip\zeropoint\relax} % relax is needed !
+%
+% I really need to sort this out!
+
+\unexpanded\def\forcecolorhack{\leaders\hrule height\zeropoint depth\zeropoint\hskip\zeropoint\relax} % relax is needed !
%D We default to the colors defined in \type {colo-imp-rgb} and
%D support both \RGB\ and \CMYK\ output. Transparencies are defined
diff --git a/Master/texmf-dist/tex/context/base/mkiv/colo-ini.mkxl b/Master/texmf-dist/tex/context/base/mkiv/colo-ini.mkxl
deleted file mode 100644
index e821fb7e282..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/colo-ini.mkxl
+++ /dev/null
@@ -1,1407 +0,0 @@
-%D \module
-%D [ file=colo-ini,
-%D version=2007.08.08,
-%D title=\CONTEXT\ Color Macros,
-%D subtitle=Initialization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-%D We need to clean this up further but first we have to make sure that mkiv
-%D code works ok.
-
-\writestatus{loading}{ConTeXt Color Macros / Initialization}
-
-%D Todo: move color space in color attribute (last two bits)
-
-%D This module implements color. Since \MKII\ and \MKIV\ use a completely
-%D different approach, this module only implements a few generic mechanisms.
-
-\installcorenamespace{color}
-\installcorenamespace{colorattribute}
-\installcorenamespace{transparencyattribute}
-\installcorenamespace{colorsetter}
-\installcorenamespace{transparencysetter}
-\installcorenamespace{colorpaletspecification}
-\installcorenamespace{colorpalet}
-\installcorenamespace{colorstack}
-\installcorenamespace{colorconversions}
-\installcorenamespace{colornumber}
-
-\registerctxluafile{colo-ini}{}
-\registerctxluafile{colo-icc}{}
-
-\unprotect
-
-%D In \MKIV\ we have independent color, colorspace and transparency but I'm still
-%D not sure if I keep it that way as it's probably more efficient to combine them
-%D (less attributes and finalizing). If it becomes a bottleneck we can set up a more
-%D complex system with one shared attribute for colorspace, color and transparency.
-%D
-%D When typesetting for paper, we prefer using the \CMYK\ color space, but for
-%D on||screen viewing we prefer \RGB\ (the previous implementation supported only
-%D this scheme). Independant of such specifications, we support some automatic
-%D conversions:
-%D
-%D \startitemize[packed]
-%D \item convert all colors to \RGB
-%D \item convert all colors to \CMYK
-%D \item convert all colors to gray scales
-%D \stopitemize
-%D
-%D These options are communicated by means of:
-
-\newconditional\c_colo_rgb_supported
-\newconditional\c_colo_cmyk_supported
-\newconditional\c_colo_spot_supported % backend driven
-\newconditional\c_colo_convert_gray \settrue\c_colo_convert_gray
-\newconditional\c_colo_enabled
-\newconditional\c_colo_expanded
-
-\let\m_colo_weight_gray\v!yes
-
-\let\currentcolormodel \empty
-\let\currentcolorname \empty
-\let\currentcolorpalet \empty
-\let\currentcolorprefix\empty % \currentcolorpalet:
-
-%D \macros
-%D {definecolor,defineglobalcolor,definenamedcolor,definespotcolor,definemultitonecolor,
-%D definetransparency}
-%D
-%D \starttyping
-%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 \defineprocesscolor[myred][r=.5]
-%D \defineprocesscolor[myredish][red][a=1,t=.5]
-%D
-%D \blackrule[color=myred,width=\hsize,height=1cm] \par
-%D \blackrule[color=myredish,width=\hsize,height=1cm]
-%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 \stoptyping
-
-\unexpanded\def\definecolor {\dodoubleargument\colo_basics_define}
-\unexpanded\def\defineglobalcolor {\dodoubleargument\colo_basics_define_global}
-\unexpanded\def\defineprocesscolor {\dotripleargument\colo_basics_define_process}
-\unexpanded\def\definenamedcolor {\dodoubleargument\colo_basics_define_named}
-\unexpanded\def\definespotcolor {\dotripleargument\colo_basics_define_spot}
-\unexpanded\def\definemultitonecolor {\doquadrupleempty\colo_basics_define_multitone}
-\unexpanded\def\definetransparency {\dodoubleargument\colo_basics_define_transpancy}
-\unexpanded\def\defineglobaltransparency{\dodoubleargument\colo_basics_define_transpancy_global}
-
-\unexpanded\def\loadfoundcolorsetfile#1#2% name foundname / not a user command
- {\startreadingfile
- \startcolorset[#1]%
- \input{#2}%
- \stopcolorset
- \showmessage\m!colors4{#1}%
- \stopreadingfile}
-
-%D \macros
-%D {startcolor,stopcolor,color,graycolor}
-%D
-%D The local and global commands are here just for compatibility with \MKII.
-%D
-%D \showsetup{startcolor}
-%D
-%D The simple color commands are:
-%D
-%D \showsetup{color}
-%D \showsetup{graycolor}
-
-%D We expect sane behaviour in \MKIV\ so we don't used grouped command any
-%D longer.
-
-% \testfeatureonce{100000}{\color[red]{}} % 1.046 => 0.541
-
-\let\g_color\empty
-\let\g_style\empty
-
-\unexpanded\def\switchtocolor[#1]{\begincsname#1\endcsname}
-
-% transparency
-
-\unexpanded\def\transparent[#1]%
- {\bgroup
- \edef\currenttransparencyname{#1}%
- % the \relax catches a non existent csname
- \ifx\currenttransparencyname\v!reset
- \attribute\transparencyattribute\attributeunsetvalue
- \else
- \begincsname\??transparencysetter\currenttransparencyname\endcsname\relax
- \fi
- \let\nexttoken}
-
-\unexpanded\def\starttransparent[#1]%$
- {\begingroup
- \edef\currenttransparencyname{#1}%
- \ifx\currenttransparencyname\v!reset
- \attribute\transparencyattribute\attributeunsetvalue
- \else
- \begincsname\??transparencysetter\currenttransparencyname\endcsname\relax
- \fi}
-
-\unexpanded\def\stoptransparent
- {\endgroup}
-
-% color
-
-\unexpanded\def\coloronly[#1]%
- {\bgroup
- \edef\currentcolorname{#1}%
- \ifx\currentcolorprefix\empty
- \colo_helpers_activate_nop_only
- \else
- \colo_helpers_activate_yes_only
- \fi
- \let\nexttoken}
-
-\unexpanded\def\startcoloronly[#1]%$
- {\begingroup
- \edef\currentcolorname{#1}%
- \ifx\currentcolorprefix\empty
- \colo_helpers_activate_nop_only
- \else
- \colo_helpers_activate_yes_only
- \fi}
-
-\unexpanded\def\stopcoloronly
- {\endgroup}
-
-% color + transparency
-
-\unexpanded\def\color[#1]%
- {\bgroup
- \edef\currentcolorname{#1}%
- \ifx\currentcolorprefix\empty
- \colo_helpers_activate_nop
- \else
- \colo_helpers_activate_yes
- \fi
- \let\nexttoken}
-
-\unexpanded\def\graycolor[#1]%
- {\bgroup
- \colo_helpers_set_model\s!gray\colo_helpers_activate{#1}%
- \let\nexttoken}
-
-\unexpanded\def\startcolor[#1]%$
- {\begingroup
- \edef\currentcolorname{#1}%
- \ifx\currentcolorprefix\empty
- \colo_helpers_activate_nop
- \else
- \colo_helpers_activate_yes
- \fi}
-
-\unexpanded\def\stopcolor
- {\endgroup}
-
-\unexpanded\def\colored[#1]%
- {\bgroup
- \colo_basics_defined_and_activated{#1}%
- \let\nexttoken}
-
-\unexpanded\def\fastcolored[#1]#2%
- {\begingroup % is this command still needed?
- \colo_basics_defined_and_activated{#1}%
- #2%
- \endgroup}
-
-\unexpanded\def\directcolored[#1]%
- {\colo_basics_defined_and_activated{#1}}
-
-\unexpanded\def\fastcolor [#1]#2%
- {\begingroup % is this command still needed?
- \edef\currentcolorname{#1}%
- \ifx\currentcolorprefix\empty
- \colo_helpers_activate_nop
- \else
- \colo_helpers_activate_yes
- \fi
- #2%
- \endgroup}
-
-\unexpanded\def\directcolor[#1]%
- {\edef\currentcolorname{#1}%
- \ifx\currentcolorprefix\empty
- \colo_helpers_activate_nop
- \else
- \colo_helpers_activate_yes
- \fi}
-
-%D The following command is obsolete:
-
-\unexpanded\def\startcolorpage {\startcolor[\ifx\maintextcolor\empty\defaulttextcolor\else\maintextcolor\fi]}
-\unexpanded\def\stopcolorpage {\stopcolor}
-
-\unexpanded\def\getcolorattributevalue#1#2% obsolete, use \thecolorattribute instead ...
- {\begingroup
- \colo_helpers_activate{#1}%
- \normalexpanded{\endgroup\edef\noexpand#2%
- {\ifnum\attribute\colorattribute=\attributeunsetvalue\else\number\attribute\colorattribute\fi}}}
-
-\let\grey\graycolor % these macros are only used in tracing
-
-%D \macros
-%D {startcurrentcolor,stopcurrentcolor}
-
-\unexpanded\def\startcurrentcolor{\startcolor[\outercolorname]}
-\unexpanded\def\stopcurrentcolor {\stopcolor}
-
-%D \macros
-%D {setupcolor}
-%D
-%D Color definitions can be grouped in files with the name:
-%D
-%D \starttyping
-%D colo-imp-tag.tex
-%D \stoptyping
-%D
-%D Loading such a file is done by:
-%D
-%D \showsetup{usecolors}
-%D
-%D Some default colors are specified in \type {colo-imp-rgb}, which is loaded into
-%D the format by default.
-%D
-%D Some demo palets and groups are defined in \type {colo-imp-dem} which can be
-%D loaded with:
-%D
-%D \starttyping
-%D \usecolors[dem]
-%D \stoptyping
-
-\unexpanded\def\startcolorset[#1]{\clf_startcolorset{#1}}
-\unexpanded\def\stopcolorset {\clf_stopcolorset}
-\unexpanded\def\usecolors [#1]{\clf_usecolors{#1}}
-
-\let\setupcolor\usecolors
-
-\installsetuponlycommandhandler \??color {colors}
-
-\let\colo_helpers_show_message\gobblethreearguments
-
-% \newtoks\everysetupcolors
-
-\let\v_colo_freeze_state\s!false
-
-\setvalue{\??colorconversions\v!yes}%
- {\settrue \c_colo_convert_gray}
-
-\setvalue{\??colorconversions\v!always}%
- {\settrue \c_colo_convert_gray
- \setfalse\c_colo_rgb_supported
- \setfalse\c_colo_cmyk_supported}
-
-\appendtoks
- %
- \doifelse{\directcolorsparameter\c!spot }\v!yes \settrue \setfalse\c_colo_spot_supported
- \doifelse{\directcolorsparameter\c!expansion}\v!yes \settrue \setfalse\c_colo_expanded
- \doifelse{\directcolorsparameter\c!rgb }\v!yes \settrue \setfalse\c_colo_rgb_supported
- \doifelse{\directcolorsparameter\c!cmyk }\v!yes \settrue \setfalse\c_colo_cmyk_supported
- \doifelse{\directcolorsparameter\c!state }\v!start\settrue \setfalse\c_colo_enabled
- %
- \edef\m_colo_weight_gray{\directcolorsparameter\c!factor}%
- %
- \ifconditional\c_colo_expanded
- \let\v_colo_freeze_state\s!true
- \else
- \let\v_colo_freeze_state\s!false
- \fi
- %
- \setfalse\c_colo_convert_gray
- \begincsname\??colorconversions\directcolorsparameter\c!conversion\endcsname
- % too often:
- \ifconditional\c_colo_rgb_supported \colo_helpers_show_message\m!colors{10}\v!rgb \fi
- \ifconditional\c_colo_cmyk_supported\colo_helpers_show_message\m!colors{10}\v!cmyk\fi
- \colo_helpers_set_current_model
- \ifproductionrun
- \edef\p_pagecolormodel{\directcolorsparameter\c!pagecolormodel}%
- \clf_setpagecolormodel{\ifx\p_pagecolormodel\v!auto\currentcolormodel\else\p_pagecolormodel\fi}%
- \fi
-\to \everysetupcolors
-
-\appendtoks
- \setupcolors[\c!state=\v!start]%
- \clf_enablecolor % this can as well happen when
- \clf_enabletransparency % the handler is defined in lua
- \let\colo_helpers_show_message\showmessage
-\to \everyjob
-
-%D We provide stacking independent of grouping.
-
-\newcount\c_colo_nesting
-
-\unexpanded\def\pushcolor[#1]%
- {\global\advance\c_colo_nesting\plusone
- \expandafter\edef\csname\??colorstack\number\c_colo_nesting\endcsname
- {\attribute\colormodelattribute \the\attribute\colormodelattribute
- \attribute\colorattribute \the\attribute\colorattribute
- \attribute\transparencyattribute\the\attribute\transparencyattribute
- \relax}% stack
- \colo_helpers_activate{#1}}
-
-\unexpanded\def\popcolor
- {\csname\??colorstack\number\c_colo_nesting\endcsname
- \global\advance\c_colo_nesting\minusone}
-
-% a simple one: assumes grouping
-
-\newcount\c_colo_saved_attribute_color
-\newcount\c_colo_saved_attribute_transparency
-
-\unexpanded\def\savecolor
- {\c_colo_saved_attribute_color \attribute\colorattribute
- \c_colo_saved_attribute_transparency\attribute\transparencyattribute}
-
-\unexpanded\def\restorecolor
- {\attribute\colorattribute \c_colo_saved_attribute_color
- \attribute\transparencyattribute\c_colo_saved_attribute_transparency}
-
-%D In this documentation we will not go into too much details on palets. Curious
-%D users can find more information on this topic in \from[use of color].
-%D
-%D At the moment we implemented color in \CONTEXT\ color printing was not yet on the
-%D desktop. In spite of this lack our graphics designer made colorfull
-%D illustrations. When printed on a black and white printer, distinctive colors can
-%D come out equally gray. We therefore decided to use only colors that were
-%D distinctive in colors as well as in black and white print.
-%D
-%D Although none of the graphic packages we used supported logical colors and global
-%D color redefition, we build this support into \CONTEXT. This enabled us to
-%D experiment and also prepared us for the future.
-
-%D \macros
-%D {definepalet}
-%D
-%D Colors are grouped in palets. The colors in such a palet can have colorful names,
-%D but best is to use names that specify their use, like {\em important} or {\em
-%D danger}. As a sort of example \CONTEXT\ has some palets predefined,
-%D like:\footnote{At the time I wrote the palet support, I was reading 'A hort
-%D history of time' of S.~Hawkins, so that's 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 palet components (not
-%D 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 deal with pretty
-%D verbatim typesetting.
-
-\installcorenamespace{paletlist}
-\installcorenamespace{paletsize}
-
-\let\m_colo_palet\relax
-\let\c_colo_palet\relax
-
-\def\colo_palet_allocate#1%
- {\expandafter\let \csname\??paletlist#1\endcsname\empty
- \expandafter\newcount\csname\??paletsize#1\endcsname}
-
-\def\colo_palet_prepare#1%
- {\edef\colo_palet_name{#1}%
- \ifcsname\??paletlist\colo_palet_name\endcsname
- \csname\??paletsize\colo_palet_name\endcsname\zerocount
- \else
- \colo_palet_allocate\colo_palet_name
- \fi
- \edef\m_colo_palet{\begincsname\??paletlist\colo_palet_name\endcsname}%
- \expandafter\let\expandafter\c_colo_palet\csname\??paletsize\colo_palet_name\endcsname}
-
-\def\colo_palet_extend#1%
- {\addtocommalist{#1}\m_colo_palet
- \expandafter\let\csname\??paletlist\colo_palet_name\endcsname\m_colo_palet
- \advance\c_colo_palet\plusone}
-
-\unexpanded\def\doifelsecolorpalet#1%
- {\ifcsname\??paletlist#1\endcsname
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\let\paletlist\empty
-\let\paletsize\!!zerocount
-
-\unexpanded\def\getpaletlist[#1]%
- {\edef\paletlist{\begincsname\??paletlist#1\endcsname}}
-
-\unexpanded\def\getpaletsize[#1]%
- {\ifcsname\??paletsize#1\endcsname
- \edef\paletsize{\the\lastnamedcs}%
- \else
- \let\paletsize\!!zerocount
- \fi}
-
-\unexpanded\def\definepalet
- {\dotripleempty\colo_palets_define}
-
-\def\colo_palets_define
- {\ifthirdargument
- \expandafter\colo_palets_define_b
- \else
- \expandafter\colo_palets_define_a
- \fi}
-
-\unexpanded\def\colo_palets_define_a[#1][#2][#3]%
- {\colo_palet_prepare{#1}%
- \ifcondition\validassignment{#2}%
- \setevalue{\??colorpaletspecification#1}{#2}%
- \processcommalist[#2]{\colo_palets_define_one{#1}}%
- \orelse\ifcsname\??colorpaletspecification#2\endcsname
- \normalexpanded{\colo_palets_define[#1][\lastnamedcs]}%
- \fi}
-
-\unexpanded\def\colo_palets_define_b[#1][#2][#3]%
- {\colo_palet_prepare{#1}%
- \setevalue{\??colorpaletspecification#1}{#2}%
- \colo_palet_extend{#2}%
- \colo_palets_define_assign{#1}{#2}{#3}}
-
-\def\colo_palets_define_one#1#2% get rid of { }
- {\ifcondition\validassignment{#2}% catch empty entries
- \colo_palets_define_two{#1}[#2]%
- \else
- \colo_palets_define_three{#1}{#2}%
- \fi}
-
-\def\colo_palets_define_two#1[#2=#3]%
- {\colo_palet_extend{#2}%
- \colo_palets_define_set{#1}{#2}{#3}}%
-
-\def\colo_palets_define_three#1#2%
- {\ifcsname\??colorpaletspecification#2\endcsname
- \processcommacommand[\lastnamedcs]{\colo_palets_define_one{#1}}%
- \fi}
-
-%D Instead of refering to colors, one can also directly specify 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. Setting the current palet is
-%D done by:
-%D
-%D \showsetup{setuppalet}
-
-\newtoks\everysetuppalet
-
-\unexpanded\def\setuppalet
- {\dosingleempty\colo_palets_setup}
-
-% \newtoks\t_colo_prefix % used in mp interface
-
-\def\colo_palets_setup[#1]%
- {\edef\currentcolorpalet{#1}%
- \ifx\currentcolorpalet\empty
- % seems to be a reset
- \let\currentcolorprefix\empty
- %\t_colo_prefix\emptytoks
- \orelse\ifcsname\??paletlist\currentcolorpalet\endcsname
- \edef\currentcolorprefix{#1:}%
- %\t_colo_prefix\expandafter{\currentcolorprefix}%
- \else
- \colo_helpers_show_message\m!colors7\currentcolorpalet
- \let\currentcolorpalet\empty
- \let\currentcolorprefix\empty
- %\t_colo_prefix\emptytoks
- \fi
- \the\everysetuppalet
- \colo_helpers_initialize_maintextcolor}
-
-%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!colo_run
-
-%D \macros
-%D {showcolorcomponents}
-%D
-%D \starttyping
-%D \showcolorcomponents[color-1,color-2]
-%D \stoptyping
-
-\fetchruntimecommand \showcolorcomponents \f!colo_run
-
-%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!colo_run
-
-%D \macros
-%D {showcolor}
-%D
-%D But let's not forget that we also have the more traditional non||related colors.
-%D 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!colo_run
-
-%D It would make sense to put the following code in \type {colo-mps}, but it it
-%D rather low level.
-
-%D \macros
-%D {negatecolorcomponent,negatedcolorcomponent}
-%D
-%D These speak for themselves. See \type {colo-ext} for usage.
-
-\unexpanded\def\negatecolorcomponent#1% #1 = \macro
- {\edef#1{\clf_negatecolorcomponent{#1}}}
-
-\def\negatedcolorcomponent#1%
- {\clf_negatecolorcomponent{#1}}
-
-%D \macros
-%D {MPcolor}
-%D
-%D A very special macro is \type{\MPcolor}. This one can be used to pass a \CONTEXT\
-%D color to \METAPOST.
-%D
-%D \starttyping
-%D \MPcolor{my own red}
-%D \stoptyping
-%D
-%D This macro returns \METAPOST\ code that represents the
-%D color.
-%D
-%D For the moment we keep the next downward compatibility switch, i.e.\ expanded
-%D colors. However, predefined colors and palets are no longer expanded (which is
-%D what I wanted in the first place).
-%D
-%D In \MKIV\ we don't support color separation as we might now assume that printing
-%D houses have the right programs to do it themselves. If it's ever needed in \MKIV\
-%D It is relatively easy to support it in the backend code.
-
-% todo: palets in definecolor
-% todo: {\red xx} vs \red{xx}
-
-% \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
-
-\unexpanded\def\setcolormodel[#1]% % beware, \setupcolors will overload this, so this one is
- {\colo_helpers_set_model{#1}} % only for local usage
-
-\def\colo_helpers_set_model#1% direct
- {\edef\currentcolormodel{#1}%
- \clf_setcolormodel{\currentcolormodel}{\m_colo_weight_gray}} % sets attribute at lua end
-
-\colo_helpers_set_model\s!all
-
-\def\colo_helpers_set_current_model
- {\ifconditional\c_colo_enabled
- \ifconditional\c_colo_rgb_supported
- \ifconditional\c_colo_cmyk_supported
- \colo_helpers_set_model\s!all
- \else
- \colo_helpers_set_model\s!rgb
- \fi
- \else
- \ifconditional\c_colo_cmyk_supported
- \colo_helpers_set_model\s!cmyk
- \else
- \ifconditional\c_colo_convert_gray
- \colo_helpers_set_model\s!gray
- \else
- \colo_helpers_set_model\s!none
- \fi
- \fi
- \fi
- \else
- \ifconditional\c_colo_convert_gray
- \colo_helpers_set_model\s!gray
- \else
- \colo_helpers_set_model\s!none
- \fi
- \fi}
-
-%D Currently in mkiv transparency is implemented independent of color. This costs a
-%D bit more processing time but gives the possibility to apply transparency
-%D independently in the future. Is this useful? If not we may as well combine them
-%D again in the future. By coupling we are downward compatible. When we decouple we
-%D need to do more tricky housekeeping (e.g. persist color independent
-%D transparencies when color bound ones are nil.
-
-% Since we couple definitions, we could stick to one test. Todo. Same for mpcolor.
-
-\def\v_colo_dummy_name{c_o_l_o_r}
-
-\letvalue{\??colorattribute \v_colo_dummy_name}\empty
-\letvalue{\??transparencyattribute\v_colo_dummy_name}\empty
-\letvalue{\??colorsetter \v_colo_dummy_name}\empty
-\letvalue{\??transparencysetter \v_colo_dummy_name}\empty
-
-\letvalue{\??colorsetter -}\empty % used?
-\letvalue{\??transparencysetter-}\empty % used?
-
-% new: expandable (see tbl)
-
-\def\colo_helpers_fast_activate
- {\ifx\currentcolorprefix\empty
- \expandafter\colo_helpers_fast_activate_nop
- \else
- \expandafter\colo_helpers_fast_activate_yes
- \fi}
-
-\def\colo_helpers_fast_activate_yes#1%
- {\ifcsname\??colorsetter\currentcolorprefix#1\endcsname
- \lastnamedcs
- \begincsname\??transparencysetter\currentcolorprefix#1\endcsname
- \orelse\ifcsname\??colorsetter#1\endcsname
- \lastnamedcs
- \begincsname\??transparencysetter#1\endcsname
- \fi}
-
-\def\colo_helpers_fast_activate_nop#1%
- {\ifcsname\??colorsetter#1\endcsname
- \lastnamedcs
- \begincsname\??transparencysetter#1\endcsname
- \fi}
-
-\def\colo_helpers_activate_dummy
- {\begincsname\??colorsetter \v_colo_dummy_name\endcsname
- \begincsname\??transparencysetter\v_colo_dummy_name\endcsname}
-
-\let\dofastcoloractivation\colo_helpers_fast_activate
-
-% so far
-
-\def\colo_helpers_activate#1% two-step is not that much faster but less tracing
- {\edef\currentcolorname{#1}%
- \ifx\currentcolorprefix\empty
- \expandafter\colo_helpers_activate_nop
- \else
- \expandafter\colo_helpers_activate_yes
- \fi}
-
-\def\colo_helpers_activate_yes
- {\ifcsname\??colorsetter\currentcolorprefix\currentcolorname\endcsname
- \lastnamedcs
- \begincsname\??transparencysetter\currentcolorprefix\currentcolorname\endcsname
- \orelse\ifcsname\??colorsetter\currentcolorname\endcsname
- \lastnamedcs
- \begincsname\??transparencysetter\currentcolorname\endcsname
- \fi}
-
-\def\colo_helpers_activate_nop
- {\ifcsname\??colorsetter\currentcolorname\endcsname
- \lastnamedcs
- \begincsname\??transparencysetter\currentcolorname\endcsname
- \fi}
-
-\def\colo_helpers_activate_yes_only
- {\ifcsname\??colorsetter\currentcolorprefix\currentcolorname\endcsname
- \lastnamedcs
- \orelse\ifcsname\??colorsetter\currentcolorname\endcsname
- \lastnamedcs
- \fi}
-
-\def\colo_helpers_activate_nop_only
- {\ifcsname\??colorsetter\currentcolorname\endcsname
- \lastnamedcs
- \fi}
-
-\let\dousecolorparameter\colo_helpers_activate
-
-\unexpanded\def\dousecolorhashparameter#1#2%
- {\ifcsname#1#2\endcsname
- \expandafter\dousecolorparameter\csname#1#2\endcsname
- \fi}
-
-\unexpanded\def\dousecurrentcolorparameter
- {\let\currentcolorname\currentcolorparameter % maybe only when success
- \ifcsname\??colorsetter\currentcolorprefix\currentcolorparameter\endcsname
- \lastnamedcs
- \begincsname\??transparencysetter\currentcolorprefix\currentcolorparameter\endcsname
- \orelse\ifcsname\??colorsetter\currentcolorparameter\endcsname
- \lastnamedcs
- \begincsname\??transparencysetter\currentcolorparameter\endcsname
- \fi}
-
-\let\dosetcolorattribute\dousecolorhashparameter % for a while
-
-\unexpanded\def\deactivatecolor % sort of public but a bad name
- {\let\currentcolorname\s!black
- \attribute\colorattribute\attributeunsetvalue
- \attribute\transparencyattribute\attributeunsetvalue}
-
-% todo: check if color is overloading a non-color command
-
-% \let\colo_basics_synchronize\gobbleoneargument % used in mp interface
-% \let\colo_basics_inherit \gobbletwoarguments % used in mp interface
-
-\def\colo_basics_allocate#1%
- {\expandafter\newcount\csname\??colornumber#1\endcsname
- \clf_synccolorcount{#1}\c_syst_last_allocated_count}
-
-\def\colo_basics_synchronize#1%
- {\ifcsname\??colornumber#1\endcsname\else
- \colo_basics_allocate{#1}%
- \fi
- \clf_synccolor{#1}%
- %\csname\??colornumber#1\endcsname\csname\??colorattribute#1\endcsname
- \lastnamedcs\csname\??colorattribute#1\endcsname}
-
-\let\colo_basics_inherit\clf_synccolorclone
-
-\newcount\c_colo_protection
-
-\unexpanded\def\startprotectedcolors
- {\advance\c_colo_protection\plusone}
-
-\unexpanded\def\stopprotectedcolors
- {\advance\c_colo_protection\minusone}
-
-\def\colo_basics_define[#1][#2]%
- {\edef\m_colo_old{#1}%
- \edef\m_colo_new{#2}%
- \ifx\m_colo_old\m_colo_new
- % maybe a warning
- \else
- \clf_defineprocesscolorlocal{#1}{#2}\v_colo_freeze_state\relax
- \colo_basics_synchronize{#1}%
- \ifcase\c_colo_protection
- \unexpanded\setvalue{#1}{\colo_helpers_activate{#1}}%
- \fi
- \fi}
-
-\def\colo_basics_define_global[#1][#2]%
- {\edef\m_colo_old{#1}%
- \edef\m_colo_new{#2}%
- \ifx\m_colo_old\m_colo_new
- % maybe a warning
- \else
- \clf_defineprocesscolorglobal{#1}{#2}\v_colo_freeze_state\relax
- \colo_basics_synchronize{#1}%
- \ifcase\c_colo_protection
- \unexpanded\setgvalue{#1}{\colo_helpers_activate{#1}}%
- \fi
- \fi}
-
-\let\colo_basics_define_named\colo_basics_define
-
-\def\dodefinefastcolor[#1][#2]% still not fast but ok (might change)
- {\clf_defineprocesscolorlocal{#1}{#2}\v_colo_freeze_state\relax
- \colo_basics_synchronize{#1}%
- \ifcase\c_colo_protection
- \unexpanded\setvalue{#1}{\colo_helpers_activate{#1}}%
- \fi}
-
-\def\colo_basics_defined_and_activated#1%
- {\clf_defineprocesscolordummy{#1}% we could pass dummy here too
- \colo_basics_synchronize{\v_colo_dummy_name}%
- \colo_helpers_activate_dummy}
-
-\def\colo_basics_define_process
- {\ifthirdargument
- \expandafter\colo_basics_define_process_yes
- \else
- \expandafter\colo_basics_define_process_nop
- \fi}
-
-\def\colo_basics_define_process_yes[#1][#2][#3]%
- {\clf_defineprocesscolorlocal{#1}{\processcolorcomponents{#2},#3}\v_colo_freeze_state\relax
- \colo_basics_synchronize{#1}%
- \ifcase\c_colo_protection
- \unexpanded\setvalue{#1}{\colo_helpers_activate{#1}}%
- \fi}
-
-\def\colo_basics_define_process_nop[#1][#2][#3]%
- {\clf_defineprocesscolorlocal{#1}{#2}\v_colo_freeze_state\relax
- \colo_basics_synchronize{#1}%
- \ifcase\c_colo_protection
- \unexpanded\setvalue{#1}{\colo_helpers_activate{#1}}%
- \fi}
-
-%D Spotcolors used setxvalue but that messes up currentcolor and probably no global
-%D is needed either but they are global at the lua end (true argument) so we keep
-%D that if only because spot colors often are a document wide property
-
-\def\colo_basics_define_spot[#1][#2][#3]%
- {\clf_definespotcolorglobal{#1}{#2}{#3}%
- \colo_basics_synchronize{#1}%
- \ifcase\c_colo_protection
- \unexpanded\setgvalue{#1}{\colo_helpers_activate{#1}}%
- \fi}
-
-\def\colo_basics_define_multitone[#1][#2][#3][#4]%
- {\clf_definemultitonecolorglobal{#1}{#2}{#3}{#4}%
- \colo_basics_synchronize{#1}%
- \ifcase\c_colo_protection
- \unexpanded\setgvalue{#1}{\colo_helpers_activate{#1}}%
- \fi}
-
-%D Transparencies (only):
-
-\def\colo_basics_define_transpancy[#1][#2]%
- {\clf_definetransparency{#1}{#2}}
-
-\def\colo_basics_define_transpancy_global[#1][#2]%
- {\clf_definetransparencyglobal{#1}{#2}}
-
-% 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]
-%
-% \definecolor[mycolorc][.5(blue,red)]
-% \definecolor[mycolord][.5(blue)]
-% \definecolor[mycolord][-.5(blue,red)] % complement
-% \definecolor[mycolord][-(blue)] % complement
-%
-% \enabledirectives[colors.pgf]
-% \definecolor[mycolorx][magenta!50!yellow]
-%
-% \starttext
-% test {\mycolora OEPS} test
-% test {\mycolorb OEPS} test
-% test {\mycolorc OEPS} test
-% test {\mycolord OEPS} test
-% test {\mycolorx OEPS} test
-% \stoptext
-%
-% Beware: if we say:
-%
-% \definecolor[one][two]
-%
-% Only color one is actually defined and two is not seen at the \LUA\ end. This
-% means that this doesn't work:
-%
-% \definecolor[ColorA][red]
-% \definecolor[ColorB][.5(ColorA)]
-% \definecolor[ColorC][.5(ColorB,white)]
-%
-% But this does work:
-%
-% \definecolor[ColorA][1.0(red)]
-% \definecolor[ColorB][0.5(ColorA)]
-% \definecolor[ColorC][0.5(ColorB,white)]
-%
-% because the fractional definition results in a new definition.
-
-\unexpanded\def\defineintermediatecolor
- {\dotripleempty\colo_basics_define_intermediate}
-
-\def\colo_basics_define_intermediate[#1][#2][#3]% \dotripleempty adds {} inside []
- {\colo_basics_define_intermediate_indeed[#1][#2][#3]}
-
-\def\colo_basics_define_intermediate_indeed[#1][#2,#3,#4][#5]%
- {\clf_defineintermediatecolor % not global
- {#1}%
- {#2}%
- \rawcolorattribute{#3} %
- \rawcolorattribute{#4} %
- \rawtransparencyattribute{#3} %
- \rawtransparencyattribute{#4} %
- {#5}%
- \v_colo_freeze_state
- \relax
- \colo_basics_synchronize{#1}%
- \unexpanded\setvalue{#1}{\colo_helpers_activate{#1}}}
-
-%D Here is a more efficient helper for pgf:
-%D
-%D \starttyping
-%D \startluacode
-%D function commands.pgfxcolorspec(ca) -- {}{}{colorspace}{list}
-%D local cv = attributes.colors.values[ca]
-%D if cv then
-%D local model = cv[1]
-%D if model == 2 then
-%D context("{}{}{gray}{%1.3f}",cv[2])
-%D elseif model == 3 then
-%D context("{}{}{rgb}{%1.3f,%1.3f,%1.3f}",cv[3],cv[4],cv[5])
-%D elseif model == 4 then
-%D context("{}{}{cmyk}{%1.3f,%1.3f,%1.3f,%1.3f}",cv[6],cv[7],cv[8],cv[9])
-%D else
-%D context("{}{}{gray}{%1.3f}",cv[2])
-%D end
-%D else
-%D context("{}{}{gray}{0}")
-%D end
-%D end
-%D \stopluacode
-%D
-%D \def\pgfutil@registercolor#1%
-%D {\setevalue{\string\color@#1}{\noexpand\xcolor@\ctxcommand{pgfxcolorspec(\thecolorattribute{#1})}}}
-%D
-%D \definecolor [darkblue] [r=0,g=0,b=0.5]
-%D
-%D \starttikzpicture
-%D \fill [blue] (0,0) circle(1);
-%D \fill [darkblue] (0,0) circle(1);
-%D \stoptikzpicture
-%D \stoptyping
-%D
-%D \stopmode
-
-\def\pgf@context@registercolor#1{\setevalue{\string\color@#1}{\noexpand\xcolor@{}{}\clf_pgfxcolorspec\zerocount\thecolorattribute{#1}}}
-\def\pgf@context@registergray #1{\setevalue{\string\color@#1}{\noexpand\xcolor@{}{}\clf_pgfxcolorspec\plustwo \thecolorattribute{#1}}}
-\def\pgf@context@registerrgb #1{\setevalue{\string\color@#1}{\noexpand\xcolor@{}{}\clf_pgfxcolorspec\plusthree\thecolorattribute{#1}}}
-\def\pgf@context@registercmyk #1{\setevalue{\string\color@#1}{\noexpand\xcolor@{}{}\clf_pgfxcolorspec\plusfour \thecolorattribute{#1}}}
-
-%D \starttyping
-%D \ifdefined\pgf@context@registercolor
-%D \let\pgfutil@registercolor\pgf@context@registercolor
-%D \fi
-%D \stoptyping
-
-%D \macros
-%D {doifcolorelse, doifcolor}
-%D
-%D Switching to a color is done by means of the following command. Later on we will
-%D explain the use of palets. We define ourselves a color conditional first.
-
-\def\doifelsecolor#1%
- {\ifcsname\??colorattribute\currentcolorprefix#1\endcsname
- \expandafter\firstoftwoarguments
- \orelse\ifcsname\??colorattribute#1\endcsname
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\let\doifcolorelse\doifelsecolor
-
-\def\doifcolor#1%
- {\ifcsname\??colorattribute\currentcolorprefix#1\endcsname
- \expandafter\firstofoneargument
- \orelse\ifcsname\??colorattribute#1\endcsname
- \expandafter\firstofoneargument
- \else
- \expandafter\gobbleoneargument
- \fi}
-
-%D \macros
-%D {startregistercolor,stopregistercolor,permitcolormode}
-%D
-%D If you only want to register a color, the switch \type {\ifpermitcolormode} can
-%D be used. That way the nested colors know where to go back to.
-%D
-%D We use these macros for implementing text colors (actually, the first application
-%D was in foreground 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
-
-\let\maintextcolor \empty
-\def\defaulttextcolor {black}
-\def\s!themaintextcolor{themaintextcolor}
-
-\unexpanded\def\inheritmaintextcolor
- {\ifx\maintextcolor\empty\else\colo_helpers_activate\maintextcolor\fi}
-
-\unexpanded\def\onlyinheritmaintextcolor
- {\ifx\maintextcolor\empty
- \deactivatecolor
- \else
- \colo_helpers_activate\maintextcolor
- \fi}
-
-\appendtoks
- \deactivatecolor % public?
- \inheritmaintextcolor
-\to \everybeforeoutput
-
-\def\colo_helpers_switch_to_maintextcolor#1%
- {\let\maintextcolor\s!themaintextcolor
- \definecolor[\maintextcolor][#1]% can be fast one
- \colo_helpers_activate\maintextcolor
- \clf_registermaintextcolor\thecolorattribute\maintextcolor\relax}
-
-\unexpanded\def\starttextcolor[#1]%
- {\doifsomething{#1}
- {\colo_helpers_switch_to_maintextcolor{#1}}}
-
-\let\stoptextcolor\relax
-
-\let\p_colo_textcolor\empty
-
-\def\colo_helpers_initialize_maintextcolor
- {\edef\p_colo_textcolor{\directcolorsparameter\c!textcolor}%
- \ifx\p_colo_textcolor\empty
- \colo_helpers_switch_to_maintextcolor\defaulttextcolor
- \else
- \colo_helpers_switch_to_maintextcolor\p_colo_textcolor
- \fi}
-
-\appendtoks \colo_helpers_initialize_maintextcolor \to \everyjob
-\appendtoks \colo_helpers_initialize_maintextcolor \to \everysetupcolors
-
-\letvalue{\??colorsetter }\empty \letvalue{\??colorattribute }\!!zerocount
-\letvalue{\??transparencysetter}\empty \letvalue{\??transparencyattribute}\!!zerocount
-
-\def\colo_helpers_inherited_direct_cs#1{\ifcsname\??colorsetter #1\endcsname\lastnamedcs\fi}
-\def\colo_helpers_inherited_direct_ca#1{\ifcsname\??colorattribute #1\endcsname\lastnamedcs\else\!!zerocount\fi}
-\def\colo_helpers_inherited_direct_ts#1{\ifcsname\??transparencysetter #1\endcsname\lastnamedcs\fi}
-\def\colo_helpers_inherited_direct_ta#1{\ifcsname\??transparencyattribute#1\endcsname\lastnamedcs\else\!!zerocount\fi}
-
-% %def\colo_helpers_inherited_palet_cs#1#2{\csname\??colorsetter \ifcsname\??colorsetter \??colorpalet#1:#2\endcsname\??colorpalet#1:#2\fi\endcsname}
-% %def\colo_helpers_inherited_palet_ca#1#2{\csname\??colorattribute \ifcsname\??colorattribute \??colorpalet#1:#2\endcsname\??colorpalet#1:#2\fi\endcsname}
-% %def\colo_helpers_inherited_palet_ts#1#2{\csname\??transparencysetter \ifcsname\??transparencysetter \??colorpalet#1:#2\endcsname\??colorpalet#1:#2\fi\endcsname}
-% %def\colo_helpers_inherited_palet_ta#1#2{\csname\??transparencyattribute\ifcsname\??transparencyattribute\??colorpalet#1:#2\endcsname\??colorpalet#1:#2\fi\endcsname}
-%
-% \def\colo_helpers_inherited_palet_cs#1#2{\ifcsname\??colorsetter \??colorpalet#1:#2\endcsname\lastnamedcs\fi}
-% \def\colo_helpers_inherited_palet_ca#1#2{\ifcsname\??colorattribute \??colorpalet#1:#2\endcsname\lastnamedcs\else\!!zerocount\fi}
-% \def\colo_helpers_inherited_palet_ts#1#2{\ifcsname\??transparencysetter \??colorpalet#1:#2\endcsname\lastnamedcs}
-% \def\colo_helpers_inherited_palet_ta#1#2{\ifcsname\??transparencyattribute\??colorpalet#1:#2\endcsname\lastnamedcs\else\!!zerocount\fi}
-
-\let\colo_helpers_set_value\setvalue
-
-\appendtoks
- \ifconditional\c_colo_expanded
- \let\colo_helpers_set_value\setevalue
- \else
- \let\colo_helpers_set_value\setvalue
- \fi
-\to \everysetupcolors
-
-\def\colo_palets_define_set#1#2#3%
- {\ifcondition\validassignment{#3}% \definepalet[test][xx={y=.4}]
- \expandafter\colo_palets_define_assign
- \orelse\ifcsname\??colorsetter#3\endcsname
- % \definepalet[test][xx=green]
- \expandafter\colo_palets_define_inherit
- \else
- % not entered when making format
- \expandafter\colo_palets_define_undefine
- \fi
- {#1}{#2}{#3}}
-
-\def\colo_palets_define_inherit#1#2#3%
- {\colo_basics_inherit{#1:#2}{#3}%
- \colo_helpers_set_value{\??colorsetter #1:#2}{\colo_helpers_inherited_direct_cs{#3}}%
- \colo_helpers_set_value{\??colorattribute #1:#2}{\colo_helpers_inherited_direct_ca{#3}}%
- \colo_helpers_set_value{\??transparencysetter #1:#2}{\colo_helpers_inherited_direct_ts{#3}}%
- \colo_helpers_set_value{\??transparencyattribute#1:#2}{\colo_helpers_inherited_direct_ta{#3}}}
-
-\def\colo_palets_define_undefine#1#2#3%
- {\localundefine{\??colorsetter #1:#2}%
- \localundefine{\??colorattribute #1:#2}%
- \localundefine{\??transparencysetter #1:#2}%
- \localundefine{\??transparencyattribute#1:#2}}
-
-\def\colo_palets_define_assign#1#2#3%
- {\definecolor[\??colorpalet#1:#2][#3]%
- \colo_helpers_set_value{\??colorsetter #1:#2}{\colo_helpers_inherited_direct_cs{\??colorpalet#1:#2}}%
- \colo_helpers_set_value{\??colorattribute #1:#2}{\colo_helpers_inherited_direct_ca{\??colorpalet#1:#2}}%
- \colo_helpers_set_value{\??transparencysetter #1:#2}{\colo_helpers_inherited_direct_ts{\??colorpalet#1:#2}}%
- \colo_helpers_set_value{\??transparencyattribute#1:#2}{\colo_helpers_inherited_direct_ta{\??colorpalet#1:#2}}}
-
-\setvalue{\??colorattribute currentcolor}{\the\attribute\colorattribute} % for mpcolor
-\setvalue{\??transparencyattribute currentcolor}{\the\attribute\transparencyattribute} % for mpcolor
-
-%def\colo_helpers_inherited_current_ca#1{\csname\??colorattribute \ifcsname\??colorattribute \currentcolorprefix#1\endcsname\currentcolorprefix#1\else\ifcsname\??colorattribute #1\endcsname#1\fi\fi\endcsname}
-%def\colo_helpers_inherited_current_cs#1{\csname\??colorsetter \ifcsname\??colorsetter \currentcolorprefix#1\endcsname\currentcolorprefix#1\else\ifcsname\??colorsetter #1\endcsname#1\fi\fi\endcsname}
-%def\colo_helpers_inherited_current_ta#1{\csname\??transparencyattribute\ifcsname\??transparencyattribute\currentcolorprefix#1\endcsname\currentcolorprefix#1\else\ifcsname\??transparencyattribute#1\endcsname#1\fi\fi\endcsname}
-%def\colo_helpers_inherited_current_ts#1{\csname\??transparencysetter \ifcsname\??transparencysetter \currentcolorprefix#1\endcsname\currentcolorprefix#1\else\ifcsname\??transparencysetter #1\endcsname#1\fi\fi\endcsname}
-
-\def\colo_helpers_inherited_current_ca#1{\ifcsname\??colorattribute \currentcolorprefix#1\endcsname\lastnamedcs\else\ifcsname\??colorattribute #1\endcsname\lastnamedcs\else\!!zerocount\fi\fi}
-\def\colo_helpers_inherited_current_cs#1{\ifcsname\??colorsetter \currentcolorprefix#1\endcsname\lastnamedcs\else\ifcsname\??colorsetter #1\endcsname\lastnamedcs\else\fi\fi}
-\def\colo_helpers_inherited_current_ta#1{\ifcsname\??transparencyattribute\currentcolorprefix#1\endcsname\lastnamedcs\else\ifcsname\??transparencyattribute#1\endcsname\lastnamedcs\else\!!zerocount\fi\fi}
-\def\colo_helpers_inherited_current_ts#1{\ifcsname\??transparencysetter \currentcolorprefix#1\endcsname\lastnamedcs\else\ifcsname\??transparencysetter #1\endcsname\lastnamedcs\else\fi\fi}
-
-%D Low level defs:
-
-\unexpanded\def\colordefalc#1#2{\setevalue{\??colorattribute #1}{#2}\setvalue {\??colorsetter #1}{\attribute\colorattribute #2 }}
-\unexpanded\def\colordefagc#1#2{\setxvalue{\??colorattribute #1}{#2}\setgvalue{\??colorsetter #1}{\attribute\colorattribute #2 }} % was not g
-\unexpanded\def\colordefalt#1#2{\setevalue{\??transparencyattribute#1}{#2}\setvalue {\??transparencysetter#1}{\attribute\transparencyattribute#2 }}
-\unexpanded\def\colordefagt#1#2{\setxvalue{\??transparencyattribute#1}{#2}\setgvalue{\??transparencysetter#1}{\attribute\transparencyattribute#2 }}
-
-\unexpanded\def\colordefflc#1#2{\setvalue {\??colorattribute #1}{\colo_helpers_inherited_current_ca{#2}}\setvalue {\??colorsetter #1}{\colo_helpers_inherited_current_cs{#2}}}
-\unexpanded\def\colordeffgc#1#2{\setgvalue{\??colorattribute #1}{\colo_helpers_inherited_current_ca{#2}}\setvalue {\??colorsetter #1}{\colo_helpers_inherited_current_cs{#2}}}
-\unexpanded\def\colordefflt#1#2{\setvalue {\??transparencyattribute#1}{\colo_helpers_inherited_current_ta{#2}}\setvalue {\??transparencysetter#1}{\colo_helpers_inherited_current_ts{#2}}}
-\unexpanded\def\colordeffgt#1#2{\setgvalue{\??transparencyattribute#1}{\colo_helpers_inherited_current_ta{#2}}\setgvalue{\??transparencysetter#1}{\colo_helpers_inherited_current_ts{#2}}}
-
-\unexpanded\def\colordefrlc #1{\localundefine {\??colorattribute #1}\localundefine {\??colorsetter #1}}
-\unexpanded\def\colordefrgc #1{\globalundefine{\??colorattribute #1}\globalundefine{\??colorsetter #1}}
-\unexpanded\def\colordefrlt #1{\localundefine {\??transparencyattribute#1}\localundefine {\??transparencysetter#1}}
-\unexpanded\def\colordefrgt #1{\globalundefine{\??transparencyattribute#1}\globalundefine{\??transparencysetter#1}}
-
-%D \macros
-%D {colorvalue, grayvalue}
-%D
-%D We can typeset the color components using \type {\colorvalue} and \type
-%D {\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 \startexample
-%D \getbuffer
-%D \stopexample
-
-\let\currentcolorname\s!black % todo
-\let\outercolorname \s!black % todo
-
-\let\colorformatseparator\space
-
-\def\MPcolor#1%
- {\clf_mpcolor
- \attribute\colormodelattribute
- \colo_helpers_inherited_current_ca{#1} %
- \colo_helpers_inherited_current_ta{#1} }
-
-\def\MPcoloronly#1%
- {\clf_mpcolor
- \attribute\colormodelattribute
- \colo_helpers_inherited_current_ca{#1} %
- \zerocount}
-
-\def\MPtransparency#1%
- {\clf_mpcolor
- \zerocount
- \zerocount
- \colo_helpers_inherited_current_ta{#1} }
-
-\def\MPoptions#1%
- {\clf_mpoptions
- \attribute\colormodelattribute
- \colo_helpers_inherited_current_ca{#1} %
- \colo_helpers_inherited_current_ta{#1} }
-
-\def\thecolormodelattribute {\the\attribute\colormodelattribute}
-
-%def\thecolorattribute #1{\number\csname\??colorattribute \ifcsname\??colorattribute \currentcolorprefix#1\endcsname\currentcolorprefix#1\else\ifcsname\??colorattribute #1\endcsname#1\fi\fi\endcsname}
-%def\thetransparencyattribute#1{\number\csname\??transparencyattribute\ifcsname\??transparencyattribute\currentcolorprefix#1\endcsname\currentcolorprefix#1\else\ifcsname\??transparencyattribute#1\endcsname#1\fi\fi\endcsname}
-
-\def\rawcolorattribute #1{\ifcsname\??colorattribute \currentcolorprefix#1\endcsname\lastnamedcs\orelse\ifcsname\??colorattribute #1\endcsname\lastnamedcs\else\zerocount\fi}
-\def\rawtransparencyattribute#1{\ifcsname\??transparencyattribute\currentcolorprefix#1\endcsname\lastnamedcs\orelse\ifcsname\??transparencyattribute#1\endcsname\lastnamedcs\else\zerocount\fi}
-
-\def\thecolorattribute #1{\number\ifcsname\??colorattribute \currentcolorprefix#1\endcsname\lastnamedcs\orelse\ifcsname\??colorattribute #1\endcsname\lastnamedcs\else\zerocount\fi}
-\def\thetransparencyattribute#1{\number\ifcsname\??transparencyattribute\currentcolorprefix#1\endcsname\lastnamedcs\orelse\ifcsname\??transparencyattribute#1\endcsname\lastnamedcs\else\zerocount\fi}
-\def\internalspotcolorname #1{\clf_spotcolorname \thecolorattribute{#1} }
-\def\internalspotcolorparent #1{\clf_spotcolorparent\thecolorattribute{#1} }
-\def\internalspotcolorsize #1{\clf_spotcolorvalue \thecolorattribute{#1} }
-
-\def\colorcomponents #1{\clf_colorcomponents \thecolorattribute {#1} }
-\def\transparencycomponents #1{\clf_transparencycomponents\thetransparencyattribute{#1} }
-\def\processcolorcomponents #1{\clf_processcolorcomponents\thecolorattribute {#1} }
-
-\def\colorvalue #1{\clf_formatcolor\thecolorattribute{#1}{\colorformatseparator}}
-\def\grayvalue #1{\clf_formatgray \thecolorattribute{#1}{\colorformatseparator}}
-
-\def\doifelseblack #1{\clf_doifelseblack\thecolorattribute{#1} }
-\def\doifelsedrawingblack {\clf_doifelsedrawingblack}
-
-\let\doifblackelse \doifelseblack
-\let\doifdrawingblackelse \doifelsedrawingblack
-
-\let\doifblackelse \doifelseblack
-\let\doifdrawingblackelse\doifelsedrawingblack
-
-%D \macros
-%D {forcecolorhack}
-%D
-%D We can out this in front of (for instance) a special and so force color to be
-%D applied (only glyphs, rules and leaders are handled).
-%D
-%D \startbuffer
-%D \framed
-%D [background=color,backgroundcolor=yellow,framecolor=red,corner=round]
-%D {test}
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-
-% ignores in attribute handler
-%
-% \def\forcecolorhack{\vrule\s!width\zeropoint\s!height\zeropoint\s!depth\zeropoint}
-
-% \normal added else fails in metafun manual (leaders do a hard scan)
-
-\unexpanded\def\forcecolorhack{\leaders\hrule\hskip\zeropoint\relax} % relax is needed !
-
-%D We default to the colors defined in \type {colo-imp-rgb} and
-%D support both \RGB\ and \CMYK\ output. Transparencies are defined
-%D here:
-
-\definecolor[black][s=0]
-\definecolor[white][s=1]
-
-\definetransparency [none] [0]
-\definetransparency [normal] [1]
-\definetransparency [multiply] [2]
-\definetransparency [screen] [3]
-\definetransparency [overlay] [4]
-\definetransparency [softlight] [5]
-\definetransparency [hardlight] [6]
-\definetransparency [colordodge] [7]
-\definetransparency [colorburn] [8]
-\definetransparency [darken] [9]
-\definetransparency [lighten] [10]
-\definetransparency [difference] [11]
-\definetransparency [exclusion] [12]
-\definetransparency [hue] [13]
-\definetransparency [saturation] [14]
-\definetransparency [color] [15]
-\definetransparency [luminosity] [16]
-
-%D Some common ones:
-
-\definecolor[trace:0][s=.4]
-\definecolor[trace:1][r=.6]
-\definecolor[trace:2][g=.6]
-\definecolor[trace:3][b=.6]
-\definecolor[trace:4][r=.6,g=.6]
-\definecolor[trace:5][r=.6,b=.6]
-\definecolor[trace:6][g=.6,b=.6]
-\definecolor[trace:7][r=.8,g=.4]
-\definecolor[trace:8][r=.8,b=.4]
-\definecolor[trace:9][g=.4,b=.8]
-
-\definecolor[trace:w][s=1]
-\definecolor[trace:r][r=.75,t=.5,a=1]
-\definecolor[trace:g][g=.75,t=.5,a=1]
-\definecolor[trace:b][b=.75,t=.5,a=1]
-%definecolor[trace:c][c=.75,t=.5,a=1]
-%definecolor[trace:m][m=.75,t=.5,a=1]
-%definecolor[trace:y][y=.75,t=.5,a=1]
-\definecolor[trace:c][g=.75,b=.75,t=.5,a=1]
-\definecolor[trace:m][r=.75,b=.75,t=.5,a=1]
-\definecolor[trace:y][r=.75,g=.75,t=.5,a=1]
-\definecolor[trace:s][s=.75,t=.5,a=1]
-\definecolor[trace:d][s=.25,t=.5,a=1]
-\definecolor[trace:o][r=1,g=.6,b=.1,t=.5,a=1]
-
-\definecolor[trace:dw][s=1]
-\definecolor[trace:dr][r=.75,t=.75,a=1]
-\definecolor[trace:dg][g=.75,t=.75,a=1]
-\definecolor[trace:db][b=.75,t=.75,a=1]
-%definecolor[trace:dc][c=.75,t=.75,a=1]
-%definecolor[trace:dm][m=.75,t=.75,a=1]
-%definecolor[trace:dy][y=.75,t=.75,a=1]
-\definecolor[trace:dc][g=.75,b=.75,t=.75,a=1]
-\definecolor[trace:dm][r=.75,b=.75,t=.75,a=1]
-\definecolor[trace:dy][r=.75,g=.75,t=.75,a=1]
-\definecolor[trace:ds][s=.75,t=.75,a=1]
-\definecolor[trace:dd][s=.25,t=.75,a=1]
-\definecolor[trace:do][r=1,g=.6,b=.1,t=.75,a=1]
-
-\setupcolors
- [\c!state=\v!stop, % color will be enabled later on
- \c!conversion=\v!yes,
- \c!rgb=\v!yes,
- \c!cmyk=\v!yes,
- \c!spot=\v!yes,
- \c!pagecolormodel=\v!none,
- \c!expansion=\v!no,
- \c!textcolor=,
- \c!factor=\v!yes]
-
-\setupcolor
- [\v!rgb]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/cont-cs.mkxl b/Master/texmf-dist/tex/context/base/mkiv/cont-cs.mkxl
deleted file mode 100644
index 8e5ae567cc4..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/cont-cs.mkxl
+++ /dev/null
@@ -1,21 +0,0 @@
-%D \module
-%D [ file=cont-cs,
-%D version=1998.12.02,
-%D title=\CONTEXT,
-%D subtitle=\CONTEXT\ Czech Format Generation,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\catcode`\{=1 \catcode`\}=2
-
-\def\defaultinterface {czech}
-\def\defaultlanguagetag{cs}
-
-\input context.mkxl
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/cont-de.mkxl b/Master/texmf-dist/tex/context/base/mkiv/cont-de.mkxl
deleted file mode 100644
index 579cc88c3c3..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/cont-de.mkxl
+++ /dev/null
@@ -1,21 +0,0 @@
-%D \module
-%D [ file=cont-de,
-%D version=1997.08.19,
-%D title=\CONTEXT,
-%D subtitle=\CONTEXT\ German Format Generation,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\catcode`\{=1 \catcode`\}=2
-
-\def\defaultinterface {german}
-\def\defaultlanguagetag{de}
-
-\input context.mkxl
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/cont-en.mkxl b/Master/texmf-dist/tex/context/base/mkiv/cont-en.mkxl
deleted file mode 100644
index bfb17ffb3c2..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/cont-en.mkxl
+++ /dev/null
@@ -1,21 +0,0 @@
-%D \module
-%D [ file=cont-en,
-%D version=1997.08.19,
-%D title=\CONTEXT,
-%D subtitle=\CONTEXT\ English Format Generation,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\catcode`\{=1 \catcode`\}=2
-
-\def\defaultinterface {english}
-\def\defaultlanguagetag{en}
-
-\input context.mkxl
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/cont-fil.mkiv b/Master/texmf-dist/tex/context/base/mkiv/cont-fil.mkiv
index aa7d9ddb314..edef8dbc82f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/cont-fil.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/cont-fil.mkiv
@@ -149,9 +149,4 @@
%definefilesynonym [set-13] [setups-proofing]
%definefilesynonym [set-15] [setups-generate]
-\ifcase\contextlmtxmode \else
- \definefilesynonym [ecmascript] [libs-imp-mujs]
- \definefilesynonym [zint] [libs-imp-zint]
-\fi
-
\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/cont-fr.mkxl b/Master/texmf-dist/tex/context/base/mkiv/cont-fr.mkxl
deleted file mode 100644
index bedae536b66..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/cont-fr.mkxl
+++ /dev/null
@@ -1,21 +0,0 @@
-%D \module
-%D [ file=cont-de,
-%D version=1997.08.19,
-%D title=\CONTEXT,
-%D subtitle=\CONTEXT\ French Format Generation,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\catcode`\{=1 \catcode`\}=2
-
-\def\defaultinterface {french}
-\def\defaultlanguagetag{fr}
-
-\input context.mkxl
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/cont-gb.mkxl b/Master/texmf-dist/tex/context/base/mkiv/cont-gb.mkxl
deleted file mode 100644
index 464b237da87..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/cont-gb.mkxl
+++ /dev/null
@@ -1,21 +0,0 @@
-%D \module
-%D [ file=cont-uk,
-%D version=1997.08.19,
-%D title=\CONTEXT,
-%D subtitle=\CONTEXT\ English Format Generation,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\catcode`\{=1 \catcode`\}=2
-
-\def\defaultinterface {english}
-\def\defaultlanguagetag{gb}
-
-\input context.mkxl
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/cont-it.mkxl b/Master/texmf-dist/tex/context/base/mkiv/cont-it.mkxl
deleted file mode 100644
index 1702a872fa4..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/cont-it.mkxl
+++ /dev/null
@@ -1,21 +0,0 @@
-%D \module
-%D [ file=cont-it,
-%D version=1997.08.19,
-%D title=\CONTEXT,
-%D subtitle=\CONTEXT\ Italian Format Generation,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\catcode`\{=1 \catcode`\}=2
-
-\def\defaultinterface {italian}
-\def\defaultlanguagetag{it}
-
-\input context.mkxl
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/cont-log.mkiv b/Master/texmf-dist/tex/context/base/mkiv/cont-log.mkiv
index 75d87eb81d9..a6cd1cc2fed 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/cont-log.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/cont-log.mkiv
@@ -149,25 +149,29 @@
\def\syst_logos_meta_hyphen % there is no hyphenchar in this font
{\discretionary{\vrule\s!height.33\emwidth\s!depth-.27\emwidth\s!width.33\emwidth}{}{}}
-\unexpanded\def\MetaFont
+\unexpanded\def\MetaFontLogo
{\dontleavehmode
\begingroup
\setMFPfont META\syst_logos_meta_hyphen FONT%
\endgroup}
-% \unexpanded\def\MetaPost
+\unexpanded\def\MetaPostLogo
+ {\dontleavehmode
+ \begingroup
+ \setMFPfont META\syst_logos_meta_hyphen POST%
+ \endgroup}
+
+% \protected\def\MetaFunLogo
% {\dontleavehmode
% \begingroup
-% \setMFPfont META\syst_logos_meta_hyphen POST%
+% \setMFPfont META\syst_logos_meta_hyphen FUN%
% \endgroup}
-%
-% As decided on the ConText Meeting 2013 the logo has been simplified:
-\unexpanded\def\MetaPost
- {MetaPost}
+% As decided on the ConText Meeting 2013 the logo has been simplified:
-\unexpanded\def\MetaFun
- {MetaFun}
+\unexpanded\def\MetaFont{MetaFont}
+\unexpanded\def\MetaPost{MetaPost}
+\unexpanded\def\MetaFun {MetaFun}
%D \macros
%D {TEX, METAFONT, METAPOST, METAFUN,
@@ -289,7 +293,7 @@
\unexpanded\def\MPXL{MpXL} % MarkFourty : LuaMetaFun
\unexpanded\def\MPLX{MpLX} % MarkSixty : LuaMetaFun
-\unexpanded\def\LMTX{lmtx} % for LuaMetaTeX
+\unexpanded\def\LMTX{LMTX} % for LuaMetaTeX
\appendtoks
\def\ConTeXt {ConTeXt}%
@@ -302,7 +306,7 @@
\def\LuaTeX {LuaTeX}%
\def\LuajitTeX {LuajitTeX}%
\def\LuaMetaTeX{LuaMetaTeX}%
- \let\wordboundary\empty
+ %\let\wordboundary\empty % primitive so we need to promote it to frozen (orjust preroll)
\to \everysimplifycommands
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/cont-new.mkiv b/Master/texmf-dist/tex/context/base/mkiv/cont-new.mkiv
index 7d76e05de80..89ef1e6c3bd 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/cont-new.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/cont-new.mkiv
@@ -13,16 +13,23 @@
% \normalend % uncomment this to get the real base runtime
-\newcontextversion{2020.03.10 14:44}
+\newcontextversion{2021.03.05 19:11}
-%D This file is loaded at runtime, thereby providing an excellent place for
-%D hacks, patches, extensions and new features.
+%D This file is loaded at runtime, thereby providing an excellent place for hacks,
+%D patches, extensions and new features. There can be local overloads in cont-loc
+%D (which has always been the case) and experimental code in cont-exp (which is also
+%D so old that I need to remind myself to check it occasionally, so here is the
+%D reminder).
+
+% \enabletrackers[pages.timing]
+% \enabletrackers[system.usage=summary]
\unprotect
\writestatus\m!system{beware: some patches loaded from cont-new.mkiv}
-% math-ini.mkiv
+%D I need to verify if this indeed will make it into \type {math-ini.mkiv}, that is:
+%D does Alan use it?
\ifdefined\t \else \unexpanded\def\t{\mathortext\text\mathtext} \fi
\ifdefined\w \else \unexpanded\def\w{\mathortext\word\mathword} \fi
@@ -32,8 +39,6 @@
\let\w\mathword
\to \everymathematics
-% \let\assumelongusagecs\relax % todo: fails on legends-001.tex
-
-% done
+%D We're done.
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/cont-nl.mkxl b/Master/texmf-dist/tex/context/base/mkiv/cont-nl.mkxl
deleted file mode 100644
index 1f00e7e892f..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/cont-nl.mkxl
+++ /dev/null
@@ -1,21 +0,0 @@
-%D \module
-%D [ file=cont-nl,
-%D version=1997.08.19,
-%D title=\CONTEXT,
-%D subtitle=\CONTEXT\ Dutch Format Generation,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\catcode`\{=1 \catcode`\}=2
-
-\def\defaultinterface {dutch}
-\def\defaultlanguagetag{nl}
-
-\input context.mkxl
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/cont-pe.mkxl b/Master/texmf-dist/tex/context/base/mkiv/cont-pe.mkxl
deleted file mode 100644
index 82bf7372195..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/cont-pe.mkxl
+++ /dev/null
@@ -1,22 +0,0 @@
-%D \module
-%D [ file=cont-en,
-%D version=1997.08.19,
-%D title=\CONTEXT,
-%D subtitle=\CONTEXT\ English Format Generation,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\catcode`\{=1 \catcode`\}=2
-
-\def\defaultinterface {persian}
-\def\messageinterface {english}
-\def\defaultlanguagetag{pe}
-
-\input context.mkxl
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/cont-ro.mkxl b/Master/texmf-dist/tex/context/base/mkiv/cont-ro.mkxl
deleted file mode 100644
index 6d636c7dc87..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/cont-ro.mkxl
+++ /dev/null
@@ -1,21 +0,0 @@
-%D \module
-%D [ file=cont-ro,
-%D version=2000.01.09,
-%D title=\CONTEXT,
-%D subtitle=\CONTEXT\ Romanian Format Generation,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\catcode`\{=1 \catcode`\}=2
-
-\def\defaultinterface {romanian}
-\def\defaultlanguagetag{ro}
-
-\input context.mkxl
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/cont-run.lua b/Master/texmf-dist/tex/context/base/mkiv/cont-run.lua
index 9a2b3db965c..0d8d7969145 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/cont-run.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/cont-run.lua
@@ -9,27 +9,27 @@ if not modules then modules = { } end modules ['cont-run'] = {
-- When a style is loaded there is a good change that we never enter
-- this code.
-local report = logs.reporter("system")
local type, tostring = type, tostring
-local report = logs.reporter("sandbox","call")
-local fastserialize = table.fastserialize
-local quoted = string.quoted
-local possiblepath = sandbox.possiblepath
-
-local context = context
-local implement = interfaces.implement
-
-local qualified = { }
-local writeable = { }
-local readable = { }
-local blocked = { }
-local trace_files = false
-local trace_calls = false
-local nofcalls = 0
-local nofrejected = 0
-local logfilename = "sandbox.log"
+local report_sandbox = logs.reporter("sandbox","call")
+local report_system = logs.reporter("system")
+local fastserialize = table.fastserialize
+local quoted = string.quoted
+local possiblepath = sandbox.possiblepath
+
+local context = context
+local implement = interfaces.implement
+
+local qualified = { }
+local writeable = { }
+local readable = { }
+local blocked = { }
+local trace_files = false
+local trace_calls = false
+local nofcalls = 0
+local nofrejected = 0
+local logfilename = "sandbox.log"
local function registerstats()
statistics.register("sandboxing", function()
@@ -82,7 +82,7 @@ local function logsandbox(details)
end
end
if trace_calls then
- report("%s(%,t) => %l",details.comment,arguments,result)
+ report_sandbox("%s(%,t) => %l",details.comment,arguments,result)
end
nofcalls = nofcalls + 1
if not result then
@@ -146,7 +146,7 @@ local debugging = environment.arguments.debug
if sandboxing then
- report("enabling sandbox")
+ report_system("enabling sandbox")
sandbox.enable()
@@ -169,7 +169,7 @@ if sandboxing then
context [[\let\primitive\relax\let\normalprimitive\relax]]
debug = {
- traceback = traceback,
+ traceback = debug.traceback,
}
package.loaded.debug = debug
@@ -181,20 +181,26 @@ elseif debugging then
else
debug = {
- traceback = traceback,
- getinfo = getinfo,
- sethook = sethook,
+ traceback = debug.traceback,
+ getinfo = debug.getinfo,
+ sethook = debug.sethook,
}
package.loaded.debug = debug
end
-local preparejob preparejob = function() -- tricky: we need a hook for this
+local function processjob()
+
+ tokens.setters.macro("processjob","") -- make a
+
+ environment.initializefilenames() -- todo: check if we really need to pre-prep the filename
local arguments = environment.arguments
+ local suffix = environment.suffix
+ local filename = environment.filename -- hm, not inputfilename !
- environment.lmtxmode = CONTEXTLMTXMODE
+ environment.lmtxmode = false
if arguments.nosynctex then
luatex.synctex.setup {
@@ -207,55 +213,6 @@ local preparejob preparejob = function() -- tricky: we need a hook for this
}
end
- -- -- todo: move from mtx-context to here:
- --
- -- local timing = arguments.timing
- -- if type(timing) == "string" then
- -- context.usemodule { timing }
- -- end
- -- local nodates = arguments.nodates
- -- if nodates then
- -- context.enabledirectives { "backend.date=" .. (type(nodates) == "string" and nodates or "no") }
- -- end
- -- local trailerid = arguments.trailerid
- -- if type(trailerid) == "string" then
- -- context.enabledirectives { "backend.trailerid=" .. trailerid }
- -- end
- -- local profile = arguments.profile
- -- if profile then
- -- context.enabledirectives { "system.profile=" .. tonumber(profile) or 0 }
- -- end
-
- -- -- already done in mtxrun / mtx-context, has to happen very early
- --
- -- if arguments.silent then
- -- directives.enable("logs.blocked",arguments.silent)
- -- end
- --
- -- -- already done in mtxrun / mtx-context, can as well happen here
- --
- -- if arguments.errors then
- -- directives.enable("logs.errors",arguments.errors)
- -- end
-
- preparejob = function() end
-
- job.prepare = preparejob
-
-end
-
-job.prepare = preparejob
-
-local function processjob()
-
- environment.initializefilenames() -- todo: check if we really need to pre-prep the filename
-
- local arguments = environment.arguments
- local suffix = environment.suffix
- local filename = environment.filename -- hm, not inputfilename !
-
- preparejob()
-
if not filename or filename == "" then
-- skip
elseif suffix == "xml" or arguments.forcexml then
@@ -264,7 +221,7 @@ local function processjob()
-- can be part of (any) loaded (sub) file. The \starttext
-- wrapping might go away.
- report("processing as xml: %s",filename)
+ report_system("processing as xml: %s",filename)
context.starttext()
context.xmlprocess("main",filename,"")
@@ -272,7 +229,7 @@ local function processjob()
elseif suffix == "cld" or arguments.forcecld then
- report("processing as cld: %s",filename)
+ report_system("processing as cld: %s",filename)
context.runfile(filename)
@@ -281,7 +238,7 @@ local function processjob()
-- The wrapping might go away. Why is is it there in the
-- first place.
- report("processing as lua: %s",filename)
+ report_system("processing as lua: %s",filename)
context.starttext()
context.ctxlua(string.format('dofile("%s")',filename))
@@ -289,7 +246,7 @@ local function processjob()
elseif suffix == "mp" or arguments.forcemp then
- report("processing as metapost: %s",filename)
+ report_system("processing as metapost: %s",filename)
context.starttext()
context.processMPfigurefile(filename)
@@ -306,7 +263,7 @@ local function processjob()
elseif suffix == "mps" or arguments.forcemps then
- report("processing metapost output: %s",filename)
+ report_system("processing metapost output: %s",filename)
context.starttext()
context.startTEXpage()
@@ -331,6 +288,7 @@ end
implement {
name = "processjob",
+ public = true,
onlyonce = true,
actions = processjob,
}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/cont-run.mkiv b/Master/texmf-dist/tex/context/base/mkiv/cont-run.mkiv
index f841ce53033..12c12e0d93a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/cont-run.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/cont-run.mkiv
@@ -53,4 +53,12 @@
\unexpanded\def\blocksynctexfile[#1]%
{\processcommacommand{#1}\synctexblockfilename}
+\def\continuewhenlmtxmode
+ {\starttext
+ \startTEXpage[\c!offset=2ex,\c!foregroundstyle=\tttf]%
+ This file needs \LuaMetaTeX\ and \ConTeXt\ \LMTX.%
+ \stopTEXpage
+ \stoptext
+ \endinput}
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/cont-yes.mkiv b/Master/texmf-dist/tex/context/base/mkiv/cont-yes.mkiv
index 0b7f3231baf..d17c4878cae 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/cont-yes.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/cont-yes.mkiv
@@ -11,89 +11,6 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-% At some point I will reconsider the \starttext .. \stoptext
-% wraping as we can assume proper styling. It's a left-over from
-% mkii that we need to get rid of.
-
-% now moved to cont-run.lua
-%
-% \startluacode
-%
-% -- When a style is loaded there is a good change that we never enter
-% -- this code.
-%
-% local report = logs.reporter("system")
-%
-% environment.initializefilenames() -- todo: check if we really need to pre-prep the filename
-%
-% local arguments = environment.arguments
-% local suffix = environment.suffix
-% local filename = environment.filename -- hm, not inputfilename !
-%
-% if suffix == "xml" or arguments.forcexml then
-%
-% -- Maybe we should move the preamble parsing here as it
-% -- can be part of (any) loaded (sub) file. The \starttext
-% -- wrapping might go away.
-%
-% report("processing as xml: %s",filename)
-%
-% context.starttext()
-% context.xmlprocess("main",filename,"")
-% context.stoptext()
-%
-% elseif suffix == "cld" or arguments.forcecld then
-%
-% report("processing as cld: %s",filename)
-%
-% context.runfile(filename)
-%
-% elseif suffix == "lua" or arguments.forcelua then
-%
-% -- The wrapping might go away. Why is is it there in the
-% -- first place.
-%
-% report("processing as lua: %s",filename)
-%
-% context.starttext()
-% context.ctxlua(string.format('dofile("%s")',filename))
-% context.stoptext()
-%
-% elseif suffix == "mp" or arguments.forcemp then
-%
-% report("processing as metapost: %s",filename)
-%
-% context.starttext()
-% context.processMPfigurefile(filename)
-% context.stoptext()
-%
-% -- elseif suffix == "prep" then
-% --
-% -- -- Why do we wrap here. Because it can be xml? Let's get rid
-% -- -- of prepping in general.
-% --
-% -- context.starttext()
-% -- context.input(filename)
-% -- context.stoptext()
-%
-% else
-%
-% -- \writestatus{system}{processing as tex}
-% -- We have a regular tex file so no \starttext yet as we can
-% -- load fonts.
-%
-% -- context.enabletrackers { "resolvers.*" }
-% context.input(filename)
-% -- context.disabletrackers { "resolvers.*" }
-%
-% end
-%
-% context.finishjob()
-%
-% \stopluacode
-
-% We don't want to be in protected mode!
-
-\getvalue{clf_processjob} % from cont-run.lua
+\processjob
\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/context-characters.lmx b/Master/texmf-dist/tex/context/base/mkiv/context-characters.lmx
deleted file mode 100644
index f018e412ba9..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/context-characters.lmx
+++ /dev/null
@@ -1,110 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
-<!--
- filename : context-characters.lmx
- comment : companion to context.tex
- author : Hans Hagen, PRAGMA-ADE, Hasselt NL
- copyright: PRAGMA ADE / ConTeXt Development Team
- license : see context related readme files
--->
-
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
- <head>
- <script type='text/javascript'>
- <!--
- window.focus();
- -->
- </script>
- <title><?lua pv('title') ?></title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
- <style type="text/css">
- <!--
- <?lmx-include context.css ?>
- #type {
- text-align: center ;
- }
- #variable {
- width: 10em ;
- text-align: right ;
- margin-right: 1em ;
- }
- #value {
- text-align: left ;
- }
- -->
- </style>
- </head>
- <body> <!-- onclick="location.reload()" -->
- <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">
- <!-- empty -->
- </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">
- <!-- empty -->
- </div></div></div></div></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"></div></div></div></div></div></div></div>
- <div id="main"><div id='main-settings'>
- <?lmx-define-begin chr-head ?>
- <tr>
- <th><div id="value">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></th>
- <th colspan='2'><div id="value">characters&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></th>
- <th colspan='2'><div id="value">unicodes&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></th>
- <th colspan='2'><div id="value">indices&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></th>
- <th colspan='1'><div id="value">fonts&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></th>
- </tr>
- <tr>
- <th><div id="value">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></th>
- <th><div id="value">before utf&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></th>
- <th><div id="value">after utf&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></th>
- <th><div id="value">before hex&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></th>
- <th><div id="value">after hex&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></th>
- <th><div id="value">after hex&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></th>
- <th><div id="value">after dec&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></th>
- <th><div id="value">filename&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></th>
- </tr>
- <?lmx-define-end ?>
- <?lmx-define-begin chr-body ?>
- <tr>
- <td valign="top"><div id="value"><?lua t((nodes.tracers.characters.equal(v.before,v.after) and "=") or "!") ?></div></td>
- <td valign="top"><div id="value"><?lua t(nodes.tracers.characters.string(v.before)) ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></td>
- <td valign="top"><div id="value"><?lua t(nodes.tracers.characters.string(v.after)) ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></td>
- <td valign="top"><div id="value"><?lua t(nodes.tracers.characters.unicodes(v.before)) ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></td>
- <td valign="top"><div id="value"><?lua t(nodes.tracers.characters.unicodes(v.after)) ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></td>
- <td valign="top"><div id="value"><?lua t(nodes.tracers.characters.indices(v.after)) ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></td>
- <td valign="top"><div id="value"><?lua t(nodes.tracers.characters.indices(v.after,true)) ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></td>
- <td valign="top"><div id="value"><?lua t(nodes.tracers.characters.fonts(v.after)) ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></td>
- </tr>
- <?lmx-define-end ?>
- <?lmx-define-begin chr-none ?>
- <tr>
- <td><br/></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- </tr>
- <?lmx-define-end ?>
- <?lua if tracers.knownlist('characters') then ?>
- <h1>Processed Words</h1>
- <table>
- <?lmx-resolve chr-head ?>
- <?lua for k,v in pairs(tracers.list['characters']) do if v.before and v.after then ?>
- <?lmx-resolve chr-body ?>
- <?lua else ?>
- <?lmx-resolve chr-none ?>
- <?lua end end ?>
- </table>
- <br/>
- <?lua end ?>
- </div></div>
- <div id="bottom"><div id="bottom-one"><div id="bottom-two">
- Job Name: <?lua p(environment.jobname) ?> &nbsp;&nbsp;&nbsp;
- ConTeXt Version: <?lua p(environment.version) ?> &nbsp;&nbsp;&nbsp;
- </div></div></div>
- </body>
-</html>
diff --git a/Master/texmf-dist/tex/context/base/mkiv/context-debug.lmx b/Master/texmf-dist/tex/context/base/mkiv/context-debug.lmx
deleted file mode 100644
index 51b18c83729..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/context-debug.lmx
+++ /dev/null
@@ -1,112 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
-<!--
- filename : context-debug.lmx
- comment : companion to context.tex
- author : Hans Hagen, PRAGMA-ADE, Hasselt NL
- copyright: PRAGMA ADE / ConTeXt Development Team
- license : see context related readme files
--->
-
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
- <head>
- <script type='text/javascript'>
- <!--
- window.focus();
- -->
- </script>
- <title><?lua pv('title') ?></title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
- <style type="text/css">
- <!--
- <?lmx-include context.css ?>
- #type {
- text-align: center ;
- }
- #variable {
- width: 10em ;
- text-align: right ;
- margin-right: 1em ;
- }
- #value {
- text-align: left ;
- }
- -->
- </style>
- </head>
- <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">
- <!-- empty -->
- </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">
- <!-- empty -->
- </div></div></div></div></div></div></div>
- <div id="main"><div id='main-settings'>
- <?lua if tracers.knownlist('scratch') then ?>
- <h1>Scratch Variables</h1>
- <table>
- <tr>
- <th align='middle'>index</th>
- <th align='middle'>&nbsp;&nbsp;&nbsp;dimen</th>
- <th align='middle'>&nbsp;&nbsp;&nbsp;count</th>
- <th align='left' >&nbsp;&nbsp;&nbsp;toks</th>
- </tr>
- <?lua for k,v in pairs(tracers.list['scratch']) do ?>
- <tr>
- <th align='middle'><?lua t(v) ?></th>
- <th align='middle'>&nbsp;&nbsp;&nbsp;<?lua t(tracers.dimen(v)) ?></th>
- <th align='middle'>&nbsp;&nbsp;&nbsp;<?lua t(tracers.count(v)) ?></th>
- <th align='left' >&nbsp;&nbsp;&nbsp;<?lua t(tracers.toks (v)) ?></th>
- </tr>
- <?lua end ?>
- </table>
- <br/>
- <?lua end ?>
- <?lmx-define-begin tvv-head ?>
- <tr>
- <th><div id="type" >type </div></th>
- <th><div id="variable">variable</div></th>
- <th><div id="value" >value </div></th>
- </tr>
- <?lmx-define-end ?>
- <?lmx-define-begin tvv-body ?>
- <tr>
- <th><div id="type" ><?lua t(tracers.type(v)) ?></div></th>
- <th><div id="variable"><?lua t(tracers.name(v)) ?></div></th>
- <th><div id="value" ><?lua t(tracers.cs(v)) ?></div></th>
- </tr>
- <?lmx-define-end ?>
- <?lua if tracers.knownlist('internals') then ?>
- <h1>Internal Variables</h1>
- <table>
- <?lmx-resolve tvv-head ?>
- <?lua for k,v in pairs(tracers.list['internals']) do ?>
- <?lmx-resolve tvv-body ?>
- <?lua end ?>
- </table>
- <br/>
- <?lua end ?>
- <?lua if tracers.knownlist('context') then ?>
- <h1>ConTeXt Variables</h1>
- <table>
- <?lmx-resolve tvv-head ?>
- <?lua for k,v in pairs(tracers.list['context']) do ?>
- <?lmx-resolve tvv-body ?>
- <?lua end ?>
- </table>
- <br/>
- <?lua end ?>
- </div></div>
- <div id="bottom"><div id="bottom-one"><div id="bottom-two">
- Job Name: <?lua p(environment.jobname) ?> &nbsp;&nbsp;&nbsp;
- ConTeXt Version: <?lua p(environment.version) ?> &nbsp;&nbsp;&nbsp;
- Real Page: <?lua p(tracers.cs('c:realpageno')) ?> &nbsp;&nbsp;&nbsp;
- Page: <?lua p(tracers.cs('c:pageno')) ?> &nbsp;&nbsp;&nbsp;
- </div></div></div>
- </body>
-</html>
diff --git a/Master/texmf-dist/tex/context/base/mkiv/context-performance.tex b/Master/texmf-dist/tex/context/base/mkiv/context-performance.tex
index dd376866496..8b6ef11b2f6 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/context-performance.tex
+++ b/Master/texmf-dist/tex/context/base/mkiv/context-performance.tex
@@ -1,5 +1,3 @@
-% language=uk
-
\usemodule[art-01,abr-01]
\starttext
diff --git a/Master/texmf-dist/tex/context/base/mkiv/context.lus b/Master/texmf-dist/tex/context/base/mkiv/context.lus
deleted file mode 100644
index 960e96adf7c..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/context.lus
+++ /dev/null
@@ -1,71 +0,0 @@
-if not modules then modules = { } end modules ['context'] = {
- version = 1.001,
- comment = "companion to context.mkiv",
- author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
- copyright = "PRAGMA ADE / ConTeXt Development Team",
- license = "see context related readme files"
-}
-
---[[<p>This table specifies what stub files are needed in order to create
-the format. These files are loaded before the format is made so that we
-bypass kpse. When the format itself is used, another stub is used (with
-suffix lui). The current format builder is to a large part determined by
-the way luatex evolved and the process will probaby change.</p>]]--
-
-local method = 3
-
-local stubfiles = {
-
- 'luat-cod.lua',
-
- -- Here follows a list of trac, luat and data files, but we don't
- -- it this way any more so there is no need to keep this updated.
-
-}
-
--- This method will trigger the creation of a stub file with all neccessary
--- libraries merged. This is how we originally did it.
-
-if method == 1 then
-
- return stubfiles
-
-end
-
--- This method will use this file as stub file so no merge is needed.
-
-if method == 2 then
-
- if resolvers then
- -- we're loading this file in mtxrun
- else
-
- local sourcepath = string.gsub(arg and arg[1] or "","/[^/]+$","")
- local targetpath = "."
-
- if sourcepath == "" then sourcepath = targetpath end
-
- for i=1,#stubfiles do
- local filename = sourcepath .. "/" .. stubfiles[i]
- texio.write_nl("preloading " .. filename)
- dofile(filename)
- end
- texio.write_nl("\n")
-
- end
-
- return "context.lus"
-
-end
-
--- Only a simple stub:
-
-if method == 3 then
-
- return "luat-cod.lua"
-
-end
-
--- The last resort.
-
-return stubfiles
diff --git a/Master/texmf-dist/tex/context/base/mkiv/context.mkiv b/Master/texmf-dist/tex/context/base/mkiv/context.mkiv
index ff4c7f6c6b7..49eb150497e 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/context.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/context.mkiv
@@ -45,8 +45,7 @@
%D {YYYY.MM.DD HH:MM} format.
\edef\contextformat {\jobname}
-\edef\contextversion{2020.03.10 14:44}
-\edef\contextkind {beta}
+\edef\contextversion{2021.03.05 19:11}
%D Kind of special:
@@ -92,7 +91,6 @@
%D now put it into the environment.
\newtoks\contextversiontoks \contextversiontoks\expandafter{\contextversion}
-\newtoks\contextkindtoks \contextkindtoks \expandafter{\contextkind}
% \normaleverypar{\wait} % uncomment for test of funny injections
@@ -135,7 +133,7 @@
\loadmkvifile{file-ini}
\loadmkvifile{file-res}
-\loadmkvifile{file-lib}
+\loadmkivfile{file-lib}
%D This needs more checking for clashes:
%D
@@ -162,7 +160,7 @@
% \loadmarkfile{luat-ini}
-\loadmarkfile{toks-tra}
+%loadmarkfile{toks-tra}
\loadmarkfile{toks-aux}
%loadmarkfile{toks-map} % obsolete, never used
@@ -196,8 +194,6 @@
\loadmarkfile{trac-tex}
\loadmarkfile{trac-deb} % will move up
-%loadmarkfile{blob-ini} % not to be used, we only use a helper
-
\loadmarkfile{supp-box}
\loadmarkfile{supp-ran}
@@ -264,6 +260,7 @@
\loadmarkfile{lxml-sor}
\loadmkvifile{typo-prc}
+\loadmkivfile{typo-plc}
% \loadmarkfile{anch-pos}
@@ -429,7 +426,7 @@
\loadmarkfile{spac-chr} % depends on fonts
-\loadmarkfile{blob-ini} % not to be used, we only use a helper
+\loadmarkfile{blob-ini}
\loadmarkfile{trac-vis}
\loadmarkfile{trac-jus}
@@ -461,11 +458,10 @@
\loadmarkfile{symb-emj}
+\loadmarkfile{lang-tra}
\loadmarkfile{lang-wrd} % can be optional (discussion with mm sideeffect)
\loadmarkfile{lang-rep} % can be optional (bt 2013 side effect)
-\loadmarkfile{prop-ini} % only for downward compatibility
-
\loadmarkfile{mlib-ctx} % messy order
\loadmarkfile{meta-ini}
@@ -618,7 +614,7 @@
% \to \everyjob
\appendtoks
- \ctxlua{statistics.savefmtstatus("\jobname","\contextversion","context.mkiv","\contextkind","\contextbanner")}% can become automatic
+ \ctxlua{statistics.savefmtstatus("\jobname","\contextversion","context.mkiv","\contextbanner")}% can become automatic
\to \everydump
\errorstopmode \dump \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/context.mkxl b/Master/texmf-dist/tex/context/base/mkiv/context.mkxl
deleted file mode 100644
index 13e6a100b07..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/context.mkxl
+++ /dev/null
@@ -1,619 +0,0 @@
-%D \module
-%D [ file=context,
-%D version=2019.07.24, % 2008.28.10, % 1995.10.10,
-%D title=\CONTEXT,
-%D subtitle=\CONTEXT\ Format Generation,
-%D author=Hans Hagen, % ɦɑns ɦɑˈχən
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% http://build.contextgarden.net/waterfall?tag=c/lua(meta)tex
-
-%D Welcome to context, pronounced as kontekst (rather dutch) and not as conτεχt.
-
-\catcode`\{=1 \catcode`\}=2 \catcode`\#=6
-
-%D From the next string (which is set by the script that assembles the distribution)
-%D later on we will calculate a number that can be used by use modules to identify
-%D the feature level. Starting with version 2004.8.30 the low level interface is
-%D english. Watch out and adapt your styles an modules.
-
-% \everypar{\writestatus{!!!!}{some spurious input in line \the\inputlineno}\wait}
-
-%D The order of loading will change when all modules have been cleaned up and the
-%D dependencies are more consistent. Beware, the version number has to match \type
-%D {YYYY.MM.DD HH:MM} format.
-
-\edef\contextformat {\jobname}
-\edef\contextversion{2020.03.10 14:44}
-\edef\contextkind {beta}
-
-%D Kind of special:
-
-\chardef\contextlmtxmode\directlua{tex.print(CONTEXTLMTXMODE or 0)}\relax
-
-%D For those who want to use this:
-
-\let\fmtname \contextformat
-\let\fmtversion\contextversion
-
-%D Loading:
-
-\edef\mksuffix {mkiv}
-\edef\contextmark{MKIV}
-
-\ifx\normalinput\undefined \let\normalinput\input \fi
-
-\def\loadmarkfile#1{\normalinput{#1.\mksuffix}}
-\def\loadmkivfile#1{\normalinput{#1.mkiv}}
-\def\loadmkvifile#1{\normalinput{#1.mkvi}}
-\def\loadmkxlfile#1{\normalinput{#1.mkxl}}
-\def\loadmklxfile#1{\normalinput{#1.mklx}}
-
-%D First we load the system modules. These implement a lot of manipulation macros.
-%D We start with setting up some basic \TEX\ machinery.
-
-\loadmkxlfile{syst-ini} % LMTX
-
-%D We just quit if new functionality is expected.
-
-\ifnum\luatexversion<200 % also change message
- \writestatus{!!!!}{Your luametatex binary is too old, you need at least version 2.00!}
- \expandafter\end
-\fi
-
-%D Some checking (more primitives are now defined):
-
-\ifdefined\defaultinterface \else \def\defaultinterface {english} \fi
-%ifdefined\messageinterface \else \let\messageinterface \defaultinterface \fi
-\ifdefined\defaultlanguagetag \else \def\defaultlanguagetag{en} \fi
-
-%D There is only this way to pass the version info to \LUA\ (currently). Hm, we could
-%D now put it into the environment.
-
-\newtoks\contextversiontoks \contextversiontoks\expandafter{\contextversion}
-\newtoks\contextkindtoks \contextkindtoks \expandafter{\contextkind}
-
-% \normaleverypar{\wait} % uncomment for test of funny injections
-
-%D Now the more fundamental code gets defined.
-
-\loadmarkfile{norm-ctx}
-\loadmarkfile{syst-pln}
-\loadmarkfile{syst-mes}
-
-\loadmarkfile{luat-cod}
-\loadmarkfile{luat-bas}
-\loadmarkfile{luat-lib}
-\loadmarkfile{luat-soc}
-
-\loadmarkfile{catc-ini}
-\loadmarkfile{catc-act}
-\loadmarkfile{catc-def}
-\loadmarkfile{catc-ctx}
-\loadmarkfile{catc-sym}
-
-\loadmarkfile{toks-ini}
-\loadmarkfile{cldf-ini}
-
-% \tracecatcodetables
-
-%D From here on we have \unexpanded being \normalprotected, as we already had
-%D \type {\unexpanded} long before etex came around.
-
-\loadmarkfile{luat-ini}
-\loadmarkfile{toks-scn}
-
-\loadmkxlfile{syst-aux} % LMTX
-\loadmkxlfile{syst-lua} % LMTX
-\loadmkxlfile{syst-con} % LMTX
-
-\loadmarkfile{syst-fnt}
-\loadmarkfile{syst-rtp}
-
-\loadmarkfile{luat-usr}
-
-\loadmkvifile{file-ini}
-\loadmkvifile{file-res}
-\loadmkvifile{file-lib}
-
-\loadmkxlfile{core-lmt} % LMTX
-
-%D This needs more checking for clashes:
-%D
-%D \starttyping
-%D \doifelsefileexists{l-macro-imp-codes-luametatex.lua}{\registerctxluafile{l-macro-imp-codes-luametatex}{}}{}
-%D \stoptyping
-
-\loadmarkfile{supp-dir}
-
-\loadmarkfile{char-utf} % generic code (i.e. not much tex) ... could become unic-ini
-\loadmarkfile{char-ini} % tex / context specific
-\loadmarkfile{char-act} % even more specific
-
-\loadmarkfile{mult-ini}
-\loadmarkfile{mult-sys}
-\loadmkxlfile{mult-aux} % LMTX
-\loadmarkfile{mult-def}
-\loadmarkfile{mult-chk}
-\loadmkvifile{mult-dim}
-
-\loadmarkfile{cldf-int} % interface
-
-\loadmarkfile{trac-ctx} % maybe move up
-
-% \loadmarkfile{luat-ini}
-
-\loadmarkfile{toks-tra}
-\loadmarkfile{toks-aux}
-%loadmarkfile{toks-map} % obsolete, never used
-
-\loadmarkfile{attr-ini}
-
-\loadmarkfile{core-ini}
-\loadmarkfile{core-env}
-
-\loadmarkfile{layo-ini}
-
-\loadmarkfile{node-ini}
-
-\loadmarkfile{cldf-bas} % basics / depends on nodes
-
-\loadmkivfile{node-fin}
-\loadmarkfile{node-mig}
-%loadmarkfile{node-pag}
-
-\loadmkxlfile{driv-ini} % LMTX
-
-\loadmkxlfile{back-ini} % LMTX
-\loadmarkfile{back-res}
-\loadmarkfile{back-trf}
-\loadmkxlfile{back-out} % LMTX
-
-\loadmarkfile{attr-col}
-\loadmarkfile{attr-lay}
-\loadmarkfile{attr-neg}
-\loadmarkfile{attr-eff}
-\loadmarkfile{attr-mkr}
-
-\loadmarkfile{trac-tex}
-\loadmarkfile{trac-deb} % will move up
-
-%loadmarkfile{blob-ini} % not to be used, we only use a helper
-
-\loadmkxlfile{supp-box} % LMTX
-
-\loadmarkfile{supp-ran}
-\loadmarkfile{supp-mat}
-
-\loadmarkfile{core-uti}
-\loadmkvifile{file-job}
-
-\loadmarkfile{anch-pos}
-
-\loadmarkfile{typo-ini}
-\loadmarkfile{typo-lin}
-\loadmarkfile{typo-bld} % par builders
-
-\loadmarkfile{typo-inj}
-
-\loadmkvifile{file-syn}
-\loadmkvifile{file-mod}
-
-\loadmarkfile{core-sys}
-\loadmarkfile{core-con}
-
-\loadmarkfile{cont-fil}
-
-\loadmarkfile{regi-ini}
-\loadmarkfile{enco-ini}
-\loadmkxlfile{hand-ini}
-
-\loadmkxlfile{lang-ini} % LMTX
-\loadmarkfile{lang-hyp} % also loads dis
-\loadmkxlfile{lang-lab} % LMTX
-
-\loadmarkfile{unic-ini}
-
-% \loadmarkfile{core-uti}
-\loadmarkfile{core-two}
-\loadmarkfile{core-dat}
-
-\loadmkxlfile{colo-ini} % LMTX
-\loadmarkfile{colo-grp} % optional
-\loadmarkfile{colo-ext}
-
-\loadmarkfile{node-bck} % overloads anch-pgr (experimental and undocumented)
-
-\loadmarkfile{pack-cut}
-
-\loadmarkfile{lang-mis}
-\loadmarkfile{lang-url}
-\loadmarkfile{lang-def}
-
-% \loadmkvifile{file-job} % why so late?
-
-\loadmarkfile{symb-ini} % brrr depends on fonts
-
-\loadmarkfile{sort-ini}
-
-\loadmkvifile{pack-mis}
-\loadmkxlfile{pack-ori} % LMTX
-\loadmkxlfile{pack-rul} % LMTX
-\loadmarkfile{pack-mrl}
-\loadmkvifile{pack-bck}
-\loadmarkfile{pack-fen}
-
-\loadmarkfile{lxml-ini}
-\loadmarkfile{lxml-sor}
-
-\loadmkvifile{typo-prc}
-
-% \loadmarkfile{anch-pos}
-
-\loadmkvifile{strc-ini}
-\loadmarkfile{strc-tag}
-\loadmarkfile{strc-doc}
-\loadmarkfile{strc-num}
-\loadmarkfile{strc-mar}
-\loadmarkfile{strc-sbe}
-\loadmkvifile{strc-lst}
-\loadmarkfile{strc-sec}
-\loadmarkfile{strc-pag} % hm, depends on core-num
-\loadmarkfile{strc-ren}
-\loadmarkfile{strc-xml}
-\loadmarkfile{strc-def} % might happen later
-\loadmkvifile{strc-ref}
-%loadmarkfile{strc-reg}
-\loadmkvifile{strc-lev} % experiment
-
-\loadmarkfile{spac-hor}
-\loadmarkfile{spac-ali}
-\loadmarkfile{spac-flr}
-\loadmkxlfile{spac-ver} % LMTX beware, hooks into strc-sec
-\loadmarkfile{spac-lin}
-\loadmarkfile{spac-pag}
-\loadmarkfile{spac-par}
-\loadmarkfile{spac-def}
-\loadmkvifile{spac-prf}
-\loadmarkfile{spac-grd}
-
-%loadmarkfile{anch-pos}
-
-\loadmkvifile{scrn-ini}
-\loadmkvifile{scrn-ref}
-
-\loadmarkfile{pack-obj}
-
-\loadmklxfile{strc-itm} % LMTX
-
-\loadmkvifile{strc-con}
-\loadmkvifile{strc-des}
-\loadmkvifile{strc-enu}
-
-\loadmarkfile{strc-ind}
-\loadmarkfile{strc-lab}
-\loadmarkfile{strc-syn}
-
-% \loadmarkfile{core-sys}
-
-\loadmarkfile{page-var}
-\loadmkvifile{page-otr}
-\loadmarkfile{page-ini}
-\loadmarkfile{page-ins}
-\loadmarkfile{page-fac}
-\loadmarkfile{page-brk}
-\loadmarkfile{page-col}
-\loadmarkfile{page-inf}
-\loadmarkfile{page-flt}
-\loadmarkfile{page-bck}
-\loadmarkfile{page-not}
-\loadmarkfile{page-one}
-\loadmarkfile{page-lay}
-\loadmkvifile{page-box}
-\loadmklxfile{page-txt} % LMTX
-\loadmarkfile{page-sid} % when
-
-\loadmkvifile{strc-flt}
-
-\loadmarkfile{page-pst}
-\loadmkvifile{page-mbk}
-%loadmarkfile{page-mul} % \usecolumns[old-multicolumns]
-\loadmarkfile{page-mix}
-\loadmarkfile{page-smp}
-%loadmarkfile{page-set} % \usecolumns[old-columnsets]
-\loadmarkfile{page-cst}
-\loadmarkfile{page-pcl} % new
-\loadmkxlfile{pack-lyr} % LMTX
-\loadmarkfile{pack-pos}
-\loadmkvifile{page-mak}
-
-\loadmarkfile{strc-reg} % uses mixed columns
-
-\loadmkvifile{page-lin}
-\loadmarkfile{page-par}
-\loadmarkfile{typo-pag}
-\loadmarkfile{typo-mar}
-\loadmarkfile{typo-itm}
-
-\loadmarkfile{buff-ini}
-\loadmkxlfile{buff-ver} % LMTX
-\loadmkvifile{buff-par}
-
-\loadmarkfile{buff-imp-tex} % optional as also runtime if not loaded
-\loadmarkfile{buff-imp-mp} % optional as also runtime if not loaded
-\loadmarkfile{buff-imp-lua} % optional as also runtime if not loaded
-\loadmarkfile{buff-imp-xml} % optional as also runtime if not loaded
-
-\loadmarkfile{buff-imp-parsed-xml} % optional
-%loadmarkfile{buff-imp-parsed-lua} % optional
-
-\loadmarkfile{strc-blk}
-
-\loadmarkfile{page-imp}
-\loadmkvifile{page-sel} % optional
-\loadmkvifile{page-inj} % optional
-
-\loadmkvifile{scrn-pag}
-\loadmkvifile{scrn-wid}
-\loadmkvifile{scrn-but}
-\loadmkvifile{scrn-bar}
-
-\loadmarkfile{page-com} % optional (after scrn-pag)
-
-\loadmarkfile{strc-bkm} % bookmarks
-
-\loadmarkfile{java-ini}
-
-\loadmkvifile{scrn-fld}
-\loadmkvifile{scrn-hlp}
-
-\loadmarkfile{char-enc} % will move up
-
-\loadmkvifile{font-lib} % way too late but after language
-\loadmklxfile{font-fil} % LMTX
-\loadmkvifile{font-var}
-\loadmkvifile{font-fea}
-\loadmklxfile{font-mat} % LMTX
-\loadmklxfile{font-ini} % LMTX
-\loadmklxfile{font-sym} % LMTX
-\loadmklxfile{font-sty} % LMTX
-\loadmkvifile{font-set}
-\loadmklxfile{font-emp} % LMTX
-\loadmarkfile{font-pre}
-\loadmarkfile{font-unk}
-\loadmarkfile{font-tra}
-\loadmarkfile{font-chk}
-\loadmarkfile{font-uni}
-\loadmkvifile{font-col}
-\loadmkvifile{font-gds}
-\loadmkvifile{font-aux}
-\loadmkvifile{font-sel}
-
-\loadmarkfile{typo-tal}
-\loadmarkfile{typo-par} % par builders (uses fonts)
-
-\loadmarkfile{tabl-com}
-\loadmarkfile{tabl-pln}
-
-\loadmarkfile{tabl-tab} % thrd-tab stripped and merged
-
-\loadmkxlfile{tabl-tbl} % LMTX
-\loadmkxlfile{tabl-ntb} % LMTX
-\loadmarkfile{tabl-nte}
-\loadmarkfile{tabl-ltb}
-\loadmarkfile{tabl-frm}
-\loadmarkfile{tabl-tsp}
-\loadmkvifile{tabl-xtb}
-\loadmarkfile{tabl-mis}
-
-\loadmarkfile{typo-lan}
-
-\loadmarkfile{lxml-css}
-
-\loadmarkfile{spac-chr} % depends on fonts
-
-\loadmarkfile{blob-ini} % not to be used, we only use a helper
-
-\loadmarkfile{trac-vis}
-\loadmarkfile{trac-jus}
-
-\loadmarkfile{typo-cln}
-\loadmarkfile{typo-wrp}
-\loadmarkfile{typo-spa}
-\loadmarkfile{typo-krn}
-\loadmkvifile{typo-itc}
-\loadmarkfile{typo-dir}
-\loadmarkfile{typo-brk}
-\loadmarkfile{typo-cap}
-\loadmarkfile{typo-dig}
-\loadmarkfile{typo-rep}
-\loadmkvifile{typo-txt}
-\loadmarkfile{typo-drp}
-\loadmarkfile{typo-fln}
-\loadmarkfile{typo-sus}
-\loadmarkfile{typo-lig}
-\loadmarkfile{typo-chr}
-\loadmarkfile{typo-rub}
-\loadmkivfile{typo-fkr}
-\loadmkivfile{typo-pnc}
-
-\loadmklxfile{type-ini} % LMTX
-\loadmarkfile{type-set}
-
-\loadmarkfile{scrp-ini}
-
-\loadmarkfile{symb-emj}
-
-\loadmarkfile{lang-wrd} % can be optional (discussion with mm sideeffect)
-\loadmarkfile{lang-rep} % can be optional (bt 2013 side effect)
-
-\loadmarkfile{prop-ini} % only for downward compatibility
-
-\loadmkxlfile{mlib-ctx} % LMTX % messy order
-
-\loadmkxlfile{meta-ini} % LMTX
-\loadmarkfile{meta-tex}
-\loadmarkfile{meta-fun}
-\loadmkxlfile{meta-pag}
-\loadmarkfile{meta-grd}
-\loadmarkfile{meta-fnt}
-\loadmarkfile{meta-nod}
-\loadmarkfile{meta-lua}
-\loadmkxlfile{meta-mac} % LMTX
-
-\loadmarkfile{page-mrk} % depends on mp
-
-\loadmarkfile{page-flw}
-\loadmarkfile{page-spr}
-\loadmarkfile{page-plg}
-\loadmarkfile{page-str}
-
-\loadmarkfile{anch-pgr} % can be moved up (nicer for dependencies)
-\loadmkvifile{anch-bck}
-\loadmarkfile{anch-tab} % overloads tabl-tbl
-\loadmarkfile{anch-bar}
-%loadmarkfile{anch-snc} % when needed this one will be redone
-
-\loadmarkfile{math-ini} % way after font-pre !
-\loadmarkfile{math-pln}
-\loadmarkfile{math-for}
-\loadmarkfile{math-def} % also saves some meanings
-\loadmarkfile{math-ali}
-%loadmarkfile{math-arr}
-\loadmkvifile{math-stc}
-\loadmarkfile{math-frc}
-\loadmarkfile{math-mis}
-\loadmarkfile{math-scr}
-\loadmarkfile{math-int}
-\loadmarkfile{math-del}
-\loadmarkfile{math-fen}
-\loadmkvifile{math-acc}
-\loadmkvifile{math-rad}
-\loadmarkfile{math-inl}
-\loadmarkfile{math-dis}
-%loadmarkfile{math-lan}
-
-%loadmarkfile{phys-dim} % moved to after typo-scr
-
-\loadmarkfile{strc-mat}
-
-\loadmarkfile{chem-ini}
-\loadmarkfile{chem-str}
-
-\loadmarkfile{typo-scr}
-\loadmarkfile{phys-dim}
-
-\loadmarkfile{node-rul} % beware, defined \underbar so after math
-\loadmkvifile{font-sol} % font solutions
-
-\loadmkvifile{strc-not}
-\loadmkvifile{strc-lnt}
-\loadmkivfile{strc-tnt}
-\loadmkivfile{strc-usr}
-
-\loadmarkfile{pack-com}
-\loadmarkfile{typo-del}
-
-\loadmarkfile{grph-trf}
-\loadmarkfile{grph-inc}
-\loadmarkfile{grph-fig}
-\loadmarkfile{grph-raw}
-\loadmarkfile{grph-rul}
-\loadmarkfile{grph-pat}
-
-\loadmarkfile{pack-box}
-\loadmarkfile{pack-bar}
-\loadmarkfile{page-app}
-\loadmarkfile{meta-fig}
-
-\loadmarkfile{page-ffl}
-
-\loadmarkfile{lang-spa} % will become obsolete
-
-\loadmarkfile{typo-ovl} % fuzzy project (tracing) code
-
-% old bibtex support: (will be m-oldbibtex.mkiv)
-
-% \loadmarkfile{bibl-bib}
-% \loadmarkfile{bibl-tra}
-
-% new bibtex support:
-
-\loadmarkfile{publ-ini}
-\loadmarkfile{publ-tra}
-\loadmarkfile{publ-xml}
-\loadmarkfile{publ-old}
-
-%loadmarkfile{x-xtag} % no longer preloaded
-
-\loadmarkfile{meta-xml}
-
-\loadmarkfile{cont-log}
-
-% \loadmarkfile{task-ini}
-
-\loadmarkfile{cldf-ver} % verbatim, this can come late
-\loadmarkfile{cldf-com} % commands, this can come late
-
-\loadmarkfile{core-ctx} % this order might change but we need to check depedencies / move to another namespace
-
-\loadmarkfile{core-def}
-
-%usemodule[x][res-04] % xml resource libraries
-%usemodule[x][res-08] % rlx runtime conversion
-%usemodule[x][res-12] % rli external indentification
-
-% now we hook in backend code (needs checking)
-
-\loadmkxlfile{driv-shp} % LMTX
-
-\loadmarkfile{back-exp}
-\loadmkxlfile{back-pdf} % LMTX
-\loadmkxlfile{back-mps} % LMTX
-\loadmkxlfile{back-lua} % LMTX
-
-\loadmkxlfile{mlib-pdf} % LMTX
-\loadmarkfile{mlib-pps}
-\loadmarkfile{meta-pdf}
-\loadmarkfile{meta-blb}
-\loadmarkfile{grph-epd}
-
-\loadmarkfile{math-inc} % an experiment
-\loadmarkfile{publ-inc} % an experiment
-
-\loadmarkfile{task-ini}
-
-\loadmarkfile{syst-cmp} % compatibility stuff moved here
-
-\loadmkxlfile{libs-ini}
-
-\loadmarkfile{cont-run} % the main runner (used in cont-yes.mkiv)
-
-\setupcurrentlanguage[\defaultlanguagetag]
-
-\prependtoks
- \ctxlua{statistics.starttiming(statistics)}%
-\to \everyjob
-
-\appendtoks
- \ctxlua{statistics.stoptiming(statistics)}%
-\to \everyjob
-
-% \appendtoks
-% \ctxlua{job.prepare()}%
-% \to \everyjob
-
-% \appendtoks
-% \enabletrackers[*]%
-% \to \everyjob
-
-\appendtoks
- \ctxlua{statistics.savefmtstatus("\jobname","\contextversion","context.mkxl","\contextkind","\contextbanner")}% can become automatic
-\to \everydump
-
-\errorstopmode \dump \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/core-con.lua b/Master/texmf-dist/tex/context/base/mkiv/core-con.lua
index 4f6090ef5b5..4bf1424bc02 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/core-con.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/core-con.lua
@@ -16,12 +16,15 @@ slower but look nicer this way.</p>
<p>Some code may move to a module in the language namespace.</p>
--ldx]]--
-local floor, osdate, ostime, concat = math.floor, os.date, os.time, table.concat
+local floor = math.floor
+local osdate, ostime = os.date, os.time
+local concat, insert, reverse = table.concat, table.insert, table.reverse
local lower, upper, rep, match, gsub = string.lower, string.upper, string.rep, string.match, string.gsub
local utfchar, utfbyte = utf.char, utf.byte
local tonumber, tostring, type, rawset = tonumber, tostring, type, rawset
local P, S, R, Cc, Cf, Cg, Ct, Cs, C, V, Carg = lpeg.P, lpeg.S, lpeg.R, lpeg.Cc, lpeg.Cf, lpeg.Cg, lpeg.Ct, lpeg.Cs, lpeg.C, lpeg.V, lpeg.Carg
local lpegmatch, lpegpatterns = lpeg.match, lpeg.patterns
+local div, mod = math.div, math.mod
local context = context
local commands = commands
@@ -328,7 +331,7 @@ converters.nofdays = nofdays
converters.textime = textime
implement { name = "weekday", actions = { weekday, context }, arguments = { "integer", "integer", "integer" } }
-implement { name = "leapyear", actions = { leapyear, context }, arguments = { "integer" } }
+implement { name = "leapyear", actions = { leapyear, context }, arguments = "integer" }
implement { name = "nofdays", actions = { nofdays, context }, arguments = { "integer", "integer" } }
implement { name = "year", actions = { osdate, context }, arguments = "'%Y'" }
@@ -445,6 +448,94 @@ implement {
arguments = { "integer", true }
}
+-- -- - hebrew and jiddish -- -- --
+
+local trace_hebrew trackers.register("converters.hebrew", function(v)
+ trace_hebrew = v
+end)
+
+local list = {
+ { 400, "ת" }, { 300, "ש" }, { 200, "ר" }, { 100, "ק" },
+ { 90, "צ" }, { 80, "פ" }, { 70, "ע" }, { 60, "ס "}, { 50, "נ" }, { 40, "מ" }, { 30, "ל" }, { 20, "כ" }, { 10, "י" },
+ { 9, "ט" }, { 8, "ח" }, { 7, "ז", }, { 6, "ו", }, { 5, "ה" }, { 4, "ד" }, { 3, "ג" }, { 2, "ב" }, { 1, "א" },
+}
+
+local special = {
+ [15] = "ט״ו", -- exception: avoid mixup with God יה
+ [16] = "ט״ז", -- exception: avoid mixup with God יו
+}
+
+local function tohebrew(n,gershayim,geresh)
+ local split = { }
+ local size = 0
+ while n > 1000 do
+ size = size + 1
+ split[size] = n % 1000
+ n = floor(n/1000)
+ end
+ size = size + 1
+ split[size] = n
+ for i=1,size do
+ local t = { }
+ local n = 0
+ local s = split[i]
+ while s > 0 do
+ for i=1,#list do
+ ::again::
+ local li = list[i]
+ local l1 = li[1]
+ local s1 = special[l1]
+ if s1 then
+ s = s - l1
+ n = n + 1
+ t[n] = s1
+ goto again
+ elseif s >= l1 then
+ s = s - l1
+ n = n + 1
+ t[n] = li[2]
+ goto again
+ end
+ end
+ end
+ ::done::
+ split[i] = t
+ end
+ if gershayim then
+ for i=1,size do
+ local si = split[i]
+ local ni = #si
+ if ni >= 2 then
+ local s = "״"
+ insert(split[i],ni,trace_hebrew and ("{\\red "..s.."}") or s)
+ end
+ end
+ end
+ if geresh then
+ for i=2,#split do
+ local s = rep("׳",i-1)
+ insert(split[i],trace_hebrew and ("{\\blue "..s.."}") or s)
+ end
+ end
+ for i=1,size do
+ split[i] = concat(split[i])
+ end
+ return concat(reverse(split))
+end
+
+converters.tohebrew = tohebrew
+converters.hebrewnumerals = converters.tohebrew
+
+-- converters['alphabetic:hb'] = converters.hebrewnumerals
+
+interfaces.implement {
+ name = "hebrewnumerals",
+ actions = { tohebrew, context },
+ arguments = { "integer", true, true }
+}
+
+-- -- --
+
local vector = {
normal = {
[0] = "〇",
@@ -703,115 +794,303 @@ implement {
arguments = { "string", "integer" }
}
--- Well, since the one asking for this didn't test it the following code is not
--- enabled.
---
--- -- This Lua version is based on a Javascript by Behdad Esfahbod which in turn
--- -- is based on GPL'd code by Roozbeh Pournader of the The FarsiWeb Project
--- -- Group: http://www.farsiweb.info/jalali/jalali.js.
--- --
--- -- We start tables at one, I kept it zero based in order to stay close to
--- -- the original.
--- --
--- -- Conversion by Hans Hagen
-
-local g_days_in_month = { [0] = 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
-local j_days_in_month = { [0] = 31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29 }
-
-local div = math.div
-local mod = math.mod
-
-function gregorian_to_jalali(gy,gm,gd)
- local jy, jm, jd, g_day_no, j_day_no, j_np, i
- gy, gm, gd = gy - 1600, gm - 1, gd - 1
- g_day_no = 365*gy + div((gy+3),4) - div((gy+99),100) + div((gy+399),400)
- i = 0
- while i < gm do
- g_day_no = g_day_no + g_days_in_month[i]
- i = i + 1
+-- hebrew data conversion
+
+local gregorian_to_hebrew do
+
+ -- The next code is based on the c code at https://github.com/hebcal/hebcal
+ --
+ -- Hebcal : A Jewish Calendar Generator
+ -- Copyright : 1994 - 2004 Danny Sadinoff, 2002 Michael J. Radwin
+ -- License : GPL
+ --
+ -- Because we only need simple dates, we use part of the code. There is more
+ -- at that github place.
+ --
+ -- The number of days elapsed between the Gregorian date 12/31/1 BC and DATE.
+ -- The Gregorian date Sunday, December 31, 1 BC is imaginary.
+ --
+ -- The code is luafied and a little different because we have no assignments
+ -- in loops and such. We could speed up the code but then we divert from the
+ -- original. This is not that critical anyway.
+
+ local NISAN = 1
+ local IYYAR = 2
+ local SIVAN = 3
+ local TAMUZ = 4
+ local AV = 5
+ local ELUL = 6
+ local TISHREI = 7
+ local CHESHVAN = 8
+ local KISLEV = 9
+ local TEVET = 10
+ local SHVAT = 11
+ local ADAR_I = 12
+ local ADAR_II = 13
+
+ local mmap = {
+ KISLEV,
+ TEVET,
+ SHVAT,
+ ADAR_I,
+ NISAN,
+ IYYAR,
+ SIVAN,
+ TAMUZ,
+ TISHREI,
+ TISHREI,
+ TISHREI,
+ CHESHVAN
+ }
+
+ local function greg2abs(year,month,day)
+ local y = year - 1
+ return y * 365 + div(y,4)- div(y,100) + div(y,400) + os.nofdays(year,month,day)
+ end
+
+ local function abs2greg(abs)
+
+ local d0 = abs - 1
+
+ local n400 = div(d0, 146097)
+ local d1 = mod(d0, 146097)
+ local n100 = div(d1, 36524)
+ local d2 = mod(d1, 36524)
+ local n4 = div(d2, 1461)
+ local d3 = mod(d2, 1461)
+ local n1 = div(d3, 365)
+
+ local day = mod(d3, 365) + 1
+ local year = 400 * n400 + 100 * n100 + 4 * n4 + n1
+
+ if n100 == 4 or n1 == 4 then
+ return year, 12, 31
+ else
+ year = year + 1
+ month = 1
+ while true do
+ local mlen = os.nofdays(year,month)
+ if mlen < day then
+ day = day - mlen
+ month = month + 1
+ else
+ break
+ end
+ end
+ return year, month, day
+ end
end
- if (gm>1 and ((gy%4==0 and gy%100~=0) or (gy%400==0))) then
- g_day_no = g_day_no + 1
+
+ local function hebrew_leapyear(year)
+ return mod(1 + year * 7, 19) < 7
end
- g_day_no = g_day_no + gd
- j_day_no = g_day_no - 79
- j_np = div(j_day_no,12053)
- j_day_no = mod(j_day_no,12053)
- jy = 979 + 33*j_np + 4*div(j_day_no,1461)
- j_day_no = mod(j_day_no,1461)
- if j_day_no >= 366 then
- jy = jy + div((j_day_no-1),365)
- j_day_no = mod((j_day_no-1),365)
+
+ local function hebrew_months_in_year(year)
+ return hebrew_leapyear(year) and 13 or 12
end
- i = 0
- while i < 11 and j_day_no >= j_days_in_month[i] do
- j_day_no = j_day_no - j_days_in_month[i]
- i = i + 1
+
+ local function hebrew_elapsed_days(year)
+ local y = year - 1
+ local m_elapsed = 235 * div(y,19) + 12 * mod(y,19) + div(((mod(y,19) * 7) + 1),19)
+ local p_elapsed = 204 + 793 * mod(m_elapsed,1080)
+ local h_elapsed = 5 + 12 * m_elapsed + 793 * div(m_elapsed,1080) + div(p_elapsed,1080)
+ local parts = mod(p_elapsed,1080) + 1080 * mod(h_elapsed,24)
+ local day = 1 + 29 * m_elapsed + div(h_elapsed,24)
+ local d = mod(day,7)
+ local alt_day = day
+ if parts >= 19440
+ or (parts >= 9924 and d == 2 and not (hebrew_leapyear(year)))
+ or (parts >= 16789 and d == 1 and hebrew_leapyear(y )) then
+ alt_day = alt_day + 1
+ end
+ d = mod(alt_day,7)
+ if d == 0 or d == 3 or d == 5 then
+ alt_day = alt_day + 1
+ end
+ return alt_day
end
- jm = i + 1
- jd = j_day_no + 1
- return jy, jm, jd
-end
-function jalali_to_gregorian(jy,jm,jd)
- local gy, gm, gd, g_day_no, j_day_no, leap, i
- jy, jm, jd = jy - 979, jm - 1, jd - 1
- j_day_no = 365*jy + div(jy,33)*8 + div((mod(jy,33)+3),4)
- for i=0,jm-1,1 do
- j_day_no = j_day_no + j_days_in_month[i]
+ local function days_in_hebrew_year(year)
+ return hebrew_elapsed_days(year + 1) - hebrew_elapsed_days(year)
end
- j_day_no = j_day_no + jd
- g_day_no = j_day_no + 79
- gy = 1600 + 400*div(g_day_no,146097)
- g_day_no = mod(g_day_no, 146097)
- leap = 1
- if g_day_no >= 36525 then
- g_day_no = g_day_no - 1
- gy = gy + 100*div(g_day_no,36524)
- g_day_no = mod(g_day_no, 36524)
- if g_day_no >= 365 then
- g_day_no = g_day_no + 1
+
+ local function long_cheshvan(year)
+ return mod(days_in_hebrew_year(year),10) == 5
+ end
+
+ local function short_kislev(year)
+ return mod(days_in_hebrew_year(year),10) == 3
+ end
+
+ local function max_days_in_heb_month(month,year)
+ if month == IYYAR or month == TAMUZ or month == ELUL or month == TEVET or month == ADAR_II or
+ (month == ADAR_I and not hebrew_leapyear(year)) or
+ (month == CHESHVAN and not long_cheshvan(year)) or
+ (month == KISLEV and short_kislev (year)) then
+ return 29
else
- leap = 0
+ return 30
end
end
- gy = gy + 4*div(g_day_no,1461)
- g_day_no = mod(g_day_no, 1461)
- if g_day_no >= 366 then
- leap = 0
- g_day_no = g_day_no - 1
- gy = gy + div(g_day_no, 365)
- g_day_no = mod(g_day_no, 365)
- end
- i = 0
- while true do
- local d = g_days_in_month[i] + ((i == 1 and leap) or 0)
- if g_day_no >= d then
- g_day_no = g_day_no - d
- i = i + 1
+
+ local function hebrew2abs(year,month,day)
+ if month < TISHREI then
+ for m=TISHREI, hebrew_months_in_year(year), 1 do
+ day = day + max_days_in_heb_month(m,year)
+ end
+ for m=NISAN, month - 1, 1 do
+ day = day + max_days_in_heb_month(m,year)
+ end
else
- break
+ for m=TISHREI, month - 1, 1 do
+ day = day + max_days_in_heb_month(m,year)
+ end
end
+ return hebrew_elapsed_days(year) - 1373429 + day
end
- gm = i + 1
- gd = g_day_no + 1
- return gy, gm, gd
+
+ local function abs2hebrew(abs)
+ local yy, mm, dd = abs2greg(abs)
+ local day = 1
+ local month = TISHREI
+ local year = 3760 + yy
+ while abs >= hebrew2abs(year+1,month,day) do
+ year = year + 1
+ end
+ if year >= 4635 and year < 10666 then
+ month = mmap[mm]
+ end
+ while abs > hebrew2abs(year,month,max_days_in_heb_month(month,year)) do
+ month = mod(month,hebrew_months_in_year(year)) + 1
+ end
+ day = abs - hebrew2abs(year,month,1) + 1
+ return year, month, day
+ end
+
+ -- months = { "ניסן" "אייר" "סיון" "תמוז" "אב" "אלול" "תשרי" "חשון" "כסלו" "טבת" "שבט" }
+
+ gregorian_to_hebrew = function(y,m,d)
+ return abs2hebrew(greg2abs(y,m,d))
+ end
+
+ converters.gregorian_to_hebrew = gregorian_to_hebrew
+
end
--- local function test(yg,mg,dg,yj,mj,dj)
--- local y1, m1, d1 = jalali_to_gregorian(yj,mj,dj)
--- local y2, m2, d2 = gregorian_to_jalali(yg,mg,dg)
--- print(y1 == yg and m1 == mg and d1 == dg, yg,mg,dg, y1,m1,d1)
--- print(y2 == yj and m2 == mj and d2 == dj, yj,mj,dj, y2,m2,d2)
--- end
+local gregorian_to_jalali, jalali_to_gregorian do
+
+ -- Well, since the one asking for this didn't test it the following code is not
+ -- enabled.
+ --
+ -- -- This Lua version is based on a Javascript by Behdad Esfahbod which in turn
+ -- -- is based on GPL'd code by Roozbeh Pournader of the The FarsiWeb Project
+ -- -- Group: http://www.farsiweb.info/jalali/jalali.js.
+ -- --
+ -- -- We start tables at one, I kept it zero based in order to stay close to
+ -- -- the original.
+ -- --
+ -- -- Conversion by Hans Hagen
+
+ local g_days_in_month = { [0] = 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
+ local j_days_in_month = { [0] = 31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29 }
+
+
+ gregorian_to_jalali = function(gy,gm,gd)
+ local jy, jm, jd, g_day_no, j_day_no, j_np, i
+ gy, gm, gd = gy - 1600, gm - 1, gd - 1
+ g_day_no = 365*gy + div((gy+3),4) - div((gy+99),100) + div((gy+399),400)
+ i = 0
+ while i < gm do
+ g_day_no = g_day_no + g_days_in_month[i]
+ i = i + 1
+ end
+ if (gm>1 and ((gy%4==0 and gy%100~=0) or (gy%400==0))) then
+ g_day_no = g_day_no + 1
+ end
+ g_day_no = g_day_no + gd
+ j_day_no = g_day_no - 79
+ j_np = div(j_day_no,12053)
+ j_day_no = mod(j_day_no,12053)
+ jy = 979 + 33*j_np + 4*div(j_day_no,1461)
+ j_day_no = mod(j_day_no,1461)
+ if j_day_no >= 366 then
+ jy = jy + div((j_day_no-1),365)
+ j_day_no = mod((j_day_no-1),365)
+ end
+ i = 0
+ while i < 11 and j_day_no >= j_days_in_month[i] do
+ j_day_no = j_day_no - j_days_in_month[i]
+ i = i + 1
+ end
+ jm = i + 1
+ jd = j_day_no + 1
+ return jy, jm, jd
+ end
+
+ jalali_to_gregorian = function(jy,jm,jd)
+ local gy, gm, gd, g_day_no, j_day_no, leap, i
+ jy, jm, jd = jy - 979, jm - 1, jd - 1
+ j_day_no = 365*jy + div(jy,33)*8 + div((mod(jy,33)+3),4)
+ for i=0,jm-1,1 do
+ j_day_no = j_day_no + j_days_in_month[i]
+ end
+ j_day_no = j_day_no + jd
+ g_day_no = j_day_no + 79
+ gy = 1600 + 400*div(g_day_no,146097)
+ g_day_no = mod(g_day_no, 146097)
+ leap = 1
+ if g_day_no >= 36525 then
+ g_day_no = g_day_no - 1
+ gy = gy + 100*div(g_day_no,36524)
+ g_day_no = mod(g_day_no, 36524)
+ if g_day_no >= 365 then
+ g_day_no = g_day_no + 1
+ else
+ leap = 0
+ end
+ end
+ gy = gy + 4*div(g_day_no,1461)
+ g_day_no = mod(g_day_no, 1461)
+ if g_day_no >= 366 then
+ leap = 0
+ g_day_no = g_day_no - 1
+ gy = gy + div(g_day_no, 365)
+ g_day_no = mod(g_day_no, 365)
+ end
+ i = 0
+ while true do
+ local d = g_days_in_month[i] + ((i == 1 and leap) or 0)
+ if g_day_no >= d then
+ g_day_no = g_day_no - d
+ i = i + 1
+ else
+ break
+ end
+ end
+ gm = i + 1
+ gd = g_day_no + 1
+ return gy, gm, gd
+ end
+
+ -- local function test(yg,mg,dg,yj,mj,dj)
+ -- local y1, m1, d1 = jalali_to_gregorian(yj,mj,dj)
+ -- local y2, m2, d2 = gregorian_to_jalali(yg,mg,dg)
+ -- print(y1 == yg and m1 == mg and d1 == dg, yg,mg,dg, y1,m1,d1)
+ -- print(y2 == yj and m2 == mj and d2 == dj, yj,mj,dj, y2,m2,d2)
+ -- end
+
+ -- test(1953,08,19, 1332,05,28)
+ -- test(1979,02,11, 1357,11,22)
+ -- test(2000,02,28, 1378,12,09)
+ -- test(2000,03,01, 1378,12,11)
+ -- test(2009,02,24, 1387,12,06)
+ -- test(2015,03,21, 1394,01,01)
+ -- test(2016,03,20, 1395,01,01)
--- test(1953,08,19, 1332,05,28)
--- test(1979,02,11, 1357,11,22)
--- test(2000,02,28, 1378,12,09)
--- test(2000,03,01, 1378,12,11)
--- test(2009,02,24, 1387,12,06)
--- test(2015,03,21, 1394,01,01)
--- test(2016,03,20, 1395,01,01)
+ converters.gregorian_to_jalali = gregorian_to_jalali
+ converters.jalali_to_gregorian = jalali_to_gregorian
+
+end
-- -- more efficient but needs testing
@@ -945,7 +1224,7 @@ local words = {
[1000000000000] = "trillion",
}
-local function translate(n)
+local function translate(n,connector)
local w = words[n]
if w then
return w
@@ -995,7 +1274,7 @@ local function translate(n)
if n > 0 then
compose_one(n)
end
- return #t > 0 and concat(t," ") or tostring(n)
+ return #t > 0 and concat(t,connector or " ") or tostring(n)
end
data.english = {
@@ -1067,7 +1346,7 @@ local words = {
[1000000000000] = "billón",
}
-local function translate(n)
+local function translate(n,connector)
local w = words[n]
if w then
return w
@@ -1122,7 +1401,7 @@ local function translate(n)
if n > 0 then
compose_one(n)
end
- return #t > 0 and concat(t," ") or tostring(n)
+ return #t > 0 and concat(t,connector or " ") or tostring(n)
end
data.spanish = {
@@ -1138,20 +1417,20 @@ data.es = data.spanish
-- verbose handler:
-function converters.verbose.translate(n,language)
+function converters.verbose.translate(n,language,connector)
local t = language and data[language]
- return t and t.translate(n) or n
+ return t and t.translate(n,connector) or n
end
-local function verbose(n,language)
+local function verbose(n,language,connector)
local t = language and data[language]
- context(t and t.translate(n) or n)
+ context(t and t.translate(n,connector) or n)
end
implement {
name = "verbose",
actions = verbose,
- arguments = { "integer", "string" }
+ arguments = { "integer", "string", "string" }
}
-- These are just helpers but not really for the tex end. Do we have to
@@ -1227,8 +1506,13 @@ local monthmnems = { -- not variables
-- virtual table
}
-setmetatableindex(months, function(t,k) return "unknown" end)
+local daymnems = { -- not variables
+ -- virtual table
+}
+
setmetatableindex(days, function(t,k) return "unknown" end)
+setmetatableindex(daymnems, function(t,k) return days[k] .. ":mnem" end)
+setmetatableindex(months, function(t,k) return "unknown" end)
setmetatableindex(monthmnems, function(t,k) return months[k] .. ":mnem" end)
do
@@ -1237,6 +1521,10 @@ do
ctx_labeltext(days[n])
end
+ local function daymnem(n)
+ ctx_labeltext(daymnems[n])
+ end
+
local function weekdayname(day,month,year)
ctx_labeltext(days[weekday(day,month,year)])
end
@@ -1256,6 +1544,12 @@ do
}
implement {
+ name = "daymnem",
+ actions = daymnem,
+ arguments = "integer",
+ }
+
+ implement {
name = "weekdayname",
actions = weekdayname,
arguments = { "integer", "integer", "integer" }
@@ -1264,22 +1558,28 @@ do
implement {
name = "monthname",
actions = monthname,
- arguments = { "integer" }
+ arguments = "integer",
}
implement {
name = "monthmnem",
actions = monthmnem,
- arguments = { "integer" }
+ arguments = "integer",
}
+ -- todo : short week days
+
local f_monthlong = formatters["\\monthlong{%s}"]
local f_monthshort = formatters["\\monthshort{%s}"]
+ local f_daylong = formatters["\\daylong{%s}"]
+ local f_dayshort = formatters["\\dayshort{%s}"]
local f_weekday = formatters["\\weekday{%s}"]
local f_dayoftheweek = formatters["\\dayoftheweek{%s}{%s}{%s}"]
local function tomonthlong (m) return f_monthlong (tonumber(m) or 1) end
local function tomonthshort(m) return f_monthshort(tonumber(m) or 1) end
+ local function todaylong (d) return f_daylong (tonumber(d) or 1) end
+ local function todayshort (d) return f_dayshort (tonumber(d) or 1) end
local function toweekday (d) return f_weekday (tonumber(d) or 1) end
local function todayoftheweek(d,m,y)
@@ -1288,6 +1588,8 @@ do
addformatter(formatters,"monthlong", [[tomonthlong(%s)]], { tomonthlong = tomonthlong })
addformatter(formatters,"monthshort", [[tomonthshort(%s)]], { tomonthshort = tomonthshort })
+ addformatter(formatters,"daylong", [[todaylong(%s)]], { todaylong = todaylong })
+ addformatter(formatters,"dayshort", [[todayshort(%s)]], { todayshort = todayshort })
addformatter(formatters,"weekday", [[toweekday(%s)]], { toweekday = toweekday })
addformatter(formatters,"dayoftheweek",[[todayoftheweek(%s,%s,%s)]],{ todayoftheweek = todayoftheweek })
@@ -1307,6 +1609,14 @@ do
return f_monthshort(tonumber(osdate("%m",tonumber(e))))
end
+ local function toedaylong(e)
+ return f_datlong(tonumber(osdate("%w",tonumber(e))))
+ end
+
+ local function toedayshort(e)
+ return f_dayshort(tonumber(osdate("%w",tonumber(e))))
+ end
+
local function toeweek(e) -- we run from 1-7 not 0-6
return tostring(tonumber(osdate("%w",tonumber(e)))+1)
end
@@ -1319,18 +1629,20 @@ do
return osdate(format,tonumber(e))
end
- addformatter(formatters,"eyear", [[toeyear(%s)]], { toeyear = toeyear })
- addformatter(formatters,"emonth", [[toemonth(%s)]], { toemonth = toemonth })
- addformatter(formatters,"eday", [[toeday(%s)]], { toeday = toeday })
- addformatter(formatters,"eweek", [[toeweek(%s)]], { toeweek = toeweek })
- addformatter(formatters,"eminute", [[toeminute(%s)]], { toeminute = toeminute })
- addformatter(formatters,"esecond", [[toesecond(%s)]], { toesecond = toesecond })
+ addformatter(formatters,"eyear", [[toeyear(%s)]], { toeyear = toeyear })
+ addformatter(formatters,"emonth", [[toemonth(%s)]], { toemonth = toemonth })
+ addformatter(formatters,"eday", [[toeday(%s)]], { toeday = toeday })
+ addformatter(formatters,"eweek", [[toeweek(%s)]], { toeweek = toeweek })
+ addformatter(formatters,"eminute", [[toeminute(%s)]], { toeminute = toeminute })
+ addformatter(formatters,"esecond", [[toesecond(%s)]], { toesecond = toesecond })
- addformatter(formatters,"emonthlong", [[toemonthlong(%s)]], { toemonthlong = toemonthlong })
- addformatter(formatters,"emonthshort", [[toemonthshort(%s)]], { toemonthshort = toemonthshort })
- addformatter(formatters,"eweekday", [[toeweekday(%s)]], { toeweekday = toeweekday })
+ addformatter(formatters,"emonthlong", [[toemonthlong(%s)]], { toemonthlong = toemonthlong })
+ addformatter(formatters,"emonthshort", [[toemonthshort(%s)]], { toemonthshort = toemonthshort })
+ addformatter(formatters,"edaylong", [[toedaylong(%s)]], { toedaylong = toedaylong })
+ addformatter(formatters,"edayshort", [[toedayshort(%s)]], { toedayshort = toedayshort })
+ addformatter(formatters,"eweekday", [[toeweekday(%s)]], { toeweekday = toeweekday })
- addformatter(formatters,"edate", [[toedate(%s,%s)]], { toedate = toedate })
+ addformatter(formatters,"edate", [[toedate(%s,%s)]], { toedate = toedate })
end
@@ -1346,17 +1658,27 @@ local spaced = {
[v_day] = true,
[v_weekday] = true,
[v_WEEKDAY] = true,
- [v_day] = true,
}
local dateconverters = {
+ ["hebrew:to"] = gregorian_to_hebrew,
["jalali:to"] = gregorian_to_jalali,
["jalali:from"] = jalali_to_gregorian,
}
local variants = {
- mnem = monthmnems,
- jalali = setmetatableindex(function(t,k) return months[k] .. ":jalali" end),
+ mnem = {
+ month = monthmnems,
+ day = daymnems,
+ },
+ hebrew = {
+ month = setmetatableindex(function(t,k) return months[k] .. ":hebrew" end),
+ day = setmetatableindex(function(t,k) return days [k] .. ":hebrew" end),
+ },
+ jalali = {
+ month = setmetatableindex(function(t,k) return months[k] .. ":jalali" end),
+ day = setmetatableindex(function(t,k) return days [k] .. ":jalali" end),
+ },
}
do
@@ -1386,9 +1708,7 @@ do
elseif plus == "++" or plus == "highord" then
ordinal = true
highordinal = true
- -- elseif plus == "mnem" then
- -- mnemonic = true
- elseif plus then -- elseif plus == "mnem" then
+ elseif plus then -- mnem MNEM etc
mnemonic = variants[plus]
end
if not auto and spaced[tag] then
@@ -1396,34 +1716,58 @@ do
end
auto = false
if tag == v_year or tag == "y" or tag == "Y" then
- context(year)
+ if plus then
+ plus = converters[plus]
+ end
+ if plus then
+ context(plus(year))
+ elseif currentlanguage == false then
+ context(year)
+ else
+ ctx_convertnumber(v_year,year)
+ end
elseif tag == "yy" or tag == "YY" then
context("%02i",year % 100)
elseif tag == v_month or tag == "m" then
if currentlanguage == false then
context(Word(months[month]))
- elseif mnemonic then
- ctx_labeltext(variables[mnemonic[month]])
else
- ctx_labeltext(variables[months[month]])
+ if type(mnemonic) == "table" then
+ mnemonic = mnemonic.month
+ end
+ if mnemonic then
+ ctx_labeltext(variables[mnemonic[month]])
+ else
+ ctx_labeltext(variables[months[month]])
+ end
end
elseif tag == v_MONTH then
if currentlanguage == false then
context(Word(variables[months[month]]))
- elseif mnemonic then
- ctx_LABELTEXT(variables[mnemonic[month]])
else
- ctx_LABELTEXT(variables[months[month]])
+ if type(mnemonic) == "table" then
+ mnemonic = mnemonic.month
+ end
+ if mnemonic then
+ ctx_LABELTEXT(variables[mnemonic[month]])
+ else
+ ctx_LABELTEXT(variables[months[month]])
+ end
end
elseif tag == "mm" then
context("%02i",month)
elseif tag == "M" then
context(month)
elseif tag == v_day or tag == "d" then
- if currentlanguage == false then
+ if plus then
+ plus = converters[plus]
+ end
+ if plus then
+ context(plus(day))
+ elseif currentlanguage == false then
context(day)
else
- ctx_convertnumber(v_day,day) -- why not direct
+ ctx_convertnumber(v_day,day)
end
whatordinal = day
elseif tag == "dd" then
@@ -1437,14 +1781,28 @@ do
if currentlanguage == false then
context(Word(days[wd]))
else
- ctx_labeltext(variables[days[wd]])
+ if type(mnemonic) == "table" then
+ mnemonic = mnemonic.day
+ end
+ if mnemonic then
+ ctx_labeltext(variables[mnemonic[wd]])
+ else
+ ctx_labeltext(variables[days[wd]])
+ end
end
elseif tag == v_WEEKDAY then
local wd = weekday(day,month,year)
if currentlanguage == false then
context(Word(days[wd]))
else
- ctx_LABELTEXT(variables[days[wd]])
+ if type(mnemonic) == "table" then
+ mnemonic = mnemonic.day
+ end
+ if mnemonic then
+ ctx_LABELTEXT(variables[mnemonic[wd]])
+ else
+ ctx_LABELTEXT(variables[days[wd]])
+ end
end
elseif tag == "W" then
context(weekday(day,month,year))
diff --git a/Master/texmf-dist/tex/context/base/mkiv/core-con.mkiv b/Master/texmf-dist/tex/context/base/mkiv/core-con.mkiv
index b73280d00f1..616ed199640 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/core-con.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/core-con.mkiv
@@ -76,6 +76,9 @@
\def\abjadnodotnumerals#1{\clf_abjadnodotnumerals\numexpr#1\relax}
\def\abjadnaivenumerals#1{\clf_alphabetic \numexpr#1\relax{arabic}} % okay?
+\def\hebrewnumerals #1{\clf_hebrewnumerals\numexpr#1\relax}
+\let\yiddishnumerals \hebrewnumerals
+
\def\languagecharacters#1{\clf_alphabetic\numexpr#1\relax{\currentlanguage}} % new
\def\languageCharacters#1{\clf_Alphabetic\numexpr#1\relax{\currentlanguage}} % new
@@ -210,6 +213,8 @@
\unexpanded\def\monthlong #1{\clf_monthname\numexpr#1\relax}
\unexpanded\def\monthshort#1{\clf_monthmnem\numexpr#1\relax}
+\unexpanded\def\daylong #1{\clf_dayname\numexpr#1\relax}
+\unexpanded\def\dayshort #1{\clf_daymnem\numexpr#1\relax}
\let\convertmonth\monthlong % for old times sake
@@ -218,11 +223,15 @@
%D \showsetup{month}
%D \showsetup{MONTH}
+\pushoverloadmode
+
\let\month\monthlong
-\unexpanded\def\MONTH #1{\WORD{\month {#1}}}
-\unexpanded\def\MONTHLONG #1{\WORD{\monthlong {#1}}}
-\unexpanded\def\MONTHSHORT#1{\WORD{\monthshort{#1}}}
+\popoverloadmode
+
+\unexpanded\def\MONTH #1{\WORD{\clf_monthname\numexpr#1\relax}}
+\unexpanded\def\MONTHLONG #1{\WORD{\clf_monthname\numexpr#1\relax}}
+\unexpanded\def\MONTHSHORT#1{\WORD{\clf_monthmnem\numexpr#1\relax}}
%D We never explicitly needed this, but Tobias Burnus pointed out that it would be
%D handy to convert to the day of the week. In doing so, we have to calculate the
@@ -242,8 +251,10 @@
%D \showsetup{weekday}
%D \showsetup{WEEKDAY}
-\unexpanded\def\weekday#1{\clf_dayname\numexpr#1\relax}
-\unexpanded\def\WEEKDAY#1{\WORD{\clf_dayname\numexpr#1\relax}}
+\unexpanded\def\weekday #1{\clf_dayname\numexpr#1\relax}
+\unexpanded\def\WEEKDAY #1{\WORD{\clf_dayname\numexpr#1\relax}}
+\unexpanded\def\DAYLONG #1{\WORD{\clf_dayname\numexpr#1\relax}}
+\unexpanded\def\DAYSHORT#1{\WORD{\clf_daymnem\numexpr#1\relax}}
%D \macros
%D {getdayoftheweek, dayoftheweek}
@@ -407,8 +418,28 @@
%D \stopbuffer
%D
%D \typebuffer \getbuffer
+%D
+%D Some indirectness and abstraction:
+%D
+%D \starttyping
+%D \definedate[crap][year]
+%D \currentdate[crap]
+%D \stoptyping
+
+\installcorenamespace{date}
-\newtoks \everycurrentdate
+\unexpanded\def\definedate
+ {\dodoubleargument\syst_converters_define_date}
+
+\def\syst_converters_define_date[#1][#2]%
+ {\setvalue{\??date#1}{#2}}
+
+\def\syst_converters_check_date_specification#1%
+ {\ifcsname\??date#1\endcsname
+ \edef#1{\lastnamedcs}%
+ \fi}
+
+\newtoks\everycurrentdate
\unexpanded\def\currentdate
{\dosingleempty\syst_converters_current_date}
@@ -417,8 +448,11 @@
{\dontleavehmode
\begingroup
\the\everycurrentdate
+ \edef\forceddatespecification{#1}%
+ \syst_converters_check_date_specification\forceddatespecification
+ \syst_converters_check_date_specification\currentdatespecification
\clf_currentdate
- {#1}{\currentdatespecification}{\labellanguage}%
+ {\forceddatespecification}{\currentdatespecification}{\labellanguage}%
\normalyear\normalmonth\normalday
\endgroup}
@@ -433,16 +467,22 @@
\letdummyparameter\c!m\normalmonth
\letdummyparameter\c!y\normalyear
\getdummyparameters[#1]%
+ \edef\p_d{\directdummyparameter\c!d}%
+ \edef\p_m{\directdummyparameter\c!m}%
+ \edef\p_y{\directdummyparameter\c!y}%
\normalexpanded
{\endgroup
- \normalday \number\directdummyparameter\c!d\relax
- \normalmonth\number\directdummyparameter\c!m\relax
- \normalyear \number\directdummyparameter\c!y\relax}%
+ \ifx\p_d\empty\else\normalday \number\directdummyparameter\c!d\relax\fi
+ \ifx\p_m\empty\else\normalmonth\number\directdummyparameter\c!m\relax\fi
+ \ifx\p_y\empty\else\normalyear \number\directdummyparameter\c!y\relax\fi}%
\fi
\begingroup
\the\everycurrentdate
+ \edef\forceddatespecification{#2}%
+ \syst_converters_check_date_specification\forceddatespecification
+ \syst_converters_check_date_specification\currentdatespecification
\clf_currentdate
- {#2}{\currentdatespecification}{\labellanguage}%
+ {\forceddatespecification}{\currentdatespecification}{\labellanguage}%
\normalyear\normalmonth\normalday
\endgroup}
@@ -627,8 +667,10 @@
\def\ordinalnumber #1{\clf_ordinal\numexpr#1\relax{\currentlanguage}}
\def\Ordinalnumber #1{\Words{\clf_ordinal\numexpr#1\relax{\currentlanguage}}}
-\def\verbosenumber #1{\clf_verbose\numexpr#1\relax{\currentlanguage}}
-\def\VerboseNumber #1{\Words{\clf_verbose\numexpr#1\relax{\currentlanguage}}}
+\let\verbosenumberconnector\space
+
+\def\verbosenumber #1{\clf_verbose\numexpr#1\relax{\currentlanguage}{\verbosenumberconnector}}
+\def\VerboseNumber #1{\Words{\clf_verbose\numexpr#1\relax{\currentlanguage}{\verbosenumberconnector}}}
%D As longs as symbols are linked to levels or numbers, we can also use the
%D conversion mechanism, but in for instance the itemization macros, we prefer
@@ -705,6 +747,12 @@
\defineconversion [abjadnodotnumerals] [\abjadnodotnumerals]
\defineconversion [abjadnaivenumerals] [\abjadnaivenumerals]
+\defineconversion [hebrewnumerals] [\hebrewnumerals]
+\defineconversion [yiddishnumerals] [\yiddishnumerals]
+
+% users can do: \defineconversion [he] [\hebrewnumerals]
+% users can do: \defineconversion [yi] [\hebrewnumerals]
+
\defineconversion [thainumerals] [\thainumerals]
\defineconversion [devanagarinumerals] [\devanagarinumerals]
\defineconversion [gurmurkhinumerals] [\gurmurkhinumerals]
diff --git a/Master/texmf-dist/tex/context/base/mkiv/core-dat.mkiv b/Master/texmf-dist/tex/context/base/mkiv/core-dat.mkiv
index 9f4344b99d4..41a84c3e61a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/core-dat.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/core-dat.mkiv
@@ -77,9 +77,12 @@
\installcommandhandler \??pagestate {pagestate} \??pagestate
+% \def\syst_pagestates_allocate
+% {\expandafter\newcount\csname\??pagestatecounter\currentpagestate\endcsname
+% \expandafter\let\expandafter\c_syst_pagestate\csname\??pagestatecounter\currentpagestate\endcsname}
+
\def\syst_pagestates_allocate
- {\expandafter\newcount\csname\??pagestatecounter\currentpagestate\endcsname
- \expandafter\let\expandafter\c_syst_pagestate\csname\??pagestatecounter\currentpagestate\endcsname}
+ {\expandafter\newcount\csname\??pagestatecounter\currentpagestate\endcsname}
\appendtoks
\syst_pagestates_allocate
@@ -91,19 +94,37 @@
\unexpanded\def\setpagestate
{\dodoubleempty\syst_pagestates_set}
+% \def\syst_pagestates_set[#1][#2]%
+% {\begingroup
+% \edef\currentpagestate{#1}%
+% \ifcsname\??pagestatecounter\currentpagestate\endcsname
+% \let\c_syst_pagestate\lastnamedcs
+% \else
+% \syst_pagestates_allocate
+% \fi
+% \global\advance\c_syst_pagestate\plusone
+% \scratchcounter\lastnamedcs
+% \clf_setpagestate
+% name {\currentpagestate}%
+% tag {\ifsecondargument#2\else\number\c_syst_pagestate\fi}%
+% delay {\pagestateparameter\c!delay}%
+% \relax
+% \endgroup}
+
\def\syst_pagestates_set[#1][#2]%
{\begingroup
\edef\currentpagestate{#1}%
\ifcsname\??pagestatecounter\currentpagestate\endcsname
- \let\c_syst_pagestate\lastnamedcs
+ \scratchcounter\lastnamedcs
+ \advance\scratchcounter\plusone
\else
+ \scratchcounter\plusone
\syst_pagestates_allocate
\fi
- \global\advance\c_syst_pagestate\plusone
- \scratchcounter\lastnamedcs
+ \global\csname\??pagestatecounter\currentpagestate\endcsname\scratchcounter
\clf_setpagestate
name {\currentpagestate}%
- tag {\ifsecondargument#2\else\number\c_syst_pagestate\fi}%
+ tag {\ifsecondargument#2\else\number\scratchcounter\fi}%
delay {\pagestateparameter\c!delay}%
\relax
\endgroup}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/core-def.mkiv b/Master/texmf-dist/tex/context/base/mkiv/core-def.mkiv
index d10527d7bc7..b09d5b28f30 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/core-def.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/core-def.mkiv
@@ -145,7 +145,9 @@
% temporary here:
-\unexpanded\def\arg{\mathortext\normalmatharg\normaltextarg}
+\pushoverloadmode
+ \frozen\unexpanded\def\arg{\mathortext\normalmatharg\normaltextarg}
+\popoverloadmode
% might move to \everydump or even disappear:
@@ -172,6 +174,6 @@
%D Till we fixed all styles:
-\let\\=\crlf
+\enforced\let\\\crlf % frozen or permanent?
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/core-env.lua b/Master/texmf-dist/tex/context/base/mkiv/core-env.lua
index 50759dd1941..1c5165ac891 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/core-env.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/core-env.lua
@@ -47,12 +47,12 @@ local cache = tokens.cache
local iftrue = cache["iftrue"].mode
-local dimencode = cache["scratchdimen"] .command
-local countcode = cache["scratchcounter"] .command
-local tokencode = cache["scratchtoken"] .command
-local skipcode = cache["scratchskip"] .command
-local muskipcode = cache["scratchmuskip"] .command
------ attributecode = cache["scratchattribute"].command
+local dimencode = cache["scratchdimen"] .command -- tokens.commands.register_dimen
+local countcode = cache["scratchcounter"].command -- tokens.commands.register_int
+local tokencode = cache["scratchtoks"] .command -- tokens.commands.register_toks
+local skipcode = cache["scratchskip"] .command -- tokens.commands.register_glue
+local muskipcode = cache["scratchmuskip"] .command -- tokens.commands.register_mu_glue
+local conditioncode = cache["iftrue"] .command -- tokens.commands.if_test
local types = {
[dimencode] = "dimen",
@@ -61,6 +61,7 @@ local types = {
[skipcode] = "skip",
[muskipcode] = "muskip",
-- [attributecode] = "attribute",
+ [conditioncode] = "condition"
}
setmetatableindex(texmodes, function(t,k)
@@ -80,10 +81,6 @@ setmetatableindex(texmodes, function(t,k)
end
end)
-setmetatablenewindex(texmodes, function(t,k)
- report_mode("you cannot set the %s named %a this way","mode",k)
-end)
-
setmetatableindex(texsystemmodes, function(t,k)
local m = systemmodes[k]
if m then
@@ -98,30 +95,39 @@ setmetatableindex(texsystemmodes, function(t,k)
end
end
end)
-setmetatablenewindex(texsystemmodes, function(t,k)
- report_mode("you cannot set the %s named %a this way","systemmode",k)
+
+do -- we could do the same as in lmtx (use the mode)
+
+ local trialtypesettingstate = createtoken("trialtypesettingstate").index
+ local texgetcount = tex.getcount
+
+ context.settrialtypesettingmethod(function()
+ return texgetcount(trialtypesettingstate) ~= 0
+ end)
+
+end
+
+setmetatablenewindex(texmodes, function(t,k) report_mode("you cannot set the %s named %a this way","mode", k) end)
+setmetatablenewindex(texsystemmodes, function(t,k) report_mode("you cannot set the %s named %a this way","systemmode", k) end)
+setmetatablenewindex(texconstants, function(t,k) report_mode("you cannot set the %s named %a this way","constant", k) end)
+setmetatablenewindex(texconditionals, function(t,k) report_mode("you cannot set the %s named %a this way","conditional",k) end)
+setmetatablenewindex(texifs, function(t,k) end)
+
+setmetatablenewindex(texifs, function(t,k)
+ -- just ignore
end)
setmetatableindex(texconstants, function(t,k)
return cache[k].mode ~= 0 and texgetcount(k) or 0
end)
-setmetatablenewindex(texconstants, function(t,k)
- report_mode("you cannot set the %s named %a this way","constant",k)
-end)
setmetatableindex(texconditionals, function(t,k) -- 0 == true
return cache[k].mode ~= 0 and texgetcount(k) == 0
end)
-setmetatablenewindex(texconditionals, function(t,k)
- report_mode("you cannot set the %s named %a this way","conditional",k)
-end)
-table.setmetatableindex(texifs, function(t,k)
+setmetatableindex(texifs, function(t,k)
return cache[k].mode == iftrue
end)
-setmetatablenewindex(texifs, function(t,k)
- -- just ignore
-end)
tex.isdefined = isdefined
diff --git a/Master/texmf-dist/tex/context/base/mkiv/core-env.mkiv b/Master/texmf-dist/tex/context/base/mkiv/core-env.mkiv
index 09de435e7c0..0f042f81512 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/core-env.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/core-env.mkiv
@@ -17,7 +17,7 @@
\unprotect
-\def\wildcardsymbol{*}
+\ifdefined\wildcardsymbol \else \def\wildcardsymbol{*} \fi
%D Modes:
%D
@@ -104,10 +104,14 @@
% demo: trialtypesetting is a systemmode as well as an if
+\pushoverloadmode
+
\newsystemmode{trialtypesetting}
\expandafter\let\csname\??mode\systemmodeprefix trialtypesetting\endcsname\trialtypesettingstate
+\popoverloadmode
+
\appendtoks
\trialtypesettingstate\enabledmode
\luacopyinputnodes\plusone
@@ -588,13 +592,15 @@
\def\syst_setups_start_loc{\ifsecondargument\expandafter\syst_setups_start_loc_c\else\expandafter\syst_setups_start_loc_d\fi}
\def\syst_setups_start_tex{\ifsecondargument\expandafter\syst_setups_start_tex_c\else\expandafter\syst_setups_start_tex_d\fi}
+% no need for \the\t_syst_setups_lua in the next, now too often
+
\def\syst_setups_start_lua_a{\the\t_syst_setups_lua\dodoubleempty\syst_setups_start_lua} % [ ] delimited
\def\syst_setups_start_xml_a{\the\t_syst_setups_xml\dodoubleempty\syst_setups_start_xml} % [ ] delimited
\def\syst_setups_start_raw_a{\the\t_syst_setups_raw\dodoubleempty\syst_setups_start_raw} % [ ] delimited
\def\syst_setups_start_loc_a{\the\t_syst_setups_loc\dodoubleempty\syst_setups_start_loc} % [ ] delimited
\def\syst_setups_start_tex_a{\the\t_syst_setups_tex\dodoubleempty\syst_setups_start_tex} % [ ] delimited
-% empty preserves inner {} (is removed by the \expandafter{#3})
+% empty preserves inner {} (is removed by the \expandafter{#3}) .. hm, looks old
\def\syst_setups_start_lua_b#1 {\the\t_syst_setups_lua\syst_setups_start_lua_indeed\empty{#1}\empty} % space delimited
\def\syst_setups_start_xml_b#1 {\the\t_syst_setups_xml\syst_setups_start_xml_indeed\empty{#1}\empty} % space delimited
diff --git a/Master/texmf-dist/tex/context/base/mkiv/core-ini.mkiv b/Master/texmf-dist/tex/context/base/mkiv/core-ini.mkiv
index cb8881c223d..9352c9487e6 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/core-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/core-ini.mkiv
@@ -47,12 +47,14 @@
%D Document:
-\newtoks \everysetupdocument
\newtoks \everyendoftextbody
\newtoks \everystarttext
\newtoks \everystoptext
+\newtoks \everystartdocument
+\newtoks \everystopdocument
+
%D Purity:
\newtoks \everyforgetall
@@ -89,7 +91,7 @@
%D Exporting:
-\newtoks\everyinitializeexport
+\newtoks \everyinitializeexport
%D Sectioning:
@@ -170,8 +172,9 @@
\newif \ifinpagebody
\newif \ifinsidecolumns
-\newif \ifdoublesided \doublesidedfalse
-\newif \ifsinglesided \singlesidedtrue
+\newif \ifinsidemulticolumns % simple mixed-in-text columns
+\newif \ifdoublesided \doublesidedfalse
+\newif \ifsinglesided \singlesidedtrue
\newif \ifinsidefloat
\newif \ifdoingblocks
\newif \ifgridsnapping
@@ -180,12 +183,15 @@
\newconstant\pageduplexmode % 0 single 1 double 2 mix
\newconstant\pagebodymode % 0 not 1 normal pagebody 2 spread
+\newcount\nofcolumns \nofcolumns \plusone
+\newcount\nofmulticolumns \nofmulticolumns\plusone
+
%D \macros
%D {ifproductionrun}
%D
%D This boolean can be used to bypass certain initializations.
-\newif\ifproductionrun
+% \newif\ifproductionrun % already defined
\appendtoks
\productionruntrue
diff --git a/Master/texmf-dist/tex/context/base/mkiv/core-lmt.lua b/Master/texmf-dist/tex/context/base/mkiv/core-lmt.lua
deleted file mode 100644
index 700ce47211e..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/core-lmt.lua
+++ /dev/null
@@ -1,34 +0,0 @@
-if not modules then modules = { } end modules ['core-lmt'] = {
- version = 1.001,
- comment = "companion to core-lmt.mkiv",
- author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
- copyright = "PRAGMA ADE / ConTeXt Development Team",
- license = "see context related readme files"
-}
-
-local implement = interfaces.implement
-local scankeyword = tokens.scanners.keyword
-
-local settextdir = tex.settextdir
-local setlinedir = tex.setlinedir
-local setpardir = tex.setpardir
-local setboxdir = tex.setboxdir
-
-local function scandir(what)
- if scankeyword("tlt") then
- what(0)
- elseif scankeyword("trt") then
- what(1)
- -- elseif scankeyword("rtt") then
- -- what(2)
- -- elseif scankeyword("ltl") then
- -- what(3)
- else
- what(0)
- end
-end
-
-implement { name = "textdir", public = true, protected = true, actions = function() scandir(settextdir) end }
-implement { name = "linedir", public = true, protected = true, actions = function() scandir(setlinedir) end }
-implement { name = "pardir", public = true, protected = true, actions = function() scandir(setpardir) end }
-implement { name = "boxdir", public = true, protected = true, actions = function() scandir(setboxdir) end }
diff --git a/Master/texmf-dist/tex/context/base/mkiv/core-lmt.mkxl b/Master/texmf-dist/tex/context/base/mkiv/core-lmt.mkxl
deleted file mode 100644
index 75a791a50d9..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/core-lmt.mkxl
+++ /dev/null
@@ -1,31 +0,0 @@
-%D \module
-%D [ file=core-lmt,
-%D version=2018.08.2,
-%D title=\CONTEXT\ System Macros,
-%D subtitle=Primitives,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt System Macros / Primitives}
-
-%D This is offered temporarily because in the end we don't expect u sers to use the
-%D low level direction directives directly.
-
-\registerctxluafile{core-lmt}{}
-
-\unprotect
-
-% nothing yet
-
-\protect \endinput
-
-% \starttext
-% abc{\textdir TRTdef}ghi
-% abc{\textdir trtdef}ghi
-% \boxdirection0=1
-% \stoptext
diff --git a/Master/texmf-dist/tex/context/base/mkiv/core-sys.lua b/Master/texmf-dist/tex/context/base/mkiv/core-sys.lua
index 7e9648fb845..3ab597849d3 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/core-sys.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/core-sys.lua
@@ -77,13 +77,9 @@ implement { name = "outputfilename", actions = function() context(environme
statistics.register("result saved in file", function()
-- suffix will be fetched from backend
local outputfilename = environment.outputfilename or environment.jobname or tex.jobname or "<unset>"
- -- if (tex.pdfoutput or tex.outputmode) > 0 then
- return format("%s.%s, compresslevel %s, objectcompresslevel %s",outputfilename,"pdf",
- lpdf.getcompression()
- )
- -- else
- -- return format("%s.%s",outputfilename,"dvi") -- hard to imagine
- -- end
+ return lpdf and format("%s.%s, compresslevel %s, objectcompresslevel %s",outputfilename,"pdf",
+ lpdf.getcompression()
+ ) or "error"
end)
implement {
diff --git a/Master/texmf-dist/tex/context/base/mkiv/core-sys.mkiv b/Master/texmf-dist/tex/context/base/mkiv/core-sys.mkiv
index 7a04df8408f..728d37908df 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/core-sys.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/core-sys.mkiv
@@ -132,10 +132,10 @@
[ \v!small=>\divide\scratchcounter 15, % 900,
\v!medium=>\divide\scratchcounter 30, % 1800,
\v!big=>\divide\scratchcounter 60, % 3600,
- \v!normal=>\getnewrandomseed\scratchcounter,
- \s!default=>\getnewrandomseed\scratchcounter,
+ \v!normal=>\scratchcounter\newrandomseed,
+ \s!default=>\scratchcounter\newrandomseed,
\s!unknown=>\scratchcounter#1]%
- \expanded{\setrandomseed{\the\scratchcounter}}%
+ \setrandomseed\scratchcounter
% \writestatus\m!system{randomseed: \the\scratchcounter}%
\endgroup}}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/core-uti.lua b/Master/texmf-dist/tex/context/base/mkiv/core-uti.lua
index 50c7bc9dc6a..887ef9a7536 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/core-uti.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/core-uti.lua
@@ -43,7 +43,7 @@ local report_passes = logs.reporter("job","passes")
job = job or { }
local job = job
-job.version = 1.31
+job.version = 1.32
job.packversion = 1.02
-- some day we will implement loading of other jobs and then we need
@@ -73,10 +73,9 @@ local enabled = true
local initialized = false
directives.register("job.save",function(v) enabled = v end)
-----------.register("job.keep",function(v) kept = v end)
-function job.disablesave() -- can be command
- enabled = false
+function job.disablesave()
+ enabled = false -- for instance called when an error
end
function job.initialize(loadname,savename)
@@ -89,10 +88,7 @@ function job.initialize(loadname,savename)
end
job.load(loadname) -- has to come after structure is defined !
luatex.registerstopactions(function()
- if enabled and not status.lasterrorstring or status.lasterrorstring == "" then
- -- if kept then
- -- job.keep(loadname) -- could move to mtx-context instead
- -- end
+ if enabled then
job.save(savename)
end
end)
@@ -396,37 +392,24 @@ statistics.register("jobdata time",function()
end
end)
--- statistics.register("callbacks", function()
--- local total, indirect = status.callbacks or 0, status.indirect_callbacks or 0
--- local pages = texgetcount('realpageno') - 1
--- if pages > 1 then
--- return format("direct: %s, indirect: %s, total: %s (%i per page)", total-indirect, indirect, total, total/pages)
--- else
--- return format("direct: %s, indirect: %s, total: %s", total-indirect, indirect, total)
--- end
--- end)
-
-function statistics.callbacks()
+statistics.register("callbacks", function()
local c_internal = status.callbacks or 0
local c_file = status.indirect_callbacks or 0
local c_direct = status.direct_callbacks or 0
- local c_late = backends.noflatelua() or 0
+ local c_late = backends.getcallbackstate().count
local c_function = status.function_callbacks or 0
local c_total = c_internal + c_file + c_direct + c_late + c_function
- local n_pages = texgetcount('realpageno') - 1
+ local n_pages = structures.pages.nofpages or 0
local c_average = n_pages > 0 and math.round(c_total/n_pages) or 0
- local s_result = format (
- c_average > 0 and "internal: %s, file: %s, direct: %s, late: %s, function %s, total: %s (%s per page)"
- or "internal: %s, file: %s, direct: %s, late: %s, function %s, total: %s",
+ local result = format (
+ "internal: %s, file: %s, direct: %s, late: %s, function %s, total: %s (%s per page)",
c_internal, c_file, c_direct, c_late, c_function, c_total, c_average
)
statistics.callbacks = function()
- return s_result
+ return result
end
- return s_result
-end
-
-statistics.register("callbacks", statistics.callbacks)
+ return result
+end)
statistics.register("randomizer", function()
if rmethod and rvalue then
diff --git a/Master/texmf-dist/tex/context/base/mkiv/data-env.lua b/Master/texmf-dist/tex/context/base/mkiv/data-env.lua
index 53f0c27cc27..3b10d89b8b4 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/data-env.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/data-env.lua
@@ -94,7 +94,9 @@ local relations = allocate { -- todo: handlers also here
mp = {
names = { "mp" },
variable = 'MPINPUTS',
- suffixes = { 'mp', 'mpvi', 'mpiv', 'mpxl', 'mpii' },
+ suffixes = CONTEXTLMTXMODE > 0
+ and { 'mp', 'mpxl', 'mpvi', 'mpiv', 'mpii' }
+ or { 'mp', 'mpvi', 'mpiv', 'mpii' },
usertype = true,
},
tex = {
diff --git a/Master/texmf-dist/tex/context/base/mkiv/data-fil.lua b/Master/texmf-dist/tex/context/base/mkiv/data-fil.lua
index bbcc954b2ea..8dbc8a0d2cc 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/data-fil.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/data-fil.lua
@@ -22,7 +22,7 @@ local appendhash = resolvers.appendhash
local loadcachecontent = caches.loadcontent
-local checkgarbage = utilities.garbagecollector and utilities.garbagecollector.check
+----- checkgarbage = utilities.garbagecollector and utilities.garbagecollector.check
function resolvers.locators.file(specification)
local filename = specification.filename
@@ -128,9 +128,9 @@ function loaders.file(specification,filetype)
report_files("file loader: %a loaded",filename)
end
local s = f:read("*a") -- io.readall(f) is faster but we never have large files here
- if checkgarbage then
- checkgarbage(#s)
- end
+ -- if checkgarbage then
+ -- checkgarbage(#s)
+ -- end
f:close()
if s then
return true, s, #s
diff --git a/Master/texmf-dist/tex/context/base/mkiv/data-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/data-ini.lua
index 2e9010085ba..6cf5669b3e7 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/data-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/data-ini.lua
@@ -73,8 +73,9 @@ end
-- Next comes the user's home path. We need this as later on we have
-- to replace ~ with its value.
-do
+if not environment.homedir then
+ local oldhome = osgetenv('HOME')
local homedir = osgetenv(ostype == "windows" and 'USERPROFILE' or 'HOME') or ''
if not homedir or homedir == "" then
@@ -86,6 +87,7 @@ do
ossetenv("HOME", homedir) -- can be used in unix cnf files
ossetenv("USERPROFILE",homedir) -- can be used in windows cnf files
+ environment.oldhome = oldhome
environment.homedir = homedir
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/data-tex.lua b/Master/texmf-dist/tex/context/base/mkiv/data-tex.lua
index e4795d09d18..2c1a7dbd5d1 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/data-tex.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/data-tex.lua
@@ -143,20 +143,31 @@ local function textopener(tag,filename,filehandle,coding)
lines[noflines] = nil
end
pushinputname(filename)
- local currentline, noflines = 0, noflines
- local t = {
+ local currentline = 0
+ local noflines = noflines
+ local handler = {
filename = filename,
noflines = noflines,
-- currentline = 0,
+ gotoline = function(self,n)
+ currentline = n - 1
+ if currentline <= 0 then
+ currentline = 0
+ end
+ end,
+ endoffile = function()
+ return not lines or currentline >= noflines
+ end,
close = function()
local usedname = popinputname() -- should match filename
if trace_locating then
report_tex("%a closer: %a closed",tag,filename)
end
- t = nil
+ handler = nil
+ lines = nil
end,
reader = function(self)
- self = self or t
+ self = self or handler
-- local currentline, noflines = self.currentline, self.noflines
if currentline >= noflines then
return nil
@@ -164,6 +175,7 @@ local function textopener(tag,filename,filehandle,coding)
currentline = currentline + 1
-- self.currentline = currentline
local content = lines[currentline]
+-- lines[currentline] = nil
if content == "" then
return ""
-- elseif content == ctrl_d or ctrl_z then
@@ -181,14 +193,14 @@ local function textopener(tag,filename,filehandle,coding)
end
end
}
- setmetatableindex(t,function(t,k)
+ setmetatableindex(handler,function(t,k)
if k == "currentline" then
return currentline
else
-- no such key
end
end)
- return t
+ return handler
end
helpers.settextopener(textopener) -- can only be done once
diff --git a/Master/texmf-dist/tex/context/base/mkiv/data-tmp.lua b/Master/texmf-dist/tex/context/base/mkiv/data-tmp.lua
index 9b0117c1562..9a8a586cda4 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/data-tmp.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/data-tmp.lua
@@ -324,7 +324,11 @@ caches.setluanames = setluanames
--
-- runtime files like fonts are written to the writable cache anyway
+local checkmemory = utilities and utilities.lua and utilities.lua.checkmemory
+local threshold = 100 -- MB
+
function caches.loaddata(readables,name,writable)
+ local used = checkmemory and checkmemory()
if type(readables) == "string" then
readables = { readables }
end
@@ -352,7 +356,11 @@ function caches.loaddata(readables,name,writable)
end
if loader then
loader = loader()
- collectgarbage("step")
+ if checkmemory then
+ checkmemory(used,threshold)
+ else -- generic
+ collectgarbage("step") -- option, really slows down!
+ end
return loader
end
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/data-use.lua b/Master/texmf-dist/tex/context/base/mkiv/data-use.lua
index 7df416b65c9..a7ca2389e99 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/data-use.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/data-use.lua
@@ -68,7 +68,7 @@ statistics.register("used cache path", function() return caches.usedpaths() end
-- experiment (code will move)
-function statistics.savefmtstatus(texname,formatbanner,sourcefile,kind,banner) -- texname == formatname
+function statistics.savefmtstatus(texname,formatbanner,sourcefile,banner) -- texname == formatname
local enginebanner = status.banner
if formatbanner and enginebanner and sourcefile then
local luvname = file.replacesuffix(texname,"luv") -- utilities.lua.suffixes.luv
diff --git a/Master/texmf-dist/tex/context/base/mkiv/driv-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/driv-ini.lua
index 316613b2167..1e19fd5f887 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/driv-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/driv-ini.lua
@@ -6,6 +6,10 @@ if not modules then modules = { } end modules ['driv-ini'] = {
license = "see context related readme files"
}
+-- This file is a bit overkill because it was meant for both luatex and luametatex
+-- but after the splti I decided not to simplify this one. It can only introduce
+-- issues.
+
local type = type
local addsuffix = file.addsuffix
diff --git a/Master/texmf-dist/tex/context/base/mkiv/driv-ini.mkxl b/Master/texmf-dist/tex/context/base/mkiv/driv-ini.mkxl
deleted file mode 100644
index 9f489a2a1a6..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/driv-ini.mkxl
+++ /dev/null
@@ -1,20 +0,0 @@
-%D \module
-%D [ file=driv-ini,
-%D version=2018.07.26,
-%D title=\CONTEXT\ Driver Macros,
-%D subtitle=Initialization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Driver Macros / Initialization}
-
-\registerctxluafile{driv-ini}{}
-
-\unprotect
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/driv-shp.lua b/Master/texmf-dist/tex/context/base/mkiv/driv-shp.lua
deleted file mode 100644
index 5cf7cfcc614..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/driv-shp.lua
+++ /dev/null
@@ -1,1324 +0,0 @@
-if not modules then modules = { } end modules ['driv-shp'] = {
- version = 1.001,
- comment = "companion to driv-ini.mkiv",
- author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
- copyright = "PRAGMA ADE / ConTeXt Development Team",
- license = "see context related readme files"
-}
-
-local type, next = type, next
-local round = math.round
-
-local setmetatableindex = table.setmetatableindex
-local formatters = string.formatters
-local concat = table.concat
-local keys = table.keys
-local sortedhash = table.sortedhash
-local splitstring = string.split
-local idiv = number.idiv
-local extract = bit32.extract
-local nuts = nodes.nuts
-
-local tonut = nodes.tonut
-local tonode = nodes.tonode
-
-local getdirection = nuts.getdirection
-local getlist = nuts.getlist
-local getoffsets = nuts.getoffsets
-local getorientation = nuts.getorientation
-local getfield = nuts.getfield
-local getwhd = nuts.getwhd
-local getkern = nuts.getkern
-local getheight = nuts.getheight
-local getdepth = nuts.getdepth
------ getwidth = nuts.getwidth
-local getnext = nuts.getnext
-local getsubtype = nuts.getsubtype
-local getid = nuts.getid
-local getleader = nuts.getleader
------ getglue = nuts.getglue
-local getshift = nuts.getshift
-local getdata = nuts.getdata
------ getexpansion = nuts.getexpansion
-local getreplace = nuts.getreplace
-local setreplace = nuts.setreplace
-local getfont = nuts.getfont
-
-local setdirection = nuts.setdirection
-local setfield = nuts.setfield
-local setlink = nuts.setlink
-
-local isglyph = nuts.isglyph
-local findtail = nuts.tail
-local nextdir = nuts.traversers.dir
-local nextnode = nuts.traversers.node
-
-local rangedimensions = node.direct.rangedimensions -- nuts ?
-local effectiveglue = nuts.effective_glue
-local start_of_par = nuts.start_of_par
-local dirdimensions = nuts.dirdimensions
-
-local texget = tex.get
-
-local fonthashes = fonts.hashes
-local fontdata = fonthashes.identifiers
-local characters = fonthashes.characters
-local parameters = fonthashes.parameters
-
-local nodecodes = nodes.nodecodes
-local whatsitcodes = nodes.whatsitcodes
-local leadercodes = nodes.leadercodes
-local gluecodes = nodes.gluecodes
-local dircodes = nodes.dircodes
-local dirvalues = nodes.dirvalues
-local subtypes = nodes.subtypes
-
-local normaldir_code <const> = dircodes.normal
-
-local lefttoright_code <const> = dirvalues.lefttoright
-local righttoleft_code <const> = dirvalues.righttoleft
-
-local glyph_code <const> = nodecodes.glyph
-local kern_code <const> = nodecodes.kern
-local glue_code <const> = nodecodes.glue
-local hlist_code <const> = nodecodes.hlist
-local vlist_code <const> = nodecodes.vlist
-local dir_code <const> = nodecodes.dir
-local disc_code <const> = nodecodes.disc
-local math_code <const> = nodecodes.math
-local rule_code <const> = nodecodes.rule
-local whatsit_code <const> = nodecodes.whatsit
------ penalty_code <const> = nodecodes.penalty
------ boundary_code <const> = nodecodes.boundary
-
-local leaders_code <const> = leadercodes.leaders
-local cleaders_code <const> = leadercodes.cleaders
-local xleaders_code <const> = leadercodes.xleaders
-local gleaders_code <const> = leadercodes.gleaders
-
-local spaceskip_code <const> = gluecodes.spaceskip
-
-local saveposwhatsit_code <const> = whatsitcodes.savepos
-local userdefinedwhatsit_code <const> = whatsitcodes.userdefined
-local openwhatsit_code <const> = whatsitcodes.open
-local writewhatsit_code <const> = whatsitcodes.write
-local closewhatsit_code <const> = whatsitcodes.close
-local lateluawhatsit_code <const> = whatsitcodes.latelua
-local literalwhatsit_code <const> = whatsitcodes.literal
-local setmatrixwhatsit_code <const> = whatsitcodes.setmatrix
-local savewhatsit_code <const> = whatsitcodes.save
-local restorewhatsit_code <const> = whatsitcodes.restore
-
-local getpagedimensions getpagedimensions = function()
- getpagedimensions = backends.codeinjections.getpagedimensions
- return getpagedimensions()
-end
-
-local drivers = drivers
-local instances = drivers.instances
-
-local report = logs.reporter("drivers")
-
----------------------------------------------------------------------------------------
-
-local lastfont = nil
-local fontcharacters = nil
-
-local magicconstants = tex.magicconstants
-local trueinch = magicconstants.trueinch
-local maxdimen = magicconstants.maxdimen
-local running = magicconstants.running
-
-local pos_h = 0
-local pos_v = 0
-local pos_r = lefttoright_code
-local shippingmode = "none"
-
-local abs_max_v = 0
-local abs_max_h = 0
-
-local shipbox_h = 0
-local shipbox_v = 0
-local page_size_h = 0
-local page_size_v = 0
------ page_h_origin = 0 -- trueinch
------ page_v_origin = 0 -- trueinch
-
-local initialize
-local finalize
-local updatefontstate
-local pushorientation
-local poporientation
-local flushcharacter
-local flushfontchar
-local flushrule
-local flushliteral
-local flushsetmatrix
-local flushsave
-local flushrestore
-local flushspecial
------ flushimage
-
--- make local
-
-function drivers.getpos () return round(pos_h), round(pos_v) end
-function drivers.getrpos() return round(pos_h), round(pos_v), pos_r end
-function drivers.gethpos() return round(pos_h) end
-function drivers.getvpos() return round(pos_v) end
-
--- characters
-
-local flush_character
-
-local stack = setmetatableindex("table")
-local level = 0
-local nesting = 0
-local main = 0
-
--- experiment (smaller page stream but might be fragile)
-
-local tospace = false directives.register("backends.spaces", function(v) tospace = v end)
-
--- todo: cache streams
-
-local function flush_vf_packet(pos_h,pos_v,pos_r,font,char,data,factor,vfcommands)
-
- if nesting > 100 then
- return
- elseif nesting == 0 then
- main = font
- end
-
- nesting = nesting + 1
-
- local saved_h = pos_h
- local saved_v = pos_v
- local saved_r = pos_r
- pos_r = lefttoright_code
-
- local data = fontdata[font]
- local fnt = font
- local fonts = data.fonts
- local siz = (data.parameters.factor or 1)/65536
-
- local function flushchar(font,char,fnt,chr,f,e)
- if fnt then
- local nest = char ~= chr or font ~= fnt
- if fnt == 0 then
- fnt = main
- end
- return flush_character(false,fnt,chr,factor,nest,pos_h,pos_v,pos_r,f,e)
- else
- return 0
- end
- end
-
- -- we assume resolved fonts: id mandate but maybe also size
-
- for i=1,#vfcommands do
- local packet = vfcommands[i]
- local command = packet[1]
- if command == "char" then
- local chr = packet[2]
- local f = packet[3]
- local e = packet[4]
- pos_h = pos_h + flushchar(font,char,fnt,chr,f,e)
- elseif command == "slot" then
- local index = packet[2]
- local chr = packet[3]
- local f = packet[4]
- local e = packet[5]
- if index == 0 then
- pos_h = pos_h + flushchar(font,char,font,chr,f,e)
- else
- local okay = fonts and fonts[index]
- if okay then
- local fnt = okay.id
- if fnt then
- pos_h = pos_h + flushchar(font,char,fnt,chr,f,e)
- end
- else
- -- safeguard, we assume the font itself (often index 1)
- pos_h = pos_h + flushchar(font,char,font,chr,f,e)
- end
- end
- elseif command == "use" then
- local index = packet[2]
- if index then
- local fnt
- if index == 0 then
- fnt = font
- else
- local okay = fonts and fonts[index]
- if okay then
- fnt = okay.id
- end
- end
- if fnt then
- -- not efficient but ok for now as experiment
- local d = characters[fnt]
- if d then
- for i=3,#packet do
- local chr = packet[i]
- local dat = d[chr]
- if dat then
- flushfontchar(fnt,chr,dat)
- end
- end
- end
- end
- end
- elseif command == "right" then
- local h = packet[2] -- * siz
- if factor ~= 0 and h ~= 0 then
- h = h + h * factor / 1000 -- expansion
- end
- pos_h = pos_h + h
- elseif command == "down" then
- local v = packet[2] -- * siz
- pos_v = pos_v - v
- elseif command == "push" then
- level = level + 1
- local s = stack[level]
- s[1] = pos_h
- s[2] = pos_v
- elseif command == "pop" then
- if level > 0 then
- local s = stack[level]
- pos_h = s[1]
- pos_v = s[2]
- level = level - 1
- end
- elseif command == "pdf" then
- flushliteral(false,pos_h,pos_v,packet[2],packet[3])
- elseif command == "rule" then
- local size_v = packet[2]
- local size_h = packet[3]
- if factor ~= 0 and size_h > 0 then
- size_h = size_h + size_h * factor / 1000
- end
- if size_h > 0 and size_v > 0 then
- flushsimplerule(pos_h,pos_v,pos_r,size_h,size_v)
- pos_h = pos_h + size_h
- end
- elseif command == "font" then
- local index = packet[2]
- local okay = fonts and fonts[index]
- if okay then
- fnt = okay.id or fnt -- or maybe just return
- end
- elseif command == "lua" then
- local code = packet[2]
- if type(code) ~= "function" then
- code = loadstring(code)
- end
- if type(code) == "function" then
- code(font,char,pos_h,pos_v)
- end
- elseif command == "node" then
- local h = packet[2]
- hlist_out(h,getlist(h))
- elseif command == "image" then
- -- doesn't work because intercepted by engine so we use a different
- -- mechanism (for now)
- local image = packet[2]
- -- to do
- elseif command == "pdfmode" then
- -- doesn't happen
- -- elseif command == "special" then
- -- -- not supported
- -- elseif command == "nop" then
- -- -- nothing to do|
- -- elseif command == "scale" then
- -- -- not supported
- end
- end
-
- pos_h = saved_h
- pos_v = saved_v
- pos_r = saved_r
-
- nesting = nesting - 1
-end
-
-local onetimemessage -- could be defined later (todo: make plug for this)
-
-flush_character = function(current,font,char,factor,vfcommands,pos_h,pos_v,pos_r,f,e)
-
- if font ~= lastfont then
- lastfont = font
- fontcharacters = characters[font]
- updatefontstate(font)
- end
-
- local data = fontcharacters[char]
- if not data then
- if char > 0 then
- if not onetimemessage then
- onetimemessage = fonts.loggers.onetimemessage
- end
- onetimemessage(font,char,"missing")
- end
- return 0, 0, 0
- end
-
- local width, height, depth, naturalwidth
- if current then
- naturalwidth, height, depth, factor = getwhd(current,true) -- also get corrected width
- if factor == 0 then
- width = naturalwidth
- else
- -- width = (1.0 + factor/1000000.0) * naturalwidth
- width = naturalwidth + naturalwidth * factor/1000000.0
- -- width = naturalwidth + naturalwidth * 0.000001 * factor
- end
- else
- width = data.width or 0
- height = data.height or 0
- depth = data.depth or 0
- naturalwidth = width
- if not factor then
- factor = 0
- end
- end
-
- if pos_r == righttoleft_code then
- pos_h = pos_h - width
- end
- if vfcommands then
- vfcommands = data.commands
- end
- if vfcommands then
- flush_vf_packet(pos_h,pos_v,pos_r,font,char,data,factor,vfcommands) -- also f ?
- else
- -- kind of messy that we do orientation here and offsets elsewhere
- local orientation = data.orientation
- if orientation and (orientation == 1 or orientation == 3) then
- local x = data.xoffset
- local y = data.yoffset
- if x then
- pos_h = pos_h + x
- end
- if y then
- pos_v = pos_v + y
- end
- pushorientation(orientation,pos_h,pos_v)
- flushcharacter(current,pos_h,pos_v,pos_r,font,char,data,f,e,factor) -- ,naturalwidth,width)
- poporientation(orientation,pos_h,pos_v)
- else
- flushcharacter(current,pos_h,pos_v,pos_r,font,char,data,f,e,factor) -- ,naturalwidth,width)
- end
- end
- return width, height, depth
-end
-
--- end of characters
-
-local function reset_state()
- pos_h = 0
- pos_v = 0
- pos_r = lefttoright_code
- shipbox_h = 0
- shipbox_v = 0
- shippingmode = "none"
- page_size_h = 0
- page_size_v = 0
- -- page_h_origin = 0 -- trueinch
- -- page_v_origin = 0 -- trueinch
-end
-
--- local function dirstackentry(t,k)
--- local v = {
--- cur_h = 0,
--- cur_v = 0,
--- ref_h = 0,
--- ref_v = 0,
--- }
--- t[k] = v
--- return v
--- end
-
------ dirstack = { }
-local dirstack = setmetatableindex(dirstackentry)
-
-local function reset_dir_stack()
- -- dirstack = setmetatableindex(dirstackentry)
- dirstack = { }
-end
-
-local function flushlatelua(current,h,v)
- return backends.latelua(current,h,v)
-end
-
-local function flushwriteout(current)
- if not doing_leaders then
- backends.writeout(current)
- end
-end
-
-local function flushopenout(current)
- if not doing_leaders then
- backends.openout(current)
- end
-end
-
-local function flushcloseout(current)
- if not doing_leaders then
- backends.closeout(current)
- end
-end
-
-local hlist_out, vlist_out do
-
- local function applyanchor(orientation,x,y,width,height,depth,woffset,hoffset,doffset,xoffset,yoffset)
- local ot = extract(orientation, 0,4)
- local ay = extract(orientation, 4,4)
- local ax = extract(orientation, 8,4)
- local of = extract(orientation,12,4)
- if ot == 4 then
- ot, ay = 0, 1
- elseif ot == 5 then
- ot, ay = 0, 2
- end
- if ot == 0 or ot == 2 then
- if ax == 1 then x = x - width
- elseif ax == 2 then x = x + width
- elseif ax == 3 then x = x - width/2
- elseif ax == 4 then x = x + width/2
- end
- if ot == 2 then
- doffset, hoffset = hoffset, doffset
- end
- if ay == 1 then y = y - doffset
- elseif ay == 2 then y = y + hoffset
- elseif ay == 3 then y = y + (doffset + hoffset)/2 - doffset
- end
- elseif ot == 1 or ot == 3 then
- if ay == 1 then y = y - height
- elseif ay == 2 then y = y + height
- elseif ay == 3 then y = y - height/2
- end
- if ot == 1 then
- doffset, hoffset = hoffset, doffset
- end
- if ax == 1 then x = x - width
- elseif ax == 2 then x = x + width
- elseif ax == 3 then x = x - width/2
- elseif ax == 4 then x = x + width/2
- elseif ax == 5 then x = x - hoffset
- elseif ax == 6 then x = x + doffset
- end
- end
- return ot, x + xoffset, y - yoffset
- end
-
- -- to be checked: begin- or enddir kan nil zijn, weird
-
- -- local function calculate_width_to_enddir(this_box,begindir) -- can be a helper
- -- local dir_nest = 1
- -- local enddir = begindir
- -- for current, subtype in nextdir, getnext(begindir) do
- -- if subtype == normaldir_code then -- todo
- -- dir_nest = dir_nest + 1
- -- else
- -- dir_nest = dir_nest - 1
- -- end
- -- if dir_nest == 0 then -- does the type matter
- -- enddir = current
- -- local width = rangedimensions(this_box,begindir,enddir)
- -- return enddir, width
- -- end
- -- end
- -- if enddir == begindir then
- -- local width = rangedimensions(this_box,begindir) -- ,enddir)
- -- return enddir, width
- -- end
- -- return enddir, 0
- -- end
-
- -- check frequencies of nodes
-
- hlist_out = function(this_box,current)
- local outer_doing_leaders = false
-
- local ref_h = pos_h
- local ref_v = pos_v
- local ref_r = pos_r
- pos_r = getdirection(this_box)
- local boxwidth,
- boxheight,
- boxdepth = getwhd(this_box)
-
- local cur_h = 0
- local cur_v = 0
-
- -- if not current then
- -- current = getlist(this_box)
- -- end
-
- -- we can encounter localpar, boundary and penalty nodes but a special
- -- iterator over content nodes won't save much
-
- for current, id, subtype in nextnode, current do
- if id == glyph_code then
- local char, font = isglyph(current)
- local x_offset, y_offset = getoffsets(current)
- if x_offset ~= 0 or y_offset ~= 0 then
- if pos_r == righttoleft_code then
- pos_h = ref_h - (cur_h + x_offset)
- else
- pos_h = ref_h + (cur_h + x_offset)
- end
- pos_v = ref_v - (cur_v - y_offset)
- -- synced
- end
- local wd = flush_character(current,font,char,false,true,pos_h,pos_v,pos_r)
- cur_h = cur_h + wd
- elseif id == glue_code then
- local gluewidth = effectiveglue(current,this_box)
- if gluewidth ~= 0 then
- if subtype >= leaders_code then
- local leader = getleader(current)
- if leader then
- local width, height, depth = getwhd(leader)
- if getid(leader) == rule_code then
- if gluewidth > 0 then
- if height == running then
- height = boxheight
- end
- if depth == running then
- depth = boxdepth
- end
- local total = height + depth
- if total > 0 then
- if pos_r == righttoleft_code then
- pos_h = pos_h - gluewidth
- end
- pos_v = pos_v - depth
- flushrule(leader,pos_h,pos_v,pos_r,gluewidth,total,getsubtype(leader))
- end
- cur_h = cur_h + gluewidth
- end
- elseif width > 0 and gluewidth > 0 then
- local boxdir = getdirection(leader) or lefttoright_code
- gluewidth = gluewidth + 10
- local edge = cur_h + gluewidth
- local lx = 0
- if subtype == gleaders_code then
- local save_h = cur_h
- if pos_r == righttoleft_code then
- cur_h = ref_h - shipbox_h - cur_h
- cur_h = width * (cur_h / width)
- cur_h = ref_h - shipbox_h - cur_h
- else
- cur_h = cur_h + ref_h - shipbox_h
- cur_h = width * (cur_h / width)
- cur_h = cur_h - ref_h - shipbox_h
- end
- if cur_h < save_h then
- cur_h = cur_h + width
- end
- elseif subtype == leaders_code then
- local save_h = cur_h
- cur_h = width * (cur_h / width)
- if cur_h < save_h then
- cur_h = cur_h + width
- end
- else
- lq = gluewidth / width
- lr = gluewidth % width
- if subtype == cleaders_code then
- cur_h = cur_h + lr / 2
- else
- lx = lr / (lq + 1)
- cur_h = cur_h + (lr - (lq - 1) * lx) / 2
- end
- end
- local shift = getshift(leader)
- while cur_h + width <= edge do
- local basepoint_h = 0
- -- local basepoint_v = shift
- if boxdir ~= pos_r then
- basepoint_h = boxwidth
- end
- -- synch_pos_with_cur(ref_h,ref_v,cur_h + basepoint_h,shift)
- if pos_r == righttoleft_code then
- pos_h = ref_h - (cur_h + basepoint_h)
- else
- pos_h = ref_h + (cur_h + basepoint_h)
- end
- pos_v = ref_v - shift
- -- synced
- outer_doing_leaders = doing_leaders
- doing_leaders = true
- if getid(leader) == vlist_code then
- vlist_out(leader,getlist(leader))
- else
- hlist_out(leader,getlist(leader))
- end
- doing_leaders = outer_doing_leaders
- cur_h = cur_h + width + lx
- end
- cur_h = edge - 10
- else
- cur_h = cur_h + gluewidth
- end
- else
- cur_h = cur_h + gluewidth
- end
- else
- if tospace and subtype == spaceskip_code then
- -- todo: flush_space
- flush_character(false,getfont(current),32,false,true,pos_h,pos_v,pos_r)
- end
- cur_h = cur_h + gluewidth
- end
- end
- elseif id == hlist_code or id == vlist_code then
- local boxdir = getdirection(current) or lefttoright_code
- local width, height, depth = getwhd(current)
- local list = getlist(current)
- if list then
- local shift, orientation = getshift(current)
- if not orientation then
- local basepoint_h = boxdir ~= pos_r and width or 0
- -- local basepoint_v = shift
- if pos_r == righttoleft_code then
- pos_h = ref_h - (cur_h + basepoint_h)
- else
- pos_h = ref_h + (cur_h + basepoint_h)
- end
- pos_v = ref_v - shift
- -- synced
- if id == vlist_code then
- vlist_out(current,list)
- else
- hlist_out(current,list)
- end
- elseif orientation == 0x1000 then
- local orientation, xoffset, yoffset = getorientation(current)
- local basepoint_h = boxdir ~= pos_r and width or 0
- -- local basepoint_v = shift
- if pos_r == righttoleft_code then
- pos_h = ref_h - (cur_h + basepoint_h + xoffset)
- else
- pos_h = ref_h + (cur_h + basepoint_h + xoffset)
- end
- pos_v = ref_v - (shift - yoffset)
- -- synced
- if id == vlist_code then
- vlist_out(current,list)
- else
- hlist_out(current,list)
- end
- else
- local orientation, xoffset, yoffset, woffset, hoffset, doffset = getorientation(current)
- local orientation, basepoint_h, basepoint_v = applyanchor(orientation,0,shift,width,height,depth,woffset,hoffset,doffset,xoffset,yoffset)
- if orientation == 1 then
- basepoint_h = basepoint_h + doffset
- if boxdir == pos_r then
- basepoint_v = basepoint_v - height
- end
- elseif orientation == 2 then
- if boxdir == pos_r then
- basepoint_h = basepoint_h + width
- end
- elseif orientation == 3 then
- basepoint_h = basepoint_h + hoffset
- if boxdir ~= pos_r then
- basepoint_v = basepoint_v - height
- end
- end
- if pos_r == righttoleft_code then
- pos_h = ref_h - (cur_h + basepoint_h)
- else
- pos_h = ref_h + (cur_h + basepoint_h)
- end
- pos_v = ref_v - (cur_v + basepoint_v)
- -- synced
- pushorientation(orientation,pos_h,pos_v,pos_r)
- if id == vlist_code then
- vlist_out(current,list)
- else
- hlist_out(current,list)
- end
- poporientation(orientation,pos_h,pos_v,pos_r)
- end
- end
- cur_h = cur_h + width
- elseif id == disc_code then
- local replace, tail = getreplace(current)
- if replace and subtype ~= select_disc then
- -- we could flatten .. no gain
- setlink(tail,getnext(current))
- setlink(current,replace)
- setreplace(current)
- end
- elseif id == kern_code then
- local kern, factor = getkern(current,true)
- if kern ~= 0 then
- if factor ~= 0 then
- cur_h = cur_h + (1.0 + factor/1000000.0) * kern
- else
- cur_h = cur_h + kern
- end
- end
- elseif id == rule_code then
- local width, height, depth = getwhd(current)
- if width > 0 then
- if height == running then
- height = boxheight
- end
- if depth == running then
- depth = boxdepth
- end
- local total = height + depth
- if total > 0 then
- local xoffset, yoffset, left, right = getoffsets(current) -- top bottom
- if left ~= 0 then
- pos_v = pos_v + left
- total = total - left
- end
- if right ~= 0 then
- depth = depth - right
- total = total - right
- end
- if pos_r == righttoleft_code then
- pos_h = pos_h - width
- xoffset = - xoffset
- end
- pos_v = pos_v - depth
- flushrule(current,pos_h + xoffset,pos_v + yoffset,pos_r,width,total,subtype)
- end
- cur_h = cur_h + width
- end
- elseif id == math_code then
- -- local kern = getkern(current)
- -- if kern ~= 0 then
- -- cur_h = cur_h + kern
- -- else
- cur_h = cur_h + effectiveglue(current,this_box)
- -- end
- elseif id == dir_code then
- -- We normally have proper begin-end pairs. A begin without end is (silently) handled
- -- and an end without a begin will be (silently) skipped we only need to move forward
- -- so we then have a faster calculation.
- local dir, cancel = getdirection(current)
- if cancel then
- local ds = dirstack[current]
- if ds then
- ref_h = ds.ref_h
- ref_v = ds.ref_v
- cur_h = ds.cur_h
- cur_v = ds.cur_v
- else
- -- pardir
- end
- pos_r = dir
- else
- local width, enddir = dirdimensions(this_box,current)
- local new_h = cur_h + width
- if dir ~= pos_r then
- cur_h = new_h
- end
- if enddir ~= current then
- dirstack[enddir] = {
- cur_h = new_h,
- cur_v = cur_v,
- ref_h = ref_h,
- ref_v = ref_v,
- }
- setdirection(enddir,pos_r)
- end
- if pos_r == righttoleft_code then
- pos_h = ref_h - cur_h
- else
- pos_h = ref_h + cur_h
- end
- pos_v = ref_v - cur_v
- -- synced
- ref_h = pos_h
- ref_v = pos_v
- cur_h = 0
- cur_v = 0
- pos_r = dir
- goto synced
- end
- elseif id == whatsit_code then
- if subtype == literalwhatsit_code then
- flushliteral(current,pos_h,pos_v)
- elseif subtype == lateluawhatsit_code then
- flushlatelua(current,pos_h,pos_v)
- elseif subtype == setmatrixwhatsit_code then
- flushsetmatrix(current,pos_h,pos_v)
- elseif subtype == savewhatsit_code then
- flushsave(current,pos_h,pos_v)
- elseif subtype == restorewhatsit_code then
- flushrestore(current,pos_h,pos_v)
- elseif subtype == saveposwhatsit_code then
- last_position_x = pos_h
- last_position_y = pos_v
- elseif subtype == writewhatsit_code then
- flushwriteout(current)
- elseif subtype == closewhatsit_code then
- flushcloseout(current)
- elseif subtype == openwhatsit_code then
- flushopenout(current)
- end
- -- elseif id == localpar_code and start_of_par(current) then
- -- local pardir = getdirection(current) or lefttoright_code
- -- if pardir == righttoleft_code then
- -- end
- -- end
- end
- -- There is no gain in skipping over this when we have zero progression
- -- and such.
- if pos_r == righttoleft_code then
- pos_h = ref_h - cur_h
- else
- pos_h = ref_h + cur_h
- end
- pos_v = ref_v - cur_v
- ::synced::
- end
- pos_h = ref_h
- pos_v = ref_v
- pos_r = ref_r
- end
-
- vlist_out = function(this_box,current)
- local outer_doing_leaders = false
-
- local ref_h = pos_h
- local ref_v = pos_v
- local ref_r = pos_r
- pos_r = getdirection(this_box)
-
- local boxwidth,
- boxheight,
- boxdepth = getwhd(this_box)
-
- local cur_h = 0
- local cur_v = - boxheight
- local top_edge = cur_v
-
- if pos_r == righttoleft_code then
- pos_h = ref_h - cur_h
- else
- pos_h = ref_h + cur_h
- end
- pos_v = ref_v - cur_v
- -- synced
-
- -- if not current then
- -- current = getlist(this_box)
- -- end
-
- -- while current do
- -- local id = getid(current)
- for current, id, subtype in nextnode, current do
- if id == glue_code then
- local glueheight = effectiveglue(current,this_box)
- if glueheight ~= 0 then
- if subtype >= leaders_code then
- local leader = getleader(current)
- if leader then
- local width, height, depth = getwhd(leader)
- local total = height + depth
- if getid(leader) == rule_code then
- depth = 0 -- hm
- if total > 0 then
- if width == running then
- width = boxwidth
- end
- if width > 0 then
- if pos_r == righttoleft_code then
- cur_h = cur_h - width
- end
- flushrule(leader,pos_h,pos_v - total,pos_r,width,total,getsubtype(leader))
- end
- cur_v = cur_v + total
- end
- elseif total > 0 and glueheight > 0 then
- glueheight = glueheight + 10
- local edge = cur_v + glueheight
- local ly = 0
- if subtype == gleaders_code then
- save_v = cur_v
- cur_v = ref_v - shipbox_v - cur_v
- cur_v = total * (cur_v / total)
- cur_v = ref_v - shipbox_v - cur_v
- if cur_v < save_v then
- cur_v = cur_v + total
- end
- elseif subtype == leaders_code then -- aleader
- save_v = cur_v
- cur_v = top_edge + total * ((cur_v - top_edge) / total)
- if cur_v < save_v then
- cur_v = cur_v + total
- end
- else
- lq = glueheight / total
- lr = glueheight % total
- if subtype == cleaders_code then
- cur_v = cur_v + lr / 2
- else
- ly = lr / (lq + 1)
- cur_v = cur_v + (lr - (lq - 1) * ly) / 2
- end
- end
- local shift = getshift(leader)
- while cur_v + total <= edge do -- todo: <= edge - total
- -- synch_pos_with_cur(ref_h, ref_v, getshift(leader), cur_v + height)
- if pos_r == righttoleft_code then
- pos_h = ref_h - shift
- else
- pos_h = ref_h + shift
- end
- pos_v = ref_v - (cur_v + height)
- -- synced
- outer_doing_leaders = doing_leaders
- doing_leaders = true
- if getid(leader) == vlist_code then
- vlist_out(leader,getlist(leader))
- else
- hlist_out(leader,getlist(leader))
- end
- doing_leaders = outer_doing_leaders
- cur_v = cur_v + total + ly
- end
- cur_v = edge - 10
- else
- cur_v = cur_v + glueheight
- end
- end
- else
- cur_v = cur_v + glueheight
- end
- end
- elseif id == hlist_code or id == vlist_code then
- local boxdir = getdirection(current) or lefttoright_code
- local width, height, depth = getwhd(current)
- local list = getlist(current)
- if list then
- local shift, orientation = getshift(current)
- if not orientation then
- -- local basepoint_h = shift
- -- local basepoint_v = height
- if boxdir ~= pos_r then
- shift = shift + width
- end
- if pos_r == righttoleft_code then
- pos_h = ref_h - shift
- else
- pos_h = ref_h + shift
- end
- pos_v = ref_v - (cur_v + height)
- -- synced
- if id == vlist_code then
- vlist_out(current,list)
- else
- hlist_out(current,list)
- end
- elseif orientation == 0x1000 then
- local orientation, xoffset, yoffset = getorientation(current)
- -- local basepoint_h = shift
- -- local basepoint_v = height
- if boxdir ~= pos_r then
- shift = shift + width
- end
- if pos_r == righttoleft_code then
- pos_h = ref_h - (shift + xoffset)
- else
- pos_h = ref_h + (shift + xoffset)
- end
- pos_v = ref_v - (cur_v + height - yoffset)
- -- synced
- if id == vlist_code then
- vlist_out(current,list)
- else
- hlist_out(current,list)
- end
- else
- local orientation, xoffset, yoffset, woffset, hoffset, doffset = getorientation(current)
- local orientation, basepoint_h, basepoint_v = applyanchor(orientation,shift,height,width,height,depth,woffset,hoffset,doffset,xoffset,yoffset)
- if orientation == 1 then
- basepoint_h = basepoint_h + width - height
- basepoint_v = basepoint_v - height
- elseif orientation == 2 then
- basepoint_h = basepoint_h + width
- basepoint_v = basepoint_v + depth - height
- elseif orientation == 3 then -- weird
- basepoint_h = basepoint_h + height
- end
- if pos_r == righttoleft_code then
- pos_h = ref_h - basepoint_h
- else
- pos_h = ref_h + basepoint_h
- end
- pos_v = ref_v - (cur_v + basepoint_v)
- -- synced
- pushorientation(orientation,pos_h,pos_v,pos_r)
- if id == vlist_code then
- vlist_out(current,list)
- else
- hlist_out(current,list)
- end
- poporientation(orientation,pos_h,pos_v,pos_r)
- end
- end
- cur_v = cur_v + height + depth
- elseif id == kern_code then
- cur_v = cur_v + getkern(current)
- elseif id == rule_code then
- local width, height, depth = getwhd(current)
- local total = height + depth
- if total > 0 then
- if width == running then
- width = boxwidth
- end
- if width > 0 then
- local xoffset, yoffset, left, right = getoffsets(current)
- if left ~= 0 then
- width = width - left
- xoffset = left
- end
- if right ~= 0 then
- width = width - right
- end
- if pos_r == righttoleft_code then
- xoffset = - xoffset - width
- end
- flushrule(current,pos_h + xoffset,pos_v - total - yoffset,pos_r,width,total,subtype)
- end
- cur_v = cur_v + total
- end
- elseif id == whatsit_code then
- if subtype == literalwhatsit_code then
- flushliteral(current,pos_h,pos_v)
- elseif subtype == lateluawhatsit_code then
- flushlatelua(current,pos_h,pos_v)
- elseif subtype == setmatrixwhatsit_code then
- flushsetmatrix(current,pos_h,pos_v)
- elseif subtype == savewhatsit_code then
- flushsave(current,pos_h,pos_v)
- elseif subtype == restorewhatsit_code then
- flushrestore(current,pos_h,pos_v)
- elseif subtype == saveposwhatsit_code then
- last_position_x = pos_h
- last_position_y = pos_v
- elseif subtype == writewhatsit_code then
- flushwriteout(current)
- elseif subtype == closewhatsit_code then
- flushcloseout(current)
- elseif subtype == openwhatsit_code then
- flushopenout(current)
- end
- end
- if pos_r == righttoleft_code then
- pos_h = ref_h - cur_h
- else
- pos_h = ref_h + cur_h
- end
- pos_v = ref_v - cur_v
- ::synced::
- end
- pos_h = ref_h
- pos_v = ref_v
- pos_r = ref_r
- end
-
-end
-
-function drivers.converters.lmtx(driver,box,smode,objnum,specification)
-
- if not driver then
- report("error in converter, no driver")
- return
- end
-
- if box then
- box = tonut(box)
- else
- report("error in converter, no box")
- return
- end
-
- local actions = driver.actions
- local flushers = driver.flushers
-
- initialize = actions.initialize
- finalize = actions.finalize
-
- updatefontstate = flushers.updatefontstate
-
- pushorientation = flushers.pushorientation
- poporientation = flushers.poporientation
-
- flushcharacter = flushers.character
- flushfontchar = flushers.fontchar
- flushrule = flushers.rule
- flushsimplerule = flushers.simplerule
- flushspecial = flushers.special
- flushliteral = flushers.literal
- flushsetmatrix = flushers.setmatrix
- flushsave = flushers.save
- flushrestore = flushers.restore
- -- flushimage = flushers.image
-
- reset_dir_stack()
- reset_state()
-
- shippingmode = smode
-
- local details = nil -- must be outside labels
-
- local width, height, depth = getwhd(box)
-
- local total = height + depth
-
- ----- v_offset_par = 0
- ----- h_offset_par = 0
-
- local max_v = total -- + v_offset_par
- local max_h = width -- + h_offset_par
-
- if height > maxdimen or depth > maxdimen or width > maxdimen then
- goto DONE
- end
-
- if max_v > maxdimen then
- goto DONE
- elseif max_v > abs_max_v then
- abs_max_v = max_v
- end
-
- if max_h > maxdimen then
- goto DONE
- elseif max_h > abs_max_h then
- abs_max_h = max_h
- end
-
- if shippingmode == "page" then
-
- -- We have zero offsets in ConTeXt.
-
- local pagewidth, pageheight = getpagedimensions()
-
- -- local h_offset_par = texget("hoffset")
- -- local v_offset_par = texget("voffset")
-
- -- page_h_origin = trueinch
- -- page_v_origin = trueinch
-
- pos_r = lefttoright_code
-
- if pagewidth > 0 then
- page_size_h = pagewidth
- else
- page_size_h = width
- end
-
- if page_size_h == 0 then
- page_size_h = width
- end
-
- if pageheight > 0 then
- page_size_v = pageheight
- else
- page_size_v = total
- end
-
- if page_size_v == 0 then
- page_size_v = total
- end
-
- local refpoint_h = 0 -- + page_h_origin + h_offset_par
- local refpoint_v = page_size_v -- - page_v_origin - v_offset_par
-
- pos_h = refpoint_h
- pos_v = refpoint_v - height
- -- synced
-
- else
-
- -- page_h_origin = 0
- -- page_v_origin = 0
- page_size_h = width
- page_size_v = total
- pos_r = getdirection(box)
- pos_v = depth
- pos_h = pos_r == righttoleft_code and width or 0
-
- end
-
- shipbox_ref_h = pos_h
- shipbox_ref_v = pos_v
-
- details = {
- shippingmode = smode, -- target
- boundingbox = { 0, 0, page_size_h, page_size_v },
- objectnumber = smode ~= "page" and objnum or nil,
- pagenumber = smode == "page" and objnum or nil,
- specification = specification,
- }
-
- initialize(driver,details)
-
- lastfont = nil -- this forces a sync each page / object
-
- if getid(box) == vlist_code then
- vlist_out(box,getlist(box))
- else
- hlist_out(box,getlist(box))
- end
-
- ::DONE::
-
- finalize(driver,details)
-
- shippingmode = "none"
-end
-
--- This will move to back-out.lua eventually.
-
-do
-
- ----- sortedhash = table.sortedhash
-
- ----- tonut = nodes.tonut
- local properties = nodes.properties.data
- local flush = texio.write_nl
-
- local periods = utilities.strings.newrepeater(".")
-
- local function showdetails(n,l)
- local p = properties[tonut(n)]
- if p then
- local done = false
- for k, v in sortedhash(p) do
- if done then
- flush("\n")
- else
- done = true
- end
- flush(periods[l+1] .. " " .. k .. " = " .. tostring(v))
- end
- end
- end
-
- local whatsittracers = {
- latelua = showdetails,
- literal = showdetails,
- }
-
- callback.register("show_whatsit",function(n,l)
- local s = nodes.whatsitcodes[n.subtype]
- texio.write(" [" .. s .. "]")
- local w = whatsittracers[s]
- if w then
- w(n,l)
- end
- end)
-
-end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/driv-shp.mkxl b/Master/texmf-dist/tex/context/base/mkiv/driv-shp.mkxl
deleted file mode 100644
index 68b62c72a72..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/driv-shp.mkxl
+++ /dev/null
@@ -1,18 +0,0 @@
-%D \module
-%D [ file=driv-shp,
-%D version=2018.07.26,
-%D title=\CONTEXT\ Driver Macros,
-%D subtitle=Shipout,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\registerctxluafile{driv-shp}{optimize}
-
-\unprotect
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/enco-ini.mkiv b/Master/texmf-dist/tex/context/base/mkiv/enco-ini.mkiv
index f78643975e5..26f218b035b 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/enco-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/enco-ini.mkiv
@@ -314,7 +314,7 @@
% left-overs (some day in private unicode space, so that we can roundtrip)
\unexpanded\def\textblacksquare {\dontleavehmode\hbox{\vrule\s!width.3\s!em\s!height.4\s!em\s!depth-.1\s!em}}
-\unexpanded\def\schwa {\hbox{\rotate[\c!rotation=180,\c!location=\v!high]{\hbox{e}}}}
+%unexpanded\def\schwa {\hbox{\rotate[\c!rotation=180,\c!location=\v!high]{\hbox{e}}}}
\unexpanded\def\schwagrave {\buildtextgrave\schwa}
\chardef\textcontrolspace"2423
@@ -427,7 +427,7 @@
{\char \iffontchar\font"2012 "2012 % figuredash
\else\iffontchar\font"2013 "2013 % endash
\else\iffontchar\font"2212 "2212 % math minus
- "002D % hyphen
+ \else "002D % hyphen
\fi\fi\fi}
\unexpanded\def\textplus
diff --git a/Master/texmf-dist/tex/context/base/mkiv/export-example.css b/Master/texmf-dist/tex/context/base/mkiv/export-example.css
index 19a2a071e88..7cfd7f291fc 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/export-example.css
+++ b/Master/texmf-dist/tex/context/base/mkiv/export-example.css
@@ -405,7 +405,7 @@ context|div.item {
}
itemtag,
-context|div.item {
+context|div.itemtag {
display: none ;
}
@@ -479,8 +479,9 @@ context|div.verbatim {
font-family : "DejaVu Sans Mono", "Lucida Console", monospace ;
}
-/* lines : display */
-/* line : mixed */
+/* lines : display */
+/* line : mixed */
+/* linenumber : inline */
lines,
context|div.lines {
@@ -501,6 +502,15 @@ context|div.line {
white-space : pre-wrap ;
}
+linenumber,
+context|div.linenumber {
+ display : inline-block ;
+ margin-right : 1em ;
+ width : 3em ;
+ text-align : left ;
+ font-family : "DejaVu Sans Mono", "Lucida Console", monospace ;
+}
+
/* synonym : inline */
/* sorting : inline */
@@ -546,44 +556,61 @@ context|div.registerlocation:after {
/* tablerow : display */
/* tablecell : mixed */
+/* we have a few bonus mappings here */
+
table,
context|div.table {
display : table ;
}
-tablerow,
-context|div.tablerow {
+tablerow, tr
+context|div.tablerow, context|div.tr {
display : table-row ;
}
-tablecell[align="middle"],
+tablecell[align="middle"], td[align="middle"],
context|div.tablecell.align-middle {
display : table-cell ;
text-align : center ;
padding : .1em ;
}
-tablecell[align="flushleft"],
+tablecell[align="flushleft"], td[align="flushleft"],
context|div.tablecell.align-flushleft {
display : table-cell ;
text-align : left ;
padding : .1em ;
}
-tablecell[align="flushright"],
+tablecell[align="flushright"], td[align="flushright"],
context|div.tablecell.align-flushright {
display : table-cell ;
text-align : right ;
padding : .1em ;
}
-tablecell,
-context|div.tablecell {
+tablecell, td
+context|div.tablecell, context|div.td {
display : table-cell ;
text-align : left ;
padding : .1em ;
}
+tablehead,
+div.thead, div.tableheader {
+ display : table-header-group ;
+}
+
+tablefoot,
+div.tfoot, div.tablefooter {
+ display : table-footer-group ;
+}
+
+tablebody,
+div.tbody, div.tablebody {
+ display : table-body-group ;
+}
+
/* tabulate : display */
/* tabulaterow : display */
/* tabulatecell : mixed */
@@ -648,6 +675,13 @@ context|div.tabulatecell.kind-equals:before {
content : ":" ;
}
+/*
+
+ A combination needs some processing because it is not a table yet. So, the next
+ mapping is just one row! The tags are a bit confusing now.
+
+*/
+
/* combination : display */
/* combinationpair : display */
/* combinationcontent : mixed */
@@ -660,8 +694,8 @@ context|div.combination {
margin-bottom : 0em ;
}
-combinationpair,
-context|div.combinationpair {
+combinationpair, combinationtext,
+context|div.combinationpair, context|div.combinationtext {
display : table-cell ;
padding-right : 1em ;
}
@@ -727,7 +761,7 @@ context|div.listitem.subsection context|div.listtag {
*/
listitem[detail="chapter"]>listtag,
-context|div.listitem.chapter context|div.listtag {
+context|div.listitem.chapter > context|div.listtag {
display : inline-block ;
margin-left : -5em ;
float : left ;
@@ -735,7 +769,7 @@ context|div.listitem.chapter context|div.listtag {
}
listitem[detail="section"]>listtag,
-context|div.listitem.section context|div.listtag {
+context|div.listitem.section > context|div.listtag {
display : inline-block ;
margin-left : -5em ;
float : left ;
@@ -743,7 +777,7 @@ context|div.listitem.section context|div.listtag {
}
listitem[detail="subsection"]>listtag,
-context|div.listitem.subsection context|div.listtag {
+context|div.listitem.subsection > context|div.listtag {
display : inline-block ;
margin-left : -5em ;
float : left ;
diff --git a/Master/texmf-dist/tex/context/base/mkiv/export-example.tex b/Master/texmf-dist/tex/context/base/mkiv/export-example.tex
index 32cb79c5ea2..9ef414422ee 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/export-example.tex
+++ b/Master/texmf-dist/tex/context/base/mkiv/export-example.tex
@@ -1,5 +1,3 @@
-% language=uk
-
\usemodule[abr-01]
\setupexport
diff --git a/Master/texmf-dist/tex/context/base/mkiv/file-ini.mkvi b/Master/texmf-dist/tex/context/base/mkiv/file-ini.mkvi
index 225b6b40deb..5fa5aa560a1 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/file-ini.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/file-ini.mkvi
@@ -10,9 +10,8 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-%D \TEX\ operates on files, so one wouldn't wonder that there
-%D is a separate module for file commands. In \CONTEXT\ files
-%D are used for several purposes:
+%D \TEX\ operates on files, so one wouldn't wonder that there is a separate module
+%D for file commands. In \CONTEXT\ files are used for several purposes:
%D
%D \startitemize[packed]
%D \item general textual input
@@ -21,10 +20,9 @@
%D \item buffering defered textual input
%D \stopitemize
%D
-%D When dealing with files we can load them as a whole, using
-%D the \type{\input} primitive or load them on a line||by||line
-%D basis, using \type{\read}. Writing is always done line by
-%D line, using \type{\write}.
+%D When dealing with files we can load them as a whole, using the \type {\input}
+%D primitive or load them on a line||by||line basis, using \type {\read}. Writing is
+%D always done line by line, using \type {\write}.
\writestatus{loading}{ConTeXt File Macros / Helpers}
@@ -35,9 +33,9 @@
%D \macros
%D {scratchread, scratchwrite}
%D
-%D We define a scratch file for reading. Keep in mind that
-%D the number of files is limited to~16, so use this one when
-%D possible. We also define a scratch output file.
+%D We define a scratch file for reading. Keep in mind that the number of files is
+%D limited to~16, so use this one when possible. We also define a scratch output
+%D file. In \MKIV\ and \LMTX\ we never use these file handles.
\ifdefined\scratchread \else \newread \scratchread \fi
\ifdefined\scratchwrite \else \newwrite\scratchwrite \fi
@@ -60,12 +58,10 @@
%D \macros
%D {pushendofline,popendofline}
%D
-%D When we are loading files in the middle of the typesetting
-%D process, for instance when we load references, we have to be
-%D sure that the reading process does not generate so called
-%D 'spurious spaces'. This can be prevented by assigning the
-%D line ending character the \CATCODE\ comment. This is
-%D accomplished by
+%D When we are loading files in the middle of the typesetting process, for instance
+%D when we load references, we have to be sure that the reading process does not
+%D generate so called 'spurious spaces'. This can be prevented by assigning the line
+%D ending character the \CATCODE\ comment. This is accomplished by
%D
%D \starttyping
%D \pushendofline
@@ -114,21 +110,20 @@
%D \macros
%D {input, normalinput}
%D
-%D Sometimes we run into troubles when \type {\input} wants to get
-%D expanded, e.g. in a \type {\write} (which happens in the metafun
-%D manual when we permit long MP lines). So, instead of fixing that,
-%D we go for a redefinition of \type {\input}. Of course it's better
-%D to use \type {\readfile} or \type {\processfile}.
+%D Sometimes we run into troubles when \type {\input} wants to get expanded, e.g. in
+%D a \type {\write} (which happens in the metafun manual when we permit long MP
+%D lines). So, instead of fixing that, we go for a redefinition of \type {\input}.
+%D Of course it's better to use \type {\readfile} or \type {\processfile}.
-\unexpanded\def\input{\normalinput}
+% \unexpanded\def\input{\normalinput}
\def\inputgivenfile#name{\normalinput{#name}}
%D \macros
%D {doifelsefile}
%D
-%D The next alternative only looks if a file is present. No
-%D loading is done. This one obeys the standard \TEX\ lookup.
+%D The next alternative only looks if a file is present. No loading is done. This
+%D one obeys the standard \TEX\ lookup.
%D
%D \starttyping
%D \doiffileelse {filename} {found} {not found}
@@ -155,7 +150,7 @@
%D \doifparentfileelse{filename}{yes}{no}
%D \stoptyping
-\ifx\outputfilename\undefined \def\outputfilename{\jobname} \fi
+\ifdefined\outputfilename \else \def\outputfilename{\jobname} \fi
\unexpanded\def\doifelseparentfile{\clf_doifelseparentfile}
@@ -200,10 +195,9 @@
%D \macros
%D {doonlyonce, doinputonce, doendinputonce}
%D
-%D Especially macropackages need only be loaded once.
-%D Repetitive loading not only costs time, relocating registers
-%D often leads to abortion of the processing because \TEX's
-%D capacity is limited. One can prevent multiple execution and
+%D Especially macropackages need only be loaded once. Repetitive loading not only
+%D costs time, relocating registers often leads to abortion of the processing
+%D because \TEX's capacity is limited. One can prevent multiple execution and
%D loading by using one of both:
%D
%D \starttyping
@@ -212,8 +206,8 @@
%D \doendinputonce{filename}
%D \stoptyping
%D
-%D This command obeys the standard method for locating files. We could
-%D move this function to the \LUA\ end.
+%D This command obeys the standard method for locating files. We could move this
+%D function to the \LUA\ end.
\installsystemnamespace {fileonce}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/file-job.lua b/Master/texmf-dist/tex/context/base/mkiv/file-job.lua
index 407c3c15da1..97e223387dc 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/file-job.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/file-job.lua
@@ -27,8 +27,8 @@ local implement = interfaces.implement
local trace_jobfiles = false trackers.register("system.jobfiles", function(v) trace_jobfiles = v end)
local report = logs.reporter("system")
-local report_jobfiles = logs.reporter("system","jobfiles")
-local report_functions = logs.reporter("system","functions")
+local report_jobfiles = logs.reporter("system", "jobfiles")
+local report_functions = logs.reporter("system", "functions")
local texsetcount = tex.setcount
local elements = interfaces.elements
@@ -968,7 +968,11 @@ function document.setcommandline() -- has to happen at the tex end in order to e
-- to trick the files table which actually only has one entry in a tex job
if arguments.timing then
- context.usemodule("timing")
+ context.usemodule { "timing" }
+ end
+
+ if arguments.usage then
+ trackers.enable("system.usage")
end
if arguments.batchmode then
diff --git a/Master/texmf-dist/tex/context/base/mkiv/file-job.mkvi b/Master/texmf-dist/tex/context/base/mkiv/file-job.mkvi
index a46e519c061..1f8da6b0cd8 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/file-job.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/file-job.mkvi
@@ -133,10 +133,15 @@
\unexpanded\def\starttext {\clf_starttext}
\unexpanded\def\stoptext {\clf_stoptext}
\unexpanded\def\forcequitjob {\clf_forcequitjob}
-\unexpanded\def\end {\clf_forceendjob}
\unexpanded\def\autostarttext{\clf_autostarttext}
\unexpanded\def\autostoptext {\clf_autostoptext}
+\pushoverloadmode
+
+\unexpanded\def\end {\clf_forceendjob}
+
+\popoverloadmode
+
\unexpanded\def\finishjob{\stoptext} % nicer in luatex call commandline
\newtoks\everystartnotext
@@ -295,22 +300,81 @@
{\popsystemmode\v!environment
\signalendofinput\v!environment}
-%D Relatively new (might move as it depends on setups):
+%D Upgraded after the ctx 2020 meeting:
+%D
+%D \starttyping
+%D \definedocument[thesis]
+%D
+%D \setupdocument[a=b,e=f]
+%D \setupdocument[thesis][a=x,c=d]
+%D
+%D % \startsetups[thesis:start]
+%D \startsetups[document:start]
+%D START
+%D \stopsetups
+%D
+%D \startsetups[thesis:stop]
+%D % \startsetups[document:stop]
+%D STOP
+%D \stopsetups
+%D
+%D % \startdocument[thesis]
+%D \startthesis
+%D (\currentdocument/a): \documentvariable{a}\par
+%D (\currentdocument/c): \documentvariable{c}\par
+%D (\currentdocument/e): \documentvariable{e}\par
+%D \stopthesis
+%D % \stopdocument
+%D \stoptyping
+
+\installcorenamespace {document}
-%newtoks\everysetupdocument
+\installcommandhandler \??document \s!document \??document
-\unexpanded\def\startdocument % todo: dostarttagged\t!document
- {\dosingleargument\syst_structure_document_start}
+\setupdocument
+ [\c!before=\directsetup{\s!document:\v!start},
+ \c!after =\directsetup{\s!document:\v!stop}]
-\unexpanded\def\syst_structure_document_start[#settings]%
- {\setvariables[\s!document][#settings]%
- \the\everysetupdocument\relax
+\def\syst_document_setup#1%
+ {\directsetup{\doifelsesetups{\currentdocument:\v!start}\currentdocument\s!document:\v!start}}
+
+\appendtoks
+ \normalexpanded {%
+ \startsetups[\currentdocument:\v!start]\noexpand\directsetup{\ifx\empty\currentdocumentparent\s!document\else\currentdocumentparent\fi:\v!start}\stopsetups
+ \startsetups[\currentdocument:\v!stop ]\noexpand\directsetup{\ifx\empty\currentdocumentparent\s!document\else\currentdocumentparent\fi:\v!stop }\stopsetups
+ \setvalue{\e!start\currentdocument}{\dodoubleargument\syst_document_start[\currentdocument]}%
+ \letvalue{\e!stop \currentdocument}\stopdocument
+ }%
+\to \everydefinedocument
+
+\unexpanded\def\startdocument % todo: dostarttagged\t!document
+ {\dodoubleargument\syst_document_start}
+
+\unexpanded\def\syst_document_start[#namespace][#settings]%
+ {\pushmacro\currentdocument
+ \ifsecondargument
+ \edef\currentdocument{#namespace}%
+ \setupcurrentdocument[#settings]%
+ \else\iffirstargument
+ \doifelseassignment{#namespace}%
+ {\let\currentdocument\empty
+ \setupcurrentdocument[#namespace]}%
+ {\edef\currentdocument{#namespace}}%
+ \fi\fi
+ \ifx\empty\currentdocument\else\setmode\currentdocument\fi
\starttext
+ \the\everystartdocument
\documentvariable\c!before}
\unexpanded\def\stopdocument % todo: dostoptagged\t!document
{\documentvariable\c!after
- \stoptext}
+ \the\everystopdocument
+ \stoptext
+ \ifx\empty\currentdocument\else\resetmode\currentdocument\fi
+ \popmacro\currentdocument}
+
+ \let\documentvariable \documentparameter
+\unexpanded\def\unexpandeddocumentvariable{\documentparameter}
\unexpanded\def\doifelsedocumentvariable#name{\doifelsesomething{\documentvariable{#name}}}
\unexpanded\def\doifdocumentvariable #name{\doifsomething {\documentvariable{#name}}}
@@ -318,38 +382,21 @@
\let\doifdocumentvariableelse\doifelsedocumentvariable
-\def\documentvariable#name%
- {\getvariable\s!document{#name}}
-
-\unexpanded\def\unexpandeddocumentvariable#name%
- {\getvariable\s!document{#name}}
-
-\unexpanded\def\setupdocument[#settings]%
- {\setvariables[\s!document][#settings]%
- \the\everysetupdocument\relax}
-
-\unexpanded\def\presetdocument[#settings]%
- {\checkvariables[\s!document][#settings]}
-
-% We silently ignore missing documents. Beware: there are no begin/end setups
-% invoked as we expect the loaded document to be wrapped in \startdocument ...
-% \stopdocument. This is just a convenient variant of input.
-%
-% \unexpanded\def\document
-% {\dosingleempty\syst_document}
-%
-% \def\syst_document[#1]#2%
-% \startdocument[#1]
-% \readfile{#2}{}{}}
-
-% metadata:author metadata:title metadata:subject
-
-\setvariables
- [document]
- [\c!before=\directsetup{\s!document:start},
- \c!after=\directsetup{\s!document:stop}]
-
-%S The document: namespace will be used elsewhere too.
+\unexpanded\def\presetdocument
+ {\dodoubleargument\syst_document_preset}
+
+\unexpanded\def\syst_document_preset[#namespace][#settings]%
+ {\pushmacro\currentdocument
+ \ifsecondargument
+ \edef\currentdocument{#namespace}%
+ \setupcurrentdocument[#settings]%
+ \else\iffirstargument
+ \doifelseassignment{#namespace}%
+ {\let\currentdocument\empty
+ \setupcurrentdocument[#namespace]}%
+ {}%
+ \fi\fi
+ \popmacro\currentdocument}
% Bonus:
diff --git a/Master/texmf-dist/tex/context/base/mkiv/file-lib.mkvi b/Master/texmf-dist/tex/context/base/mkiv/file-lib.mkiv
index c2ec555cf2f..c2ec555cf2f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/file-lib.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/file-lib.mkiv
diff --git a/Master/texmf-dist/tex/context/base/mkiv/file-mod.lua b/Master/texmf-dist/tex/context/base/mkiv/file-mod.lua
index 10a18717865..d392887ec18 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/file-mod.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/file-mod.lua
@@ -111,64 +111,66 @@ local function usemodule(name,hasscheme)
end
function environment.usemodules(prefix,askedname,truename)
- local truename = truename or environment.truefilename(askedname)
- local hasprefix = prefix and prefix ~= ""
- local hashname = ((hasprefix and prefix) or "*") .. "-" .. truename
- local status = modstatus[hashname] or false -- yet unset
- if status == 0 then
- -- not found
- elseif status == 1 then
- status = status + 1
- else
- if trace_modules then
- report("locating, prefix %a, askedname %a, truename %a",prefix,askedname,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
+ local truename = truename or environment.truefilename(askedname) or askedname
+ if truename and truename ~= "" then
+ local hasprefix = prefix and prefix ~= ""
+ local hashname = ((hasprefix and prefix) or "*") .. "-" .. truename
+ local status = modstatus[hashname] or false -- yet unset
+ if status == 0 then
+ -- not found
+ elseif status == 1 then
+ status = status + 1
else
- for i=1,#prefixes do
- -- todo: reconstruct name i.e. basename
- local thename = prefixes[i] .. "-" .. truename
- if usemodule(thename) then
+ if trace_modules then
+ report("locating, prefix %a, askedname %a, truename %a",prefix,askedname,truename)
+ end
+ local hasscheme = url.hasscheme(truename)
+ if hasscheme then
+ -- no prefix and suffix done
+ if usemodule(truename,true) then
status = 1
- break
+ else
+ status = 0
+ end
+ elseif hasprefix then
+ if usemodule(prefix .. "-" .. truename) then
+ status = 1
+ else
+ status = 0
end
- end
- if status then
- -- ok, don't change
- elseif find(truename,"-",1,true) and usemodule(truename) then
- -- assume a user namespace
- report("using user prefixed file %a",truename)
- status = 1
- elseif permit_unprefixed and usemodule(truename) then
- report("using unprefixed file %a",truename)
- status = 1
else
- status = 0
+ 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 find(truename,"-",1,true) and usemodule(truename) then
+ -- assume a user namespace
+ report("using user prefixed file %a",truename)
+ status = 1
+ elseif permit_unprefixed and usemodule(truename) then
+ report("using unprefixed file %a",truename)
+ status = 1
+ else
+ status = 0
+ end
end
end
+ if status == 0 then
+ missing = true
+ report("%a is not found",askedname)
+ elseif status == 1 then
+ report("%a is loaded",trace_modules and truename or askedname)
+ else
+ report("%a is already loaded",trace_modules and truename or askedname)
+ end
+ modstatus[hashname] = status
end
- if status == 0 then
- missing = true
- report("%a is not found",askedname)
- elseif status == 1 then
- report("%a is loaded",trace_modules and truename or askedname)
- else
- report("%a is already loaded",trace_modules and truename or askedname)
- end
- modstatus[hashname] = status
end
statistics.register("loaded tex modules", function()
@@ -246,18 +248,16 @@ function environment.useluamodule(list)
end
end
-local strings = interfaces.strings
-
implement {
name = "usemodules",
actions = environment.usemodules,
- arguments = strings[2]
+ arguments = "2 strings",
}
implement {
name = "doifelseolderversion",
actions = function(one,two) commands.doifelse(comparedversion(one,two) >= 0) end,
- arguments = strings[2]
+ arguments = "2 strings"
}
implement {
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-cff.lua b/Master/texmf-dist/tex/context/base/mkiv/font-cff.lua
index 72b0a038f17..4e2981011ac 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-cff.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-cff.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['font-cff'] = {
version = 1.001,
+ optimize = true,
comment = "companion to font-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
@@ -609,12 +610,15 @@ do
+ p_unsupported
)^1
- parsedictionaries = function(data,dictionaries,what)
+ parsedictionaries = function(data,dictionaries,version)
stack = { }
strings = data.strings
+ if trace_charstrings then
+ report("charstring format %a",version)
+ end
for i=1,#dictionaries do
top = 0
- result = what == "cff" and {
+ result = version == "cff" and {
monospaced = false,
italicangle = 0,
underlineposition = -100,
@@ -1421,13 +1425,15 @@ do
-- to wrap my head around the rather complex variable font specification
-- with regions and axis, the following approach kind of works but is more
-- some trial and error trick. It's still not clear how much of the complex
- -- truetype description applies to cff.
+ -- truetype description applies to cff. Once there are fonts out there we'll
+ -- get there. (Marcel and friends did some tests with recent cff2 fonts so
+ -- the code has been adapted accordingly.)
local reginit = false
local function updateregions(n) -- n + 1
if regions then
- local current = regions[n] or regions[1]
+ local current = regions[n+1] or regions[1]
nofregions = #current
if axis and n ~= reginit then
factors = { }
@@ -1517,7 +1523,7 @@ do
end
end
else
- -- error
+ top = top - nofregions * n
end
end
@@ -2151,7 +2157,14 @@ do
popped = 3
seacs = { }
if regions then
- regions = { regions } -- needs checking
+ -- this was:
+ -- regions = { regions } -- needs checking
+ -- and is now (MFC):
+ regions = { }
+ local deltas = data.deltas
+ for i = 1, #deltas do
+ regions[i] = deltas[i].regions
+ end
axis = data.factors or false
end
end
@@ -2261,8 +2274,8 @@ do
end
-local function readglobals(f,data)
- local routines = readlengths(f)
+local function readglobals(f,data,version)
+ local routines = readlengths(f,version == "cff2")
for i=1,#routines do
routines[i] = readbytetable(f,routines[i])
end
@@ -2320,14 +2333,14 @@ local function readprivates(f,data)
end
end
-local function readlocals(f,data,dictionary)
+local function readlocals(f,data,dictionary,version)
local header = data.header
local private = dictionary.private
if private then
local subroutineoffset = private.data.subroutines
if subroutineoffset ~= 0 then
setposition(f,header.offset+private.offset+subroutineoffset)
- local subroutines = readlengths(f)
+ local subroutines = readlengths(f,version == "cff2")
for i=1,#subroutines do
subroutines[i] = readbytetable(f,subroutines[i])
end
@@ -2344,7 +2357,7 @@ end
-- These charstrings are little programs and described in: Technical Note #5177. A truetype
-- font has only one dictionary.
-local function readcharstrings(f,data,what)
+local function readcharstrings(f,data,version)
local header = data.header
local dictionaries = data.dictionaries
local dictionary = dictionaries[1]
@@ -2355,7 +2368,7 @@ local function readcharstrings(f,data,what)
elseif stringtype == 2 then
setposition(f,header.offset+offset)
-- could be a metatable .. delayed loading
- local charstrings = readlengths(f,what=="cff2")
+ local charstrings = readlengths(f,version=="cff2")
local nofglyphs = #charstrings
for i=1,nofglyphs do
charstrings[i] = readstring(f,charstrings[i])
@@ -2390,7 +2403,8 @@ readers.parsecharstrings = parsecharstrings -- used in font-onr.lua (type 1)
local function readnoselect(f,fontdata,data,glyphs,doshapes,version,streams)
local dictionaries = data.dictionaries
local dictionary = dictionaries[1]
- readglobals(f,data)
+ local cid = not dictionary.private and dictionary.cid
+ readglobals(f,data,version)
readcharstrings(f,data,version)
if version == "cff2" then
dictionary.charset = nil
@@ -2398,9 +2412,27 @@ local function readnoselect(f,fontdata,data,glyphs,doshapes,version,streams)
readencodings(f,data)
readcharsets(f,data,dictionary)
end
+ if cid then
+ local fdarray = cid.fdarray
+ if fdarray then
+ setposition(f,data.header.offset + fdarray)
+ local dictionaries = readlengths(f,version=="cff2")
+ local nofdictionaries = #dictionaries
+ if nofdictionaries > 0 then
+ for i=1,nofdictionaries do
+ dictionaries[i] = readstring(f,dictionaries[i])
+ end
+ parsedictionaries(data,dictionaries)
+ dictionary.private = dictionaries[1].private
+ if nofdictionaries > 1 then
+ report("ignoring dictionaries > 1 in cid font")
+ end
+ end
+ end
+ end
readprivates(f,data)
parseprivates(data,data.dictionaries)
- readlocals(f,data,dictionary)
+ readlocals(f,data,dictionary,version)
startparsing(fontdata,data,streams)
parsecharstrings(fontdata,data,glyphs,doshapes,version,streams)
stopparsing(fontdata,data)
@@ -2412,7 +2444,7 @@ local function readfdselect(f,fontdata,data,glyphs,doshapes,version,streams)
local dictionary = dictionaries[1]
local cid = dictionary.cid
local cidselect = cid and cid.fdselect
- readglobals(f,data)
+ readglobals(f,data,version)
readcharstrings(f,data,version)
if version ~= "cff2" then
readencodings(f,data)
@@ -2458,7 +2490,7 @@ local function readfdselect(f,fontdata,data,glyphs,doshapes,version,streams)
local cidarray = cid.fdarray
if cidarray then
setposition(f,header.offset+cidarray)
- local dictionaries = readlengths(f)
+ local dictionaries = readlengths(f,version == "cff2")
for i=1,#dictionaries do
dictionaries[i] = readstring(f,dictionaries[i])
end
@@ -2466,7 +2498,7 @@ local function readfdselect(f,fontdata,data,glyphs,doshapes,version,streams)
cid.dictionaries = dictionaries
readcidprivates(f,data)
for i=1,#dictionaries do
- readlocals(f,data,dictionaries[i])
+ readlocals(f,data,dictionaries[i],version)
end
startparsing(fontdata,data,streams)
for i=1,#charstrings do
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-cft.lua b/Master/texmf-dist/tex/context/base/mkiv/font-cft.lua
index ee9ffa6a77a..cf6c232a606 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-cft.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-cft.lua
@@ -6,7 +6,7 @@ if not modules then modules = { } end modules ['font-cft'] = {
license = "see context related readme files"
}
--- context font tables
+-- context font tables (needs updating)
--
-- todo: extra:
--
@@ -229,7 +229,7 @@ do
data.scaled = {
properties = {
- encodingbytes = t_cardinal,
+ encodingbytes = t_cardinal, -- not in lmtx
embedding = t_cardinal, -- ?
cidinfo = t_hash,
format = t_string,
@@ -238,7 +238,7 @@ do
filename = t_string,
psname = t_string,
name = t_string,
- virtualized = t_boolean,
+ virtualized = t_boolean, -- not in lmtx
hasitalics = t_boolean,
autoitalicamount = t_float,
nostackmath = t_boolean,
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-chk.lua b/Master/texmf-dist/tex/context/base/mkiv/font-chk.lua
index ab145ce4d8f..e18e4b8048a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-chk.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-chk.lua
@@ -9,6 +9,8 @@ if not modules then modules = { } end modules ['font-chk'] = {
-- possible optimization: delayed initialization of vectors
-- move to the nodes namespace
+-- This is old code and I'll make a nicer one for lmtx some day.
+
local next = next
local floor = math.floor
@@ -248,11 +250,14 @@ local function addmissingsymbols(tfmdata) -- we can have an alternative with rul
end
end
end
- if #collected > 0 then
- addcharacters(properties.id, {
- type = "real",
- characters = collected,
- })
+ if next(collected) then
+ local id = properties.id
+ if id then
+ addcharacters(properties.id, {
+ type = "real",
+ characters = collected,
+ })
+ end
end
end
@@ -268,12 +273,6 @@ registerotffeature {
fonts.loggers.add_placeholders = function(id) addmissingsymbols(fontdata[id or true]) end
fonts.loggers.category_to_placeholder = mapping
-function commands.getplaceholderchar(name)
- local id = currentfont()
- addmissingsymbols(fontdata[id])
- context(getprivatenode(fontdata[id],name))
-end
-
-- todo in luatex: option to add characters (just slots, no kerns etc)
-- we can do that now so ...
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-col.lua b/Master/texmf-dist/tex/context/base/mkiv/font-col.lua
index d197c7c8583..c47a299060b 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-col.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-col.lua
@@ -478,5 +478,5 @@ implement {
implement {
name = "doifelsecharinfont",
actions = { collections.found, commands.doifelse },
- arguments = { "integer" }
+ arguments = "integer"
}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-con.lua b/Master/texmf-dist/tex/context/base/mkiv/font-con.lua
index 1bb63aa5192..f650e5b03d6 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-con.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-con.lua
@@ -191,6 +191,9 @@ function constructors.assignmathparameters(target,original) -- simple variant, n
if not mathparameters.FractionDelimiterDisplayStyleSize then
targetmathparameters.FractionDelimiterDisplayStyleSize = 2.40 * targetparameters.size
end
+ if not targetmathparameters.SpaceBeforeScript then
+ targetmathparameters.SpaceBeforeScript = targetmathparameters.SpaceAfterScript
+ end
target.mathparameters = targetmathparameters
end
end
@@ -210,60 +213,45 @@ end
-- we default to false, so a macro package has to enable it explicitly. In
-- LuaTeX the fullname is used to identify a font as being unique.
-constructors.sharefonts = false
-constructors.nofsharedfonts = 0
-local sharednames = { }
+local nofinstances = 0
+local instances = setmetatableindex(function(t,k)
+ nofinstances = nofinstances + 1
+ t[k] = nofinstances
+ return nofinstances
+end)
function constructors.trytosharefont(target,tfmdata)
- if constructors.sharefonts then -- not robust !
- local characters = target.characters
- local n = 1
- local t = { target.psname }
- local u = sortedkeys(characters)
- for i=1,#u do
- local k = u[i]
- n = n + 1 ; t[n] = k
- n = n + 1 ; t[n] = characters[k].index or k
+ local properties = target.properties
+ local instance = properties.instance
+ if instance then
+ local fullname = target.fullname
+ local fontname = target.fontname
+ local psname = target.psname
+ local format = tfmdata.properties.format
+ if format == "opentype" then
+ target.streamprovider = 1
+ elseif format == "truetype" then
+ target.streamprovider = 2
+ else
+ target.streamprovider = 0
end
- local h = md5.HEX(concat(t," "))
- local s = sharednames[h]
- if s then
- if trace_defining then
- report_defining("font %a uses backend resources of font %a",target.fullname,s)
+ if target.streamprovider > 0 then
+ if fullname then
+ fullname = fullname .. ":" .. instances[instance]
+ target.fullname = fullname
+ end
+ if fontname then
+ fontname = fontname .. ":" .. instances[instance]
+ target.fontname = fontname
+ end
+ if psname then
+ psname = psname .. ":" .. instances[instance]
+ target.psname = psname
end
- target.fullname = s
- constructors.nofsharedfonts = constructors.nofsharedfonts + 1
- target.properties.sharedwith = s
- else
- sharednames[h] = target.fullname
end
end
end
--- function constructors.enhanceparameters(parameters)
--- local xheight = parameters.x_height
--- local quad = parameters.quad
--- local space = parameters.space
--- local stretch = parameters.space_stretch
--- local shrink = parameters.space_shrink
--- local extra = parameters.extra_space
--- local slant = parameters.slant
--- -- synonyms
--- parameters.xheight = xheight
--- parameters.spacestretch = stretch
--- parameters.spaceshrink = shrink
--- parameters.extraspace = extra
--- parameters.em = quad
--- parameters.ex = xheight
--- parameters.slantperpoint = slant
--- parameters.spacing = {
--- width = space,
--- stretch = stretch,
--- shrink = shrink,
--- extra = extra,
--- }
--- end
-
local synonyms = {
exheight = "x_height",
xheight = "x_height",
@@ -463,6 +451,7 @@ function constructors.scale(tfmdata,specification)
target.format = properties.format
target.cache = constructors.cacheintex and "yes" or "renew"
--
+ local original = properties.original or tfmdata.original
local fontname = properties.fontname or tfmdata.fontname
local fullname = properties.fullname or tfmdata.fullname
local filename = properties.filename or tfmdata.filename
@@ -474,6 +463,7 @@ function constructors.scale(tfmdata,specification)
--
local psname, psfixed = fixedpsname(psname,fontname or fullname or file.nameonly(filename))
--
+ target.original = original
target.fontname = fontname
target.fullname = fullname
target.filename = filename
@@ -578,6 +568,15 @@ function constructors.scale(tfmdata,specification)
targetparameters.quad = targetquad
targetparameters.extra_space = targetextra_space
--
+ local hshift = parameters.hshift
+ if hshift then
+ targetparameters.hshift = delta * hshift
+ end
+ local vshift = parameters.vshift
+ if vshift then
+ targetparameters.vshift = delta * vshift
+ end
+ --
local ascender = parameters.ascender
if ascender then
targetparameters.ascender = delta * ascender
@@ -601,13 +600,17 @@ function constructors.scale(tfmdata,specification)
--
if hasmath then
constructors.assignmathparameters(target,tfmdata) -- does scaling and whatever is needed
- properties.hasmath = true
- target.nomath = false
- target.MathConstants = target.mathparameters
+ properties.hasmath = true
+ target.nomath = false
+ target.MathConstants = target.mathparameters
+ --
+ local oldmath = properties.oldmath
+ targetproperties.oldmath = oldmath
+ target.oldmath = oldmath
else
- properties.hasmath = false
- target.nomath = true
- target.mathparameters = nil -- nop
+ properties.hasmath = false
+ target.nomath = true
+ target.mathparameters = nil -- nop
end
--
-- Here we support some context specific trickery (this might move to a plugin). During the
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-ctx.lua b/Master/texmf-dist/tex/context/base/mkiv/font-ctx.lua
index 6f8354de853..eead8abff67 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-ctx.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-ctx.lua
@@ -167,12 +167,8 @@ addformatter(formatters,"font:features",[["'"..sequenced(%s," ",true).."'"]],{ s
-- ... like font-sfm or so
constructors.resolvevirtualtoo = true -- context specific (due to resolver)
-
-if CONTEXTLMTXMODE and CONTEXTLMTXMODE > 0 then
- constructors.fixprotrusion = false
-end
-
constructors.sharefonts = true -- experimental
+constructors.nofsharedfonts = 0
constructors.nofsharedhashes = 0
constructors.nofsharedvectors = 0
constructors.noffontsloaded = 0
@@ -202,6 +198,7 @@ do
local shares = { }
local hashes = { }
+
local nofinstances = 0
local instances = setmetatableindex(function(t,k)
nofinstances = nofinstances + 1
@@ -240,7 +237,7 @@ do
end
if psname then
-- this one is used for the funny prefix in font names in pdf
- -- so it has ot be kind of unique in order to avoid subset prefix
+ -- so it has to be kind of unique in order to avoid subset prefix
-- clashes being reported
psname = psname .. ":" .. instances[instance]
target.psname = psname
@@ -327,12 +324,16 @@ function definers.resetnullfont()
definers.resetnullfont = function() end
end
+-- This is some initialization code and we don't want (tracing) clutter in lmtx
+-- which is why we follow a different route there. I admit that is sounds freaky.
+-- Watch out: in lmtx the font dimen array is no longer resized automatically.
+
implement {
- name = "resetnullfont",
- onlyonce = true,
- actions = function()
+ name = "resetnullfont",
+ onlyonce = true,
+ permanent = false,
+ actions = function()
for i=1,7 do
- -- we have no direct method yet
context([[\fontdimen%s\nullfont\zeropoint]],i)
end
definers.resetnullfont()
@@ -1010,7 +1011,8 @@ end
local function splitcontext(features) -- presetcontext creates dummy here
local n, sf
- if find(features,",") then
+ -- We can have: "a=yes,b=yes" "a,b" "a" "a=yes" etc.
+ if find(features,"[,=]") then
--
-- from elsewhere (!)
--
@@ -1166,69 +1168,57 @@ local specifiers = { }
do -- else too many locals
- ----- ctx_setdefaultfontname = context.fntsetdefname
- ----- ctx_setsomefontname = context.fntsetsomename
- ----- ctx_setemptyfontsize = context.fntsetnopsize
- ----- ctx_setsomefontsize = context.fntsetsomesize
- ----- ctx_letvaluerelax = context.letvaluerelax
-
- local starttiming = statistics.starttiming
- local stoptiming = statistics.stoptiming
-
- local scanners = tokens.scanners
- local scanstring = scanners.string
- local scaninteger = scanners.integer
- local scannumber = scanners.number
- local scanboolean = scanners.boolean
-
- local setmacro = tokens.setters.macro
- local scanners = interfaces.scanners
-
- -- function commands.definefont_one(str)
+ local starttiming = statistics.starttiming
+ local stoptiming = statistics.stoptiming
- scanners.definefont_one = function()
- local str = scanstring()
+ local setmacro = tokens.setters.macro
- starttiming(fonts)
- if trace_defining then
- report_defining("memory usage before: %s",statistics.memused())
- report_defining("start stage one: %s",str)
- end
- local fullname, size = lpegmatch(splitpattern,str)
- local lookup, name, sub, method, detail = getspecification(fullname)
- if not name then
- report_defining("strange definition %a",str)
- -- ctx_setdefaultfontname()
- elseif name == "unknown" then
- -- ctx_setdefaultfontname()
- else
- -- ctx_setsomefontname(name)
- setmacro("somefontname",name,"global")
- end
- -- we can also use a count for the size
- if size and size ~= "" then
- local mode, size = lpegmatch(sizepattern,size)
- if size and mode then
- texsetcount("scaledfontmode",mode)
- -- ctx_setsomefontsize(size)
- setmacro("somefontsize",size)
+ implement {
+ name = "definefont_one",
+ arguments = "string",
+ actions = function(str)
+ starttiming(fonts)
+ if trace_defining then
+ report_defining("memory usage before: %s",statistics.memused())
+ report_defining("start stage one: %s",str)
+ end
+ local fullname, size = lpegmatch(splitpattern,str)
+ local lookup, name, sub, method, detail = getspecification(fullname)
+ if not name then
+ report_defining("strange definition %a",str)
+ -- ctx_setdefaultfontname()
+ elseif name == "unknown" then
+ -- ctx_setdefaultfontname()
+ else
+ -- ctx_setsomefontname(name)
+ setmacro("somefontname",name,"global")
+ end
+ -- we can also use a count for the size
+ if size and size ~= "" then
+ local mode, size = lpegmatch(sizepattern,size)
+ if size and mode then
+ texsetcount("scaledfontmode",mode)
+ -- ctx_setsomefontsize(size)
+ setmacro("somefontsize",size)
+ else
+ texsetcount("scaledfontmode",0)
+ -- ctx_setemptyfontsize()
+ end
+ elseif true then
+ -- so we don't need to check in tex
+ texsetcount("scaledfontmode",2)
+ -- ctx_setemptyfontsize()
else
texsetcount("scaledfontmode",0)
-- ctx_setemptyfontsize()
end
- elseif true then
- -- so we don't need to check in tex
- texsetcount("scaledfontmode",2)
- -- ctx_setemptyfontsize()
- else
- texsetcount("scaledfontmode",0)
- -- ctx_setemptyfontsize()
- end
- specification = definers.makespecification(str,lookup,name,sub,method,detail,size)
- if trace_defining then
- report_defining("stop stage one")
+ specification = definers.makespecification(str,lookup,name,sub,method,detail,size)
+-- specification.original = str
+ if trace_defining then
+ report_defining("stop stage one")
+ end
end
- end
+ }
local function nice_cs(cs)
return (gsub(cs,".->", ""))
@@ -1242,179 +1232,224 @@ do -- else too many locals
combinefeatures = v
end)
- scanners.definefont_two = function()
- local global = scanboolean() -- \ifx\fontclass\empty\s!false\else\s!true\fi
- local cs = scanstring () -- {#csname}%
- local str = scanstring () -- \somefontfile
- local size = scaninteger() -- \d_font_scaled_font_size
- local inheritancemode = scaninteger() -- \c_font_feature_inheritance_mode
- local classfeatures = scanstring () -- \m_font_class_features
- local fontfeatures = scanstring () -- \m_font_features
- local classfallbacks = scanstring () -- \m_font_class_fallbacks
- local fontfallbacks = scanstring () -- \m_font_fallbacks
- local mathsize = scaninteger() -- \fontface
- local textsize = scaninteger() -- \d_font_scaled_text_face
- local relativeid = scaninteger() -- \relativefontid
- local classgoodies = scanstring () -- \m_font_class_goodies
- local goodies = scanstring () -- \m_font_goodies
- local classdesignsize = scanstring () -- \m_font_class_designsize
- local fontdesignsize = scanstring () -- \m_font_designsize
- local scaledfontmode = scaninteger() -- \scaledfontmode
-
- if trace_defining then
- report_defining("start stage two: %s, size %s, features %a & %a, mode %a",str,size,classfeatures,fontfeatures,inheritancemode)
- end
- -- name is now resolved and size is scaled cf sa/mo
- local lookup, name, sub, method, detail = getspecification(str or "")
- -- new (todo: inheritancemode)
- local designsize = fontdesignsize ~= "" and fontdesignsize or classdesignsize or ""
- local designname = designsizefilename(name,designsize,size)
- if designname and designname ~= "" then
- if trace_defining or trace_designsize then
- report_defining("remapping name %a, specification %a, size %a, designsize %a",name,designsize,size,designname)
- end
- -- we don't catch detail here
- local o_lookup, o_name, o_sub, o_method, o_detail = getspecification(designname)
- if o_lookup and o_lookup ~= "" then lookup = o_lookup end
- if o_method and o_method ~= "" then method = o_method end
- if o_detail and o_detail ~= "" then detail = o_detail end
- name = o_name
- sub = o_sub
- end
- -- so far
- -- some settings can have been overloaded
- 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 and sub ~= "" and sub) or specification.sub
- specification.mathsize = mathsize
- specification.textsize = textsize
- specification.goodies = goodies
- specification.cs = cs
- specification.global = global
- specification.scalemode = scaledfontmode -- context specific
- if detail and detail ~= "" then
- specification.method = method or "*"
- specification.detail = detail
- elseif specification.detail and specification.detail ~= "" then
- -- already set
- elseif inheritancemode == 0 then
- -- nothing
- elseif inheritancemode == 1 then
- -- fontonly
- if fontfeatures and fontfeatures ~= "" then
- specification.method = "*"
- specification.detail = fontfeatures
- end
- if fontfallbacks and fontfallbacks ~= "" then
- specification.fallbacks = fontfallbacks
- end
- elseif inheritancemode == 2 then
- -- classonly
- if classfeatures and classfeatures ~= "" then
- specification.method = "*"
- specification.detail = classfeatures
- end
- if classfallbacks and classfallbacks ~= "" then
- specification.fallbacks = classfallbacks
- end
- elseif inheritancemode == 3 then
- -- fontfirst
- if combinefeatures then
- if classfeatures and classfeatures ~= "" then
- specification.method = "*"
- if fontfeatures and fontfeatures ~= "" and fontfeatures ~= classfeatures then
- specification.detail = classfeatures .. "," .. fontfeatures
- else
- specification.detail = classfeatures
- end
- elseif fontfeatures and fontfeatures ~= "" then
- specification.method = "*"
- specification.detail = fontfeatures
+ implement {
+ name = "definefont_two",
+ arguments = {
+ "boolean", "string", "string", "integer", "integer", "string", "string", "string", "string",
+ "integer", "integer", "integer", "string", "string", "string", "string", "integer",
+ },
+ actions = function (
+ global, -- \ifx\fontclass\empty\s!false\else\s!true\fi
+ cs, -- {#csname}%
+ str, -- \somefontfile
+ size, -- \d_font_scaled_font_size
+ inheritancemode, -- \c_font_feature_inheritance_mode
+ classfeatures, -- \m_font_class_features
+ fontfeatures, -- \m_font_features
+ classfallbacks, -- \m_font_class_fallbacks
+ fontfallbacks, -- \m_font_fallbacks
+ mathsize, -- \fontface
+ textsize, -- \d_font_scaled_text_face
+ relativeid, -- \relativefontid
+ classgoodies, -- \m_font_class_goodies
+ goodies, -- \m_font_goodies
+ classdesignsize, -- \m_font_class_designsize
+ fontdesignsize, -- \m_font_designsize
+ scaledfontmode -- \scaledfontmode
+ )
+ if trace_defining then
+ report_defining("start stage two: %s, size %s, features %a & %a, mode %a",str,size,classfeatures,fontfeatures,inheritancemode)
+ end
+ -- name is now resolved and size is scaled cf sa/mo
+ local lookup, name, sub, method, detail = getspecification(str or "")
+ -- new (todo: inheritancemode)
+ local designsize = fontdesignsize ~= "" and fontdesignsize or classdesignsize or ""
+ local designname = designsizefilename(name,designsize,size)
+ if designname and designname ~= "" then
+ if trace_defining or trace_designsize then
+ report_defining("remapping name %a, specification %a, size %a, designsize %a",name,designsize,size,designname)
end
- else
+ -- we don't catch detail here
+ local o_lookup, o_name, o_sub, o_method, o_detail = getspecification(designname)
+ if o_lookup and o_lookup ~= "" then lookup = o_lookup end
+ if o_method and o_method ~= "" then method = o_method end
+ if o_detail and o_detail ~= "" then detail = o_detail end
+ name = o_name
+ sub = o_sub
+ end
+ -- so far
+ -- some settings can have been overloaded
+ 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 and sub ~= "" and sub) or specification.sub
+ specification.mathsize = mathsize
+ specification.textsize = textsize
+ specification.goodies = goodies
+ specification.cs = cs
+ specification.global = global
+ specification.scalemode = scaledfontmode -- context specific
+ if detail and detail ~= "" then
+ specification.method = method or "*"
+ specification.detail = detail
+ elseif specification.detail and specification.detail ~= "" then
+ -- already set
+ elseif inheritancemode == 0 then
+ -- nothing
+ elseif inheritancemode == 1 then
+ -- fontonly
if fontfeatures and fontfeatures ~= "" then
specification.method = "*"
specification.detail = fontfeatures
- elseif classfeatures and classfeatures ~= "" then
+ end
+ if fontfallbacks and fontfallbacks ~= "" then
+ specification.fallbacks = fontfallbacks
+ end
+ elseif inheritancemode == 2 then
+ -- classonly
+ if classfeatures and classfeatures ~= "" then
specification.method = "*"
specification.detail = classfeatures
end
- end
- if fontfallbacks and fontfallbacks ~= "" then
- specification.fallbacks = fontfallbacks
- elseif classfallbacks and classfallbacks ~= "" then
- specification.fallbacks = classfallbacks
- end
- elseif inheritancemode == 4 then
- -- classfirst
- if combinefeatures then
- if fontfeatures and fontfeatures ~= "" then
- specification.method = "*"
- if classfeatures and classfeatures ~= "" and classfeatures ~= fontfeatures then
- specification.detail = fontfeatures .. "," .. classfeatures
- else
+ if classfallbacks and classfallbacks ~= "" then
+ specification.fallbacks = classfallbacks
+ end
+ elseif inheritancemode == 3 then
+ -- fontfirst
+ if combinefeatures then
+ if classfeatures and classfeatures ~= "" then
+ specification.method = "*"
+ if fontfeatures and fontfeatures ~= "" and fontfeatures ~= classfeatures then
+ specification.detail = classfeatures .. "," .. fontfeatures
+ else
+ specification.detail = classfeatures
+ end
+ elseif fontfeatures and fontfeatures ~= "" then
+ specification.method = "*"
specification.detail = fontfeatures
end
- elseif classfeatures and classfeatures ~= "" then
- specification.method = "*"
- specification.detail = classfeatures
+ else
+ if fontfeatures and fontfeatures ~= "" then
+ specification.method = "*"
+ specification.detail = fontfeatures
+ elseif classfeatures and classfeatures ~= "" then
+ specification.method = "*"
+ specification.detail = classfeatures
+ end
end
- else
- if classfeatures and classfeatures ~= "" then
- specification.method = "*"
- specification.detail = classfeatures
- elseif fontfeatures and fontfeatures ~= "" then
- specification.method = "*"
- specification.detail = fontfeatures
+ if fontfallbacks and fontfallbacks ~= "" then
+ specification.fallbacks = fontfallbacks
+ elseif classfallbacks and classfallbacks ~= "" then
+ specification.fallbacks = classfallbacks
+ end
+ elseif inheritancemode == 4 then
+ -- classfirst
+ if combinefeatures then
+ if fontfeatures and fontfeatures ~= "" then
+ specification.method = "*"
+ if classfeatures and classfeatures ~= "" and classfeatures ~= fontfeatures then
+ specification.detail = fontfeatures .. "," .. classfeatures
+ else
+ specification.detail = fontfeatures
+ end
+ elseif classfeatures and classfeatures ~= "" then
+ specification.method = "*"
+ specification.detail = classfeatures
+ end
+ else
+ if classfeatures and classfeatures ~= "" then
+ specification.method = "*"
+ specification.detail = classfeatures
+ elseif fontfeatures and fontfeatures ~= "" then
+ specification.method = "*"
+ specification.detail = fontfeatures
+ end
+ end
+ if classfallbacks and classfallbacks ~= "" then
+ specification.fallbacks = classfallbacks
+ elseif fontfallbacks and fontfallbacks ~= "" then
+ specification.fallbacks = fontfallbacks
end
end
- if classfallbacks and classfallbacks ~= "" then
- specification.fallbacks = classfallbacks
- elseif fontfallbacks and fontfallbacks ~= "" then
- specification.fallbacks = fontfallbacks
- end
- end
- --
- local tfmdata = definers.read(specification,size) -- id not yet known (size in spec?)
- --
- local lastfontid = 0
- local tfmtype = type(tfmdata)
- if tfmtype == "table" then
- -- setting the extra characters will move elsewhere
- local characters = tfmdata.characters
- local parameters = tfmdata.parameters
- local properties = tfmdata.properties
- -- we use char0 as signal; cf the spec pdf can handle this (no char in slot)
- characters[0] = nil
- -- characters[0x00A0] = { width = parameters.space }
- -- characters[0x2007] = { width = characters[0x0030] and characters[0x0030].width or parameters.space } -- figure
- -- characters[0x2008] = { width = characters[0x002E] and characters[0x002E].width or parameters.space } -- period
--
- local fallbacks = specification.fallbacks or ""
- local mathsize = (mathsize == 1 or mathsize == 2 or mathsize == 3) and mathsize or nil -- can be unset so we test 1 2 3
- if fallbacks ~= "" and mathsize and not busy then
- busy = true
- -- We need this ugly hack in order to resolve fontnames (at the \TEX end). Originally
- -- math was done in Lua after loading (plugged into aftercopying).
+ local tfmdata = definers.read(specification,size) -- id not yet known (size in spec?)
+ --
+ local lastfontid = 0
+ local tfmtype = type(tfmdata)
+ if tfmtype == "table" then
+ -- setting the extra characters will move elsewhere
+ local characters = tfmdata.characters
+ local parameters = tfmdata.parameters
+ local properties = tfmdata.properties
+ -- we use char0 as signal; cf the spec pdf can handle this (no char in slot)
+ characters[0] = nil
+ -- characters[0x00A0] = { width = parameters.space }
+ -- characters[0x2007] = { width = characters[0x0030] and characters[0x0030].width or parameters.space } -- figure
+ -- characters[0x2008] = { width = characters[0x002E] and characters[0x002E].width or parameters.space } -- period
--
- -- After tl 2017 I'll also do text fallbacks this way (although backups there are done
- -- in a completely different way.)
- if trace_defining then
- report_defining("defining %a, id %a, target %a, features %a / %a, fallbacks %a / %a, step %a",
- name,id,nice_cs(cs),classfeatures,fontfeatures,classfallbacks,fontfallbacks,1)
- end
- mathematics.resolvefallbacks(tfmdata,specification,fallbacks)
- context(function()
- busy = false
- mathematics.finishfallbacks(tfmdata,specification,fallbacks)
+ local fallbacks = specification.fallbacks or ""
+ local mathsize = (mathsize == 1 or mathsize == 2 or mathsize == 3) and mathsize or nil -- can be unset so we test 1 2 3
+ if fallbacks ~= "" and mathsize and not busy then
+ busy = true
+ -- We need this ugly hack in order to resolve fontnames (at the \TEX end). Originally
+ -- math was done in Lua after loading (plugged into aftercopying).
+ --
+ -- After tl 2017 I'll also do text fallbacks this way (although backups there are done
+ -- in a completely different way.)
+ if trace_defining then
+ report_defining("defining %a, id %a, target %a, features %a / %a, fallbacks %a / %a, step %a",
+ name,id,nice_cs(cs),classfeatures,fontfeatures,classfallbacks,fontfallbacks,1)
+ end
+ mathematics.resolvefallbacks(tfmdata,specification,fallbacks)
+ context(function()
+ busy = false
+ mathematics.finishfallbacks(tfmdata,specification,fallbacks)
+tfmdata.original = specification.specification
+ local id = definefont(tfmdata)
+ csnames[id] = specification.cs
+ properties.id = id
+ definers.register(tfmdata,id) -- to be sure, normally already done
+ texdefinefont(global,cs,id)
+ constructors.cleanuptable(tfmdata)
+ constructors.finalize(tfmdata)
+ if trace_defining then
+ report_defining("defining %a, id %a, target %a, features %a / %a, fallbacks %a / %a, step %a",
+ name,id,nice_cs(cs),classfeatures,fontfeatures,classfallbacks,fontfallbacks,2)
+ end
+ -- resolved (when designsize is used):
+ local size = round(tfmdata.parameters.size or 655360)
+ setmacro("somefontsize",size.."sp")
+ -- ctx_setsomefontsize(size .. "sp")
+ texsetcount("scaledfontsize",size)
+ lastfontid = id
+ --
+ if trace_defining then
+ report_defining("memory usage after: %s",statistics.memused())
+ report_defining("stop stage two")
+ end
+ --
+ texsetcount("global","lastfontid",lastfontid)
+ specifiers[lastfontid] = { str, size }
+ if not mathsize then
+ -- forget about it (can't happen here)
+ elseif mathsize == 0 then
+ -- can't happen (here)
+ else
+ -- maybe only 1 2 3 (we already test for this)
+ lastmathids[mathsize] = lastfontid
+ end
+ stoptiming(fonts)
+ end)
+ return
+ else
+tfmdata.original = specification.specification
local id = definefont(tfmdata)
csnames[id] = specification.cs
properties.id = id
@@ -1424,7 +1459,7 @@ do -- else too many locals
constructors.finalize(tfmdata)
if trace_defining then
report_defining("defining %a, id %a, target %a, features %a / %a, fallbacks %a / %a, step %a",
- name,id,nice_cs(cs),classfeatures,fontfeatures,classfallbacks,fontfallbacks,2)
+ name,id,nice_cs(cs),classfeatures,fontfeatures,classfallbacks,fontfallbacks,"-")
end
-- resolved (when designsize is used):
local size = round(tfmdata.parameters.size or 655360)
@@ -1432,102 +1467,78 @@ do -- else too many locals
-- ctx_setsomefontsize(size .. "sp")
texsetcount("scaledfontsize",size)
lastfontid = id
- --
- if trace_defining then
- report_defining("memory usage after: %s",statistics.memused())
- report_defining("stop stage two")
- end
- --
- texsetcount("global","lastfontid",lastfontid)
- specifiers[lastfontid] = { str, size }
- if not mathsize then
- -- forget about it (can't happen here)
- elseif mathsize == 0 then
- -- can't happen (here)
- else
- -- maybe only 1 2 3 (we already test for this)
- lastmathids[mathsize] = lastfontid
- end
- stoptiming(fonts)
- end)
- return
- else
- local id = definefont(tfmdata)
- csnames[id] = specification.cs
- properties.id = id
- definers.register(tfmdata,id) -- to be sure, normally already done
- texdefinefont(global,cs,id)
- constructors.cleanuptable(tfmdata)
- constructors.finalize(tfmdata)
+ end
+ elseif tfmtype == "number" then
if trace_defining then
- report_defining("defining %a, id %a, target %a, features %a / %a, fallbacks %a / %a, step %a",
- name,id,nice_cs(cs),classfeatures,fontfeatures,classfallbacks,fontfallbacks,"-")
+ report_defining("reusing %s, id %a, target %a, features %a / %a, fallbacks %a / %a, goodies %a / %a, designsize %a / %a",
+ name,tfmdata,nice_cs(cs),classfeatures,fontfeatures,classfallbacks,fontfallbacks,classgoodies,goodies,classdesignsize,fontdesignsize)
end
+ csnames[tfmdata] = specification.cs
+ texdefinefont(global,cs,tfmdata)
-- resolved (when designsize is used):
- local size = round(tfmdata.parameters.size or 655360)
- setmacro("somefontsize",size.."sp")
+ local size = round(fontdata[tfmdata].parameters.size or 0)
-- ctx_setsomefontsize(size .. "sp")
+ setmacro("somefontsize",size.."sp")
texsetcount("scaledfontsize",size)
- lastfontid = id
+ lastfontid = tfmdata
+ else
+ report_defining("unable to define %a as %a",name,nice_cs(cs))
+ lastfontid = -1
+ texsetcount("scaledfontsize",0)
+ -- ctx_letvaluerelax(cs) -- otherwise the current definition takes the previous one
end
- elseif tfmtype == "number" then
if trace_defining then
- report_defining("reusing %s, id %a, target %a, features %a / %a, fallbacks %a / %a, goodies %a / %a, designsize %a / %a",
- name,tfmdata,nice_cs(cs),classfeatures,fontfeatures,classfallbacks,fontfallbacks,classgoodies,goodies,classdesignsize,fontdesignsize)
- end
- csnames[tfmdata] = specification.cs
- texdefinefont(global,cs,tfmdata)
- -- resolved (when designsize is used):
- local size = round(fontdata[tfmdata].parameters.size or 0)
- -- ctx_setsomefontsize(size .. "sp")
- setmacro("somefontsize",size.."sp")
- texsetcount("scaledfontsize",size)
- lastfontid = tfmdata
- else
- report_defining("unable to define %a as %a",name,nice_cs(cs))
- lastfontid = -1
- texsetcount("scaledfontsize",0)
- -- ctx_letvaluerelax(cs) -- otherwise the current definition takes the previous one
- end
- if trace_defining then
- report_defining("memory usage after: %s",statistics.memused())
- report_defining("stop stage two")
- end
- --
- texsetcount("global","lastfontid",lastfontid)
- specifiers[lastfontid] = { str, size }
- if not mathsize then
- -- forget about it
- elseif mathsize == 0 then
- -- can't happen (here)
- else
- -- maybe only 1 2 3
- lastmathids[mathsize] = lastfontid
+ report_defining("memory usage after: %s",statistics.memused())
+ report_defining("stop stage two")
+ end
+ --
+ texsetcount("global","lastfontid",lastfontid)
+ specifiers[lastfontid] = { str, size }
+ if not mathsize then
+ -- forget about it
+ elseif mathsize == 0 then
+ -- can't happen (here)
+ else
+ -- maybe only 1 2 3
+ lastmathids[mathsize] = lastfontid
+ end
+ --
+ stoptiming(fonts)
end
- --
- stoptiming(fonts)
- end
+ }
- function scanners.specifiedfontspec()
- local f = specifiers[scaninteger()]
- if f then
- context(f[1])
- end
- end
- function scanners.specifiedfontsize()
- local f = specifiers[scaninteger()]
- if f then
- context(f[2])
+ implement {
+ name = "specifiedfontspec",
+ arguments = "integer",
+ actions = function(id)
+ local f = specifiers[id]
+ if f then
+ context(f[1])
+ end
end
- end
- function scanners.specifiedfont()
- local f = specifiers[scaninteger()]
- local s = scannumber()
- if f and s then
- context("%s at %0.2p",f[1],s * f[2]) -- we round to 2 decimals (as at the tex end)
+ }
+
+ implement {
+ name = "specifiedfontsize",
+ arguments = "integer",
+ actions = function(id)
+ local f = specifiers[id]
+ if f then
+ context(f[2])
+ end
end
- end
+ }
+ implement {
+ name = "specifiedfont",
+ arguments = { "integer", "number" },
+ actions = function(id,size)
+ local f = specifiers[id]
+ if f and size then
+ context("%s at %0.2p",f[1],size * f[2]) -- we round to 2 decimals (as at the tex end)
+ end
+ end
+ }
--
local function define(specification)
@@ -1636,17 +1647,7 @@ do -- else too many locals
return id, csnames[id]
end
- local read
-
- if CONTEXTLMTXMODE and CONTEXTLMTXMODE > 0 then -- maybe always
- read = function(name,size)
- return (define { name = name, size = size } or 0)
- end
- else
- read = definers.read
- end
-
- callbacks.register('define_font', read, "definition of fonts (tfmdata preparation)")
+ callbacks.register('define_font', definers.read, "definition of fonts (tfmdata preparation)")
-- here
@@ -1812,7 +1813,7 @@ function mappings.loadfile(name)
if trace_mapfiles then
report_mapfiles("loading map file %a",name)
end
- lpdf.setmapfile(name)
+ lpdf.setmapfile(name) -- bah. will go in lmtx
loaded[name] = true
end
end
@@ -1830,7 +1831,7 @@ function mappings.loadline(how,line)
if trace_mapfiles then
report_mapfiles("processing map line %a",line)
end
- lpdf.setmapline(how)
+ lpdf.setmapline(how) -- bah. will go in lmtx
loaded[how] = true
end
end
@@ -3369,8 +3370,3 @@ function fonts.helpers.collectanchors(tfmdata)
return anchors
end
-
-if CONTEXTLMTXMODE > 0 then
- fonts.constructors.addtounicode = false
- fonts.constructors.autocleanup = false
-end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-def.lua b/Master/texmf-dist/tex/context/base/mkiv/font-def.lua
index e287bf79ce5..b752b3258c4 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-def.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-def.lua
@@ -207,9 +207,6 @@ function resolvers.name(specification)
features.normal = normal
end
normal.instance = instance
- -- if not callbacks.supported.glyph_stream_provider then
- -- normal.variableshapes = true -- for the moment
- -- end
end
--
local suffix = lower(suffixonly(resolved))
@@ -492,7 +489,9 @@ function definers.read(specification,size,id) -- id can be optional, name can al
end
else
tfmdata = definers.loadfont(specification) -- can be overloaded
+-- put in properties instead
if tfmdata then
+ tfmdata.original = specification.specification
if trace_defining then
report_defining("loaded and hashed: %s",hash)
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-dsp.lua b/Master/texmf-dist/tex/context/base/mkiv/font-dsp.lua
index 3058be37b9a..8d7c3d359d9 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-dsp.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-dsp.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['font-dsp'] = {
version = 1.001,
+ optimize = true,
comment = "companion to font-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
@@ -302,7 +303,7 @@ end)
-- values can be anything the min/max permits so we can either think of
-- real values of a fraction along the axis (probably easier)
--- wght:400,wdth:100,ital:1
+-- wght=400,wdth=100,ital=1
local function axistofactors(str)
local t = settings_to_hash(str)
@@ -502,7 +503,7 @@ local function readvariationdata(f,storeoffset,factors) -- store
regions[i] = t
end
-- deltas
- if factors then
+ -- if factors then
for i=1,nofdeltadata do
setposition(f,storeoffset+deltadata[i])
local nofdeltasets = readushort(f)
@@ -527,7 +528,7 @@ local function readvariationdata(f,storeoffset,factors) -- store
scales = factors and getscales(usedregions,factors) or nil,
}
end
- end
+ -- end
setposition(f,position)
return regions, deltadata
end
@@ -822,7 +823,7 @@ end
-- quite often 0, 1, 2
-function readarray(f,offset)
+local function readarray(f,offset)
if offset then
setposition(f,offset)
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-emp.mklx b/Master/texmf-dist/tex/context/base/mkiv/font-emp.mklx
deleted file mode 100644
index 2bd6f3cf9c2..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/font-emp.mklx
+++ /dev/null
@@ -1,256 +0,0 @@
-%D \module
-%D [ file=font-emp,
-%D version=20120106, % (moved from font-ini)
-%D title=\CONTEXT\ Font Macros,
-%D subtitle=Emphasis,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Font Macros / Emphasis}
-
-\unprotect
-
-%D \macros
-%D {em,emphasistypeface,emphasisboldface}
-%D
-%D The next macro started as a copy of Donald Arseneau's \type {\em} (\TUGNEWS\
-%D Vol.~3, no.~1, 1994). His implementation was a bit more sophisticated version of
-%D the standard \LATEX\ one. We further enhanced the macro, so now it also adapts
-%D itself to boldface mode. Because we favor {\sl slanted} type over {\it italic},
-%D we made the emphasis adaptable, for instance:
-%D
-%D \starttyping
-%D \def\emphasistypeface {\it}
-%D \def\emphasisboldface {\bi}
-%D \stoptyping
-%D
-%D But we prefer:
-%D
-%D \starttyping
-%D \unexpanded\def\emphasistypeface{\sl}
-%D \unexpanded\def\emphasisboldface{\bs}
-%D \stoptyping
-%D
-%D or even better:
-
-\let\m_font_emphasized_typeface\empty
-
-\def\font_emphasis_checked_typeface#slanted#italic%
- {\edef\m_font_emphasized_typeface{\font_bodyfontvariable\s!em}%
- \ifx\m_font_emphasized_typeface\v!slanted
- #slanted%
- \orelse\ifx\m_font_emphasized_typeface\v!italic
- #italic%
- \orelse\ifx\m_font_emphasized_typeface\empty
- #slanted%
- \else
- \csname\m_font_emphasized_typeface\endcsname
- \fi}
-
-\unexpanded\def\emphasistypeface{\font_emphasis_checked_typeface\sl\it}
-\unexpanded\def\emphasisboldface{\font_emphasis_checked_typeface\bs\bi}
-
-\unexpanded\def\normalboldface % public
- {\relax
- \ifx\fontalternative\s!it\bi\orelse
- \ifx\fontalternative\s!sl\bs\else
- \bf\fi}
-
-\unexpanded\def\normalitalicface % public
- {\relax
- \ifx\fontalternative\s!tf\it\orelse
- \ifx\fontalternative\s!bf\bi\else
- \tf\fi}
-
-\unexpanded\def\normalslantedface % public
- {\relax \ifx\fontalternative\s!tf\sl
- \orelse\ifx\fontalternative\s!bf\bs
- \else \tf\fi}
-
-\unexpanded\def\normaltypeface % public
- {\relax
- \ifx\fontalternative\s!bi \it \orelse
- \ifx\fontalternative\s!bs \sl \else
- \tf \fi}
-
-\unexpanded\def\swaptypeface % public
- {\relax
- \ifx\fontalternative\s!it \tf \orelse
- \ifx\fontalternative\s!sl \tf \orelse
- \ifx\fontalternative\s!bf \emphasisboldface \orelse
- \ifx\fontalternative\s!bs \bf \orelse
- \ifx\fontalternative\s!bi \bf \else
- \emphasistypeface \fi}
-
-\let\typeface \normaltypeface % public
-\let\boldface \normalboldface % public
-\let\slantedface\normalslantedface % public
-\let\italicface \normalitalicface % public
-\let\swapface \swaptypeface % public
-
-%D To be set with the default body font environment: \type
-%D {em} being \type {slanted} or \type {italic}.
-
-% maybe a \csname...\fontalternative\endcsname
-
-\newconditional\c_font_emphasis_needed
-
-\unexpanded\def\em
- {\relax
- \ifdim\slantperpoint>\zeropoint
- \settrue\c_font_emphasis_needed
- \else
- \setfalse\c_font_emphasis_needed
- \fi
- \font_emphasis_set_emphasis_boldface % new
- \ifx\fontalternative\s!it
- \unexpanded\def\emphasistypeface{\it}\tf
- \orelse\ifx\fontalternative\s!sl
- \unexpanded\def\emphasistypeface{\sl}\tf
- \orelse\ifx\fontalternative\s!bf
- \emphasisboldface
- \orelse\ifx\fontalternative\s!bs
- \unexpanded\def\emphasisboldface{\bs}\bf
- \orelse\ifx\fontalternative\s!bi
- \unexpanded\def\emphasisboldface{\bi}\bf
- \else
- \emphasistypeface
- \fi
- \ifconditional\c_font_emphasis_needed\else
- \expandafter\aftergroup
- \fi
- \emphasiscorrection}
-
-%D The next feature was not present in previous versions. It
-%D takes care of \type {\em \bf ...} situations.
-
-\let\font_emphasis_saved_emphasis_boldface\relax
-
-\def\font_emphasis_set_emphasis_boldface
- {\let\font_emphasis_saved_emphasis_boldface\bf
- \let\font_emphasis_set_emphasis_boldface\relax
- \let\bf\font_emphasis_bold_bold}
-
-\unexpanded\def\font_emphasis_bold_bold
- {%\relax
- \let\bf\relax % new
- \ifx\fontalternative\s!it
- \bi
- \orelse\ifx\fontalternative\s!sl
- \bs
- \else
- \font_emphasis_saved_emphasis_boldface
- \fi
- \let\bf\font_emphasis_saved_emphasis_boldface}
-
-%D Donald's (adapted) macros take the next character into account when placing
-%D italic correction. As a bonus we also look for something that looks like a dash,
-%D in which case we don't correct.
-
-\let\italiccorrection=\/ % tex primitive
-
-\def\emphasiscorrection % public, not in raw alignment groups, else omit problem
- {\ifhmode\ifnum\currentgrouptype=\aligngroupcode\else
- \expandafter\expandafter\expandafter\font_emphasis_look
- \fi\fi}
-
-\def\font_emphasis_look
- {\begingroup
- \futurelet\nexttoken\font_emphasis_test}
-
-\def\font_emphasis_test
- {\ifcat\noexpand\nexttoken,% we can do better in luatex ... some day ...
- \expandafter\font_emphasis_a
- \else
- \expandafter\font_emphasis_b
- \fi}
-
-\def\font_emphasis_a
- {\futurelet\nexttoken\font_emphasis_correction}
-
-\def\font_emphasis_correction
- {\setbox\scratchbox\hbox{\nexttoken}% tricky as next can be a macro
- \ifzeropt\ht\scratchbox % probably a space
- \expandafter\font_emphasis_b
- \orelse\ifdim\ht\scratchbox<.3\exheight
- \expandafter\expandafter\expandafter\endgroup
- \else
- \expandafter\expandafter\expandafter\font_emphasis_b
- \fi}
-
-\def\font_emphasis_b
- {\scratchskip\lastskip
- \ifzeropt\scratchskip
- \italiccorrection\relax
- \else
- \unskip\italiccorrection\hskip\scratchskip
- \fi
- \endgroup}
-
-%D We end with some examples which show the behavior when some punctuation is met.
-%D We also show how the mechanism adapts itself to bold, italic and slanted typing.
-%D
-%D \startbuffer
-%D test {test}test \par
-%D test {\sl test}test \par
-%D test {\em test}test \par
-%D test {\em test}--test \par
-%D
-%D test {test}, test \par
-%D test {\em test}, test \par
-%D
-%D test {\em test {\em test {\em test} test} test} test \par
-%D test {\bf test {\em test {\em test} test} test} test \par
-%D test {\sl test {\em test {\em test} test} test} test \par
-%D test {\it test {\em test {\em test} test} test} test \par
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D We get:
-%D
-%D \startpacked
-%D \getbuffer
-%D \stoppacked
-
-%D \macros
-%D {emphbf,emphit,emphsl,emphtf}
-%D
-%D The next emphasis alternatives are for \THANH. They adapt their style as good as
-%D possible. These macros are obsolete in \MKIV.
-
-% \unexpanded\def\emphbf{\groupedcommand{\bf\def\emphit{\bi}\def\emphsl{\bs}}{}}
-% \unexpanded\def\emphit{\groupedcommand{\it\def\emphbf{\bi}\def\emphsl{\sl}}{}}
-% \unexpanded\def\emphsl{\groupedcommand{\sl\def\emphbf{\bs}\def\emphit{\it}}{}}
-% \unexpanded\def\emphtf{\groupedcommand{\tf\def\emphbf{\bf}\def\emphit{\it}\def\emphsl{\sl}}{}}
-% \unexpanded\def\emph {\groupedcommand{\em}{}}
-
-\unexpanded\def\font_emphasis_bf{\bf\def\emphit{\bi}\def\emphsl{\bs}}
-\unexpanded\def\font_emphasis_it{\it\def\emphbf{\bi}\def\emphsl{\sl}}
-\unexpanded\def\font_emphasis_sl{\sl\def\emphbf{\bs}\def\emphit{\it}}
-\unexpanded\def\font_emphasis_tf{\tf\def\emphbf{\bf}\def\emphit{\it}\def\emphsl{\sl}}
-
-\unexpanded\def\emphbf{\triggergroupedcommandcs\font_emphasis_bf}
-\unexpanded\def\emphit{\triggergroupedcommandcs\font_emphasis_it}
-\unexpanded\def\emphsl{\triggergroupedcommandcs\font_emphasis_sl}
-\unexpanded\def\emphtf{\triggergroupedcommandcs\font_emphasis_tf}
-\unexpanded\def\emph {\triggergroupedcommandcs\em}
-
-\unexpanded\def\emphasized{\bgroup\em\let\nexttoken}
-
-%D \startbuffer
-%D TEXT {\emphbf text \emphit text \emphtf text \emphsl text} TEXT
-%D TEXT \emphbf{text \emphit{text} \emphtf{text} \emphsl{text}} TEXT
-%D \stopbuffer
-%D
-%D \typebuffer
-%D \startlines
-%D \getbuffer
-%D \stoplines
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-fil.mklx b/Master/texmf-dist/tex/context/base/mkiv/font-fil.mklx
deleted file mode 100644
index 6cc25db1036..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/font-fil.mklx
+++ /dev/null
@@ -1,422 +0,0 @@
-%D \module
-%D [ file=font-fil,
-%D version=2011.01.13, % (copied fron font-ini)
-%D title=\CONTEXT\ Font Macros,
-%D subtitle=Classes and Files,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Font Macros / Classes and Files}
-
-\unprotect
-
-%D Personally I think that using \TEX\ macro packages is complicated by the way
-%D fonts are handled. Apart from the many encodings, we also deal with different
-%D naming schemes. Confronted with this problem, I decided to change the definitions
-%D into:
-%D
-%D \starttyping
-%D \definebodyfont [12pt] [rm] [tf=Times-Roman at 12pt]
-%D \stoptyping
-%D
-%D combined with for instance:
-%D
-%D \starttyping
-%D \definefontsynonym [Times-Roman] [tir]
-%D \stoptyping
-
-% \definetypeface[palatino][rm][serif][palatino,allbold][default]
-%
-% \startfontclass[palatino]
-% \definefontsynonym [Serif] [SerifBold]
-% \definefontsynonym [SerifItalic] [SerifBoldItalic]
-% \definefontsynonym [SerifSlanted] [SerifBoldSlanted]
-% \definefontsynonym [SerifCaps] [SerifBold]
-% \stopfontclass
-%
-% \setupbodyfont[palatino]
-
-\unexpanded\def\startfontclass
- {\dosingleempty\font_basics_start_font_class}
-
-\def\font_basics_start_font_class[#class]%
- {\push_macro_fontclass
- \doifelse{#class}\v!each
- {\let\fontclass\empty}
- {\doifsomething{#class}{\def\fontclass{#class}}}}
-
-\unexpanded\def\stopfontclass
- {\pop_macro_fontclass}
-
-\def\classfont#class#name{#class#name} % \definefont[whatever][\classfont{xx}{yy} at 10pt]
-
-%D \macros
-%D {definefontsynonym, doifelsefontsynonym,
-%D expandfontsynonym, truefontname, truefontdata}
-%D
-%D While looking for fonts, fontsynonyms are used for accessing
-%D the files!
-%D
-%D \starttyping
-%D \definefontsynonym[Serif][Lucida-Bright]
-%D \definefontsynonym[Lucida-Bright][lbr][encoding=texnansi]
-%D \stoptyping
-
-\installcorenamespace {fontfile} % file synonyms
-
-\let\m_font_name\empty
-\let\m_font_file\empty
-
-\def \defaultfontfile{\truefontname{Normal}} % was cmtt10, but that one is gone
-\edef\nullfontname {\fontname\nullfont}
-
-\unexpanded\def\definefontsynonym[#name]#crap[#file]%
- {\edef\m_font_name{#name}%
- \edef\m_font_file{#file}%
- \ifx\fontclass\empty
- \expandafter\font_basics_define_font_synonym_nop
- \else
- \expandafter\font_basics_define_font_synonym_yes
- \fi}
-
-\unexpanded\def\font_basics_define_font_synonym_nop
- {\expandafter\let\csname\??fontfile\m_font_name\endcsname\m_font_file
- \doifelsenextoptionalcs\font_basics_define_font_synonym_nop_opt\font_basics_define_font_synonym_nop_nil}
-
-\unexpanded\def\font_basics_define_font_synonym_yes
- {\expandafter\let\csname\??fontfile\fontclass\m_font_name\endcsname\m_font_file
- \doifelsenextoptionalcs\font_basics_define_font_synonym_yes_opt\font_basics_define_font_synonym_yes_nil}
-
-\unexpanded\def\edefinefontsynonym[#name]#crap[#file]%
- {\edef\m_font_name{#name}%
- \edef\m_font_file{#file}%
- \ifx\fontclass\empty
- \expandafter\font_basics_define_font_synonym_nop_expanded
- \else
- \expandafter\font_basics_define_font_synonym_yes_expanded
- \fi}
-
-\unexpanded\def\font_basics_define_font_synonym_nop_expanded#crap[#spec]%
- {\expandafter\let\csname\??fontfile\m_font_name\endcsname\m_font_file
- \normalexpanded{\font_basics_define_font_synonym_nop_opt[#1]}}
-
-\unexpanded\def\font_basics_define_font_synonym_yes_expanded#crap[#spec]%
- {\expandafter\let\csname\??fontfile\fontclass\m_font_name\endcsname\m_font_file
- \normalexpanded{\font_basics_define_font_synonym_yes_opt[#spec]}}
-
-\unexpanded\def\font_basics_define_font_synonym_nop_opt[#specification]%
- {\let\p_features \undefined
- \let\p_fallbacks \undefined
- \let\p_goodies \undefined
- \let\p_designsize\undefined
- \expandafter\font_basics_get_font_parameter_nop#specification,]=,}
-
-\unexpanded\def\font_basics_define_font_synonym_yes_opt[#specification]%
- {\let\p_features \undefined
- \let\p_fallbacks \undefined
- \let\p_goodies \undefined
- \let\p_designsize\undefined
- \expandafter\font_basics_get_font_parameter_yes#specification,]=,}
-
-% todo: check if we can use \edef but then we need to protect \mathsizesuffix .. in fact that
-% can be default then: \let\mathsizesuffix\relax .. i need to play with it first
-
-\def\font_basics_get_font_parameter_nop#key=#value,%
- {\if]#key%
- \font_basics_get_font_parameter_nop_finish
- \else
- \expandafter\normaldef\csname p_#key\endcsname{#value}% % no edef as we need to keep \mathsizesuffix
- \expandafter\font_basics_get_font_parameter_nop
- \fi}
-
-\def\font_basics_get_font_parameter_yes#key=#value,%
- {\if]#key%
- \font_basics_get_font_parameter_yes_finish
- \else
- \expandafter\normaldef\csname p_#key\endcsname{#value}% % no edef as we need to keep \mathsizesuffix
- \expandafter\font_basics_get_font_parameter_yes
- \fi}
-
-% helpers, some day these will be toks and counts
-
-% \def\fntsetdefname {\glet\somefontname\defaultfontfile}
-% \def\fntsetsomename{\gdef\somefontname} % takes argument
-% \def\fntsetnopsize {\let\somefontsize\empty}
-% \def\fntsetsomesize{\def\somefontsize} % takes argument
-
-% happens later, else mkvi parsing gets into troubles
-
-% end of helpers
-
-% we could collect them in one macro (but no expansion)
-
-\def\font_basics_define_font_synonym_nop_nil
- {\expandafter\let\csname\??fontfile\m_font_name\s!features \endcsname\undefined
- \expandafter\let\csname\??fontfile\m_font_name\s!fallbacks \endcsname\undefined
- \expandafter\let\csname\??fontfile\m_font_name\s!goodies \endcsname\undefined
- \expandafter\let\csname\??fontfile\m_font_name\s!designsize\endcsname\undefined}
-
-\def\font_basics_define_font_synonym_yes_nil
- {\expandafter\glet\csname\??fontfile\fontclass\m_font_name\s!features \endcsname\undefined
- \expandafter\glet\csname\??fontfile\fontclass\m_font_name\s!fallbacks \endcsname\undefined
- \expandafter\glet\csname\??fontfile\fontclass\m_font_name\s!goodies \endcsname\undefined
- \expandafter\glet\csname\??fontfile\fontclass\m_font_name\s!designsize\endcsname\undefined}
-
-\def\font_basics_get_font_parameter_nop_finish
- {\expandafter\let\csname\??fontfile\m_font_name\s!features \endcsname\p_features
- \expandafter\let\csname\??fontfile\m_font_name\s!fallbacks \endcsname\p_fallbacks
- \expandafter\let\csname\??fontfile\m_font_name\s!goodies \endcsname\p_goodies
- \expandafter\let\csname\??fontfile\m_font_name\s!designsize\endcsname\p_designsize}
-
-\def\font_basics_get_font_parameter_yes_finish
- {\expandafter\glet\csname\??fontfile\fontclass\m_font_name\s!features \endcsname\p_features
- \expandafter\glet\csname\??fontfile\fontclass\m_font_name\s!fallbacks \endcsname\p_fallbacks
- \expandafter\glet\csname\??fontfile\fontclass\m_font_name\s!goodies \endcsname\p_goodies
- \expandafter\glet\csname\??fontfile\fontclass\m_font_name\s!designsize\endcsname\p_designsize}
-
-%\definefontsynonym [KopFont] [\fontclassname{officina}{SerifBold}]
-%
-%\defineclassfontsynonym [KopFont] [officina] [SerifBold]
-
-\unexpanded\def\defineclassfontsynonym
- {\dotripleargument\font_basics_define_class_font_synonym}
-
-%\definefontsynonym[#tag][\fontclassname{#class}{#fileortag}]}
-
-\def\font_basics_define_class_font_synonym[#tag][#class][#fileortag]% needs testing
- {\expandafter\normaldef\csname\??fontfile\fontclass#tag\endcsname{\fontclassname{#class}{#fileortag}}%
- \font_basics_define_font_synonym_yes_nil}
-
-\let\definefontfile\definefontsynonym % dedicated to Taco Hoekwater
-
-\unexpanded\def\setupfontsynonym
- {\dodoubleempty\dosetupfontsynonym}
-
-\def\dosetupfontsynonym[#name][#settings]% not yet supported, will do when needed
- {}
-
-% todo: replace * by ... less messy with features
-
-\def\truefontname#name%
- {\expandafter\font_helpers_true_fontname#name*\empty*\relax}
-
-\def\font_helpers_true_fontname#name*#first#rest*#crap\relax
- {\ifcsname\??fontfile\fontclass#name\endcsname
- \ifx#first\empty
- %\expandafter\truefontname\csname\??fontfile\fontclass#name\endcsname
- \expandafter\truefontname\lastnamedcs
- \else
- %\expandafter\font_helpers_true_fontname_check\csname\??fontfile\fontclass#name\endcsname*#first#rest%
- \expandafter\font_helpers_true_fontname_check\lastnamedcs*#first#rest%
- \fi
- \orelse\ifcsname\??fontfile\defaultfontclass#name\endcsname
- \ifx#first\empty
- %\expandafter\truefontname\csname\??fontfile\defaultfontclass#name\endcsname
- \expandafter\truefontname\lastnamedcs
- \else
- %\expandafter\font_helpers_true_fontname_check\csname\??fontfile\defaultfontclass#name\endcsname*#first#rest%
- \expandafter\font_helpers_true_fontname_check\lastnamedcs*#first#rest%
- \fi
- \orelse\ifcsname\??fontfile#name\endcsname
- \ifx#first\empty
- %\expandafter\truefontname\csname\??fontfile#name\endcsname
- \expandafter\truefontname\lastnamedcs
- \else
- %\expandafter\font_helpers_true_fontname_check\csname\??fontfile#name\endcsname*#first#rest%
- \expandafter\font_helpers_true_fontname_check\lastnamedcs*#first#rest%
- \fi
- \else
- #name\ifx#first\empty\else*#first#rest\fi
- \fi}
-
-\def\font_helpers_true_fontname_check#name%
- {\expandafter\font_helpers_true_fontname_check_indeed#name*\relax}
-
-\def\font_helpers_true_fontname_check_indeed#name*#crap\relax
- {\ifcsname\??fontfile\fontclass#name\endcsname
- %\expandafter\font_helpers_true_fontname_check\csname\??fontfile\fontclass#name\endcsname
- \expandafter\font_helpers_true_fontname_check\lastnamedcs
- \orelse\ifcsname\??fontfile\defaultfontclass#name\endcsname
- %\expandafter\font_helpers_true_fontname_check\csname\??fontfile\defaultfontclass#name\endcsname
- \expandafter\font_helpers_true_fontname_check\lastnamedcs
- \orelse\ifcsname\??fontfile#name\endcsname
- %\expandafter\font_helpers_true_fontname_check\csname\??fontfile#name\endcsname
- \expandafter\font_helpers_true_fontname_check\lastnamedcs
- \else
- #name%
- \fi}
-
-% ok when the last lookup is not stripped .. we need to be able to define synonyms for symbols
-%
-% \def\truefontname#name%
-% %{\normalexpanded{\noexpand\font_helpers_true_fontname{\clf_truefontname{#name}}}}
-% {\expandafter\expandafter\expandafter\font_helpers_true_fontname\expandafter\expandafter\expandafter{\clf_truefontname{#name}}}
-%
-% \def\font_helpers_true_fontname#name%
-% {\ifcsname\??fontfile\fontclass#name\endcsname
-% \expandafter\font_helpers_true_fontname\expandafter{\lastnamedcs}%
-% \orelse\ifcsname\??fontfile\defaultfontclass#name\endcsname
-% \expandafter\font_helpers_true_fontname\expandafter{\lastnamedcs}%
-% \orelse\ifcsname\??fontfile#name\endcsname
-% \expandafter\font_helpers_true_fontname\expandafter{\lastnamedcs}%
-% \else
-% % \clf_truefontname{#name}%
-% #name% so the last one can have features !
-% \fi}
-
-\def\expandfontsynonym#command#name% one level expansion
- {\ifcsname\??fontfile\fontclass#name\endcsname
- %\expandafter\normaldef\expandafter#command\expandafter{\csname\??fontfile\fontclass#name\endcsname}%
- \expandafter\normaldef\expandafter#command\expandafter{\lastnamedcs}%
- \orelse\ifcsname\??fontfile\defaultfontclass#2\endcsname
- %\expandafter\normaldef\expandafter#command\expandafter{\csname\??fontfile\defaultfontclass#name\endcsname}%
- \expandafter\normaldef\expandafter#command\expandafter{\lastnamedcs}%
- \fi}
-
-\def\doifelsefontsynonym#name%
- {\ifcsname\??fontfile\fontclass#name\endcsname
- \expandafter\firstoftwoarguments
- \orelse\ifcsname\??fontfile\defaultfontclass#name\endcsname
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\let\doiffontsynonymelse\doifelsefontsynonym
-
-%D \macros
-%D {tracedfontname}
-%D
-%D A goody:
-
-\def\tracedfontname#name%
- {#name\ifcsname\??fontfile\fontclass#name\endcsname
- %\expandafter\tracedfontname\csname\??fontfile\fontclass#name\endcsname
- \expandafter\tracedfontname\lastnamedcs
- \orelse\ifcsname\??fontfile#name\endcsname
- %\expandafter\tracedfontname\csname\??fontfile#name\endcsname
- \expandafter\tracedfontname\lastnamedcs
- \fi}
-
-%D \macros
-%D {fontclass, defaultfontclass}
-%D
-%D The fontclass model was introduced a while after we implement the basic font
-%D model and at that time we still defaulted to no model at all. Nowadays we default
-%D to the \type {modern} fontclass.
-
-\let\fontclass \empty
-\let\defaultfontclass\empty
-
-\def\fontclassname#class#name% tricky ... no lastnamedcs here due to nesting
- {\ifcsname\??fontfile#class#name\endcsname
- \fontclassname{#class}{\csname\??fontfile#class#name\endcsname}%
- \orelse\ifcsname\??fontfile#name\endcsname
- \fontclassname{#class}{\csname\??fontfile#name\endcsname}%
- \else
- #2%
- \fi}
-
-\installmacrostack\fontclass
-
-%D Files or names can have properties and these need to be consulted at some point.
-%D They can inherit them.
-
-% Why these expanded and rscale not ... maybe not worth the trouble (delayed
-% expansion actually would be better i.e. macros in feature specs). Test
-% without pre-expansion.
-
-\def\font_helpers_update_font_class_parameters
- {\edef\m_font_class_direction {\begincsname\??fontclass\fontclass\fontstyle\s!direction \endcsname}%
- \edef\m_font_class_features {\begincsname\??fontclass\fontclass\fontstyle\s!features \endcsname}%
- \edef\m_font_class_fallbacks {\begincsname\??fontclass\fontclass\fontstyle\s!fallbacks \endcsname}%
- \edef\m_font_class_goodies {\begincsname\??fontclass\fontclass\fontstyle\s!goodies \endcsname}%
- \edef\m_font_class_designsize{\begincsname\??fontclass\fontclass\fontstyle\s!designsize\endcsname}}
-
-% resolve
-
-\def\font_helpers_set_features_yes#name%
- {\ifcsname\??fontfile\fontclass#name\s!features\endcsname \edef\m_font_features{\lastnamedcs}\orelse % class + symbolic_name
- \ifcsname\??fontfile #name\s!features\endcsname \edef\m_font_features{\lastnamedcs}\orelse % symbolic_name
- \ifcsname\??fontfile\fontclass#name\endcsname \expandafter\font_helpers_set_features_yes\lastnamedcs \orelse % class + parent_name
- \ifcsname\??fontfile #name\endcsname \expandafter\font_helpers_set_features_yes\lastnamedcs \else % parent_name
- \let\m_font_features\empty\fi}
-
-\def\font_helpers_set_fallbacks_yes#name%
- {\ifcsname\??fontfile\fontclass#name\s!fallbacks\endcsname \edef\m_font_fallbacks{\lastnamedcs}\orelse
- \ifcsname\??fontfile #name\s!fallbacks\endcsname \edef\m_font_fallbacks{\lastnamedcs}\orelse
- \ifcsname\??fontfile\fontclass#name\endcsname \expandafter\font_helpers_set_fallbacks_yes\lastnamedcs \orelse
- \ifcsname\??fontfile #name\endcsname \expandafter\font_helpers_set_fallbacks_yes\lastnamedcs \else
- \let\m_font_fallbacks\empty\fi}
-
-\def\font_helpers_set_goodies_yes#name%
- {\ifcsname\??fontfile\fontclass#name\s!goodies \endcsname \edef\m_font_goodies{\lastnamedcs}\orelse
- \ifcsname\??fontfile #name\s!goodies \endcsname \edef\m_font_goodies{\lastnamedcs}\orelse
- \ifcsname\??fontfile\fontclass#name\endcsname \expandafter\font_helpers_set_goodies_yes\lastnamedcs \orelse
- \ifcsname\??fontfile #name\endcsname \expandafter\font_helpers_set_goodies_yes\lastnamedcs \else
- \let\m_font_goodies\empty\fi}
-
-\def\font_helpers_set_designsize_yes#name%
- {\ifcsname\??fontfile\fontclass#name\s!designsize\endcsname \edef\m_font_designsize{\lastnamedcs}\orelse
- \ifcsname\??fontfile #name\s!designsize\endcsname \edef\m_font_designsize{\lastnamedcs}\orelse
- \ifcsname\??fontfile\fontclass#name\endcsname \expandafter\font_helpers_set_designsize_yes\lastnamedcs \orelse
- \ifcsname\??fontfile #name\endcsname \expandafter\font_helpers_set_designsize_yes\lastnamedcs \else
- \let\m_font_designsize\empty\fi}
-
-\def\font_helpers_set_features_nop#name%
- {\ifcsname\??fontfile#name\s!features\endcsname \edef\m_font_features{\lastnamedcs}\orelse
- \ifcsname\??fontfile#name\endcsname \expandafter\font_helpers_set_features_nop\lastnamedcs \else
- \let\m_font_features\empty\fi}
-
-\def\font_helpers_set_fallbacks_nop#name%
- {\ifcsname\??fontfile#name\s!fallbacks\endcsname \edef\m_font_fallbacks{\lastnamedcs}\orelse
- \ifcsname\??fontfile#name\endcsname \expandafter\font_helpers_set_fallbacks_nop\lastnamedcs \else
- \let\m_font_fallbacks\empty\fi}
-
-\def\font_helpers_set_goodies_nop#name%
- {\ifcsname\??fontfile#name\s!goodies\endcsname \edef\m_font_goodies{\lastnamedcs}\orelse
- \ifcsname\??fontfile#name\endcsname \expandafter\font_helpers_set_goodies_nop\lastnamedcs \else
- \let\m_font_goodies\empty\fi}
-
-\def\font_helpers_set_designsize_nop#name%
- {\ifcsname\??fontfile#name\s!designsize\endcsname \edef\m_font_designsize{\lastnamedcs}\orelse
- \ifcsname\??fontfile#name\endcsname \expandafter\font_helpers_set_designsize_nop\lastnamedcs \else
- \let\m_font_designsize\empty\fi}
-
-\def\font_helpers_update_font_parameters_yes
- {\font_helpers_set_features_yes \somefontname
- \font_helpers_set_fallbacks_yes \somefontname
- \font_helpers_set_goodies_yes \somefontname
- \font_helpers_set_designsize_yes\somefontname}
-
-\def\font_helpers_update_font_parameters_nop
- {\font_helpers_set_features_nop \somefontname
- \font_helpers_set_fallbacks_nop \somefontname
- \font_helpers_set_goodies_nop \somefontname
- \font_helpers_set_designsize_nop\somefontname}
-
-\def\font_helpers_update_font_parameters
- {\ifx\fontclass\empty\font_helpers_update_font_parameters_nop\else\font_helpers_update_font_parameters_yes\fi}
-
-\installcorenamespace{fontclass}
-
-% we can pack them (don't use \setxvalue!)
-
-\unexpanded\def\savefontclassparameters#style#rscale#features#fallbacks#goodies#designsize#direction%
- {\letgvalue{\??fontclass\fontclass#style\s!rscale }#rscale%
- \letgvalue{\??fontclass\fontclass#style\s!features }#features%
- \letgvalue{\??fontclass\fontclass#style\s!fallbacks }#fallbacks%
- \letgvalue{\??fontclass\fontclass#style\s!goodies }#goodies%
- \letgvalue{\??fontclass\fontclass#style\s!designsize}#designsize%
- \letgvalue{\??fontclass\fontclass#style\s!direction }#direction}% math
-
-% bonus
-
-\let\currentfontinstancespec\clf_currentfontinstancespec % expandable
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-fil.mkvi b/Master/texmf-dist/tex/context/base/mkiv/font-fil.mkvi
index 8622e733f3d..f70be13eeb2 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-fil.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-fil.mkvi
@@ -103,7 +103,7 @@
\unexpanded\def\font_basics_define_font_synonym_nop_expanded#crap[#spec]%
{\expandafter\let\csname\??fontfile\m_font_name\endcsname\m_font_file
- \normalexpanded{\font_basics_define_font_synonym_nop_opt[#1]}}
+ \normalexpanded{\font_basics_define_font_synonym_nop_opt[#spec]}}
\unexpanded\def\font_basics_define_font_synonym_yes_expanded#crap[#spec]%
{\expandafter\let\csname\??fontfile\fontclass\m_font_name\endcsname\m_font_file
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-gds.mkvi b/Master/texmf-dist/tex/context/base/mkiv/font-gds.mkvi
index 05cf087903c..405419416a0 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-gds.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-gds.mkvi
@@ -43,6 +43,13 @@
\definecolor[colorscheme:3:6][r=.75,g=.75]
\definecolor[colorscheme:3:7][g=.75]
+\definecolor[colorscheme:4:1] [r=.6] % a
+\definecolor[colorscheme:4:5] [g=.6] % e
+\definecolor[colorscheme:4:9] [b=.6] % i
+\definecolor[colorscheme:4:15][g=.6,b=.6] % o
+\definecolor[colorscheme:4:21][r=.6,b=.6] % u
+\definecolor[colorscheme:4:25][r=.6,b=.6] % y
+
\definesystemattribute[colorscheme][public]
\unexpanded\def\loadfontgoodies[#filename]%
@@ -50,11 +57,11 @@
\unexpanded\def\setfontcolorscheme % will move to the lua end
{\clf_enablefontcolorschemes
- \unexpanded\xdef\setfontcolorscheme[##1]{\attribute\colorschemeattribute##1\relax}%
+ \unexpanded\xdef\setfontcolorscheme[##1]{\c_attr_colorscheme##1\relax}%
\setfontcolorscheme}
\unexpanded\def\resetfontcolorscheme
- {\attribute\colorschemeattribute\attributeunsetvalue}
+ {\c_attr_colorscheme\attributeunsetvalue}
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-imp-combining.lua b/Master/texmf-dist/tex/context/base/mkiv/font-imp-combining.lua
new file mode 100644
index 00000000000..7db3b905aca
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-imp-combining.lua
@@ -0,0 +1,170 @@
+if not modules then modules = { } end modules ['font-imp-combining'] = {
+ version = 1.001,
+ comment = "companion to font-ini.mkiv",
+ author = "Hans Hagen, PRAGMA ADE",
+ copyright = "ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+if not context then return end
+
+local next, unpack = next, unpack
+local sort, copy, insert = table.sort, table.copy, table.insert
+local setmetatableindex = table.setmetatableindex
+
+local fontdata = fonts.hashes.identifiers
+local otf = fonts.handlers.otf
+
+local nuts = nodes.nuts
+
+local nextnode = nuts.traversers.node
+local ischar = nuts.ischar
+local getprev = nuts.getprev
+local getnext = nuts.getnext
+local setprev = nuts.setprev
+local setnext = nuts.setnext
+local setboth = nuts.setboth
+local setlink = nuts.setlink
+local exchange = nuts.exchange
+
+local class = { } -- reused
+local point = { } -- reused
+local classes = { }
+local sorters = { }
+local slide = { }
+local count = 0
+
+-- List provided by Joey McCollum (Hebrew Layout Intelligence):
+--
+-- 1. The consonants (Unicode points 05D0-05EA) have no combining class and are never reordered; this is typographically correct.
+-- 2. Shin dot and sin dot (05C1-05C2) should be next, but Unicode places them in combining classes 24 and 25, after the characters in recommended classes 3-5 and many of the characters in recommended class 6.
+-- 3. Dagesh / mapiq (05BC) should be next, but Unicode assigns it a combining class of 21. This means that it will be incorrectly ordered before characters in recommended class 2 and after characters in recommended classes 4-6 after Unicode normalization.
+-- 4. Rafe (05BF) should be next, but Unicode assigns it a combining class of 23. Thus, it will be correctly placed after characters in recommended class 3, but incorrectly placed before characters in recommended class 2 after Unicode normalization.
+-- 5. The holam and holam haser vowel points (05B9-05BA) should be next, but Unicode places them in combining class 19. This means that it will be placed incorrectly before characters in recommended classes 2-4 and after all characters in recommended class 6 except 05BB after Unicode normalization.
+-- 6. The characters in 0591, 0596, 059B, 05A2-05A7, 05AA, 05B0-05B8, 05BB, 05BD, 05C5, 05C7 should be treated as being in the same class, but Unicode places them in combining classes 10-18, 20, 22, and 220.
+-- 7. The prepositive marks yetiv and dehi (059A, 05AD) should be next; Unicode places them in combining class 222, so they should correctly come after all characters in recommended classes 1-6.
+-- 8. The characters 0307, 0593-0595, 0597-0598, 059C-05A1, 05A8, 05AB-05AC, 05AF, 05C4 should be treated as being in the same class; Unicode places them in combining class 230, so they should correctly come after all characters in recommended classes 1-7.
+-- 9. The postpositive marks segolta, pashta, telisha qetana, and zinor (0592, 0599, 05A9, 05AE) should be next; Unicode places them in combining class 230, so they will need to be reordered after the characters in recommended class 8.
+--
+-- Some tests by Joey:
+--
+-- Arial, Calibri, and Times New Roman will correctly typeset most combinations of points even in Unicode's canonical order, but they typeset the normalized sequences (hiriq, shin dot, tipeha) and (qamatz, dagesh, shin dot) incorrectly and their typographically recommended reorderings correctly.
+-- Cardo will correctly typeset most combinations of points even in Unicode's canonical order, but it typesets the normalized sequences (hiriq, shin dot, tipeha) incorrectly and its typographically recommended reorderings correctly.
+-- Frank Ruehl CLM typesets most combinations of points even in Unicode's canonical order, but it consistently does a poor job positioning cantillation marks even when they are placed in the typographically recommended position. Taamey Frank CLM is another version of the same font that handles this correctly, so it is possible that Frank Ruehl CLM is just an obsolete font that did not have well-implemented Hebrew font features for cantillation marks to begin with.
+-- For Linux Libertine, the text samples with both the normalized mark ordering and the typographically recommended mark ordering were typeset poorly. I think that this is just because that font does not have full support for the Hebrew glyph set (it lacks cantillation marks) or Hebrew font features (it does not place Hebrew diacritical marks intelligently), so no mark reordering would fix its problems.
+-- Taamey David CLM and Taamey Frank CLM exhibits the same typographical mistakes as SBL Hebrew when the input is in Unicode canonical order, and these mistakes go away if the marks are ordered in the typographically recommended way.
+--
+-- SBL Hebrew is used as reference font.
+
+classes.hebr = {
+ [0x05C1] = 1, [0x05C2] = 1,
+ [0x05BC] = 2,
+ [0x05BF] = 3,
+ [0x05B9] = 4, [0x05BA] = 4,
+ [0x0591] = 5, [0x0596] = 5, [0x059B] = 5, [0x05A2] = 5, [0x05A3] = 5, [0x05A4] = 5,
+ [0x05A5] = 5, [0x05A6] = 5, [0x05A7] = 5, [0x05AA] = 5, [0x05B0] = 5, [0x05B1] = 5,
+ [0x05B2] = 5, [0x05B3] = 5, [0x05B4] = 5, [0x05B5] = 5, [0x05B6] = 5, [0x05B7] = 5,
+ [0x05B8] = 5, [0x05BB] = 5, [0x05BD] = 5, [0x05C5] = 5, [0x05C7] = 5,
+ [0x059A] = 6, [0x05AD] = 6,
+ [0x0307] = 7, [0x0593] = 7, [0x0594] = 7, [0x0595] = 7, [0x0597] = 7, [0x0598] = 7,
+ [0x059C] = 7, [0x059D] = 7, [0x059E] = 7, [0x059F] = 7, [0x05A0] = 7, [0x05A1] = 7,
+ [0x05A8] = 7, [0x05AB] = 7, [0x05AC] = 7, [0x05AF] = 7, [0x05C4] = 7,
+ [0x0592] = 8, [0x0599] = 8, [0x05A9] = 8, [0x05AE] = 8,
+}
+
+sorters.hebr = function(a,b)
+ return class[a] < class[b]
+end
+
+-- local dflt = setmetatableindex(function(t,k,v)
+-- for k, v in next, characters.data do
+-- local c = v.combining
+-- if c then
+-- t[k] = c
+-- end
+-- end
+-- setmetatableindex(t,nil)
+-- return t[k]
+-- end)
+--
+-- classes.dflt = dflt
+-- sorters.dflt = function(a,b) return class[b] < class[a] end
+
+-- see analyzeprocessor in case we want scripts
+
+local function reorder(head)
+ if count == 2 then
+ local first = slide[1]
+ local last = slide[2]
+ if sorter(last,first) then
+ head = exchange(head,first,last)
+ end
+ elseif count > 1 then
+ local first = slide[1]
+ local last = slide[count]
+ local before = getprev(first)
+ local after = getnext(last)
+ setprev(first)
+ setnext(last)
+ sort(slide,sorter)
+ setlink(unpack(slide))
+ local first = slide[1]
+ local last = slide[count]
+ if before then
+ setlink(before,first)
+ end
+ setlink(last,after)
+ if first == head then
+ head = first
+ end
+ end
+ count = 0
+ return head
+end
+
+local function reorderprocessor(head,font,attr)
+ local tfmdata = fontdata[font]
+ local script = otf.scriptandlanguage(tfmdata,attr)
+ sorter = sorters[script]
+ if sorter then
+ local classes = classes[script]
+ for n in nextnode, head do
+ local char, id = ischar(n,font)
+ if char then
+ local c = classes[char]
+ if c then
+ if count == 0 then
+ count = 1
+ slide = { n }
+ else
+ count = count + 1
+ slide[count] = n
+ end
+ class[n] = c
+ point[n] = char
+ elseif count > 0 then
+ head = reorder(head)
+ end
+ elseif count > 0 then
+ head = reorder(head)
+ end
+ end
+ if count > 0 then
+ head = reorder(head)
+ end
+ end
+ return head
+end
+
+fonts.constructors.features.otf.register {
+ name = "reordercombining",
+ description = "reorder combining characters",
+-- default = true,
+-- initializers = {
+-- node = reorderinitializer,
+-- },
+ processors = {
+ position = 1,
+ node = reorderprocessor,
+ }
+}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-imp-dimensions.lua b/Master/texmf-dist/tex/context/base/mkiv/font-imp-dimensions.lua
index 24891a2cdf3..760ce37193a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-imp-dimensions.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-imp-dimensions.lua
@@ -47,6 +47,8 @@ local function initialize(tfmdata,key,value)
newdepth = gettexdimen("strutdp")
elseif value == "mono" then
newwidth = emwidth
+ elseif value == "halfmono" then
+ newwidth = emwidth / 2
else
-- there are fonts out there with no x_height ...
local spec = settings_to_array(value)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-imp-effects.lua b/Master/texmf-dist/tex/context/base/mkiv/font-imp-effects.lua
index cc6e4c0bf88..43ce82b71a6 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-imp-effects.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-imp-effects.lua
@@ -215,62 +215,88 @@ local rules = {
-- end
-- end
-local function setmathparameters(tfmdata,characters,mathparameters,dx,dy,squeeze)
- if delta ~= 0 then
- for i=1,#rules do
- local name = rules[i]
- local value = mathparameters[name]
- if value then
- mathparameters[name] = (squeeze or 1) * (value + dx)
+-- radicals are not yet ok
+
+local setmathparameters
+local setmathcharacters
+
+if CONTEXTLMTXMODE and CONTEXTLMTXMODE > 0 then
+
+ setmathparameters = function(tfmdata,characters,mathparameters,dx,dy,squeeze,multiplier)
+ if delta ~= 0 then
+ for i=1,#rules do
+ local name = rules[i]
+ local value = mathparameters[name]
+ if value then
+ mathparameters[name] = (squeeze or 1) * (value + dy)
+ end
end
end
end
-end
-local function setmathcharacters(tfmdata,characters,mathparameters,dx,dy,squeeze,wdelta,hdelta,ddelta)
+ setmathcharacters = function()
+ end
+
+else
- local function wdpatch(char)
- if wsnap ~= 0 then
- char.width = char.width + wdelta/2
+ setmathparameters = function(tfmdata,characters,mathparameters,dx,dy,squeeze,multiplier)
+ if delta ~= 0 then
+ for i=1,#rules do
+ local name = rules[i]
+ local value = mathparameters[name]
+ if value then
+ mathparameters[name] = (squeeze or 1) * (value + dy)
+ end
+ end
end
end
- local function htpatch(char)
- if hsnap ~= 0 then
- local height = char.height
- if height then
- char.height = char.height + 2 * dy
+ setmathcharacters = function(tfmdata,characters,mathparameters,dx,dy,squeeze,wdelta,hdelta,ddelta)
+
+ -- still not the perfect rule
+
+ local function wdpatch(char)
+ if wsnap ~= 0 then
+ char.width = char.width + wdelta/2
end
end
- end
- local character = characters[0x221A]
+ local function htpatch(char)
+ if hsnap ~= 0 then
+ local height = char.height
+ if height then
+ char.height = char.height + 2 * dy
+ end
+ end
+ end
- if character and character.next then
--- print("base char",0x221A,table.sequenced(character))
- local char = character
- local next = character.next
- wdpatch(char)
- htpatch(char)
- while next do
- char = characters[next]
+ local character = characters[0x221A]
+
+ if character and character.next then
+ local char = character
+ local next = character.next
wdpatch(char)
htpatch(char)
--- print("next char",next,table.sequenced(char))
- next = char.next
- end
- if char then
- local v = char.vert_variants
- if v then
- local top = v[#v]
- if top then
- local char = characters[top.glyph]
--- print("top char",top.glyph,table.sequenced(char))
- htpatch(char)
+ while next do
+ char = characters[next]
+ wdpatch(char)
+ htpatch(char)
+ next = char.next
+ end
+ if char then
+ local v = char.vert_variants
+ if v then
+ local top = v[#v]
+ if top then
+ local char = characters[top.glyph]
+ htpatch(char)
+ end
end
end
end
+
end
+
end
-- local show_effect = { "lua", function(f,c)
@@ -278,7 +304,7 @@ end
-- inspect(fonts.hashes.characters[f][c])
-- end }
--- local show_effect = { "lua", "print('!')" }
+local shiftmode = CONTEXTLMTXMODE and CONTEXTLMTXMODE > 0
local function manipulateeffect(tfmdata)
local effect = tfmdata.properties.effect
@@ -301,42 +327,49 @@ local function manipulateeffect(tfmdata)
local factor = (1 + effect.factor) * factor
local hfactor = (1 + effect.hfactor) * hfactor
local vfactor = (1 + effect.vfactor) * vfactor
- local vshift = vshift ~= 0 and upcommand[vshift] or false
+ if shiftmode then
+ parameters.hshift = hshift
+ parameters.vshift = vshift
+ else
+ vshift = vshift ~= 0 and upcommand[vshift] or false
+ hshift = rightcommand[hshift]
+ end
for unicode, character in next, characters do
local oldwidth = character.width
local oldheight = character.height
local olddepth = character.depth
if oldwidth and oldwidth > 0 then
character.width = oldwidth + wdelta
- local commands = character.commands
- local hshift = rightcommand[hshift]
- if vshift then
- if commands then
- prependcommands ( commands,
--- show_effect,
- hshift,
- vshift
- )
- else
- character.commands = {
--- show_effect,
- hshift,
- vshift,
- charcommand[unicode]
- }
- end
- else
- if commands then
- prependcommands ( commands,
--- show_effect,
- hshift
- )
+ if not shiftmode then
+ local commands = character.commands
+ if vshift then
+ if commands then
+ prependcommands ( commands,
+ -- show_effect,
+ hshift,
+ vshift
+ )
+ else
+ character.commands = {
+ -- show_effect,
+ hshift,
+ vshift,
+ charcommand[unicode]
+ }
+ end
else
- character.commands = {
--- show_effect,
- hshift,
- charcommand[unicode]
- }
+ if commands then
+ prependcommands ( commands,
+ -- show_effect,
+ hshift
+ )
+ else
+ character.commands = {
+ -- show_effect,
+ hshift,
+ charcommand[unicode]
+ }
+ end
end
end
end
@@ -348,7 +381,7 @@ local function manipulateeffect(tfmdata)
end
end
if mathparameters then
- setmathparameters(tfmdata,characters,mathparameters,dx,dy,squeeze)
+ setmathparameters(tfmdata,characters,mathparameters,dx,dy,squeeze,multiplier)
setmathcharacters(tfmdata,characters,mathparameters,dx,dy,squeeze,wdelta,hdelta,ddelta)
end
parameters.factor = factor
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-imp-italics.lua b/Master/texmf-dist/tex/context/base/mkiv/font-imp-italics.lua
index 83c785d3876..6c432d7cf4a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-imp-italics.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-imp-italics.lua
@@ -79,33 +79,7 @@ if context then
registerotffeature(specification)
registerafmfeature(specification)
-end
-
--- no longer used
-
--- if context then
---
--- -- local function initializemathitalics(tfmdata,value) -- yes no delay
--- -- tfmdata.properties.mathitalics = toboolean(value)
--- -- end
--- --
--- -- local specification = {
--- -- name = "mathitalics",
--- -- description = "use alternative math italic correction",
--- -- initializers = {
--- -- base = initializemathitalics,
--- -- node = initializemathitalics,
--- -- }
--- -- }
--- --
--- -- registerotffeature(specification)
--- -- registerafmfeature(specification)
---
--- end
-
--- -- also not used, only when testing
-
-if context then
+ -- only used when testing
local letter = characters.is_letter
local always = true
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-imp-math.lua b/Master/texmf-dist/tex/context/base/mkiv/font-imp-math.lua
index d93ece4059b..d2294e93c6f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-imp-math.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-imp-math.lua
@@ -79,3 +79,53 @@ registerotffeature {
node = initialize,
}
}
+
+function fonts.helpers.mathscriptslots(tfmdata,textcode)
+ local rawdata = tfmdata.shared.rawdata
+ local rawresources = rawdata and rawdata.resources
+ local rawfeatures = rawresources and rawresources.features
+ local basesubstitutions = rawfeatures and rawfeatures.gsub
+ local sequences = basesubstitutions and tfmdata.resources.sequences
+ if sequences then
+ local characters = tfmdata.characters
+ if characters[textcode] then
+ for s=1,#sequences do
+ local sequence = sequences[s]
+ local sfeatures = sequence.features
+ if sfeatures and sfeatures.ssty then
+ local steps = sequence.steps
+ for i=1,#steps do
+ local coverage = steps[i].coverage
+ if coverage then
+ local okay = coverage[textcode]
+ if okay then
+ return okay
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+end
+local function initialize(tfmdata,key,value)
+ if value then
+ local rawdata = tfmdata.shared.rawdata
+ local rawresources = rawdata and rawdata.resources
+ local mathconstants = rawresources.mathconstants
+ if mathconstants then
+ tfmdata.properties.oldmath = true
+ end
+ end
+end
+
+local specification = {
+ name = "oldmath",
+ description = "deal with fake opentype fonts",
+ initializers = {
+ base = initialize,
+ node = initialize,
+ }
+}
+
+registerotffeature(specification)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-imp-tracing.lua b/Master/texmf-dist/tex/context/base/mkiv/font-imp-tracing.lua
index 6ce44514372..255b4cdf068 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-imp-tracing.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-imp-tracing.lua
@@ -47,58 +47,22 @@ local v_none = variables.none
-- boundingbox={yes|background|frame|empty|<color>}
-local bp = number.dimenfactors.bp
-local r = 16384 * bp -- 65536 // 4
-local f_1 = formatters["%.6F w 0 %.6F %.6F %.6F re f"]
-local f_2 = formatters["[] 0 d 0 J %.6F w %.6F %.6F %.6F %.6F re S"]
-
--- change this into w h d instead of h d w
-
-local backcache = setmetatableindex(function(t,h)
- local h = h * bp
- local v = setmetatableindex(function(t,d)
- local d = d * bp
- local v = setmetatableindex(function(t,w)
- local v = { "pdf", "origin", f_1(r,-d,w*bp,h+d) }
- t[w] = v
- return v
- end)
- t[d] = v
- return v
- end)
- t[h] = v
- return v
-end)
-
-local forecache = setmetatableindex(function(t,h)
- local h = h * bp
- local v = setmetatableindex(function(t,d)
- local d = d * bp
- local v = setmetatableindex(function(t,w)
- -- the frame goes through the boundingbox
- local v = { "pdf", "origin", f_2(r,r/2,-d+r/2,w*bp-r,h+d-r) }
- t[w] = v
- return v
- end)
- t[d] = v
- return v
- end)
- t[h] = v
- return v
-end)
-
-local startcolor = nil
-local stopcolor = nil
+local backgrounds = nil
+local outlines = nil
+local startcolor = nil
+local stopcolor = nil
local function initialize(tfmdata,key,value)
if value then
- if not backcolors then
+ if not backgrounds then
local vfspecials = backends.pdf.tables.vfspecials
- startcolor = vfspecials.startcolor
- stopcolor = vfspecials.stopcolor
+ startcolor = vfspecials.startcolor
+ stopcolor = vfspecials.stopcolor
+ backgrounds = vfspecials.backgrounds
+ outlines = vfspecials.outlines
end
local characters = tfmdata.characters
- local rulecache = backcache
+ local rulecache = backgrounds
local showchar = true
local color = "palegray"
if type(value) == "string" then
@@ -106,9 +70,9 @@ local function initialize(tfmdata,key,value)
for i=1,#value do
local v = value[i]
if v == v_frame then
- rulecache = forecache
+ rulecache = outlines
elseif v == v_background then
- rulecache = backcache
+ rulecache = backgrounds
elseif v == v_empty then
showchar = false
elseif v == v_none then
@@ -175,107 +139,3 @@ local specification = {
registerotffeature(specification)
registerafmfeature(specification)
-
-local f_m = formatters["%F %F m"]
-local f_l = formatters["%F %F l"]
-local f_b = formatters["[] 0 d 0 J %.6F w"]
-local f_e = formatters["s"]
-
-local function ladder(list,docolor,nocolor,lst,offset,sign,default)
- local l = lst[1]
- local x1 = bp * (offset + l.kern) * sign
- local y1 = bp * l.height
- local t = { f_b(r,r/2), f_m(x1,y1) }
- local n = 2
- local m = #lst
- if default > 0 then
- default = default * bp + r
- else
- default = default * bp - r
- end
- if m == 1 then
- n = n + 1 t[n] = f_l(x1,default)
- else
- for i=1,m do
- local l = lst[i]
- local x2 = bp * (offset + l.kern) * sign
- local y2 = bp * l.height
- if i > 1 and y2 == 0 then
- y2 = default
- end
- n = n + 1 t[n] = f_l(x2,y1)
- n = n + 1 t[n] = f_l(x2,y2)
- x1, y1 = x2, y2
- end
- end
- n = n + 1 t[n] = f_e()
- list[#list+1] = docolor
- list[#list+1] = { "pdf", "origin", concat(t," ") }
- list[#list+1] = nocolor
-end
-
-local function initialize(tfmdata,key,value)
- if value then
- if not backcolors then
- local vfspecials = backends.pdf.tables.vfspecials
- startcolor = vfspecials.startcolor
- stopcolor = vfspecials.stopcolor
- end
- local characters = tfmdata.characters
- local brcolor = startcolor("darkred")
- local trcolor = startcolor("darkgreen")
- local blcolor = startcolor("darkblue")
- local tlcolor = startcolor("darkyellow")
- local black = stopcolor
- for unicode, character in next, characters do
- local mathkern = character.mathkern
- if mathkern then
- -- more efficient would be co collect more in one pdf
- -- directive but this is hardly used so not worth the
- -- effort
- local width = character.width or 0
- local height = character.height or 0
- local depth = character.depth or 0
- local list = { }
- local br = mathkern.bottom_right
- local tr = mathkern.top_right
- local bl = mathkern.bottom_left
- local tl = mathkern.top_left
- if br then
- ladder(list,brcolor,black,br,width,1,height)
- end
- if tr then
- ladder(list,trcolor,black,tr,width,1,-depth)
- end
- if bl then
- ladder(list,blcolor,black,bl,0,-1,height)
- end
- if tl then
- ladder(list,tlcolor,black,tl,0,-1,-depth)
- end
- if #list > 0 then
- local commands = character.commands
- if commands then
- character.commands = appendcommandtable(commands,list)
- else
- list[#list+1] = charcommand[unicode]
- character.commands = list
- end
- end
- end
- end
- end
-end
-
-local specification = {
- name = "staircase",
- description = "show staircase kerns",
- position=1,
- manipulators = {
- base = initialize,
- node = initialize,
- }
-}
-
-registerotffeature(specification)
-registerafmfeature(specification)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-ini.mklx b/Master/texmf-dist/tex/context/base/mkiv/font-ini.mklx
deleted file mode 100644
index 4b112322dc3..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/font-ini.mklx
+++ /dev/null
@@ -1,2563 +0,0 @@
-%D \module
-%D [ file=font-ini,
-%D version=1998.09.11, % (second)
-%D version=2001.02.20, % (third)
-%D title=\CONTEXT\ Font Macros,
-%D subtitle=Initialization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% todo: < 3 pt => 3pt
-% todo: check where more class usage
-% todo: split font-nam (style/alternative/size)
-% todo: split font-dim (scales etc)
-% todo: reconsider defaultfontclass
-%
-
-%D Watch out: as we define inside macros in sometimes special ways,
-%D an occasional \type {\normaldef} is used in order to please the
-%D \MKVI\ parser.
-
-%D Beware, we use a special set of parameters here:
-%D
-%D \starttabulate[|l|l|]
-%D \NC system variable (fixed) \NC \type {\s!text} \NC \NR
-%D \NC system variable (fixed) \NC \type {\s!script} \NC \NR
-%D \NC system variable (fixed) \NC \type {\s!scriptscript} \NC \NR
-%D \NC system variable (fixed) \NC \type {\s!x} \NC \NR
-%D \NC system variable (fixed) \NC \type {\s!xx} \NC \NR
-%D \NC variable (value) \NC \type {\v!big} \NC \NR
-%D \NC variable (value) \NC \type {\v!small} \NC \NR
-%D \NC constant (regular key) \NC \type {\c!interlinespace} \NC \NR
-%D \NC constant (regular key) \NC \type {\c!em} \NC \NR
-%D \stoptabulate
-%D
-%D The math related ones are similar to the ones used in \TEX\ itself,
-%D the size related ones show up as keywords in the user interface
-%D when switching sizes, and the two constants are used in key|/|value
-%D situations.
-
-%D We should consider design sizes ... maybe kick 'm out which removes
-%D the size code and simplifies things considerably. After all, there
-%D will be no latin modern math in sizes.
-
-\writestatus{loading}{ConTeXt Font Macros / Initialization}
-
-%D Documentation is somewhat messy as it contains bits and pieces of
-%D previous versions.
-
-\unprotect
-
-%D There are several ways to specify a font. Three of them are pure \TEX\ ones, the
-%D fourth one is new:
-%D
-%D \starttyping
-%D \font\name=cmr12
-%D \font\name=cmr12 at 10pt
-%D \font\name=cmr12 scaled 2
-%D \font\name=cmr12 sa 1.440
-%D \stoptyping
-%D
-%D The non||\TEX\ alternative \type{sa} stands for {\em scaled at}. This means as
-%D much as: scale the bodyfontsize with this factor. The scaled option is not that
-%D useful as one needs to know the design size.
-%D
-%D Because \type {sa} (scaled at) and \type {mo} (mapped on) are not low level \TEX\
-%D supported alternatives, we have to test for it ourselves. In doing so, we need an
-%D auxiliary \DIMENSION. We cannot use \type{\scratchdimen} because font loading can
-%D happen at any moment due to postponed loading. We could instead have used dirty
-%D grouping tricks, but this 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
-
-% \definetypeface[one][rm][serif][computer-roman][default]
-% \definetypeface[two][rm][serif][computer-roman][default][rscale=.9]
-%
-% {\one \bf test \two test}
-% {\one \bf test \pushcurrentfont \two \popcurrentfont test}
-
-%D \macros
-%D {rm,ss,tt,hw,cg}
-%D
-%D Fonts are defined in separate files. When we define a font, we distinguish
-%D between several styles. In most cases we will use:
-%D
-%D \startlinecorrection
-%D \starttable[|l||]
-%D \HL
-%D \NC roman regular serif \NC \type{\rm} \NC\FR
-%D \NC sansserif sans support \NC \type{\ss} \NC\MR
-%D \NC type teletype mono \NC \type{\tt} \NC\LR
-%D \HL
-%D \stoptable
-%D \stoplinecorrection
-%D
-%D The number of styles is not limited to these three. When using Lucida Bright we
-%D can for instance also define:
-%D
-%D \startlinecorrection
-%D \starttable[|l||]
-%D \HL
-%D \NC handwritten \NC \type{\hw} \NC\FR
-%D \NC calligraphic \NC \type{\cg} \NC\LR
-%D \HL
-%D \stoptable
-%D \stoplinecorrection
-%D
-%D Within such a font set (\type{cmr}) and style (\type{\rm}) we can define a number
-%D of text font alternatives:
-%D
-%D \startlinecorrection
-%D \starttable[|l||]
-%D \HL
-%D \NC typeface \NC \type{\tf} \NC\FR
-%D \NC boldface \NC \type{\bf} \NC\MR
-%D \NC slanted \NC \type{\sl} \NC\MR
-%D \NC italic \NC \type{\it} \NC\MR
-%D \NC boldslanted \NC \type{\bs} \NC\MR
-%D \NC bolditalic \NC \type{\bi} \NC\MR
-%D \NC smallcaps \NC \type{\sc} \NC\LR
-%D \HL
-%D \stoptable
-%D \stoplinecorrection
-%D
-%D Internally fonts are stored as combination of size, style
-%D and alternative, e.g. \type{12pt}+\type{\ss}+\type{\bf}. Users are not confronted
-%D with sizes, but use the style or style+alternative to activate them.
-%D
-%D During the definition of a bodyfont one can also declare the available larger
-%D alternatives:
-%D
-%D \starttyping
-%D \tf \tfa \tfb \tfc ...
-%D \bf \bfa \bfb \bfc ...
-%D \sl \sla \slb \slc ...
-%D \stoptyping
-%D
-%D The smaller ones are automatically supplied and derived from
-%D the the bodyfont environment.
-%D
-%D \starttyping
-%D \tfx \tfxx
-%D \bfx \bfxx
-%D \slx \slxx
-%D \stoptyping
-%D
-%D There are only two smaller alternatives per style. The larger alternatives on the
-%D other hand have no limitations.
-%D
-%D These larger alternatives are mostly used in chapter and section titles or on
-%D title pages. When one switches to a larger alternative, the bold an other ones
-%D automatically adapt themselves:
-%D
-%D \startbuffer
-%D \tfd Hi \bf there\sl, here \tfb I \bf am
-%D \stopbuffer
-%D
-%S \startnarrower
-%D \typebuffer
-%S \stopnarrower
-%D
-%D therefore becomes:
-%D
-%D \startexample
-%D \getbuffer
-%D \stopexample
-%D
-%D Maybe this mechanism isn't always as logic, but as said before, we tried to make
-%D it as intuitive as possible.
-%D
-%D So a specific kind of glyph can be characterized by:
-%D
-%D \startnarrower
-%D family (cmr) + bodyfont (12pt) + style (rm) + alternative (bf) + size (a)
-%D \stopnarrower
-%D
-%D The last component (the size) is optional.
-%D
-%D We introduced \type {\tf} as command to call for the current normally sized
-%D typeface. This commands results in roman, sans serif, teletype or whatever style
-%D is in charge. Such rather massive switches of style sometimes take more
-%D processing time than comfortable. Of course there is a workaround for this: we
-%D can call fonts directly by means of commands like:
-%D
-%D \starttyping
-%D \rmtf \sssl \tttf \rmbsa
-%D \stoptyping
-%D
-%D One should realize that this fast calls have limitations, they lack for instance
-%D automatic super- and subscript support.
-%D
-%D This leaves us two more commands: \type {\tx} and \type {\txx}. These activate a
-%D smaller and even more smaller font than the current one and adapt themselves to
-%D the current alternative, so when \type {\bf} is active, \type {\tx} gives a
-%D smaller boldface, which in turn can be called directly by \type {\bfx}.
-%D
-%D These two smaller alternatives are specified by the bodyfont environment and
-%D therefore not necessarily have similar sizes as \type {\scriptsize} and \type
-%D {\scriptscriptsize}. The main reason for this incompatibility (which can easily
-%D be undone) lays in the fact that we often want a bit bigger characters than in
-%D math mode. In \CONTEXT\ for instance the \type {\tx} and \type {\txx} commands
-%D are used for surrogate \cap {smallcaps} which support both nesting and
-%D alternatives, like in {\bf \cap {a \cap {small} world}}, which was typeset by
-%D
-%D \starttyping
-%D \bf\cap{a \cap{small} world}
-%D \stoptyping
-%D
-%D And compare $\rm \scriptstyle THIS$ with the slightly larger \cap {THIS}:
-%D \ruledhbox {$\rm \scriptstyle scriptstyle: THIS$} or \ruledhbox {\cap {x style:
-%D THIS}} makes a big difference.
-%D
-%D The \type {x..d} sizes should be used grouped. If you don't group them, i.e. call
-%D them in a row, \CONTEXT\ will not be able to sort out your intention (\type {x}
-%D inside \type {d} inside \type {x}. etc.). The following table demonstrates this:
-%D
-%D \def\FontState{\setstrut\ruledhbox{\strut Hello}}
-%D
-%D \starttabulate[|||||]
-%D \HL
-%D \NC \rlap{\quad\bf grouped} \NC \NC \type {\tx} \NC \type {\txx} \NC \NR
-%D \HL
-%D \NC \type{\tfx} \NC \tfx \FontState \NC \tfx \tx \FontState \NC \tfx \txx \FontState \NC \NR
-%D \NC \type{\tfxx} \NC \tfxx \FontState \NC \tfxx\tx \FontState \NC \tfxx\txx \FontState \NC \NR
-%D \NC \type{\tf} \NC \tf \FontState \NC \tf \tx \FontState \NC \tf \txx \FontState \NC \NR
-%D \NC \type{\tfa} \NC \tfa \FontState \NC \tfa \tx \FontState \NC \tfa \txx \FontState \NC \NR
-%D \NC \type{\tfb} \NC \tfb \FontState \NC \tfb \tx \FontState \NC \tfb \txx \FontState \NC \NR
-%D \NC \type{\tfc} \NC \tfc \FontState \NC \tfc \tx \FontState \NC \tfc \txx \FontState \NC \NR
-%D \NC \type{\tfd} \NC \tfd \FontState \NC \tfd \tx \FontState \NC \tfd \txx \FontState \NC \NR
-%D \NC \type{\tfx} \NC \tfx \FontState \NC \tfx \tx \FontState \NC \tfx \txx \FontState \NC \NR
-%D \NC \type{\tfxx} \NC \tfxx \FontState \NC \tfxx\tx \FontState \NC \tfxx\txx \FontState \NC \NR
-%D \HL
-%D \stoptabulate
-%D
-%D \blank
-%D
-%D \starttabulate[|||||]
-%D \HL
-%D \NC \rlap{\quad\bf stacked} \NC \NC \type {\tx} \NC \type {\txx} \NC \NR
-%D \HL
-%D \NC \type{\tfx}
-%D \NC \tfx \FontState
-%D \NC \tfx \tx \FontState
-%D \NC \tfx \txx \FontState
-%D \NC \NR
-%D \NC \type{\tfxx}
-%D \NC \tfx\tfxx \FontState
-%D \NC \tfx\tfxx \tx \FontState
-%D \NC \tfx\tfxx \txx \FontState
-%D \NC \NR
-%D \NC \type{\tf}
-%D \NC \tfx\tfxx\tf \FontState
-%D \NC \tfx\tfxx\tf \tx \FontState
-%D \NC \tfx\tfxx\tf \txx \FontState
-%D \NC \NR
-%D \NC \type{\tfa}
-%D \NC \tfx\tfxx\tf\tfa \FontState
-%D \NC \tfx\tfxx\tf\tfa \tx \FontState
-%D \NC \tfx\tfxx\tf\tfa \txx \FontState
-%D \NC \NR
-%D \NC \type{\tfb}
-%D \NC \tfx\tfxx\tf\tfa\tfb \FontState
-%D \NC \tfx\tfxx\tf\tfa\tfb \tx \FontState
-%D \NC \tfx\tfxx\tf\tfa\tfb \txx \FontState
-%D \NC \NR
-%D \NC \type{\tfc}
-%D \NC \tfx\tfxx\tf\tfa\tfb\tfc \FontState
-%D \NC \tfx\tfxx\tf\tfa\tfb\tfc \tx \FontState
-%D \NC \tfx\tfxx\tf\tfa\tfb\tfc \txx \FontState
-%D \NC \NR
-%D \NC \type{\tfd}
-%D \NC \tfx\tfxx\tf\tfa\tfb\tfd \FontState
-%D \NC \tfx\tfxx\tf\tfa\tfb\tfd \tx \FontState
-%D \NC \tfx\tfxx\tf\tfa\tfb\tfd \txx \FontState
-%D \NC \NR
-%D \NC \type{\tfx}
-%D \NC \tfx\tfxx\tf\tfa\tfb\tfc\tfx \FontState
-%D \NC \tfx\tfxx\tf\tfa\tfb\tfc\tfx \tx \FontState
-%D \NC \tfx\tfxx\tf\tfa\tfb\tfc\tfx \txx \FontState
-%D \NC \NR
-%D \NC \type{\tfxx}
-%D \NC \tfx\tfxx\tf\tfa\tfb\tfc\tfx\tfxx \FontState
-%D \NC \tfx\tfxx\tf\tfa\tfb\tfc\tfx\tfxx \tx \FontState
-%D \NC \tfx\tfxx\tf\tfa\tfb\tfc\tfx\tfxx \txx \FontState
-%D \NC \NR
-%D \HL
-%D \stoptabulate
-
-\fontslantperpoint \nullfont 0\scaledpoint
-\fontinterwordspace \nullfont 256377\scaledpoint
-\fontinterwordstretch\nullfont 128188\scaledpoint
-\fontinterwordshrink \nullfont 85459\scaledpoint
-\fontexheight \nullfont 338952\scaledpoint
-\fontemwidth \nullfont 786432\scaledpoint
-\fontextraspace \nullfont 85459\scaledpoint
-
-\appendtoks
- \fontslantperpoint \nullfont 0\scaledpoint
- \fontinterwordspace \nullfont 256377\scaledpoint
- \fontinterwordstretch\nullfont 128188\scaledpoint
- \fontinterwordshrink \nullfont 85459\scaledpoint
- \fontexheight \nullfont 338952\scaledpoint
- \fontemwidth \nullfont 786432\scaledpoint
- \fontextraspace \nullfont 85459\scaledpoint
-\to \everyjob
-
-%D Tracing
-
-\newtoks\t_font_tracers_definitions
-
-\unexpanded\def\tracefontdefinitions
- {\the\t_font_tracers_definitions}
-
-%D Some housekeeping macros:
-
-\unexpanded\def\setfontparameters
- {\setfalse\c_font_synchronize
- \the\everybodyfont
- \settrue\c_font_synchronize}
-
-\let\savedfont\empty
-
-\installmacrostack\savedfont
-
-\unexpanded\def\savefont
- {\edef\savedfont{\the\font}% gives \csname
- \push_macro_savedfont}
-
-\unexpanded\def\restorefont
- {\pop_macro_savedfont
- \savedfont}
-
-\unexpanded\def\pushcurrentfont
- {\edef\popcurrentfont
- {\def\noexpand\fontbody {\fontbody}%
- \def\noexpand\fontstyle {\fontstyle}%
- \def\noexpand\fontalternative{\fontalternative}%
- \def\noexpand\fontsize {\fontsize}%
- \font_helpers_check_big_math_synchronization
- \font_helpers_synchronize_font}}
-
-%D \macros{definedfont}
-
-\let\thedefinedfont\relax % not to be confused with \everydefinefont
-
-\unexpanded\def\definedfont
- {\doifelsenextoptionalcs\font_basics_defined_font_yes\font_basics_defined_font_nop}
-
-\def\font_basics_defined_font_yes[#specification]%
- {\c_font_feature_inheritance_mode\c_font_feature_inheritance_fontonly
- \font_basics_define_font_without_parameters{thedefinedfont}{#specification}%
- \thedefinedfont
- \the\everydefinedfont}
-
-\def\font_basics_defined_font_nop
- {\c_font_feature_inheritance_mode\c_font_feature_inheritance_fontonly
- \thedefinedfont
- \the\everydefinedfont}
-
-%D \macros{startfont}
-
-\unexpanded\def\startfont{\begingroup\definedfont}
-\unexpanded\def\stopfont {\endgroup}
-
-%D \macros
-%D {everybodyfont,everyglobalbodyfont}
-%D
-%D Every change in bodyfont size has conseqences for the baseline distance and skips
-%D between paragraphs. These are initialized in other modules. Here we only provide
-%D the hooks that garantees their handling.
-%D
-%D At the system level one can initialize thing like:
-%D
-%D \starttyping
-%D \appendtoks \setupspacing \to \everybodyfont
-%D \stoptyping
-
-%D \macros
-%D {globalbodyfontsize,localbodyfontsize,bodyfontsize}
-%D
-%D Here we have to distinguish between the global (overal) bodyfont size and the
-%D local (sometimes in the textflow) size. We store these dimensions in two
-%D \DIMENSION\ registers. These registers are not to be misused in calculations.
-
-\ifdefined\globalbodyfontsize\else \newdimen\globalbodyfontsize \fi \globalbodyfontsize=12pt
-\ifdefined\localbodyfontsize \else \newdimen\localbodyfontsize \fi \localbodyfontsize =\globalbodyfontsize
-\ifdefined\bodyfontsize \else \newdimen\bodyfontsize \fi \bodyfontsize =\globalbodyfontsize
-
-%D When we assign for instance 12pt to a \DIMENSION\ register the \type {\the}'d
-%D value comes out as 12.0pt, which is often not the way users specify the bodyfont
-%D size. Therefore we use normalized values. They are cached to save overhead in
-%D \LUA\ calls.
-
-\installcorenamespace{fontnormalizedbody}
-
-\def\normalizebodyfontsize#macro#body%
- {\expandafter\let\expandafter#macro\csname\??fontnormalizedbody\number\dimexpr#body\endcsname
- \ifx#macro\relax
- \normalizebodyfontsize_indeed#macro{#body}%
- \fi}
-
-\def\normalizebodyfontsize_indeed#macro#body%
- {\edef#macro{\clf_nbfs\dimexpr#body\relax}%
- \expandafter\glet\csname\??fontnormalizedbody\number\dimexpr#body\endcsname#macro}
-
-\def\thenormalizedbodyfontsize#body%
- {\clf_nbfs\dimexpr#body\relax}
-
-\edef\normalizedglobalbodyfontsize{\thenormalizedbodyfontsize\bodyfontsize}
-\edef\normalizedlocalbodyfontsize {\thenormalizedbodyfontsize\bodyfontsize}
-\edef\normalizedbodyfontsize {\thenormalizedbodyfontsize\bodyfontsize}
-
-%D \macros
-%D {mapfontsize}
-%D
-%D For special purposes, like in math, you may want to use slightly different sizes
-%D than the ones given. This happens for instance with the Math Times fonts. Mapped
-%D font sizes can be specified by using the \type {mo} key instead of \type {sa} in
-%D font definitions.
-%D
-%D \startbuffer
-%D \mapfontsize[10pt][11pt]
-%D \mapfontsize[11pt][12pt]
-%D \mapfontsize[12pt][13pt]
-%D
-%D \definefont[test][Serif]\test TEST \par
-%D \definefont[test][Serif sa 5]\test TEST \par
-%D \definefont[test][Serif mo 5]\test TEST \par
-%D \definefont[test][Serif sa d]\test TEST \par
-%D \definefont[test][Serif at 60pt]\test TEST \par
-%D \definefont[test][Serif scaled 6000]\test TEST \par
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \startpacked
-%D \getbuffer
-%D \stoppacked
-
-\installcorenamespace{mappedfontsize}
-
-\unexpanded\def\mapfontsize
- {\dodoubleargument\font_basics_map_fontsize}
-
-\def\font_basics_map_fontsize[#from][#to]%
- {\setvalue{\??mappedfontsize\the\dimexpr#from\relax}{#to}}
-
-\def\font_basics_set_mapped_fontsize#from%
- {\ifcsname\??mappedfontsize\the\dimexpr#from\relax\endcsname
- \lastnamedcs\else#from%
- \fi}
-
-\installcorenamespace{fontbodyknown}
-\installcorenamespace{fontclassyes} % fontclass
-\installcorenamespace{fontclassnop} % nofontclass
-
-\def\font_helpers_process_relative_size_list#command% could be a toks
- {#command\v!big
- #command\v!small}
-
-\let\v_font_size_relative \plusone
-\def\v_font_size_absolute {\fontbody}
-
-\let\v_font_rscale_default\!!plusone
-\let\p_font_rscale \v_font_rscale_default
-
-\def\font_helpers_check_relative_font_id % can be plugged in later
- {\let\p_font_rscale\minusone
- \let\p_font_rscale\v_font_rscale_default}
-
-\def\font_helpers_check_relative_font_size#style%
- {\edef\p_font_rscale
- {\ifcsname\??fontclass\fontclass#style\s!rscale\endcsname
- \lastnamedcs
- \orelse\ifcsname\??fontclass\defaultfontclass#style\s!rscale\endcsname % brr
- \lastnamedcs
- \else
- \v_font_rscale_default
- \fi}%
- % move elsewhere
- \ifx\p_font_rscale\v!auto
- \let\p_font_rscale\plusone
- \font_helpers_check_relative_font_id
- \else
- \let\relativefontid\minusone
- \fi}
-
-\def\font_rscale_xx#style%
- {\ifcsname\??fontclass\fontclass#style\s!rscale\endcsname
- \lastnamedcs
- \else
- \v_font_rscale_default
- \fi}
-
-\def\font_rscale_mm
- {\ifcsname\??fontclass\fontclass\s!mm\s!rscale\endcsname
- \lastnamedcs
- \else
- \v_font_rscale_default
- \fi}
-
-\def\font_helpers_register_fontbody#body%
- {\expandafter\let\csname\??fontbodyknown#body\endcsname\empty}
-
-%D \macros
-%D {definefontstyle,definefontsize,definefontalternative}
-%D
-%D When setting of switching the overall style we can use the short identifier like
-%D rm and ss, but when defined we can also use more verbose names like roman or
-%D sansserif. Such names are defined by:
-%D
-%D \starttyping
-%D \definefontstyle [serif,rm] [rm]
-%D \definefontstyle [sansserif,ss] [ss]
-%D \stoptyping
-
-\installcorenamespace{fontstyle} % full style prefix (roman etc)
-\installcorenamespace{fontshortstyle} % short style prefix (rm etc)
-
-\installcorenamespace{fontstyleknown}
-\installcorenamespace{fontalternativeknown}
-\installcorenamespace{fontsizeknown}
-
-\newtoks\t_font_style_commands
-\newtoks\t_font_size_commands
-\newtoks\t_font_alternative_commands
-
-\setnewmacro\m_font_style_command \gobbleoneargument
-\setnewmacro\m_font_size_command \gobbleoneargument
-\setnewmacro\m_font_alternative_command\gobbleoneargument
-
-\def\font_helpers_process_style_list #command{\def\m_font_style_command {#command}\the\t_font_style_commands}
-\def\font_helpers_process_size_list #command{\def\m_font_size_command {#command}\the\t_font_size_commands}
-\def\font_helpers_process_alternative_list#command{\def\m_font_alternative_command{#command}\the\t_font_alternative_commands}
-
-\def\font_helpers_register_style #style{\expandafter\let\csname\??fontstyleknown #style\endcsname\empty}
-\def\font_helpers_register_size #size{\expandafter\let\csname\??fontsizeknown #size\endcsname\empty}
-\def\font_helpers_register_alternative#alternative{\expandafter\let\csname\??fontalternativeknown#alternative\endcsname\empty}
-
-\unexpanded\def\definefontstyle
- {\dodoubleargument\font_basics_define_fontstyle}
-
-\def\font_basics_define_fontstyle[#commands][#style]% style: rm ss tt ...
- {\ifcsname\??fontstyleknown#style\endcsname \else % can be delayed till used (cg, hw)
- \font_helpers_register_style{#style}%
- \toksapp\t_font_style_commands{\m_font_style_command{#style}}%
- \fi
- \processcommalist[#commands]{\font_basics_define_fontstyle_indeed{#style}}}
-
-\def\font_basics_define_fontstyle_indeed#style#command%
- {\setvalue{\??fontshortstyle#command}{#style}%
- \setvalue{\??fontstyle #command}{\csname#style\endcsname}}
-
-\unexpanded\def\definefontsize[#size]%
- {\ifcsname\??fontsizeknown#size\endcsname \else
- \font_helpers_register_size{#size}%
- \toksapp\t_font_size_commands{\m_font_size_command{#size}}%
- \fi
- \font_helpers_check_fontname_combinations}
-
-\unexpanded\def\definefontalternative[#alternative]%
- {\ifcsname\??fontalternativeknown#alternative\endcsname \else
- \font_helpers_register_alternative{#alternative}%
- \toksapp\t_font_alternative_commands{\m_font_alternative_command{#alternative}}%
- \fi
- \font_helpers_check_fontname_combinations}
-
-\unexpanded\def\font_helpers_check_fontname_combinations % we need to split math and text here ... todo (math only has mr and mb)
- {\font_helpers_process_style_list\font_helpers_check_fontname_combinations_s}
-
-\def\font_helpers_check_fontname_combinations_s#style%
- {\font_helpers_process_alternative_list{\font_helpers_check_fontname_combinations_indeed_s_a{#style}}}
-
-\def\font_helpers_check_fontname_combinations_indeed_s_a#style#alternative%
- {\font_helpers_process_size_list{\font_basics_check_fontname_combination{#style}{#alternative}}}
-
-\definefontstyle [\s!mm] [\s!mm]
-\definefontstyle [\s!rm] [\s!rm]
-\definefontstyle [\s!ss] [\s!ss]
-\definefontstyle [\s!tt] [\s!tt]
-
-%D We define all the font switching commands globally. After all they are part of
-%D the formal font interface once defined. The size can be empty (so checking is
-%D needed as \type {\bf} is already defined).
-%D
-%D The \type {\normal..} variants are available as extras for cases where the \type
-%D {..} is overloaded.
-
-\newmacro\m_font_mm
-
-\def\font_basics_check_fontname_combination#style% alternative size
- {\edef\m_font_mm{#style}%
- \ifx\m_font_mm\s!mm % prevents \max and alike (re)defs
- \expandafter\font_basics_check_math_bodyfont
- \else
- \expandafter\font_basics_check_text_bodyfont
- \fi{#style}} % no \m_font_mm, not expanded later on
-
-\def\font_basics_check_math_bodyfont#style#alternative#size%
- {}
-
-\def\font_basics_check_text_bodyfont_step#whatever#body% size can be empty (checking needed as \bf is already defined)
- {\ifcsname#whatever\endcsname\else
- \setugvalue{#whatever}{#body}%
- \fi}
-
-\def\font_basics_check_text_bodyfont#style#alternative#size% size can be empty (checking needed as \bf is already defined)
- {\font_basics_check_text_bodyfont_step{#style#size}{\font_helpers_set_current_font_style_size{#style}{#size}}% \rma
- \font_basics_check_text_bodyfont_step{#alternative#size}{\font_helpers_set_current_font_alternative_size{#alternative}{#size}}% \sla
- \font_basics_check_text_bodyfont_step{#style#alternative#size}{\font_helpers_set_current_font_style_alternative_size{#style}{#alternative}{#size}}% \rmsla
- \font_basics_check_text_bodyfont_step{#style}{\font_helpers_set_current_font_style{#style}}% \rm
- \font_basics_check_text_bodyfont_step{#alternative}{\font_helpers_set_current_font_alternative{#alternative}}% \sl
- \font_basics_check_text_bodyfont_step{#style\s!x }{\font_helpers_set_current_font_x_style_alternative{#style}}% \rmx
- \font_basics_check_text_bodyfont_step{#style\s!xx}{\font_helpers_set_current_font_xx_style_alternative{#style}}% \rmxx
- \font_basics_check_text_bodyfont_step{#alternative\s!x }{\font_helpers_set_current_font_x_alternative{#alternative}}% \slx
- \font_basics_check_text_bodyfont_step{#alternative\s!xx}{\font_helpers_set_current_font_xx_alternative{#alternative}}% \slxx
- \font_basics_check_text_bodyfont_step{#style#alternative}{\font_helpers_set_current_font_style_alternative{#style}{#alternative}}}% \rmsl
-
-%D Scaling macros:
-%D
-%D This system is somewhat complicated by two (possible conflicting) demands:
-%D
-%D \startitemize
-%D \item We support wildcards like \type {sa *} which will adapt to the current
-%D size. This is also the default specification.
-%D \item We support named scales like \type {sa d}; beware: \type {x} and \type {xx}
-%D are valid scales but they are not alway the same as the ones used in for
-%D instance \type {\bfx} because there the sized come from the bodyfont
-%D environment. In the future there maybe a switch that also honors the
-%D environment in named scales.
-%D \stopitemize
-%D
-%D Keep in mind that the smaller sizes are just for text super and subscripts while
-%D larger sizes can be used in titles where for instance math follows the size.
-
-% b:x{\definedfont[SerifBold sa b]x}{\bfb x $x^x$}\par
-% 1:x{\definedfont[SerifBold sa 1]x}{\bf x $x^x$}\par
-% x:x{\definedfont[SerifBold sa x]x}{\bfx x $x^x$}\par
-% xx:x{\definedfont[SerifBold sa xx]x}{\bfxx x $x^x$}\par
-%
-% *:x{\definedfont[Serif sa *]x}\par
-% 1:x{\definedfont[Serif sa 1]x}\par
-% 2:x{\definedfont[Serif sa 2]x}\par
-% 3:x{\definedfont[Serif sa 3]x}\par
-% 4:x{\definedfont[Serif sa 4]x}\par
-% 5:x{\definedfont[Serif sa 5]x}\par
-
-\def\safontscale{\number\dimexpr\v_font_size_absolute\relax}
-\def\mofontscale{\number\dimexpr\font_basics_set_mapped_fontsize\v_font_size_absolute\relax}
-
-\let\somefontname\s!unknown
-\let\somefontspec\s!unknown
-\let\somefontsize\zerocount
-
-\newcount\scaledfontmode % also used at the lua end
-\newcount\scaledfontsize % also used at the lua end
-\newcount\lastfontid % also used at the lua end / tex end
-\newtoks \everydefinefont
-
-\let\relativefontid\minusone % todo, not yet used
-
-\let\c_font_feature_inheritance_fontnone \zerocount % none
-\let\c_font_feature_inheritance_fontonly \plusone % fontonly
-\let\c_font_feature_inheritance_classonly \plustwo % classonly
-\let\c_font_feature_inheritance_fontfirst \plusthree % fontfirst
-\let\c_font_feature_inheritance_classfirst\plusfour % classfirst
-
-\let\c_font_feature_inheritance_default \c_font_feature_inheritance_fontfirst
-
-\setnewconstant\c_font_feature_inheritance_mode \c_font_feature_inheritance_default
-
-\newdimen \d_font_scaled_text_face
-\newdimen \d_font_scaled_font_size
-\newconditional\c_font_body_scale
-\newfraction \f_font_body_scale
-
-\unexpanded\def\font_helpers_low_level_define#specification#csname%
- {% we can now set more at the lua end
- \glet\somefontname\defaultfontfile
- \let\somefontsize\empty
- \clf_definefont_one{\detokenize\expandafter{\normalexpanded{#specification}}}% the escapestring catches at \somedimen
- % sets \scaledfontmode and \somefontname and \somefontsize
- \ifcase\fontface\relax
- % \let\v_font_size_absolute\textface % fontbody
- \or
- \let\v_font_size_absolute\textface
- \or
- \let\v_font_size_absolute\scriptface
- \or
- \let\v_font_size_absolute\scriptscriptface
- \or
- \let\v_font_size_absolute\xtextface
- \or
- \let\v_font_size_absolute\xxtextface
- \fi
- %
- \ifcase\scaledfontmode\relax
- % none, avoid the designsize if possible
- \d_font_scaled_font_size-\plusthousand\scaledpoint
- \or
- % at
- \d_font_scaled_font_size\somefontsize
- \or
- % sa
- \d_font_scaled_font_size\v_font_size_absolute\relax
- \d_font_scaled_font_size\currentfontbodysize\d_font_scaled_font_size % uses \somefontsize set by lua
- \or
- % mo
- \d_font_scaled_font_size\font_basics_set_mapped_fontsize\v_font_size_absolute
- \d_font_scaled_font_size\currentfontbodysize\d_font_scaled_font_size
- \or
- % scaled, don't use this one as it's unpredictable
- \d_font_scaled_font_size-\somefontsize\scaledpoint
- \else % ht cp
- % experiment, yet undocumented
- \d_font_scaled_font_size\somefontsize
- \fi
- \relax
- \d_font_scaled_font_size\v_font_size_relative\d_font_scaled_font_size
- \ifconditional\c_font_auto_size
- \font_helpers_check_body_scale\fontsize
- \ifconditional\c_font_body_scale
- \d_font_scaled_font_size\f_font_body_scale\d_font_scaled_font_size
- \d_font_scaled_text_face\f_font_body_scale\dimexpr\textface\relax
- \else
- \d_font_scaled_font_size\f_font_body_scale
- \d_font_scaled_text_face\textface
- \fi
- \else
- \d_font_scaled_text_face\textface
- \fi
- \edef\somefontspec{at \number\d_font_scaled_font_size sp}%
- \edef\somefontfile{\truefontname\somefontname}%
- \ifx\somefontfile\s!unknown
- \edef\somefontfile{\defaultfontfile}%
- \fi
- \font_helpers_update_font_parameters
- \font_helpers_update_font_class_parameters
- %\writestatus{fonts}{low level define: #csname/\somefontfile/\number\d_font_scaled_font_size/\fontface/\number\d_font_scaled_text_face}%
- \clf_definefont_two
- \ifx\fontclass\empty\s!false\else\s!true\fi
- {#csname}%
- {\somefontfile}%
- \d_font_scaled_font_size
- \c_font_feature_inheritance_mode
- {\m_font_class_features}%
- {\m_font_features}%
- {\m_font_class_fallbacks}%
- {\m_font_fallbacks}%
- \fontface
- \d_font_scaled_text_face
- \relativefontid
- {\m_font_class_goodies}%
- {\m_font_goodies}%
- {\m_font_class_designsize}%
- {\m_font_designsize}%
- \scaledfontmode
- \relax
- \ifcase\scaledfontsize
- %\scaledfontsize\plusone
- \let\somefontspec\empty
- \let\lastrawfontcall\relax
- \expandafter\let\csname#csname\endcsname\relax
- \else
- \edef\somefontspec{at \number\scaledfontsize sp}% we need the resolved designsize (for fallbacks)
- \expandafter\let\expandafter\lastrawfontcall\csname#csname\endcsname
- \the\everydefinefont
- \fi
- \c_font_feature_inheritance_mode\c_font_feature_inheritance_default}
-
-\def\font_helpers_check_body_scale#fontsize% gets character (x xx a etc)
- {\ifcsname\??fontenvironments\fontclass\fontbody#fontsize\endcsname
- \expandafter\let\expandafter\f_font_body_scale\lastnamedcs
- \setfalse\c_font_body_scale % !
- \orelse\ifcsname\??fontenvironments\fontclass\s!default#fontsize\endcsname
- \expandafter\let\expandafter\f_font_body_scale\lastnamedcs
- \settrue\c_font_body_scale
- \orelse\ifcsname\??fontenvironments\fontbody#fontsize\endcsname
- \expandafter\let\expandafter\f_font_body_scale\lastnamedcs
- \setfalse\c_font_body_scale % !
- \orelse\ifcsname\??fontenvironments\s!default#fontsize\endcsname
- \expandafter\let\expandafter\f_font_body_scale\lastnamedcs
- \settrue\c_font_body_scale
- \orelse\ifcsname\??fontenvironments\fontclass\s!default\s!text\endcsname
- \expandafter\let\expandafter\f_font_body_scale\lastnamedcs
- \settrue\c_font_body_scale
- \orelse\ifcsname\??fontenvironments\s!default\s!text\endcsname
- \expandafter\let\expandafter\f_font_body_scale\lastnamedcs
- \settrue\c_font_body_scale
- \else
- \let\f_font_body_scale\plusone
- \settrue\c_font_body_scale
- \fi}
-
-%D The following macros are used at the \LUA\ end. Watch the \type {\normal}
-%D hackery: this makes the mkvi parser happy.
-
-% \normaldef\fntsetdefname {\glet\somefontname\defaultfontfile} % do before calling
-% \normaldef\fntsetnopsize {\let\somefontsize\empty} % do before calling
-% \normaldef\fntsetsomename{\normalgdef\somefontname} % takes argument
-% \normaldef\fntsetsomesize{\normaldef\somefontsize} % takes argument
-
-\newif\ifskipfontcharacteristics \skipfontcharacteristicstrue
-
-\tracingfonts\plussix % <id: name @ size>
-
-%D When fontclasses are used, we define the font global, since namespaces are
-%D used. Otherwise we parse the specs each time.
-
-\let\fontfile\s!unknown
-
-%D Relatively new:
-
-\installcorenamespace{fonts}
-\installcorenamespace{fontslanguage}
-
-\installsetuponlycommandhandler \??fonts {fonts}
-
-\newconstant\c_fonts_auto_language
-
-\letvalue{\??fontslanguage\v!auto}\plusone % experimental
-%letvalue{\??fontslanguage\v!yes }\plustwo % less efficient, for experiments
-
-\appendtoks
- \c_fonts_auto_language
- \ifcsname\??fontslanguage\fontsparameter\c!language\endcsname
- \lastnamedcs
- \else
- \zerocount
- \fi
-\to \everysetupfonts
-
-\appendtoks
- \ifcase\c_fonts_auto_language
- % nothing
- \or
- \addfflanguage
- % \or
- % font
- \fi
-\to \everylanguage
-
-% \setupfonts
-% [\c!language=\v!auto]
-
-%D \macros
-%D {everyfont,everyfontswitch}
-
-\ifdefined\everyfont \else \newtoks\everyfont \fi
-\ifdefined\everyfontswitch \else \newtoks\everyfontswitch \fi
-
-\def\setfontcharacteristics{\the\everyfont}
-
-% \appendtoks
-% \ifcase\c_fonts_auto_language
-% % nothing
-% \or
-% % auto
-% \or
-% \addfflanguage
-% \fi
-% \to \everyfont
-
-%D \macros
-%D {definefont}
-%D
-%D We also accept \type{sa a}||\type{sa d} as specification.
-%D
-%D Before we implement the main definition macro, we first show one for local use:
-%D
-%D \starttyping
-%D \definefont[Some][LucidaBright at 100pt] \Some some
-%D \definefont[More][LucidaBright scaled 3000] \More more
-%D \definefont[Nice][LucidaBright mo 2] \Nice nice
-%D \definefont[Text][LucidaBright sa 5.4] \Text last
-%D \stoptyping
-%D
-%D The implementation looks as follows:
-
-\unexpanded\def\definefont % [name][spec][1.6 | line=10pt | setup_id]
- {\dotripleempty\font_basics_define_font}
-
-\def\font_basics_define_font
- {\ifthirdargument
- \expandafter\font_basics_define_font_a
- \else
- \expandafter\font_basics_define_font_b
- \fi}
-
-\def\font_basics_define_font_a[#name][#specification][#settings]% [name][spec][1.6 | line=10pt | setup_id]
- {\doifelsesetups{#settings}%
- {\setuvalue{#name}{\font_basics_define_font_with_setups {#name}{#specification}{#settings}}}
- {\setuvalue{#name}{\font_basics_define_font_with_parameters{#name}{#specification}{#settings}}}}
-
-\def\font_basics_define_font_b[#name][#specification][#dummy]%
- {\setuvalue{#name}{\font_basics_define_font_without_parameters{#name}{#specification}}}
-
-\def\font_basics_define_font_with_parameters#name#specification#settings%
- {\font_basics_define_font_without_parameters{#name}{#specification}%
- \setuplocalinterlinespace[#settings]%
- \setupspacing\relax} % is this really needed ?
-
-\def\font_basics_define_font_with_setups#name#specification#settings%
- {\font_basics_define_font_without_parameters{#name}{#specification}%
- \setups[#settings]}
-
-%D Beware, in the frozen variants no settings are supported yet, but that might happen
-%D some day.
-
-\unexpanded\def\definefrozenfont
- {\dotripleempty\font_basics_define_frozen_font}
-
-% \def\font_basics_define_frozen_font[#name][#specification][#settings]%
-% {\begingroup
-% \font_basics_define_font[#name][#specification][#settings]%
-% \csname#name\endcsname
-% \expandafter\expandafter\expandafter\endgroup\expandafter\let\csname#name\endcsname\lastrawfontcall}
-
-\def\font_basics_define_frozen_font[#name][#specification][#settings]%
- {\begingroup
- \font_basics_define_font[#name][#specification][#settings]%
- \csname#name\endcsname
- \glet\lastglobalrawfontcall\lastrawfontcall
- \endgroup
- \expandafter\let\csname#name\endcsname\lastglobalrawfontcall}
-
-%D The instance namespace protection makes the switch local so that we can redefine a
-%D logical name and/or change the size in between.
-
-% todo: now mathsize twice in name (so it can go here)
-% todo: check when mathsize is needed
-
-\ifdefined\??fontinstanceready \else \installcorenamespace{fontinstanceready} \fi
-\ifdefined\??fontinstancebasic \else \installcorenamespace{fontinstancebasic} \fi
-\ifdefined\??fontinstanceclass \else \installcorenamespace{fontinstanceclass} \fi
-
-\newconditional\c_font_auto_size \settrue\c_font_auto_size
-
-\let\lastfontidentifier\empty
-
-\def\v_font_identifier_basic{\??fontinstancebasic \lastfontidentifier-\fontsize-\fontface}
-\def\v_font_identifier_class{\??fontinstanceclass\fontclass-\lastfontidentifier-\fontsize-\fontface}
-
-\let\v_font_identifier_basic_saved\v_font_identifier_basic
-\let\v_font_identifier_class_saved\v_font_identifier_class
-
-% \def\v_font_identifier_class{\??fontinstanceclass\fontclass-\lastfontidentifier-\fontstyle-\fontsize} % no \fontface
-
-\def\font_basics_define_font_without_parameters#identifier#2%
- {\c_font_feature_inheritance_mode\c_font_feature_inheritance_fontonly
- \edef\lastfontidentifier{#identifier}%
- \let\v_font_size_relative\v_font_rscale_default
- \let\v_font_size_absolute\fontbody
- \font_helpers_low_level_define{#2}\v_font_identifier_basic
- \csname\v_font_identifier_basic\endcsname
- \setfalse\c_font_auto_size
- \setfontcharacteristics
- \the\everyfontswitch
- \let\v_font_identifier_basic\v_font_identifier_basic_saved}
-
-\unexpanded\def\font_helpers_trigger#identifier% make a traced variant
- {\edef\lastfontidentifier{#identifier}%
- \ifcsname\v_font_identifier_class\endcsname
- % \writestatus{fonts}{trigger: reusing \v_font_identifier_class}%
- \expandafter\font_helpers_trigger_reuse
- \else
- % \writestatus{fonts}{trigger: defining \v_font_identifier_class}%
- \expandafter\font_helpers_trigger_define
- \fi}
-
-\def\font_helpers_trigger_define#relative#absolute#specification%
- {\def\v_font_size_relative{#relative}%
- \def\v_font_size_absolute{#absolute}%
- \font_helpers_low_level_define{#specification}\v_font_identifier_class
- \csname\v_font_identifier_class\endcsname
- \setfalse\c_font_auto_size
- \ifskipfontcharacteristics \else
- \setfontcharacteristics
- \the\everyfontswitch
- \fi
- \let\v_font_identifier_class\v_font_identifier_class_saved}
-
-\def\font_helpers_trigger_reuse#relative#absolute#specification%
- {\csname\v_font_identifier_class\endcsname
- \setfalse\c_font_auto_size
- \ifskipfontcharacteristics \else
- \setfontcharacteristics
- \the\everyfontswitch
- \fi
- \let\v_font_identifier_class\v_font_identifier_class_saved}
-
-%D \macros
-%D {currentfontbodyscale}
-%D
-%D Sometimes we need to have access to the font scale including the \type {a}||\type
-%D {d} sizes. The next macro returns the current scaling factor. Take a look at
-%D \type {cont-log.tex} for an example of its use.
-
-\installcorenamespace{fontenvironments}
-
-\def\currentfontbodysize % gets number (the normal sa 1 etc)
- {\ifcsname\??fontenvironments\fontclass\s!default\somefontsize\endcsname
- \lastnamedcs
- \orelse\ifcsname\??fontenvironments\s!default\somefontsize\endcsname
- \lastnamedcs
- \else
- \somefontsize
- \fi}
-
-\def\currentfontbodyscale % gets character (x xx a etc)
- {\csname\??fontenvironments
- \ifcsname\??fontenvironments\fontclass\s!default\fontsize\endcsname\fontclass\s!default\fontsize\orelse
- \ifcsname\??fontenvironments \s!default\fontsize\endcsname \s!default\fontsize\orelse
- \ifcsname\??fontenvironments\fontclass\s!default\s!text \endcsname\fontclass\s!default\s!text \orelse
- \ifcsname\??fontenvironments \s!default\s!text \endcsname \s!default\s!text \else
- \s!default \fi
- \endcsname}
-
-\def\font_currentfontbodyscale % gets character (x xx a etc)
- {\ifcsname\??fontenvironments\fontclass\s!default\fontsize\endcsname\lastnamedcs\orelse
- \ifcsname\??fontenvironments \s!default\fontsize\endcsname\lastnamedcs\orelse
- \ifcsname\??fontenvironments\fontclass\s!default\s!text \endcsname\lastnamedcs\orelse
- \ifcsname\??fontenvironments \s!default\s!text \endcsname\lastnamedcs\else
- \csname\??fontenvironments \s!default \endcsname \fi}
-
-\def\currentfontscale % used in default definition
- {\csname\??fontenvironments
- \ifcsname\??fontenvironments\fontclass\s!default\xfontsize\endcsname\fontclass\s!default\fontsize\orelse
- \ifcsname\??fontenvironments \s!default\xfontsize\endcsname \s!default\fontsize\orelse
- \ifcsname\??fontenvironments\fontclass\s!default\s!text \endcsname\fontclass\s!default\s!text \orelse
- \ifcsname\??fontenvironments \s!default\s!text \endcsname \s!default\s!text \else
- \s!default \fi
- \endcsname}
-
-\def\font_currentfontscale % used in default definition
- {\ifcsname\??fontenvironments\fontclass\s!default\xfontsize\endcsname\lastnamedcs\orelse
- \ifcsname\??fontenvironments \s!default\xfontsize\endcsname\lastnamedcs\orelse
- \ifcsname\??fontenvironments\fontclass\s!default\s!text \endcsname\lastnamedcs\orelse
- \ifcsname\??fontenvironments \s!default\s!text \endcsname\lastnamedcs\else
- \csname\??fontenvironments \s!default \endcsname \fi}
-
-\setvalue{\??fontenvironments\s!default}{1}
-
-%D In the following macros we use \type {\currentxfontsize} to hold the current
-%D x||size of the font. This enables us to support for instance \type {\sl} inside a
-%D \type {\tx} switch.
-
-\newconstant\currentxfontsize
-
-\def\xfontsize{\ifcase\currentxfontsize\fontsize\or\s!x\else\s!xx\fi}
-
-%D Now we enter the area of font switching. The switching mechanism has to take care
-%D of several situations, like:
-%D
-%D \startitemize[packed]
-%D \item changing the overal document fonts (including margins, headers and footers)
-%D \item changing local fonts (only the running text)
-%D \item smaller and even more smaller alternatives (super- and subscripts)
-%D \stopitemize
-%D
-%D \TEX\ offers a powerfull family mechanism for super- and subscripts in math mode.
-%D In text mode however, we don't use families for the smaller alternatives, and
-%D therefore have to take care of it otherwise.
-%D
-%D \macros
-%D {definebodyfontenvironment,setupbodyfontenvironment}
-%D
-%D The relationship between the several sizes of a font, is
-%D defined by:
-%D
-%D \showsetup{definebodyfontenvironment}
-%D
-%D Later on we will see how these parameters are used, so for the moment we stick
-%D with an example:
-%D
-%D \starttyping
-%D \definebodyfontenvironment
-%D [12pt]
-%D [ text=12pt,
-%D script=9pt,
-%D scriptscript=7pt,
-%D x=10pt,
-%D xx=8pt,
-%D big=12pt,
-%D small=10pt]
-%D \stoptyping
-%D
-%D The first argument specifies the bodyfont size to which the settings apply. All
-%D second parameters are specified in dimensions and tell us more about related
-%D sizes.
-%D
-%D Afterwards, one can change values with
-%D
-%D \showsetup{setupbodyfontenvironment}
-%D
-%D When instead of a size the keyword \type{unknown} is
-%D passed, fractions (relations) are used instead of fixed
-%D sizes.
-
-%D {\bf Remark:} We need to cover the following cases, otherwise users can get
-%D confused:
-%D
-%D \starttyping
-%D \setupbodyfont[23pt]
-%D
-%D \definebodyfontenvironment[23pt]
-%D \setupbodyfont[23pt]
-%D
-%D \definebodyfontenvironment[23pt]
-%D \definebodyfont[23pt][rm,ss,tt][default]
-%D \setupbodyfont[23pt]
-%D \stoptyping
-%D
-%D Beware: while some font defs can be global, the bodyfont environment checks
-%D local. This means that multiple local checks resulting in definitions are not
-%D that efficient. So, apart from an occasional switch, one should define an
-%D environment at the outer level.
-
-% \definebodyfontenvironment[33pt]
-% \definebodyfontenvironment[dejavu][default][1=.5]
-% \definebodyfontenvironment[dejavu][default][x=1.2]
-% \definebodyfontenvironment[dejavu][default][a=5]
-% \definebodyfontenvironment[dejavu][33pt][x=100pt]
-
-% the lookup order is:
-%
-% [class] [dimension] [parameters]
-% [class] [default] [parameters] % factors
-% [dimension] [parameters]
-% [default] [parameters] % factors
-%
-% with defaults providing factors
-
-% todo: class:size
-% todo: make assignments global
-
-\letvalue\??fontenvironments\empty % so we default to empty
-
-\def\bodyfontvariable#parameter%
- {\csname\??fontenvironments
- \ifcsname\??fontenvironments\fontclass\normalizedbodyfontsize#parameter\endcsname\fontclass\normalizedbodyfontsize#parameter\orelse
- \ifcsname\??fontenvironments\fontclass #parameter\endcsname\fontclass #parameter\orelse
- \ifcsname\??fontenvironments \normalizedbodyfontsize#parameter\endcsname \normalizedbodyfontsize#parameter\orelse
- \ifcsname\??fontenvironments\s!default #parameter\endcsname\s!default #parameter\fi
- \endcsname}
-
-\def\font_bodyfontvariable#parameter%
- {\ifcsname\??fontenvironments\fontclass\normalizedbodyfontsize#parameter\endcsname\lastnamedcs\orelse
- \ifcsname\??fontenvironments\fontclass #parameter\endcsname\lastnamedcs\orelse
- \ifcsname\??fontenvironments \normalizedbodyfontsize#parameter\endcsname\lastnamedcs\orelse
- \ifcsname\??fontenvironments\s!default #parameter\endcsname\lastnamedcs\fi}
-
-\def\bodyfontsizevariable#size#parameter%
- {\csname\??fontenvironments
- \ifcsname\??fontenvironments\fontclass#size#parameter\endcsname\fontclass#size#parameter\orelse
- \ifcsname\??fontenvironments\fontclass #parameter\endcsname\fontclass #parameter\orelse
- \ifcsname\??fontenvironments #size#parameter\endcsname #size#parameter\orelse
- \ifcsname\??fontenvironments\s!default #parameter\endcsname\s!default #parameter\fi
- \endcsname}
-
-\def\font_bodyfontsizevariable#size#parameter%
- {\ifcsname\??fontenvironments\fontclass#size#parameter\endcsname\lastnamedcs\orelse
- \ifcsname\??fontenvironments\fontclass #parameter\endcsname\lastnamedcs\orelse
- \ifcsname\??fontenvironments #size#parameter\endcsname\lastnamedcs\orelse
- \ifcsname\??fontenvironments\s!default #parameter\endcsname\lastnamedcs\fi}
-
-\def\bodyfontinterlinespace{\bodyfontvariable\c!interlinespace} % used elsewhere
-
-\def\bodyfontdimension#class#size#parameter#body%
- {\the\dimexpr
- \ifcsname\??fontenvironments #class#size#parameter\endcsname \lastnamedcs \orelse
- \ifcsname\??fontenvironments#class\s!default#parameter\endcsname \lastnamedcs\dimexpr#body\relax\orelse % factor
- \ifcsname\??fontenvironments #size#parameter\endcsname \lastnamedcs \else
- \lastnamedcs\dimexpr#body\relax\fi % factor
- \relax}
-
-\unexpanded\def\definebodyfontenvironment
- {\dotripleempty\font_basics_define_body_font_environment}
-
-\let\setupbodyfontenvironment\definebodyfontenvironment
-
-\installcorenamespace{fontenvironmentknown}
-
-\def\font_helpers_register_environment#class#body%
- {\expandafter\let\csname\??fontenvironmentknown#class#body\endcsname\empty}
-
-\newmacro\m_font_body
-\newmacro\m_font_body_normalized
-
-\def\font_basics_define_body_font_environment
- {\ifthirdargument
- \singleexpandafter\font_basics_define_body_font_environment_class
- \orelse\ifsecondargument
- \expandafter\font_basics_define_body_font_environment_empty
- \else
- \expandafter\font_basics_define_body_font_environment_unset
- \fi}
-
-%D First we handle the class specific case. Beware: you can change values before
-%D a bodyfont is loaded but changing them afterwards can be sort of tricky as
-%D values are not consulted afterwards.
-
-\def\processbodyfontenvironmentlist#1% no \unexpanded as then we cannot use it in alignments
- {\clf_processbodyfontsizes{\strippedcsname#1}}
-
-\def\bodyfontenvironmentlist
- {\clf_getbodyfontsizes}
-
-\def\font_basics_define_body_font_environment_class[#class][#body][#settings]%
- {\edef\m_font_body{#body}%
- \ifx\m_font_body\s!default
- % these are the last resort within a class
- \getrawparameters[\??fontenvironments#class\s!default][#settings]%
- \else
- \normalizebodyfontsize\m_font_body_normalized\m_font_body
- \font_basics_define_body_font_environment_size[#class][\m_font_body_normalized][#settings]%
- \clf_registerbodyfontsize{\m_font_body_normalized}%
- \fi}
-
-%D The empty case uses the same code but needs to ignore the current class settings
-%D (just to be sure, as it's not really needed).
-
-\def\font_basics_define_body_font_environment_empty[#body][#settings][#dummy]%
- {\push_macro_fontclass
- \let\fontclass\empty
- \font_basics_define_body_font_environment_class[][#body][#settings]%
- \pop_macro_fontclass}
-
-\def\font_basics_define_body_font_environment_unset[#body][#dummya][#dummyb]%
- {\push_macro_fontclass
- \let\fontclass\empty
- \font_basics_define_body_font_environment_class[][#body][]%
- \pop_macro_fontclass}
-
-%D We don't check too soon as we can refer to later definitions.
-
-\newconditional\c_font_defining_environment_state % controls messages
-
-\def\font_basics_define_body_font_environment_size[#class][#normalizedbody][#settings]% normalized body
- {\getrawparameters[\??fontenvironments#class#normalizedbody][#settings]%
- \ifcsname\??fontenvironmentknown#class#normalizedbody\endcsname
- % environment and size already defined
- \orelse\ifproductionrun
- \push_macro_fontclass
- \edef\fontclass{#class}%
- \font_helpers_register_environment{#class}{#normalizedbody}%
- \settrue\c_font_defining_environment_state
- \font_helpers_define_unknown_font{#normalizedbody}% current class
- \setfalse\c_font_defining_environment_state
- \pop_macro_fontclass
- \fi
- \font_helpers_register_fontbody{#normalizedbody}}
-
-%D Checking
-
-\def\font_helpers_check_bodyfont_environment#normalizedbody#body%
- {\ifcsname\??fontenvironmentknown\fontclass#normalizedbody\endcsname
- % already defined
- \else
- \font_helpers_check_bodyfont_environment_indeed{#normalizedbody}{#body}%
- \fi}
-
-\def\font_helpers_check_bodyfont_environment_indeed#normalizedbody#body%
- {\font_helpers_register_environment\fontclass{#normalizedbody}%
- \ifcsname\??fontbodyknown#normalizedbody\endcsname
- \else
- \font_helpers_define_unknown_font{#normalizedbody}%
- \fi}
-
-%D We default all parameters to the main bodyfont size, so the next setup is valid
-%D too:
-%D
-%D \starttyping
-%D \definebodyfontenvironment[24pt]
-%D \stoptyping
-%D
-%D All parameters can be redefined when needed, so one doesnot have to stick to the
-%D default ones.
-
-%D \macros
-%D {definebodyfont}
-%D
-%D The next step in defining a bodyfont involves the actual font files, which can be
-%D recognized by their extension \type {tfm}. Installing those file is often beyond
-%D the scope of the user and up to the system administrator.
-%D
-%D \showsetup{definebodyfont}
-%D
-%D This commands takes three arguments: a (series of) bodyfont size(s), the style
-%D group to which the definitions belong, and an alternative, as specified by the
-%D \TEX\ (math) families, extended with~a, b~\unknown.
-%D
-%D We show two examples, that show all the alternative scaling options. The \type
-%D {\tfa} alternatives can be extended with \type {\bfa}, \type {\slb}, etc. or even
-%D \type {e} and higher alternatives. The magic scaled values are derived from plain
-%D \TEX's \type {\magstep}:
-%D
-%D \starttyping
-%D \definebodyfont [12pt] [rm]
-%D [tf=cmr12,
-%D bf=cmbx12,
-%D it=cmti12,
-%D sl=cmsl12,
-%D bi=cmbxti10 at 12pt,
-%D bs=cmbxsl10 at 12pt,
-%D tfa=cmr12 scaled 1.200,
-%D tfb=cmr12 scaled 1.440,
-%D tfc=cmr12 scaled 1.728,
-%D tfd=cmr12 scaled 2.074,
-%D sc=cmcsc10 at 12pt]
-%D
-%D \definebodyfont [12pt,11pt,10pt,9pt,8pt] [rm]
-%D [tf=lbr sa 1,
-%D bf=lbd sa 1,
-%D it=lbi sa 1,
-%D sl=lbsl sa 1,
-%D bi=lbdi sa 1,
-%D bs=lbdi sa 1,
-%D tfa=lbr sa 1.200,
-%D tfb=lbr sa 1.440,
-%D tfc=lbr sa 1.728,
-%D tfd=lbr sa 2.074,
-%D sc=lbr sa 0.833]
-%D \stoptyping
-%D
-%D The second example shows that we can define more sizes at once. The main
-%D difference between these examples is that the Computer Modern Roman come in many
-%D design sizes. This means that there we cannot define them in bulk using \type
-%D {sa}. Instead of \type {rm} (roman) one can define \type {ss} (sans serif), \type
-%D {tt} (teletype), \type {hw} (hand written), \type {cg} (calygraphic) and whatever
-%D styles.
-%D
-%D The first argument may be a comma separated list. This, combined with
-%D specifications using \type{sa} can save a lot of typing. Although all arguments
-%D should be specified, we treat the second argument as optional.
-%D
-%D Defining a bodyfont involves two actions: defining the specific style related
-%D alternatives, like \type {\rma}, \type {\bfa} and \type {\rmsla}, and storing the
-%D definitions of their bodyfont size related fonts. The first step is bodyfont
-%D independant but executed every time. This permits user definitions like \type
-%D {\tfw} or \type {\bfq} for real large alternatives.
-%D
-%D If we move design size info to the lfg file (after all only lm has design sizes)
-%D we can get rid of much code .. 2012 or so.
-
-\installcorenamespace{fontdefinitions}
-
-% [class] [name] [rm,ss] [settings]
-% [class] [10pt,11pt] [rm,ss] [settings]
-% [class] [10pt,11pt] [rm,ss] [name]
-
-% [class] [name] [settings] == [name] [rm] [settings]
-% [class] [10pt,11pt] [settings] == [name] [rm] [settings]
-% [class] [10pt,11pt] [name] == [10pt,11pt] [rm] [name]
-
-\unexpanded\def\definebodyfont
- {\doquadrupleempty\font_basics_define_body_font}
-
-\def\font_basics_define_body_font[#1][#2][#3][#4]%
- {\iffourthargument
- \processcommacommand[#1]{\font_basics_define_body_font_class_given[#2][#3][#4]}%
- \else
- \font_basics_define_body_font_class_known[#1][#2][#3]%
- \fi}
-
-\def\font_basics_define_body_font_class_given[#1][#2][#3]#4%
- {\push_macro_fontclass
- \doifelse{#4}\s!default
- {\let\fontclass\empty}
- {\def\fontclass{#4}}%
- \definebodyfont[#1][#2][#3]%
- \pop_macro_fontclass}
-
-\def\font_basics_define_body_font_class_known
- {\ifthirdargument
- \singleexpandafter\font_basics_define_body_font_a
- \orelse\ifsecondargument
- \expandafter\font_basics_define_body_font_b
- \else
- \expandafter\font_basics_define_body_font_c
- \fi}
-
-\unexpanded\def\font_basics_define_body_font_b[#whatever][#specification][#dummy]% body|identifier defs|identifier
- {\font_basics_define_body_font_a[#whatever][\s!rm][#specification]}
-
-\unexpanded\def\font_basics_define_body_font_c[#whatever][#dummya][#dummyb]% body|identifier
- {\font_basics_define_body_font_a[#whatever][\s!rm][]}
-
-\unexpanded\def\font_basics_define_body_font_a[#whatever]%
- {\doifelsenumber{#whatever}%
- \font_basics_define_body_font_body
- \font_basics_define_body_font_name
- [#whatever]}
-
-\unexpanded\def\font_basics_define_body_font_body[#body][#style][#specification]%
- {\ifcondition\validassignment{#specification}%
- \expandafter\font_basics_define_body_font_body_assignment
- \else
- \expandafter\font_basics_define_body_font_body_identifier
- \fi
- [#body][#style][#specification]}%
-
-\unexpanded\def\font_basics_define_body_font_name[#name][#style][#specification]%
- {\ifcondition\validassignment{#specification}%
- \expandafter\font_basics_define_body_font_name_assignment
- \else
- \expandafter\font_basics_define_body_font_name_identifier
- \fi
- [#name][#style][#specification]}%
-
-\unexpanded\def\font_basics_define_body_font_body_assignment[#bodylist][#stylelist][#assignments]%
- {\processcommalist[#bodylist]{\font_basics_define_body_font_body_assignment_a{#stylelist}{#assignments}}}
-
-\unexpanded\def\font_basics_define_body_font_body_assignment_a#stylelist#assignments#body%
- {\normalizebodyfontsize\m_font_asked_body{#body}%
- % normally we define quite a lot in advance, i.e global defs
- \font_helpers_check_bodyfont_environment\m_font_asked_body\m_font_asked_body % !!
- \processcommalist[#stylelist]{\font_basics_define_body_font_body_assignment_b{#assignments}}}
-
-\unexpanded\def\font_basics_define_body_font_body_assignment_b#assignments#style%
- {\edef\m_font_asked_style{#style}%
- \processcommalist[#assignments]\font_basics_define_body_font_defs}
-
-\unexpanded\def\font_basics_define_body_font_defs
- {\ifx\fontclass\empty
- \expandafter\font_basics_define_body_font_defs_nop
- \else
- \expandafter\font_basics_define_body_font_defs_yes
- \fi}
-
-\unexpanded\def\font_basics_define_body_font_defs_yes_normal#assignment%
- {\ifx\m_font_asked_style\s!mm
- \expandafter\font_basics_define_body_font_yes_mm
- \else
- \expandafter\font_basics_define_body_font_yes_xx
- \fi[#assignment]}
-
-\unexpanded\def\font_basics_define_body_font_defs_nop_normal#assignment%
- {\ifx\m_font_asked_style\s!mm
- \expandafter\font_basics_define_body_font_nop_mm
- \else
- \expandafter\font_basics_define_body_font_nop_xx
- \fi[#assignment]}
-
-\unexpanded\def\font_basics_define_body_font_defs_yes_traced#assignment%
- {\writestatus\m!fonts{[\fontclass] [\m_font_asked_body] [\m_font_asked_style] [#assignment]}%
- \ifx\m_font_asked_style\s!mm
- \expandafter\font_basics_define_body_font_yes_mm
- \else
- \expandafter\font_basics_define_body_font_yes_xx
- \fi[#assignment]}
-
-\unexpanded\def\font_basics_define_body_font_defs_nop_traced#assignment%
- {\writestatus\m!fonts{[\fontclass] [\m_font_asked_body] [\m_font_asked_style] [#assignment]}%
- \ifx\m_font_asked_style\s!mm
- \expandafter\font_basics_define_body_font_nop_mm
- \else
- \expandafter\font_basics_define_body_font_nop_xx
- \fi[#assignment]}
-
-\let\font_basics_define_body_font_defs_yes\font_basics_define_body_font_defs_yes_normal
-\let\font_basics_define_body_font_defs_nop\font_basics_define_body_font_defs_nop_normal
-
-\appendtoks
- \let\font_basics_define_body_font_defs_yes\font_basics_define_body_font_defs_yes_traced
- \let\font_basics_define_body_font_defs_nop\font_basics_define_body_font_defs_nop_traced
-\to \t_font_tracers_definitions
-
-%D We split into two characters (first part of spec) and the rest: the first two are
-%D the style and the rest is a size, although in practice one will seldom define the
-%D size directly. We might even drop that as it gives faster code.
-
-\unexpanded\def\font_basics_define_body_font_nop_xx[#one#two#rest=#value]% local
- {\ifcsname\m_font_asked_style#one#two#rest\endcsname\else\font_basics_check_fontname_combination\m_font_asked_style{#one#two}{#rest}\fi
- \expandafter\let\csname\??fontinstanceclass\m_font_asked_body-\m_font_asked_style-#one#two-#rest-0\endcsname\undefined
- \unexpanded\expandafter\normaledef\csname\??fontinstanceready\m_font_asked_body-\m_font_asked_style-#one#two-#rest-0\endcsname
- {\font_helpers_trigger{\m_font_asked_body-\m_font_asked_style-#one#two#rest}{\noexpand\font_rscale_xx{\m_font_asked_style}}{\m_font_asked_body}{\normalunexpanded{#value}}}%
- \expandafter\let\csname\??fontinstanceclass\m_font_asked_body-\m_font_asked_style-#one#two-#rest-4\endcsname\undefined
- \unexpanded\expandafter\normaledef\csname\??fontinstanceready\m_font_asked_body-\m_font_asked_style-#one#two-#rest-4\endcsname
- {\font_helpers_trigger{\m_font_asked_body-\m_font_asked_style-#one#two#rest}{\noexpand\font_rscale_xx{\m_font_asked_style}}{\m_font_asked_body}{\normalunexpanded{#value}}}%
- \expandafter\let\csname\??fontinstanceclass\m_font_asked_body-\m_font_asked_style-#one#two-#rest-5\endcsname\undefined
- \unexpanded\expandafter\normaledef\csname\??fontinstanceready\m_font_asked_body-\m_font_asked_style-#one#two-#rest-5\endcsname
- {\font_helpers_trigger{\m_font_asked_body-\m_font_asked_style-#one#two#rest}{\noexpand\font_rscale_xx{\m_font_asked_style}}{\m_font_asked_body}{\normalunexpanded{#value}}}%
- }
-
-\unexpanded\def\font_basics_define_body_font_yes_xx[#one#two#rest=#value]% global
- {\ifcsname\m_font_asked_style#one#two#rest\endcsname\else\font_basics_check_fontname_combination\m_font_asked_style{#one#two}{#rest}\fi
- \expandafter\glet\csname\??fontinstanceclass\fontclass-\m_font_asked_body-\m_font_asked_style-#one#two-#rest-1\endcsname\undefined
- \unexpanded\expandafter\normalxdef\csname\??fontinstanceready\fontclass-\m_font_asked_body-\m_font_asked_style-#one#two-#rest-0\endcsname
- {\font_helpers_trigger{\m_font_asked_body-\m_font_asked_style-#one#two#rest-0}{\number\p_font_rscale}{\m_font_asked_body}{\normalunexpanded{#value}}}%
- \expandafter\glet\csname\??fontinstanceclass\fontclass-\m_font_asked_body-\m_font_asked_style-#one#two-#rest-2\endcsname\undefined
- \unexpanded\expandafter\normalxdef\csname\??fontinstanceready\fontclass-\m_font_asked_body-\m_font_asked_style-#one#two-#rest-4\endcsname
- {\font_helpers_trigger{\m_font_asked_body-\m_font_asked_style-#one#two#rest-4}{\number\p_font_rscale}{\m_font_asked_body}{\normalunexpanded{#value}}}%
- \expandafter\glet\csname\??fontinstanceclass\fontclass-\m_font_asked_body-\m_font_asked_style-#one#two-#rest-3\endcsname\undefined
- \unexpanded\expandafter\normalxdef\csname\??fontinstanceready\fontclass-\m_font_asked_body-\m_font_asked_style-#one#two-#rest-5\endcsname
- {\font_helpers_trigger{\m_font_asked_body-\m_font_asked_style-#one#two#rest-5}{\number\p_font_rscale}{\m_font_asked_body}{\normalunexpanded{#value}}}%
- }
-
-% \writestatus{fonts}{define \m_asked_style\space yes: {\expandafter\meaning\csname\fontclass\m_font_asked_body\m_font_asked_style#one#two#rest\endcsname}
-
-%D Here the rest concerns rl or lr so in this case it is not a size specifier but
-%D a directional one.
-
-\unexpanded\def\font_basics_define_body_font_nop_mm[#one#two#rest=#value]% local
- {%\ifcsname\s!mm\endcsname\else\font_basics_check_fontname_combination\s!mm{#one#two}{#rest}\fi
- \expandafter\let\csname\??fontinstanceclass\m_font_asked_body-\s!mm-#one#two#rest-1\endcsname\undefined
- % \expandafter\let\csname\??fontinstanceclass\m_font_asked_body-\s!mm-#one#two#rest-2\endcsname\undefined
- % \expandafter\let\csname\??fontinstanceclass\m_font_asked_body-\s!mm-#one#two#rest-3\endcsname\undefined
- \unexpanded\expandafter\normaledef\csname\??fontinstanceready\m_font_asked_body-\s!mm-#one#two#rest\endcsname
- {\font_helpers_trigger{\m_font_asked_body-\s!mm-#one#two#rest}{\noexpand\font_rscale_mm}{\m_font_asked_body}{\normalunexpanded{#value}}}%
- }
-
-% \writestatus{fonts}{define \m_asked_style\space nop: \expandafter\meaning\csname\m_font_asked_body\m_font_asked_style#one#two#rest\endcsname}%
-
-\unexpanded\def\font_basics_define_body_font_yes_mm[#one#two#rest=#value]% global
- {%\ifcsname\s!mm\endcsname\else\font_basics_check_fontname_combination\s!mm{#one#two}{#rest}\fi
- \expandafter\glet\csname\??fontinstanceclass\fontclass-\m_font_asked_body-\s!mm-#one#two#rest-1\endcsname\undefined
- % \expandafter\glet\csname\??fontinstanceclass\fontclass-\m_font_asked_body-\s!mm-#one#two#rest-2\endcsname\undefined
- % \expandafter\glet\csname\??fontinstanceclass\fontclass-\m_font_asked_body-\s!mm-#one#two#rest-3\endcsname\undefined
- \unexpanded\expandafter\normalxdef\csname\??fontinstanceready\fontclass-\m_font_asked_body-\s!mm-#one#two#rest\endcsname
- {\font_helpers_trigger{\m_font_asked_body-\s!mm-#one#two#rest}{\number\p_font_rscale}{\m_font_asked_body}{\normalunexpanded{#value}}}%
- }
-
-% \writestatus{fonts}{define \m_asked_style\space yes: \expandafter\meaning\csname\fontclass\m_font_asked_body\m_font_asked_style#one#two#rest\endcsname}%
-
-\unexpanded\def\font_basics_define_body_font_body_identifier[#bodylist][#stylelist][#name]%
- {\processcommalist[#bodylist]{\font_basics_define_body_font_body_identifier_a{#stylelist}{#name}}}
-
-\unexpanded\def\font_basics_define_body_font_body_identifier_a#stylelist#name#body%
- {\normalizebodyfontsize\m_font_asked_body{#body}%
- \font_helpers_check_bodyfont_environment\m_font_asked_body\m_font_asked_body % !!
- \processcommalist[#stylelist]{\font_basics_define_body_font_body_identifier_b{#name}}}
-
-\unexpanded\def\font_basics_define_body_font_body_identifier_b#name#style%
- {\edef\m_font_asked_style{#style}%
- %\writestatus\m!fonts{[\fontclass] [\m_font_asked_body] [\m_font_asked_style] => [#name]}%
- \csname\??fontdefinitions#name:\m_font_asked_style\endcsname} % no checking
-
-\unexpanded\def\font_basics_define_body_font_name_assignment[#name][#stylelist][#assignments]%
- {\processcommalist[#stylelist]{\font_basics_define_body_font_name_assignment_a{#name}{#assignments}}}
-
-\unexpanded\def\font_basics_define_body_font_name_assignment_a#name#assignments#style%
- {%\writestatus\m!fonts{[#name:#style] => [#assignments]}%
- \setevalue{\??fontdefinitions#name:#style}{\font_basics_define_body_font_default{#assignments}}}
-
-\unexpanded\def\font_basics_define_body_font_name_identifier[#name][#stylelist][#identifier]%
- {\processcommalist[#stylelist]{\font_basics_define_body_font_name_identifier_a{#name}{#identifier}}}
-
-\unexpanded\def\font_basics_define_body_font_name_identifier_a#name#identifier#style%
- {%\writestatus\m!fonts{[#name:#style] => [##identifier:#style]}%
- \ifcsname\??fontdefinitions#name:#style\endcsname
- \expandafter\let\csname\??fontdefinitions#name:#style\expandafter\endcsname\csname\??fontdefinitions#identifier:#style\endcsname
- \else
- \expandafter\def\csname\??fontdefinitions#name:#style\endcsname{\csname\??fontdefinitions#identifier:#style\endcsname}%
- \fi}
-
-%D The unknown:
-
-\newconditional\c_font_defining_unknown
-\newconditional\c_font_defining_state
-
-\unexpanded\def\font_helpers_define_unknown_font#body% one level only
- {\font_helpers_register_fontbody{#body}% prevents loop, can go
- \setfalse\c_font_defining_state
- \font_helpers_process_relative_size_list{\font_helpers_define_unknown_check_sizes{#body}}%
- \ifconditional\c_font_defining_state
- \setfalse\c_font_defining_state
- \font_helpers_process_style_list{\font_helpers_define_unknown_check_definitions{#body}}%
- \ifconditional\c_font_defining_state
- \ifconditional\c_font_defining_environment_state\else
- %\showmessage\m!fonts{14}{#body}% main
- \clf_registerunknownbodysize{#body}%
- \fi
- \setfalse\c_font_defining_state
- \font_helpers_register_fontbody{#body}%
- % needed ?
- \ifconditional\c_font_defining_unknown
- \else
- \settrue\c_font_defining_unknown
- \font_helpers_process_relative_size_list{\font_helpers_define_unknown_check_relatives{#body}}%
- \setfalse\c_font_defining_unknown
- \fi
- \fi
- \fi}
-
-\def\font_helpers_define_unknown_check_sizes#body#relativesize%
- {\ifcsname\??fontenvironments\s!default#relativesize\endcsname % fontclass ?
- \expandafter\normalizebodyfontsize\csname\??fontenvironments#body#relativesize\endcsname{\csname\??fontenvironments\s!default#relativesize\endcsname\dimexpr#body\relax}%
- \settrue\c_font_defining_state
- \fi}
-
-\def\font_helpers_define_unknown_check_definitions#body#style%
- {\ifcsname\??fontdefinitions\s!default:#style\endcsname
- \edef\m_font_asked_body{#body}%
- \edef\m_font_asked_style{#style}%
- \lastnamedcs
- \settrue\c_font_defining_state
- \fi}
-
-% \def\font_helpers_define_unknown_check_relatives#body#relativesize%
-% {\ifcsname\??fontbodyknown\csname\??fontenvironments#body#relativesize\endcsname\endcsname \else
-% % how \lastnamedcs here
-% \expandafter\font_helpers_define_unknown_font\csname\??fontenvironments#body#relativesize\endcsname
-% \settrue\c_font_defining_state
-% \fi}
-
-\def\font_helpers_define_unknown_check_relatives#body#relativesize%
- {\ifcsname\??fontbodyknown\csname\??fontenvironments#body#relativesize\endcsname\endcsname \else
- \expandafter\font_helpers_define_unknown_font\csname\??fontenvironments#body#relativesize\endcsname
- \settrue\c_font_defining_state
- \fi}
-
-\unexpanded\def\font_basics_define_body_font_default#assignments%
- {\font_helpers_check_relative_font_size\m_font_asked_style % still needed here?
- \ifcsname\m_font_asked_style\endcsname\else
- \normalexpanded{\definefontstyle[\m_font_asked_style][\m_font_asked_style]}%
- \fi
- \processcommalist[#assignments]\font_basics_define_body_font_defs
- \let\p_font_rscale\v_font_rscale_default}
-
-%D These macros show that quite some definitions take place. Fonts are not loaded
-%D yet! This means that at format generation time, no font files are present.
-
-\unexpanded\def\font_basics_switch_points#body%
- {\ifcsname\??fontbodyknown#body\endcsname \else
- % we need to check the relative sizes for this body
- \font_helpers_define_unknown_font{#body}%
- \fi%
- \ifcsname\??fontbodyknown#body\endcsname % always true now
- \font_basics_complete_switch{#body}%
- \localbodyfontsize#body\relax
- \normalizebodyfontsize\normalizedbodyfontsize\localbodyfontsize
- \font_helpers_check_bodyfont_environment\normalizedbodyfontsize\normalizedbodyfontsize % !!
- \else
- \showmessage\m!fonts4{#body}%
- \fi}
-
-\unexpanded\def\font_basics_switch_style#style%
- {\ifcsname\??fontstyle#style\endcsname
- \lastnamedcs
- \edef\fontstyle{#style}%
- \ifmmode\mr\fi % in order to be compatible with \rm in math mode
- % \the\everybodyfont % cleaner, in setting size as well as style
- \else
- \showmessage\m!fonts5{#style}%
- \fi}
-
-%D Here comes the main font switching macros. These macros handle changes in size as
-%D well as returning to the global bodyfont size.
-
-\ifdefined\font_preloads_at_definition \else \let\font_preloads_at_definition\relax \fi
-
-\def\font_helpers_set_font#method#specification%
- {\edef\m_font_specification{#specification}%
- \ifx\m_font_specification\empty \else
- \ifx\m_font_specification\v!global % we can have all kind of presets
- \restoreglobalbodyfont
- \else
- \processcommacommand[\m_font_specification]{\font_helpers_set_font_check_size}%
- \processcommacommand[\m_font_specification]{\font_helpers_set_font_set_font{#method}}%
- \ifproductionrun
- \font_preloads_at_definition
- \font_basics_switch_points\normalizedbodyfontsize
- \font_basics_switch_style\fontstyle
- \ifx\defaultfontclass\empty
- \let\defaultfontclass\fontclass
- \fi
- \fi
- \fi
- \currentxfontsize\zerocount
- \fi}
-
-\def\font_helpers_set_font_check_size#option%
- {\doifelsenumber{#option}{\font_helpers_check_bodyfont_environment{#option}{#option}}\donothing}
-
-\def\font_helpers_set_font_set_font#method#option% method=1: set, method=2: switch
- {\doifsomething{#option}{\font_helpers_set_font_set_font_option{#method}{#option}}}
-
-\def\font_helpers_set_font_set_font_option#method#option%
- {\doifelsenumber{#option}%
- \font_helpers_set_font_set_font_option_body
- \font_helpers_set_font_set_font_option_keyword
- {#method}{#option}{#option}}
-
-\newmacro\m_font_keyword
-
-\unexpanded\def\font_helpers_set_font_set_font_option_keyword#method#keyword#message%
- {\edef\m_font_keyword{#keyword}%
- \ifcsname\??fontenvironments\normalizedbodyfontsize\m_font_keyword\endcsname
- \edef\m_font_step{\font_bodyfontvariable\m_font_keyword}%
- \normalexpanded{\font_helpers_set_font_set_font_option_body{#method}{\m_font_step}{#message}}%
- \orelse\ifx\m_font_keyword\v!reset
- \let\fontstyle\empty % new 31/7/2006
- \let\fontsize \empty
- \orelse\ifcsname\??fontstyle\m_font_keyword\endcsname
- \let\fontstyle\m_font_keyword
- \else
- \setcurrentfontclass\m_font_keyword
- \ifcase#method\relax
- \let\globalfontclass\globalfontclass % -)
- \else
- \let\globalfontclass\fontclass
- \fi
- \font_helpers_set_fontstyle_of_fontclass
- \fi}
-
-\def\font_helpers_set_fontstyle_of_fontclass % will be overloaded later
- {\let\fontstyle\s!rm}
-
-\unexpanded\def\font_helpers_set_font_set_font_option_body#method#body#message%
- {\normalizebodyfontsize\normalizedsetfont{#body}% redundant for some calls
- \ifcsname\??fontbodyknown\normalizedsetfont\endcsname \else
- \font_helpers_define_unknown_font\normalizedsetfont
- \fi
- \ifcsname\??fontbodyknown\normalizedsetfont\endcsname
- \localbodyfontsize\normalizedsetfont
- \let\normalizedbodyfontsize\normalizedsetfont
- \else
- \showmessage\m!fonts4{#message}%
- %\font_helpers_set_font_set_font_option_body_fallbacks{#method}{#body}%
- \fi}
-
-% we need to check the fontclass
-
-\def\registerfontclass#class%
- {\letgvalue{\??fontclassyes#class}\v!yes} % global ?
-
-\def\setcurrentfontclass#class%
- {\ifcsname\??fontclassyes#class\endcsname
- \edef\fontclass{#class}%
- \orelse\ifcsname\??fontclassnop#class\endcsname
- % already tried
- \else % too messy: \ifcase\currentgrouplevel % (unpredictable)
- \trycurrentfontclass{#class}%
- \fi}
-
-\ifdefined\trycurrentfontclass \else
-
- \unexpanded\def\trycurrentfontclass#typeface%
- {\letvalueempty{\??fontclassnop#typeface}}
-
-\fi
-
-\let\defaultfontstyle \s!rm
-\let\defaultfontalternative\s!tf
-\let\defaultfontsize \empty
-\let\defaultfontface \!!zerocount
-
-%D So far for synchronisation. (We can inline the following macros.)
-
-\unexpanded\def\setcurrentfont#body#style#alternative#size% not used
- {\edef\fontbody {#body}%
- \edef\fontstyle {#style}%
- \edef\fontalternative{#alternative}%
- \edef\fontsize {#size}%
- \font_helpers_check_big_math_synchronization
- \font_helpers_synchronize_font}
-
-\unexpanded\def\setcurrentfontbody#body% % not used
- {\edef\fontbody{#body}%
- \font_helpers_synchronize_font}
-
-% For Taco: optional fall backs:
-
-\ifdefined\font_typescripts_inherit_check \else
- \let\font_typescripts_inherit_check\gobbleoneargument % implemented in type-ini
-\fi
-
-\unexpanded\def\font_helpers_set_current_font_style#style%
- {\edef\fontstyle{#style}%
- \font_typescripts_inherit_check\fontstyle
- \ifmmode\mr\fi % otherwise \rm not downward compatible ... not adapted yet
- \font_helpers_synchronize_font}
-
-\unexpanded\def\font_helpers_set_current_xsize_alternative#xsize#alternative%
- {\edef\fontface{#xsize}%
- \edef\fontalternative{#alternative}%
- \font_helpers_synchronize_font}
-
-\unexpanded\def\font_helpers_set_current_font_alternative#alternative%
- {\edef\fontalternative{#alternative}%
- \font_helpers_synchronize_font}
-
-\unexpanded\def\font_helpers_set_current_font_size#size%
- {\edef\fontsize{#size}%
- \font_helpers_check_big_math_synchronization % double? better in everymath?
- \font_helpers_synchronize_font}
-
-\unexpanded\def\font_helpers_set_current_font_style_alternative#style#alternative% \rmsl
- {\edef\fontstyle {#style}%
- \edef\fontalternative{#alternative}%
- \font_helpers_synchronize_font}
-
-\unexpanded\def\font_helpers_set_current_font_style_size#style#size% \rma
- {\edef\fontstyle{#style}%
- \edef\fontsize {#size}%
- \font_helpers_check_big_math_synchronization % double? better in everymath?
- \font_helpers_synchronize_font}
-
-\unexpanded\def\font_helpers_set_current_font_alternative_size#alternative#size% \sla
- {\edef\fontalternative{#alternative}%
- \edef\fontsize {#size}%
- \font_helpers_check_big_math_synchronization % double? better in everymath?
- \font_helpers_synchronize_font}
-
-\unexpanded\def\font_helpers_set_current_font_style_alternative_size#style#alternative#size% \rmsla
- {\edef\fontstyle {#style}%
- \edef\fontalternative{#alternative}%
- \edef\fontsize {#size}%
- \font_helpers_check_big_math_synchronization % double? better in everymath?
- \font_helpers_synchronize_font}
-
-\unexpanded\def\font_helpers_synchronize_font % we can have dups i.e. no need to let fontstrategy
- {\ifx\fontclass\empty
- \applyfontstrategies
- \else
- \applyfontclassstrategies
- \fi
- \setfalse\c_font_auto_size
- \ifskipfontcharacteristics
- \setfontcharacteristics
- \the\everyfontswitch
- \fi}
-
-%D This is the resolver for special cases (sizes) and in practice it is not called
-%D that often so further optimization makes no sense.
-
-\def\font_helpers_check_strategy_class_a % --- --- --- --- % pt tt bf a
- {\ifcsname\??fontinstanceready\fontclass-\fontbody-\fontstyle-\fontalternative-\fontsize-\fontface\endcsname
- \setfalse\c_font_auto_size
- \lastnamedcs
- \else
- \expandafter\font_helpers_check_strategy_class_b
- \fi}
-
-\def\font_helpers_check_strategy_class_b % --- --- --- def % pt tt bf
- {\ifcsname\??fontinstanceready\fontclass-\fontbody-\fontstyle-\fontalternative-\defaultfontsize-\fontface\endcsname
- \settrue\c_font_auto_size
- \lastnamedcs
- \else
- \expandafter\font_helpers_check_strategy_class_c
- \fi}
-
-\def\font_helpers_check_strategy_class_c % --- --- def --- % pt tt tf a
- {\ifcsname\??fontinstanceready\fontclass-\fontbody-\fontstyle-\defaultfontalternative-\fontsize-\fontface\endcsname
- \settrue\c_font_auto_size
- \lastnamedcs
- \else
- \expandafter\font_helpers_check_strategy_class_d
- \fi}
-
-\def\font_helpers_check_strategy_class_d % --- --- def def % pt tt tf
- {\ifcsname\??fontinstanceready\fontclass-\fontbody-\fontstyle-\defaultfontalternative-\defaultfontsize-\fontface\endcsname
- \settrue\c_font_auto_size
- \lastnamedcs
- \else
- \expandafter\font_helpers_check_strategy_class_e
- \fi}
-
-\def\font_helpers_check_strategy_class_e % --- def def def % pt rm tf
- {\ifcsname\??fontinstanceready\fontclass-\fontbody-\defaultfontstyle-\defaultfontalternative-\defaultfontsize-\fontface\endcsname
- \setfalse\c_font_auto_size
- \lastnamedcs
- \else
- \expandafter\font_helpers_check_strategy_class_f
- \fi}
-
-\def\font_helpers_check_strategy_class_f % def def def def % rm tf
- {\ifcsname\??fontinstanceready\fontclass-\defaultfontbody-\defaultfontstyle-\defaultfontalternative-\defaultfontsize-\fontface\endcsname
- \settrue\c_font_auto_size
- \lastnamedcs
- \else
- \expandafter\font_helpers_check_strategy_a
- \fi}
-
-% no class
-
-\def\font_helpers_check_strategy_a % --- --- --- --- % pt tt bf a
- {\ifcsname\??fontinstanceready\fontbody-\fontstyle-\fontalternative-\fontsize-\fontface\endcsname
- \setfalse\c_font_auto_size
- \lastnamedcs
- \else
- \expandafter\font_helpers_check_strategy_b
- \fi}
-
-\def\font_helpers_check_strategy_b % --- --- --- --- % pt tt bf a
- {\ifcsname\??fontinstanceready\fontbody-\fontstyle-\fontalternative-\defaultfontsize-\fontface\endcsname
- \settrue\c_font_auto_size
- \lastnamedcs
- \else
- \expandafter\font_helpers_check_strategy_c
- \fi}
-
-\def\font_helpers_check_strategy_c % --- --- --- --- % pt tt bf a
- {\ifcsname\??fontinstanceready\fontbody-\fontstyle-\defaultfontalternative-\fontsize-\fontface\endcsname
- \settrue\c_font_auto_size
- \lastnamedcs
- \else
- \expandafter\font_helpers_check_strategy_d
- \fi}
-
-\def\font_helpers_check_strategy_d % --- --- --- --- % pt tt bf a
- {\ifcsname\??fontinstanceready\fontbody-\fontstyle-\defaultfontalternative-\defaultfontsize-\fontface\endcsname
- \settrue\c_font_auto_size
- \lastnamedcs
- \else
- \expandafter\font_helpers_check_strategy_e
- \fi}
-
-\def\font_helpers_check_strategy_e % --- --- --- --- % pt tt bf a
- {\ifcsname\??fontinstanceready\fontbody-\defaultfontstyle-\defaultfontalternative-\defaultfontsize-\fontface\endcsname
- \setfalse\c_font_auto_size
- \lastnamedcs
- \else
- \expandafter\font_helpers_check_strategy_f
- \fi}
-
-\def\font_helpers_check_strategy_f % --- --- --- --- % pt tt bf a
- {\ifcsname\??fontinstanceready\defaultfontbody-\defaultfontstyle-\defaultfontalternative-\defaultfontsize-\fontface\endcsname
- \settrue\c_font_auto_size
- \lastnamedcs
- \fi}
-
-\let\applyfontstrategies \font_helpers_check_strategy_a
-\let\applyfontclassstrategies\font_helpers_check_strategy_class_a
-
-%D Let's synchronize:
-
-\newconditional\c_font_synchronize \settrue\c_font_synchronize
-
-\prependtoks
- \ifconditional\c_font_synchronize
- \font_helpers_synchronize_math
- \font_helpers_synchronize_font % problem: syncs last font
- \fi
-\to \everybodyfont
-
-%D Setting the normal sizes as well as the x and xx smaller sizes is accomplished by
-%D the next set of macros. When in math mode, the commands \type {\tx} and \type
-%D {\txx} are just a switch to the script and double script styles, but in text mode
-%D the values defined by the bodyfontenvironment are used. Here we also set \type
-%D {\currentxfontsize}.
-
-\def\font_helpers_set_current_font_xxx_alternative#alternative#xsize#scriptstyle%
- {\ifmmode
- #scriptstyle%
- \else
- \font_helpers_set_current_xsize_alternative{#xsize}{#alternative}%
- \fi}
-
-\def\font_helpers_reset_x_fontsize
- {\ifcase\currentxfontsize\else
- \currentxfontsize\zerocount
- % also \sx and \sxx ?
- \let\tx \normaltx
- \let\txx\normaltxx
- \fi}
-
-\let\font_helpers_check_nested_x_fontsize\relax
-
-\def\font_helpers_set_current_font_x_alternative#alternative%
- {\font_helpers_check_nested_x_fontsize
- \font_helpers_set_current_font_xxx_alternative{#alternative}{4}\scriptstyle
- \currentxfontsize\plusone
- \let\tx\txx}
-
-\def\font_helpers_set_current_font_xx_alternative#alternative%
- {\font_helpers_check_nested_x_fontsize
- \font_helpers_set_current_font_xxx_alternative{#alternative}{5}\scriptscriptstyle
- \currentxfontsize\plustwo
- \let\tx\empty
- \let\txx\empty}
-
-%D This alterative is not really needed, but for old time's sake we keep it there.
-%D We can speed it up when needed.
-
-\def\font_helpers_set_current_font_x_style_alternative #alternative{\csname#alternative\endcsname\tx}
-\def\font_helpers_set_current_font_xx_style_alternative#alternative{\csname#alternative\endcsname\txx}
-
-%D These macros also show us that when we call for \type {\tx}, this macro is
-%D redefined to be \type {\txx}. Therefore calls like:
-%D
-%D \startbuffer
-%D {small \tx is \tx beautiful}
-%D {small \tx is \txx beautiful}
-%D {small \txx is \tx beautiful}
-%D {small \txx is \txx beautiful}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D result in:
-%D
-%D \startlines
-%D \getbuffer
-%D \stoplines
-%D
-%D Setting the main size involves the style list and therefore takes a bit more
-%D time. Keep in mind that the fontsize is represented by a character or empty.
-
-\installcorenamespace{fontscalex}
-\installcorenamespace{fontscalexx}
-
-\newconditional\c_font_inherit_scale
-
-\def\font_scale_inherit#1%
- {\begingroup
- \scratchcounterone\fontid\font\relax
- \currentxfontsize\plusone
- \normalexpanded{\definedfont[\clf_specifiedfont\scratchcounterone\font_currentfontscale\relax]}%
- \scratchcountertwo\fontid\font\relax
- \currentxfontsize\plustwo
- \normalexpanded{\definedfont[\clf_specifiedfont\scratchcounterone\font_currentfontscale\relax]}%
- \scratchcounterthree\fontid\font\relax
- % parent -> x -> xx
- % parent -> xx
- \global\expandafter\chardef\csname\??fontscalex \number\scratchcounterone\endcsname\scratchcountertwo
- \global\expandafter\chardef\csname\??fontscalexx\number\scratchcounterone\endcsname\scratchcounterthree
- \global\expandafter\chardef\csname\??fontscalex \number\scratchcountertwo\endcsname\scratchcounterthree
- \global\expandafter\chardef\csname\??fontscalexx\number\scratchcountertwo\endcsname\scratchcounterthree
- \endgroup
- \setfontid\csname#1\number\fontid\font\endcsname}
-
-\def\font_scale_inherit_x
- {\ifcsname\??fontscalex\number\fontid\font\endcsname
- \setfontid\lastnamedcs
- \else
- \font_scale_inherit\??fontscalex
- \fi
- \ifskipfontcharacteristics
- \setfontcharacteristics
- \the\everyfontswitch
- \fi}
-
-\def\font_scale_inherit_xx
- {\ifcsname\??fontscalexx\number\fontid\font\endcsname
- \setfontid\lastnamedcs
- \else
- \font_scale_inherit\??fontscalexx
- \fi
- \ifskipfontcharacteristics
- \setfontcharacteristics
- \the\everyfontswitch
- \fi}
-
-\def\font_scale_defined_x
- {\let\fontface\!!plusfour
- \let\fontalternative\fontalternative
- \font_helpers_synchronize_font}
-
-\def\font_scale_defined_xx
- {\let\fontface\!!plusfive
- \let\fontalternative\fontalternative
- \font_helpers_synchronize_font}
-
-\unexpanded\def\tx
- {\currentxfontsize\plusone
- \ifmmode
- \scriptstyle
- \else\ifconditional\c_font_inherit_scale
- \font_scale_inherit_x
- \else
- \font_scale_defined_x
- \fi\fi
- \let\tx\txx}
-
-\unexpanded\def\txx
- {\currentxfontsize\plustwo
- \ifmmode
- \scriptscriptstyle
- \else\ifconditional\c_font_inherit_scale
- \font_scale_inherit_xx
- \else
- \font_scale_defined_xx
- \fi\fi
- \let\tx \empty
- \let\txx\empty}
-
-\unexpanded\def\sx
- {\currentxfontsize\plusone
- \ifmmode
- \scriptstyle
- \else
- \font_scale_inherit_x
- \fi
- \let\tx\txx
- \let\sx\sxx}
-
-\unexpanded\def\sxx
- {\currentxfontsize\plustwo
- \ifmmode
- \scriptscriptstyle
- \else
- \font_scale_inherit_xx
- \fi
- \let\tx \empty
- \let\txx\empty
- \let\sx \empty
- \let\sxx\empty}
-
-\unexpanded\def\useinheritxsizes{\settrue \c_font_inherit_scale} % not yet public, playground for WS and me
-\unexpanded\def\usedefinedxsizes{\setfalse\c_font_inherit_scale} % not yet public, playground for WS and me
-
-\let\normaltx \tx
-\let\normaltxx\txx
-
-\let\normalsx \sx
-\let\normalsxx\sxx
-
-%D When asking for a complete font switch, for instance from 10 to 12~points, the
-%D next macro does the job. First we normalize the size, next we define the current
-%D range of text, script and scriptscript sizes, then we set the text fonts and the
-%D math families and finally we activate the default typeface and also set the font
-%D specific parameters assigned to \type {\everybodyfont}.
-
-\def\textface {\currentbodyfontdimension\s!text }
-\def\scriptface {\currentbodyfontdimension\s!script }
-\def\scriptscriptface{\currentbodyfontdimension\s!scriptscript}
-\def\xtextface {\currentbodyfontdimension\s!x }
-\def\xxtextface {\currentbodyfontdimension\s!xx }
-
-\installcorenamespace{fontbodyfaces}
-
-\unexpanded\def\font_basics_complete_switch#size%
- {\bodyfontsize#size\relax
- \normalizebodyfontsize\normalizedbodyfontsize\bodyfontsize
- \expandafter\let\expandafter\font_basics_set_faces\csname\??fontbodyfaces\fontbody\endcsname
- \ifx\font_basics_set_faces\relax
- \font_basics_set_faces_preset
- \fi
- \font_basics_set_faces}
-
-\def\font_basics_set_faces_preset
- {\edef\font_basics_set_faces{% 0.2 sec on 10K \tfa
- \noexpand\edef\noexpand\textface {\currentbodyfontdimension\s!text }%
- \noexpand\edef\noexpand\scriptface {\currentbodyfontdimension\s!script }%
- \noexpand\edef\noexpand\scriptscriptface{\currentbodyfontdimension\s!scriptscript}%
- \noexpand\edef\noexpand\xtextface {\currentbodyfontdimension\s!x }%
- \noexpand\edef\noexpand\xxtextface {\currentbodyfontdimension\s!xx }%
- }%
- \expandafter\glet\csname\??fontbodyfaces\fontbody\endcsname\font_basics_set_faces}
-
-\def\currentbodyfontdimension#parameter% there can be factors here
- {\the\dimexpr
- \ifcsname\??fontenvironments\fontclass\normalizedbodyfontsize#parameter\endcsname
- \lastnamedcs
- \orelse\ifcsname\??fontenvironments\fontclass\s!default#parameter\endcsname
- \lastnamedcs
- \dimexpr\normalizedbodyfontsize\relax
- \orelse\ifcsname\??fontenvironments\normalizedbodyfontsize#parameter\endcsname
- \lastnamedcs
- \else
- \csname\??fontenvironments\s!default#parameter\endcsname
- \dimexpr\normalizedbodyfontsize\relax
- \fi
- \relax}
-
-%D \macros
-%D {setupbodyfont,switchtobodyfont}
-%D
-%D The next two macros are user ones. With \type {\setupbodyfont} one can set the
-%D document bodyfont size, font family, style and/or options defined in files, for
-%D example:
-%D
-%D \starttyping
-%D \setupbodyfont[modern,12pt,roman]
-%D \stoptyping
-%D
-%D This command affects the document as a whole: text, headers and footers. The
-%D second macro however affects only the text:
-%D
-%D \starttyping
-%D \switchtobodyfont[10pt]
-%D \stoptyping
-%D
-%D So we've got:
-%D
-%D \showsetup{setupbodyfont}
-%D \showsetup{switchtobodyfont}
-%D
-%D Both macros look alike. The second one also has to take all kind of keywords into
-%D account.
-
-\ifx\saveinterlinespace \undefined \let\saveinterlinespace \relax \fi
-\ifx\restoreinterlinespace\undefined \let\restoreinterlinespace\relax \fi
-
-% \newtoks \everysetupbodyfont
-% \newtoks \everyswitchtobodyfont
-
-\unexpanded\def\setupbodyfont
- {\doifelsenextoptionalcs\font_basics_setupbodyfont_yes\font_basics_setupbodyfont_nop}
-
-\def\font_basics_setupbodyfont_nop
- {\restoreglobalbodyfont
- \saveinterlinespace}
-
-\def\font_basics_setupbodyfont_yes[#specification]%
- {\doifsomething{#specification}
- {\font_helpers_set_font\plusone{#specification}%
- \globalbodyfontsize\localbodyfontsize
- \normalizebodyfontsize\normalizedglobalbodyfontsize\globalbodyfontsize
- \let\globalfontstyle\fontstyle
- \ifproductionrun
- \the\everybodyfont
- \the\everyglobalbodyfont
- \saveinterlinespace
- \fi
- \the\everysetupbodyfont}}
-
-\unexpanded\def\font_basics_switchtobodyfont#specification%
- {\edef\m_font_step{\font_bodyfontvariable{#specification}}%
- \ifx\m_font_step\empty
- \font_helpers_set_font\zerocount{#specification}%
- \else
- \font_helpers_switch_bodyfont_step % so we have a fast [small] switch
- \fi
- \the\everybodyfont
- \the\everyswitchtobodyfont}
-
-\unexpanded\def\switchtobodyfont[#specification]% could become an ifx
- {\doifsomething{#specification}{\font_basics_switchtobodyfont{#specification}}}
-
-\unexpanded\def\usebodyfontparameter#1%
- {\edef\m_font_bodyfont_asked{#1\c!bodyfont}%
- \ifx\m_font_bodyfont_asked\empty\else
- \font_basics_switchtobodyfont\m_font_bodyfont_asked
- \fi}
-
-\def\font_helpers_switch_bodyfont_step
- {\font_basics_switch_points\m_font_step
- \font_basics_switch_style \fontstyle}
-
-%D The following alternative is meant for math||to||text switching and will be
-%D optimized.
-
-\unexpanded\def\fastswitchtobodyfont#name%
- {\ifcsname\??fontenvironments\normalizedbodyfontsize#name\endcsname
- %\edef\futurebodyfontsize{\csname\??fontenvironments\normalizedbodyfontsize#name\endcsname}%
- \edef\futurebodyfontsize{\lastnamedcs}%
- \ifcsname\??fontbodyknown\futurebodyfontsize\endcsname
- \font_basics_complete_switch\futurebodyfontsize
- \localbodyfontsize\futurebodyfontsize\relax
- \fi
- \fi
- \csname\??fontstyle\fontstyle\endcsname
- \the\everybodyfont}
-
-%D \starttyping
-%D $\cases{& \ccaron}$ $x=\hbox{\ccaron $x=\hbox{\ccaron}$}$
-%D \stoptyping
-
-%D \macros
-%D {usebodyfont}
-%D
-%D This looks nicer then a switch in the preamble
-%D
-%D \starttyping
-%D \usebodyfont[pagella,10pt]
-%D \usebodyfont[termes,10pt]
-%D \usebodyfont[dejavu,10pt]
-%D
-%D \setupbodyfont[dejavu]
-%D
-%D \starttext
-%D test
-%D \stoptext
-%D \stoptyping
-
-\unexpanded\def\usebodyfont[#1]%
- {\ifx\fontclass\empty
- \setupbodyfont[#1]%
- \else
- \switchtobodyfont[#1]%
- \fullrestoreglobalbodyfont
- \fi}
-
-\unexpanded\def\showbodyfontstate
- {\dontleavehmode
- \start
- \infofont
- [fontclass: \fontclass,\space
- fontbody: \fontbody ,\space
- fontface: \fontface ,\space
- fontsize: \fontsize ]%
- \stop}
-
-%D Handy for manuals:
-
-%D The \type {\tochar} commmand takes a specification:
-%D
-%D \starttabulate[|l|l|l|]
-%D \NC e \NC entity \NC e:eacute \NC \NR
-%D \NC x \NC hexadecimal unicode \NC x:013D \NC \NR
-%D \NC d \NC decimal unicode \NC d:123 \NC \NR
-%D \NC s \NC hexadecimal index (slot) \NC s:210D \NC \NR
-%D \NC i \NC decimal index \NC i:456 \NC \NR
-%D \NC n \NC name \NC n:eight \NC \NR
-%D \NC c \NC name \NC c:x \NC \NR
-%D \NC u \NC unicode descriptions \NC u:dog \NC \NR
-%D \NC a \NC all (also descriptions) \NC a:rewind \NC \NR
-%D \stoptabulate
-%D
-%D This is an expandable command!
-
-\unexpanded\def\fontchar #character{\clf_fontchar{#character}}
-\unexpanded\def\fontcharbyindex #index{\clf_fontcharbyindex#index\relax}
- \def\tochar #specifications{\clf_tochar{#specifications}} % expanded (also used in edef)
-
-%D The next auxilliary macro is an alternative to \type {\fontname}.
-
-\def\purefontname#font{\clf_purefontname{\fontname#font}}
-
-%D \macros
-%D {switchstyleonly}
-%D
-%D For switching a style but keeping the alternative, there
-%D is:
-%D
-%D \starttyping
-%D {\bf text \switchstyleonly\ss text}
-%D {\bf text \switchstyleonly[ss]text}
-%D {\sl text \switchstyleonly[sansserif]text}
-%D \stoptyping
-
-\unexpanded\def\switchstyleonly
- {\doifelsenextoptionalcs\font_basics_switch_style_only_opt\font_basics_switch_style_only_arg}
-
-\def\font_basics_switch_style_only_arg#name% stupid version
- {\font_helpers_set_current_font_style{\csname\??fontshortstyle\checkedstrippedcsname#name\endcsname}%
- \the\everybodyfont} % needed ?
-
-\def\font_basics_switch_style_only_opt[#name]% todo : check
- {\font_helpers_set_current_font_style{\csname\??fontshortstyle#name\endcsname}%
- \the\everybodyfont} % needed ?
-
-%D \macros
-%D {definebodyfontswitch}
-%D
-%D \PLAIN\ \TEX\ defines some macro's like \type {\tenpoint} to switch to a specific
-%D bodyfontsize. Just for the sake of compatibility we can define them like:
-%D
-%D \starttyping
-%D \definebodyfontswitch [twelvepoint] [12pt]
-%D \stoptyping
-%D
-%D We don't support language specific synonyms here.
-
-\unexpanded\def\definebodyfontswitch
- {\dodoubleargument\font_basics_define_bodyfont_switch}
-
-\def\font_basics_define_bodyfont_switch[#command][#specification]% no longer a commalist (not useful)
- {\setvalue{#command}{\switchtobodyfont[#specification]}}%
-
-%D \macros
-%D {setsmallbodyfont,setmainbodyfont,setbigbodyfont}
-%D
-%D When we're typesetting at for instance 10pt, we can call for the \type {small} as
-%D well as the \type {big} alternative, related to this main size, using \type
-%D {\switchtobodyfont[small]}. The three alternatives can be activated by the next
-%D three system calls and are defined by the bodyfontenvironment.
-
-\newmacro\m_font_step
-
-\def\font_helpers_set_bodyfont_step#step%
- {\edef\m_font_step{\font_bodyfontvariable{#step}}% not always \cs
- \font_basics_switch_points\m_font_step
- \font_basics_switch_style \fontstyle}
-
-\unexpanded\def\setsmallbodyfont{\font_helpers_set_bodyfont_step\v!small\the\everybodyfont}
-\unexpanded\def\setbigbodyfont {\font_helpers_set_bodyfont_step\v!big \the\everybodyfont}
-
-\unexpanded\def\setmainbodyfont
- {\font_basics_switch_points\normalizedbodyfontsize
- \font_basics_switch_style\fontstyle
- \the\everybodyfont
- \the\everyglobalbodyfont
- \saveinterlinespace}
-
-%D \macros
-%D {restoreglobalbodyfont}
-%D
-%D Users can set whatever font available while typesetting text. Pagenumbers,
-%D footers, headers etc. however must be typeset in the main bodyfont and style of
-%D the document. Returning to the global state can be done with the next macro:
-%D
-%D This macro has to be called when entering the pagebody handling routine as well
-%D as the footnote insert routine. Users can access this feature |<|for instance
-%D when one wants to typeset tables and alike in the main bodyfont and style while
-%D the running text is temporary set to a smaller one|>| by saying \type
-%D {\switchtobodyfont [global]}.
-
-\let\globalfontstyle\s!rm
-
-\unexpanded\def\fullrestoreglobalbodyfont
- {\let\fontsize\defaultfontsize
- \let\fontbody\defaultfontbody
- \let\fontface\defaultfontface
- \currentxfontsize\zerocount
- \let\fontclass\globalfontclass
- \font_basics_switch_points\normalizedglobalbodyfontsize
- \font_basics_switch_style\globalfontstyle
- \redoconvertfont % just in case a pagebreak occurs
- \tf
- \the\everybodyfont
- \the\everyglobalbodyfont
- \saveinterlinespace}
-
-\unexpanded\def\partialrestoreglobalbodyfont
- {\let\fontsize\defaultfontsize
- \let\fontbody\defaultfontbody
- \let\fontface\defaultfontface
- \currentxfontsize\zerocount
- \redoconvertfont
- \tf
- \the\everybodyfont % indeed needed
- \the\everyglobalbodyfont % indeed needed
- \saveinterlinespace}
-
-\unexpanded\def\restoreglobalbodyfont % ook style etc
- {\ifx\fontclass\globalfontclass
- \ifx\fontstyle\globalfontstyle
- \ifx\normalizedbodyfontsize\normalizedglobalbodyfontsize
- \partialrestoreglobalbodyfont
- \else
- \fullrestoreglobalbodyfont
- \fi
- \else
- \fullrestoreglobalbodyfont
- \fi
- \else
- \fullrestoreglobalbodyfont
- \fi}
-
-% in case of troubles: \let\restorebodyfont\fullrestoreglobalbodyfont
-
-%D Here are some fast variants that can be used in cases where no font system is
-%D needed and where fonts are frozen:
-%D
-%D \starttyping
-%D \definefont [TestA][Serif at 10pt]
-%D \predefinefont[TestB][Serif at 20pt]
-%D
-%D \testfeatureonce{1000}{{\TestA}} % .312
-%D \testfeatureonce{1000}{{\TestB}} % < .016
-%D \testfeatureonce{1000}{{\definedfont[Serif at 30pt]}} % .312
-%D \testfeatureonce{1000}{{\predefinedfont[Serif at 40pt]}} % < .016
-%D \stoptyping
-
-\installcorenamespace{predefinedfont}
-
-\unexpanded\def\predefinefont[#1]#2[#3]% global !
- {\setugvalue{#1}{\font_basics_predefine{#1}{#3}}}
-
-\unexpanded\def\predefinedfont[#1]% global !
- {\ifcsname\??predefinedfont#1\endcsname
- \lastnamedcs
- \else
- \font_basics_predefined{#1}%
- \fi}
-
-\unexpanded\def\font_basics_predefine#1#2%
- {\font_basics_defined_font_yes[#2]%
- \expandafter\glet\csname#1\expandafter\endcsname\csname\v_font_identifier_basic\endcsname}
-
-\unexpanded\def\font_basics_predefined#1%
- {\font_basics_predefine{\??predefinedfont#1}{#1}}
-
-%D Handy helper:
-
-\unexpanded\def\savedefinedfont[#1]%
- {\bgroup
- \definedfont[#1]%
- \xdef\saveddefinedfontid {\number\fontid\font}%
- \xdef\saveddefinedfontname{\fontname\font}%
- \egroup}
-
-\def\saveddefinedfontid {\number\fontid\font}
-\def\saveddefinedfontname{\fontname\font}
-
-%D Ugly helper:
-
-\unexpanded\def\saverunningstyleandcolor
- {\unexpanded\edef\restorerunningstyleandcolor
- {\setfontid \number\fontid\font
- \attribute\colormodelattribute \the\attribute\colormodelattribute
- \attribute\colorattribute \the\attribute\colorattribute
- \attribute\transparencyattribute\the\attribute\transparencyattribute
- \relax}}
-
-\let\restorerunningstyleandcolor\relax
-
-%D Handy for defining additional glyphs:
-
-\let\getprivateglyphslot\clf_getprivateglyphslot % kind of private macro
-
-\let\getprivatechar \clf_getprivatechar % gives back a utf !
-\let\getprivatemathchar \clf_getprivatemathchar % gives back a utf !
-\let\getprivateslot \clf_getprivateslot % companion to fonts.helpers.addprivate
-
-% \unexpanded\def\getprivatemathchar#1%
-% {\begingroup\the\textfont\zerocount\getprivatechar{#1}\endgroup}
-
-\def\privatechar % the text variant gets expanded to utf
- {\ifmmode
- \expandafter\getprivatemathchar
- \else
- \expandafter\getprivatechar
- \fi}
-
-%D Some fonts can have color specifiers:
-%D
-%D \starttyping
-%D \definefontfeature[seguiemj-cl][default][colr=yes,ccmp=yes,dist=yes]
-%D \definefontsynonym[emoji][seguiemj*seguiemj-cl]
-%D
-%D \definecolor[emoji-red] [r=.4]
-%D \definecolor[emoji-gray][s=1,t=.5,a=1]
-%D
-%D %definefontcolorpalette [emoji-r] [emoji-red,emoji-gray,textcolor] % bad
-%D \definefontcolorpalette [emoji-r] [emoji-red,emoji-gray] % okay
-%D
-%D \definefontfeature[seguiemj-r][ccmp=yes,dist=yes,colr=emoji-r]
-%D
-%D \definefont[MyEmojiR][seguiemj*seguiemj-r @ 100pt]
-%D
-%D \startTEXpage[offset=10pt]
-%D \MyEmojiR\resolvedemoji{triangular ruler}
-%D \stopTEXpage
-%D \stoptyping
-
-\unexpanded\def\definefontcolorpalette
- {\dodoubleargument\font_define_color_palette}
-
-\def\font_define_color_palette[#1][#2]%
- {\clf_definefontcolorpalette{#1}{#2}}
-
-%D \macros
-%D {addfontpath}
-%D
-%D A way to add a path at runtime (no need to generate database):
-
-\unexpanded\def\usefontpath[#1]%
- {\clf_addfontpath{#1}}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-ini.mkvi b/Master/texmf-dist/tex/context/base/mkiv/font-ini.mkvi
index 99e7117a38e..271a81c2aa4 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-ini.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-ini.mkvi
@@ -2712,10 +2712,10 @@
\unexpanded\def\saverunningstyleandcolor
{\unexpanded\edef\restorerunningstyleandcolor
- {\setfontid \number\fontid\font
- \attribute\colormodelattribute \the\attribute\colormodelattribute
- \attribute\colorattribute \the\attribute\colorattribute
- \attribute\transparencyattribute\the\attribute\transparencyattribute
+ {\setfontid \number\fontid\font
+ \c_attr_colormodel \the\c_attr_colormodel
+ \c_attr_color \the\c_attr_color
+ \c_attr_transparency\the\c_attr_transparency
\relax}}
\let\restorerunningstyleandcolor\relax
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-lib.mkvi b/Master/texmf-dist/tex/context/base/mkiv/font-lib.mkvi
index b3cade5ff07..db9df49cd6f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-lib.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-lib.mkvi
@@ -49,17 +49,13 @@
\registerctxluafile{font-osd}{}
%registerctxluafile{font-osm}{}
-\ifcase\contextlmtxmode
- \ifnum\luatexversion>111
- \doifelsefileexists{font-ocm.lua}
- {\registerctxluafile{font-ocm}{}} % mkiv new
- {\registerctxluafile{font-ocl}{}}
- \else
- \registerctxluafile{font-ocl}{} % generic (will become luatex-fonts-ocl)
- \fi
-\else
- \registerctxluafile{font-ogr}{} % lmtx
-\fi
+% \ifcase\directlua{tex.print(callback.list()["provide_charproc_data"] == false and 1 or 0)}\relax
+% % this is the generic variant that will become luatex-fonts-ocl once we have
+% % more recent versions of luatex 1.13/1.14 on the garden
+ \registerctxluafile{font-ocl}{}
+% \else
+% \registerctxluafile{font-ocm}{}
+% \fi
% we use otf code for type one
@@ -117,6 +113,7 @@
\registerctxluafile{font-imp-dimensions}{}
\registerctxluafile{font-imp-spacekerns}{}
\registerctxluafile{font-imp-tweaks}{}
+\registerctxluafile{font-imp-combining}{}
\doifelsefileexists{font-imp-scripts.lua} {
\registerctxluafile{font-imp-scripts}{}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-map.lua b/Master/texmf-dist/tex/context/base/mkiv/font-map.lua
index 84a28a8b7ed..c983ea96343 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-map.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-map.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['font-map'] = {
version = 1.001,
+ optimize = true,
comment = "companion to font-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
@@ -103,6 +104,7 @@ local hash = { }
local conc = { }
table.setmetatableindex(hash,function(t,k)
+ local v
if k < 0xD7FF or (k > 0xDFFF and k <= 0xFFFF) then
v = f_single(k)
else
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-mat.mklx b/Master/texmf-dist/tex/context/base/mkiv/font-mat.mklx
deleted file mode 100644
index d08a2ce879f..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/font-mat.mklx
+++ /dev/null
@@ -1,500 +0,0 @@
-%D \module
-%D [ file=font-mat,
-%D version=2011.01.13, % (copied fron font-ini)
-%D title=\CONTEXT\ Font Macros,
-%D subtitle=Math,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Font Macros / Math}
-
-\unprotect
-
-%D Be nice:
-
-\ifdefined\??fontinstanceready \else \installcorenamespace{fontinstanceready} \fi
-\ifdefined\??fontinstancebasic \else \installcorenamespace{fontinstancebasic} \fi
-\ifdefined\??fontinstanceclass \else \installcorenamespace{fontinstanceclass} \fi
-
-%D The order 3 2 1 of siuze matters: needed for math-fbk relative size storage!
-
-%D \macros
-%D {textonly}
-%D
-%D Traditionally math has a big impact on font definitions, mainly because we need
-%D to define alphabet variants using families and fonts. This means that one can
-%D easily get 10 fonts loaded per math size. In \MKIV\ we use a different approach:
-%D one family which has either a virtual font made of traditional fonts, or an
-%D \OPENTYPE\ font that has it all.
-%D
-%D We currently use only one math family but in the future we might consider using a
-%D second one for bold math. For the moment we keep the \MKII\ method of using a
-%D token register for definitions but we already dropped the text and symbols ones
-%D since they now live in the same family.
-
-\newtoks \t_font_math_strategies
-\newconditional\c_font_synchronize_math_fonts \settrue\c_font_synchronize_math_fonts
-
-\unexpanded\def\font_helpers_synchronize_math % math stuff in mmode
- {\ifconditional\c_font_synchronize_math_fonts\the\t_font_math_strategies\fi}
-
-\unexpanded\def\textonly{\setfalse\c_font_synchronize_math_fonts} % document this
-
-%D The main math font definer. We have removed some optimized code simply because we
-%D now always have a fontclass. We could check for fontclass being default or empty
-%D and save a few tests but it does not help us when no math is defined.
-%D
-%D Because we want to keep mr=.. and mb=... settings (read: not break downward
-%D compatibility by enforcing mrlr etc) we need a bit more code that optimal.
-
-% todo: \c_font_fam_mr
-
-\let\c_font_fam_mr \zerocount % math regular
-\let\c_font_fam_mr_lr\plusone % math regular l2r
-\let\c_font_fam_mr_rl\plustwo % math regular r2l
-
-\let\c_font_fam_mb \plusthree % math bold
-\let\c_font_fam_mb_lr\plusfour % math bold l2r
-\let\c_font_fam_mb_rl\plusfive % math bold r2l
-
-\definesystemattribute[mathfamily][public]
-
-\newconditional\c_font_bidirectional_mathstrategy % can be default, not that much overhead: \settrue\c_font_bidirectional_mathstrategy
-\newconditional\c_font_complete_bold_mathstrategy \settrue\c_font_complete_bold_mathstrategy
-
-\def\mathtextsuffix {-text}
-\def\mathscriptsuffix {-script}
-\def\mathscriptscriptsuffix{-scriptscript}
-
-\def\mathsizesuffix{\ifcase\fontface\or\mathtextsuffix\or\mathscriptsuffix\or\mathscriptscriptsuffix\fi}
-
-%D Beware: truefontname also does a fallback on defaultfontclass so there
-%D can be some interference here, which is why we use a different method
-%D for bold.
-
-\def\font_helpers_set_math_family_a
- {\ifcsname\??fontinstanceready\fontclass -\fontbody-\s!mm-\fontfamily-\fontsize\endcsname \setfalse\c_font_auto_size
- \lastnamedcs \orelse
- \ifcsname\??fontinstanceready\fontclass -\fontbody-\s!mm-\fontfamily \endcsname \settrue \c_font_auto_size
- \lastnamedcs \else
- \font_helpers_set_math_family_b
- \fi}
-
-\def\font_helpers_set_math_family_b
- {\ifcsname\??fontinstanceready\defaultfontclass-\fontbody-\s!mm-\fontfamily-\fontsize\endcsname \setfalse\c_font_auto_size
- \lastnamedcs \orelse
- \ifcsname\??fontinstanceready\defaultfontclass-\fontbody-\s!mm-\fontfamily \endcsname \settrue \c_font_auto_size
- \lastnamedcs \else
- \font_helpers_set_math_family_c
- \fi}
-
-\def\font_helpers_set_math_family_c
- {\ifcsname\??fontinstanceready \fontbody-\s!mm-\fontfamily-\fontsize\endcsname \setfalse\c_font_auto_size
- \lastnamedcs \orelse
- \ifcsname\??fontinstanceready \fontbody-\s!mm-\fontfamily \endcsname \settrue \c_font_auto_size
- \lastnamedcs \else
- \settrue \c_font_auto_size
- \fi}
-
-\let\mathsizesuffix\empty
-
-\def\font_helpers_set_math_family_indeed#mrtag#family% \fontface etc are also used later on
- {\let\savedfontbody\fontbody
- \let\fontfamily#family%
- % the order is important as we depend on known id's when completing fonts
- % enabling is needed when we have fallbacks which spoils the families
- \let\mathsizesuffix\mathscriptscriptsuffix\let\fontface\!!plusthree
- \font_helpers_set_math_family_a\scriptscriptfont#mrtag\font % defines
- \font_helpers_set_math_family_a\scriptscriptfont#mrtag\font % enables
- \let\mathsizesuffix\mathscriptsuffix \let\fontface\!!plustwo
- \font_helpers_set_math_family_a\scriptfont #mrtag\font % defines
- \font_helpers_set_math_family_a\scriptfont #mrtag\font % enables
- \let\mathsizesuffix\mathtextsuffix \let\fontface\!!plusone
- \font_helpers_set_math_family_a\textfont #mrtag\font % defines
- \font_helpers_set_math_family_a\textfont #mrtag\font % enables
- \let\mathsizesuffix\empty \let\fontface\!!zerocount
- \let\fontbody\savedfontbody
- \setfalse\c_font_auto_size}
-
-\def\font_helpers_set_math_family_bold_a#font#mbfam#mrfam%
- {\ifcsname\??fontinstanceready\fontclass-\fontbody-\s!mm-\fontfamily-\fontsize\endcsname \setfalse\c_font_auto_size
- \lastnamedcs #font#mbfam\font \orelse
- \ifcsname\??fontinstanceready\fontclass-\fontbody-\s!mm-\fontfamily \endcsname \settrue \c_font_auto_size
- \lastnamedcs #font#mbfam\font \else
- #font#mbfam#font#mrfam%
- \fi}
-
-\def\font_helpers_set_math_family_bold_indeed#mbfam#familytag#mrfam% \c_font_fam_mb \s!mb \c_font_fam_mr
- {\let\savedfontclass\defaultfontclass
- \let\defaultfontclass\fontclass % else truefontname falls back on the wrong one
- \let\savedfontbody\fontbody
- \let\fontfamily#familytag%
- \let\mathsizesuffix\mathscriptscriptsuffix\let\fontface\!!plusthree
- \font_helpers_set_math_family_bold_a\scriptscriptfont#mbfam#mrfam% defines
- \font_helpers_set_math_family_bold_a\scriptscriptfont#mbfam#mrfam% enables
- \let\mathsizesuffix\mathscriptsuffix \let\fontface\!!plustwo
- \font_helpers_set_math_family_bold_a\scriptfont #mbfam#mrfam% defines
- \font_helpers_set_math_family_bold_a\scriptfont #mbfam#mrfam% enables
- \let\mathsizesuffix\mathtextsuffix \let\fontface\!!plusone
- \font_helpers_set_math_family_bold_a\textfont #mbfam#mrfam% defines
- \font_helpers_set_math_family_bold_a\textfont #mbfam#mrfam% enables
- \let\mathsizesuffix\empty \let\fontface\!!zerocount
- \let\fontbody\savedfontbody
- \let\defaultfontclass\savedfontclass
- \setfalse\c_font_auto_size}
-
-% optimized: math fonts are never changed (10K \bfa $x$: 3.2 => 2.5 (baseline 1.0))
-%
-% sort of tricky: we cannot reset in \everybeforedefinetypeface as we don't know
-% all sizes so we postpone the optimization to the first starttext
-%
-% pitfall: we should reset 'm when a fontclass name is reused
-
-\newconditional\optimizemathfontdefinitions \settrue\optimizemathfontdefinitions
-
-\def\font_helpers_set_math_family#mrfam#familytag%
- {\ifconditional\optimizemathfontdefinitions
- \ifcsname\??fontinstanceclass\fontclass-\fontbody-\s!mm-#familytag-\fontsize-1\endcsname
- % \writestatus{fonts}{math: reusing \fontclass\fontbody\s!mm#familytag\fontsize1}%
- \font_helpers_preset_math_family_indeed#mrfam#familytag%
- \else
- % \writestatus{fonts}{math: defining \fontclass\fontbody\s!mm#familytag\fontsize1}%
- \font_helpers_set_math_family_indeed#mrfam#familytag%
- \fi
- \else
- \font_helpers_set_math_family_indeed#mrfam#familytag%
- \fi}
-
-\def\font_helpers_set_math_family_bold#mbfam#familytag#mrfam%
- {\ifconditional\optimizemathfontdefinitions
- %\ifcsname\??fontinstanceclass\fontclass-\textface-\s!mm-#familytag-\fontsize-1\endcsname
- \ifcsname\??fontinstanceclass\fontclass-\fontbody-\s!mm-#familytag-\fontsize-1\endcsname
- \font_helpers_preset_math_family_indeed#mbfam#familytag%
- \else
- \font_helpers_set_math_family_bold_indeed#mbfam#familytag#mrfam%
- \fi
- \else
- \font_helpers_set_math_family_bold_indeed#mbfam#familytag#mrfam%
- \fi}
-
-%D It can happen that we use a bodyfont with no math in which case we have a problem
-%D with setting the global bodyfont size in the page builder. For instance in:
-%D
-%D \starttext
-%D \definetypeface[test][rm][serif][pagella][default]
-%D \setupbodyfont[test]
-%D test
-%D \stoptext
-%D
-%D This is why we need the check. At the cost of some extra checking we gain a
-%D little in restoring global states and, what's more important, we get rid of large
-%D math parameter push/pop in tracingall when not needed.
-
-\def\font_helpers_preset_math_family_indeed#fam#familytag%
- {\expandafter\let\expandafter\v_font_math_one\csname\??fontinstanceclass\fontclass-\fontbody-\s!mm-#familytag-\fontsize-1\endcsname
- \ifx\v_font_math_one\relax
- \font_helpers_preset_math_family_warning
- \orelse\ifnum\fontid\textfont#fam=\fontid\v_font_math_one\else
- \font_helpers_preset_math_family_indeed_changed#fam#familytag%
- \fi}
-
-\def\font_helpers_preset_math_family_warning
- {\writestatus{fonts}{math: unset for global bodyfont \fontclass\space at \fontbody}}
-
-\def\font_helpers_preset_math_family_indeed_changed#fam#familytag%
- {\scriptscriptfont#fam\csname\??fontinstanceclass\fontclass-\fontbody-\s!mm-#familytag-\fontsize-3\endcsname
- \scriptfont #fam\csname\??fontinstanceclass\fontclass-\fontbody-\s!mm-#familytag-\fontsize-2\endcsname
- \textfont #fam\v_font_math_one}
-
-\let\font_helpers_reset_fontclass_math_families\gobbleoneargument
-
-%D It would be nice if characters could be defined in a neutral way (say fam 255)
-%D and be mapped to a real family during noad list construction. However, this
-%D changes tex in critical places so for the moment we simulate this using
-%D manipulation.
-%D
-%D For tracing purposes we use three families but in l2r mode 1 and 2 are copies of
-%D 0 while in rl mode 0 is a copy of 1. There is no real overhead involved in this.
-%D This also permits different font definitions for normal and mixed.
-
-\let\m_font_class_direction\empty
-\let\m_font_class_features \empty
-\let\m_font_class_fallbacks\empty
-\let\m_font_class_goodies \empty
-
-\let\m_font_direction\empty
-\let\m_font_features \empty
-\let\m_font_fallbacks\empty
-\let\m_font_goodies \empty
-
-\appendtoks % can be analyzed once
- % why here ..
- %\edef\m_font_class_direction{\ifcsname\??fontclass\fontclass\s!mm\s!direction\endcsname\csname\??fontclass\fontclass\s!mm\s!direction\endcsname\fi}%
- \edef\m_font_class_direction{\begincsname\??fontclass\fontclass\s!mm\s!direction\endcsname}%
- % ...
- \ifx\m_font_class_direction\v!both
- \settrue\c_font_bidirectional_mathstrategy
- \else
- \setfalse\c_font_bidirectional_mathstrategy
- \fi
-\to \t_font_math_strategies
-
-\def\font_helpers_bidirectional_mathstrategy_yes
- {\font_helpers_set_math_family\c_font_fam_mr_lr\s!mrlr
- \font_helpers_set_math_family\c_font_fam_mr_rl\s!mrrl
- \ifnum\fontid\textfont\c_font_fam_mr=\fontid\textfont\c_font_fam_mr_lr\else
- \font_helpers_bidirectional_mathstrategy_yes_changed
- \fi}
-
-\def\font_helpers_bidirectional_mathstrategy_yes_changed
- {\textfont \c_font_fam_mr\textfont \c_font_fam_mr_lr
- \scriptfont \c_font_fam_mr\scriptfont \c_font_fam_mr_lr
- \scriptscriptfont\c_font_fam_mr\scriptscriptfont\c_font_fam_mr_lr}
-
-\def\font_helpers_bidirectional_mathstrategy_nop
- {\font_helpers_set_math_family\c_font_fam_mr\s!mr
- \ifnum\fontid\textfont\c_font_fam_mr_rl=\fontid\textfont\c_font_fam_mr\else
- \font_helpers_bidirectional_mathstrategy_nop_changed
- \fi}
-
-\def\font_helpers_bidirectional_mathstrategy_nop_changed
- {\textfont \c_font_fam_mr_lr\textfont \c_font_fam_mr
- \scriptfont \c_font_fam_mr_lr\scriptfont \c_font_fam_mr
- \scriptscriptfont\c_font_fam_mr_lr\scriptscriptfont\c_font_fam_mr
- \textfont \c_font_fam_mr_rl\textfont \c_font_fam_mr
- \scriptfont \c_font_fam_mr_rl\scriptfont \c_font_fam_mr
- \scriptscriptfont\c_font_fam_mr_rl\scriptscriptfont\c_font_fam_mr}
-
-\appendtoks
- \ifconditional\c_font_bidirectional_mathstrategy
- \font_helpers_bidirectional_mathstrategy_yes
- \else
- \font_helpers_bidirectional_mathstrategy_nop
- \fi
-\to \t_font_math_strategies
-
-\def\font_helpers_complete_bold_mathstrategy_yes_bidi
- {\font_helpers_set_math_family_bold\c_font_fam_mb_lr\s!mblr\c_font_fam_mr_lr
- \font_helpers_set_math_family_bold\c_font_fam_mb_rl\s!mbrl\c_font_fam_mr_rl
- \ifnum\fontid\textfont\c_font_fam_mb=\fontid\textfont\c_font_fam_mb_lr\else
- \font_helpers_complete_bold_mathstrategy_yes_bidi_changed
- \fi}
-
-\def\font_helpers_complete_bold_mathstrategy_yes_bidi_changed
- {\textfont \c_font_fam_mb\textfont \c_font_fam_mb_lr
- \scriptfont \c_font_fam_mb\scriptfont \c_font_fam_mb_lr
- \scriptscriptfont\c_font_fam_mb\scriptscriptfont\c_font_fam_mb_lr}
-
-\def\font_helpers_complete_bold_mathstrategy_yes
- {\font_helpers_set_math_family_bold\c_font_fam_mb\s!mb\c_font_fam_mr\relax
- \ifnum\fontid\textfont\c_font_fam_mb_rl=\fontid\textfont\c_font_fam_mb\else
- \font_helpers_complete_bold_mathstrategy_yes_changed
- \fi}
-
-\def\font_helpers_complete_bold_mathstrategy_yes_changed
- {\textfont \c_font_fam_mb_rl\textfont \c_font_fam_mb
- \scriptfont \c_font_fam_mb_rl\scriptfont \c_font_fam_mb
- \scriptscriptfont\c_font_fam_mb_rl\scriptscriptfont\c_font_fam_mb
- \textfont \c_font_fam_mb_lr\textfont \c_font_fam_mb
- \scriptfont \c_font_fam_mb_lr\scriptfont \c_font_fam_mb
- \scriptscriptfont\c_font_fam_mb_lr\scriptscriptfont\c_font_fam_mb}
-
-\def\font_helpers_complete_bold_mathstrategy_nop
- {\ifnum\fontid\textfont\c_font_fam_mb=\fontid\textfont\c_font_fam_mr\else
- \font_helpers_complete_bold_mathstrategy_nop_changed
- \fi}
-
-\def\font_helpers_complete_bold_mathstrategy_nop_changed
- {\textfont \c_font_fam_mb \textfont \c_font_fam_mr
- \scriptfont \c_font_fam_mb \scriptfont \c_font_fam_mr
- \scriptscriptfont\c_font_fam_mb \scriptscriptfont\c_font_fam_mr
- \textfont \c_font_fam_mb_lr\textfont \c_font_fam_mr_lr
- \scriptfont \c_font_fam_mb_lr\scriptfont \c_font_fam_mr_lr
- \scriptscriptfont\c_font_fam_mb_lr\scriptscriptfont\c_font_fam_mr_lr
- \textfont \c_font_fam_mb_rl\textfont \c_font_fam_mr_rl
- \scriptfont \c_font_fam_mb_rl\scriptfont \c_font_fam_mr_rl
- \scriptscriptfont\c_font_fam_mb_rl\scriptscriptfont\c_font_fam_mr_rl}
-
-\def\font_helpers_apply_complete_bold_mathstrategy
- {\ifconditional\c_font_complete_bold_mathstrategy
- \ifconditional\c_font_bidirectional_mathstrategy
- \font_helpers_complete_bold_mathstrategy_yes_bidi
- \else
- \font_helpers_complete_bold_mathstrategy_yes
- \fi
- \else
- \font_helpers_complete_bold_mathstrategy_nop
- \fi}
-
-\appendtoks
- \font_helpers_apply_complete_bold_mathstrategy
-\to \t_font_math_strategies
-
-\ifdefined\defaultmathfamily \else
- \setnewconstant\defaultmathfamily\zerocount
-\fi
-
-\appendtoks
- \fam\defaultmathfamily % all characters and symbols are in this family
-\to \everymathematics
-
-\unexpanded\def\font_helpers_synchronize_math_family_mr
- {\attribute\mathfamilyattribute\ifconditional\c_font_bidirectional_mathstrategy
- \ifconditional\c_math_right_to_left
- \plustwo
- \else
- \plusone
- \fi
- \else
- \zerocount
- \fi}
-
-\unexpanded\def\font_helpers_synchronize_math_family_mb
- {\attribute\mathfamilyattribute\ifconditional\c_font_bidirectional_mathstrategy
- \ifconditional\c_math_right_to_left
- \ifconditional\c_font_pseudo_bold_math_state\pluseight\else\plusfive\fi
- \else
- \ifconditional\c_font_pseudo_bold_math_state\plusseven\else\plusfour\fi
- \fi
- \else
- \ifconditional\c_font_pseudo_bold_math_state\plussix\else\plusthree\fi
- \fi}
-
-\installcorenamespace{fontmathsynchronizer}
-\installcorenamespace{fontmathstoredstrategy}
-
-\letvalue{\??fontmathsynchronizer\s!tf }\font_helpers_synchronize_math_family_mr
-\letvalue{\??fontmathsynchronizer\s!sl }\font_helpers_synchronize_math_family_mr
-\letvalue{\??fontmathsynchronizer\s!it }\font_helpers_synchronize_math_family_mr
-\letvalue{\??fontmathsynchronizer\s!bf }\font_helpers_synchronize_math_family_mb
-\letvalue{\??fontmathsynchronizer\s!bs }\font_helpers_synchronize_math_family_mb
-\letvalue{\??fontmathsynchronizer\s!bi }\font_helpers_synchronize_math_family_mb
-\letvalue{\??fontmathsynchronizer\empty}\font_helpers_synchronize_math_family_mr
-
-% \def\font_helpers_synchronize_math_family
-% {\csname\??fontmathsynchronizer\ifcsname\??fontmathsynchronizer\fontalternative\endcsname\fontalternative\fi\endcsname}
-
-\def\font_helpers_synchronize_math_family
- {\ifcsname\??fontmathsynchronizer\fontalternative\endcsname
- \lastnamedcs
- \else
- \font_helpers_synchronize_math_family_mr
- \fi}
-
-\ifdefined \fontid % we need to keep this test for a while
- \appendtoks
- \ifnum\fontid\textfont\zerocount=\fontid\textfont\plusthree
- \letvalue{\??fontmathstoredstrategy\fontclass}\font_helpers_set_math_partial_bold_strategy
- \else
- \letvalue{\??fontmathstoredstrategy\fontclass}\font_helpers_set_math_full_bold_strategy
- \fi
- \to \t_font_math_strategies
-\else
- \appendtoks
- \edef\currentmathfontmr{\fontname\textfont\zerocount}%
- \edef\currentmathfontmb{\fontname\textfont\plusthree}%
- \ifx\currentmathfontmr\currentmathfontmb
- \letvalue{\??fontmathstoredstrategy\fontclass}\font_helpers_set_math_partial_bold_strategy
- \else
- \letvalue{\??fontmathstoredstrategy\fontclass}\font_helpers_set_math_full_bold_strategy
- \fi
- \to \t_font_math_strategies
-\fi
-
-%def\font_helpers_synchronize_math_bold_strategy{\csname\??fontmathstoredstrategy\fontclass\endcsname}
-\def\font_helpers_synchronize_math_bold_strategy{\begincsname\??fontmathstoredstrategy\fontclass\endcsname}
-
-\newconditional\c_font_pseudo_bold_math_state
-
-\def\font_helpers_set_math_partial_bold_strategy{\settrue \c_font_pseudo_bold_math_state}
-\def\font_helpers_set_math_full_bold_strategy {\setfalse\c_font_pseudo_bold_math_state}
-
-\appendtoks
- \font_helpers_synchronize_math_bold_strategy
-\to \everymathematics
-
-%D Bold is somewhat special as we might want both full-bold-math mixed regular-math,
-%D as well as automatic adaption to outer bold (in titles and inline text bold) so
-%D we will need explicit switches as well as an automatic one. (We will use lucida
-%D as an example.)
-
-\ifdefined\mathdefault \else \let\mathdefault\relax \fi
-
-\newconditional\c_math_bold
-
-\unexpanded\def\mr % math regular
- {\ifmmode
- \font_helpers_synchronize_math_family_mr
- \else
- \font_helpers_set_current_font_alternative\s!mr
- \fi
- \mathdefault
- \setfalse\c_math_bold}
-
-\unexpanded\def\mb % math bold
- {\ifmmode
- \font_helpers_synchronize_math_family_mb
- \else
- \font_helpers_set_current_font_alternative\s!mb
- \fi
- \mathdefault
- \settrue\c_math_bold}
-
-\appendtoks
- \font_helpers_synchronize_math_family % auto bold
-\to \everymathematics
-
-\appendtoks
- \ifconditional\c_math_bold\mb\fi
-\to \everymathematics
-
-%D \macros
-%D {bigmath,nobigmath}
-%D
-%D We can inhibit this slow||downer with:
-
-% these can best be combined
-
-% 0=never 1=everymath 2=always
-
-\setnewconstant\synchronizebigmathflag\plusone
-
-\appendtoks
- \ifcase\synchronizebigmathflag
- % never
- \or
- \synchronizebigmath
- \or
- % always
- \fi
-\to \everymathematics
-
-\unexpanded\def\nobigmath {\synchronizebigmathflag\zerocount}
-\unexpanded\def\autobigmath{\synchronizebigmathflag\plusone\synchronizebigmath}
-\unexpanded\def\bigmath {\synchronizebigmathflag\plustwo\synchronizebigmath}
-
-\let\bigmathfontsize\empty
-
-\unexpanded\def\synchronizebigmath
- {\ifx\bigmathfontsize\fontsize
- % already in sync
- \else
- \let\bigmathfontsize\fontsize
- \font_helpers_synchronize_math
- \fi}
-
-\unexpanded\def\font_helpers_check_big_math_synchronization
- {\ifcase\synchronizebigmathflag
- % never
- \or
- \ifmmode \synchronizebigmath \fi
- \or
- \synchronizebigmath
- \fi}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-mat.mkvi b/Master/texmf-dist/tex/context/base/mkiv/font-mat.mkvi
index 64810d3272a..594475808b7 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-mat.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-mat.mkvi
@@ -344,7 +344,7 @@
\to \everymathematics
\unexpanded\def\font_helpers_synchronize_math_family_mr
- {\attribute\mathfamilyattribute\ifconditional\c_font_bidirectional_mathstrategy
+ {\c_attr_mathfamily\ifconditional\c_font_bidirectional_mathstrategy
\ifconditional\c_math_right_to_left
\plustwo
\else
@@ -355,7 +355,7 @@
\fi}
\unexpanded\def\font_helpers_synchronize_math_family_mb
- {\attribute\mathfamilyattribute\ifconditional\c_font_bidirectional_mathstrategy
+ {\c_attr_mathfamily\ifconditional\c_font_bidirectional_mathstrategy
\ifconditional\c_math_right_to_left
\ifconditional\c_font_pseudo_bold_math_state\pluseight\else\plusfive\fi
\else
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-mis.lua b/Master/texmf-dist/tex/context/base/mkiv/font-mis.lua
index fe972114f47..18120f524a0 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-mis.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-mis.lua
@@ -21,7 +21,7 @@ local readers = otf.readers
if readers then
- otf.version = otf.version or 3.111
+ otf.version = otf.version or 3.113
otf.cache = otf.cache or containers.define("fonts", "otl", otf.version, true)
function fonts.helpers.getfeatures(name,save)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-nod.lua b/Master/texmf-dist/tex/context/base/mkiv/font-nod.lua
index 8c0f6e441a7..ed307e7c531 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-nod.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-nod.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['font-nod'] = {
version = 1.001,
+ optimize = true,
comment = "companion to font-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
@@ -18,7 +19,6 @@ local match, rep = string.match, string.rep
fonts = fonts or { }
nodes = nodes or { }
-
local fonts = fonts
local nodes = nodes
local context = context
@@ -39,9 +39,6 @@ local tonode = nuts.tonode
local injections = nodes.injections or { }
nodes.injections = injections
-local char_tracers = tracers.characters or { }
-tracers.characters = char_tracers
-
local step_tracers = tracers.steppers or { }
tracers.steppers = step_tracers
@@ -54,7 +51,7 @@ local disc_code = nodecodes.disc
local glue_code = nodecodes.glue
local kern_code = nodecodes.kern
local dir_code = nodecodes.dir
-local localpar_code = nodecodes.localpar
+local par_code = nodecodes.par
local getnext = nuts.getnext
local getprev = nuts.getprev
@@ -111,135 +108,9 @@ local function freeze(h,where)
end
end
-function char_tracers.collect(head,list,tag,n)
- n = n or 0
- local ok = false
- local fn = nil
- while head do
- local char, id = isglyph(head)
- if char then
- local font = id
- if font ~= fn then
- ok, fn = false, font
- end
- if not ok then
- ok = true
- n = n + 1
- list[n] = list[n] or { }
- list[n][tag] = { }
- end
- local l = list[n][tag]
- -- l[#l+1] = { char, font, i }
- l[#l+1] = { char, font }
- elseif id == disc_code then
- -- skip
- -- local pre, post, replace = getdisc(head)
- -- if replace then
- -- for n in nextglyph, replace do
- -- l[#l+1] = { c, f }
- -- end
- -- end
- -- if pre then
- -- for n in nextglyph, pre do
- -- l[#l+1] = { c, f }
- -- end
- -- end
- -- if post then
- -- for n in nextglyph, post do
- -- l[#l+1] = { c, f }
- -- end
- -- end
- else
- ok = false
- end
- head = getnext(head)
- end
-end
-
-function char_tracers.equal(ta, tb)
- if #ta ~= #tb then
- return false
- else
- for i=1,#ta do
- local a = ta[i]
- local b = tb[i]
- -- if a[1] ~= b[1] or a[2] ~= b[2] or a[3] ~= b[3] then
- if a[1] ~= b[1] or a[2] ~= b[2] then
- return false
- end
- end
- end
- return true
-end
-
-function char_tracers.string(t)
- local tt = { }
- for i=1,#t do
- tt[i] = utfchar(t[i][1])
- end
- return concat(tt,"")
-end
-
local f_unicode = formatters["%U"]
local f_badcode = formatters["{%i}"]
-function char_tracers.unicodes(t,decimal)
- local tt = { }
- for i=1,#t do
- local n = t[i][1]
- if n == 0 then
- tt[i] = "-"
- elseif decimal then
- tt[i] = n
- else
- tt[i] = f_unicode(n)
- end
- end
- return concat(tt," ")
-end
-
--- function char_tracers.indices(t,decimal)
--- local tt = { }
--- for i=1,#t do
--- local n = t[i][3]
--- if n == 0 then
--- tt[i] = "-"
--- elseif decimal then
--- tt[i] = n
--- else
--- tt[i] = f_unicode(n)
--- end
--- end
--- return concat(tt," ")
--- end
-
-function char_tracers.start()
- local npc = handlers.characters -- should accept nuts too
- local list = { }
- function handlers.characters(head)
- local n = #list
- char_tracers.collect(head,list,'before',n)
- head = npc(head) -- for the moment tonode
- char_tracers.collect(head,list,'after',n)
- if #list > n then
- list[#list+1] = { }
- end
- return head
- end
- function char_tracers.stop()
- tracers.list['characters'] = list
- 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)
- handlers.characters = npc
- tasks.restart("processors", "characters")
- end
- tasks.restart("processors", "characters")
-end
-
local stack = { }
function tracers.start(tag)
@@ -293,7 +164,6 @@ function step_tracers.glyphs(n,i)
end
function step_tracers.features()
- -- we cannot use first_glyph here as it only finds characters with subtype < 256
local f = collection[1]
for n, char, font in nextglyph, f do
local tfmdata = fontidentifiers[font]
@@ -396,7 +266,7 @@ function step_tracers.codes(i,command,space)
local char, id = isglyph(c)
if char then
showchar(char,id)
- elseif id == dir_code or (id == localpar_code and start_of_par(c)) then
+ elseif id == dir_code or (id == par_code and start_of_par(c)) then
context("[%s]",getdirection(c) or "?")
elseif id == disc_code then
local pre, post, replace = getdisc(c)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-ocl.lua b/Master/texmf-dist/tex/context/base/mkiv/font-ocl.lua
index 1890e5ec54e..e6a38af5c3e 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-ocl.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-ocl.lua
@@ -8,10 +8,6 @@ if not modules then modules = { } end modules ['font-ocl'] = {
-- todo : user list of colors
-if CONTEXTLMTXMODE and CONTEXTLMTXMODE > 0 then
- return
-end
-
local tostring, tonumber, next = tostring, tonumber, next
local round, max = math.round, math.round
local gsub, find = string.gsub, string.find
@@ -151,85 +147,17 @@ local function convert(t,k)
return v
end
-local start = { "pdf", "mode", "font" } -- force text mode (so get q Q right)
------ stop = { "pdf", "mode", "page" } -- force page mode (else overlap)
-local push = { "pdf", "page", "q" }
-local pop = { "pdf", "page", "Q" }
-
--- -- This one results in color directives inside BT ET but has less q Q pairs. It
--- -- only shows the first glyph in acrobat and nothing more. No problem with other
--- -- renderers.
---
--- local function initializeoverlay(tfmdata,kind,value) -- hm, always value
--- if value then
--- local resources = tfmdata.resources
--- local palettes = resources.colorpalettes
--- if palettes then
--- --
--- local converted = resources.converted
--- if not converted then
--- converted = setmetatableindex(convert)
--- resources.converted = converted
--- end
--- local colorvalues = sharedpalettes[value] or converted[palettes[tonumber(value) or 1] or palettes[1]] or { }
--- local classes = #colorvalues
--- if classes == 0 then
--- return
--- end
--- --
--- local characters = tfmdata.characters
--- local descriptions = tfmdata.descriptions
--- local properties = tfmdata.properties
--- --
--- properties.virtualized = true
--- tfmdata.fonts = {
--- { id = 0 }
--- }
--- --
--- local getactualtext = otf.getactualtext
--- local default = colorvalues[#colorvalues]
--- local b, e = getactualtext(tounicode(0xFFFD))
--- local actualb = { "pdf", "page", b } -- saves tables
--- local actuale = { "pdf", "page", e } -- saves tables
--- --
--- for unicode, character in next, characters do
--- local description = descriptions[unicode]
--- if description then
--- local colorlist = description.colors
--- if colorlist then
--- local u = description.unicode or characters[unicode].unicode
--- local w = character.width or 0
--- local s = #colorlist
--- local goback = w ~= 0 and leftcommand[w] or nil -- needs checking: are widths the same
--- local t = {
--- start,
--- not u and actualb or { "pdf", "page", (getactualtext(tounicode(u))) },
--- push,
--- }
--- local n = 3
--- local l = nil
--- for i=1,s do
--- local entry = colorlist[i]
--- local v = colorvalues[entry.class] or default
--- if v and l ~= v then
--- n = n + 1 t[n] = v
--- l = v
--- end
--- n = n + 1 t[n] = charcommand[entry.slot]
--- if s > 1 and i < s and goback then
--- n = n + 1 t[n] = goback
--- end
--- end
--- n = n + 1 t[n] = pop
--- n = n + 1 t[n] = actuale
--- n = n + 1 t[n] = stop
--- character.commands = t
--- end
--- end
--- end
--- end
--- end
--- end
+-- At some point 'font' mode was added to the engine and we can assume that most distributions
+-- ship a luatex that has it; ancient versions are no longer supported anyway. Begin 2020 there
+-- was an actualtext related mail exchange with RM etc. that might result in similar mode keys
+-- in other tex->pdf programs because there is a bit of inconsistency in the way this is dealt
+-- with. Best is not to touch this code too much.
+
+local mode = { "pdf", "mode", "font" }
+local push = { "pdf", "page", "q" }
+local pop = { "pdf", "page", "Q" }
+
+-- see context git repository for older variant (pre 20200501 cleanup)
local function initializeoverlay(tfmdata,kind,value)
if value then
@@ -278,10 +206,11 @@ local function initializeoverlay(tfmdata,kind,value)
local s = #colorlist
local goback = w ~= 0 and leftcommand[w] or nil -- needs checking: are widths the same
local t = {
+ mode,
not u and actualb or { "pdf", "page", (getactualtext(tounicode(u))) },
push,
}
- local n = 2
+ local n = 3
local l = nil
for i=1,s do
local entry = colorlist[i]
@@ -436,7 +365,7 @@ do
local savedata = io.savedata
local remove = os.remove
- if context and xml.convert then
+if context then
local xmlconvert = xml.convert
local xmlfirst = xml.first
@@ -451,13 +380,13 @@ do
return data
end
- else
+else
function otfsvg.filterglyph(entry,index) -- can be overloaded
return entry.data
end
- end
+end
local runner = sandbox and sandbox.registerrunner {
name = "otfsvg",
@@ -484,6 +413,16 @@ do
-- Because a generic setup can be flawed we need to catch bad inkscape runs which add a bit of
-- ugly overhead. Bah.
+ local new = nil
+
+ local function inkscapeformat(suffix)
+ if new == nil then
+ new = os.resultof("inkscape --version") or ""
+ new = new == "" or not find(new,"Inkscape%s*0")
+ end
+ return new and "filename" or suffix
+ end
+
function otfsvg.topdf(svgshapes,tfmdata)
local pdfshapes = { }
local inkscape = runner()
@@ -493,7 +432,7 @@ do
local nofshapes = #svgshapes
local f_svgfile = formatters["temp-otf-svg-shape-%i.svg"]
local f_pdffile = formatters["temp-otf-svg-shape-%i.pdf"]
- local f_convert = formatters["%s --export-pdf=%s\n"]
+ local f_convert = formatters["%s --export-%s=%s\n"]
local filterglyph = otfsvg.filterglyph
local nofdone = 0
local processed = { }
@@ -507,7 +446,7 @@ do
local svgfile = f_svgfile(index)
local pdffile = f_pdffile(index)
savedata(svgfile,data)
- inkscape:write(f_convert(svgfile,pdffile))
+ inkscape:write(f_convert(svgfile,inkscapeformat("pdf"),pdffile))
processed[index] = true
nofdone = nofdone + 1
if nofdone % 25 == 0 then
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-ocm.lua b/Master/texmf-dist/tex/context/base/mkiv/font-ocm.lua
new file mode 100644
index 00000000000..2f6c29e65d8
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-ocm.lua
@@ -0,0 +1,874 @@
+if not modules then modules = { } end modules ['font-ocm'] = {
+ version = 1.001,
+ comment = "companion to font-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+if not context then
+ return
+elseif CONTEXTLMTXMODE and CONTEXTLMTXMODE > 0 then
+ return
+else
+ -- Maybe I'll also make a generic variant but for now I just test this in
+ -- MkIV. After all, color fonts are not that much used (and generic is for
+ -- serious looking articles and books and not for fancy documents using
+ -- emoji.) Below is a quick and dirty implementation. Also, it looks like
+ -- these features were never used outside context anyway (in spite of being
+ -- in generic).
+end
+
+local tostring, tonumber, next = tostring, tonumber, next
+local round, max = math.round, math.round
+local sortedkeys, sortedhash, concat = table.sortedkeys, table.sortedhash, table.concat
+local setmetatableindex = table.setmetatableindex
+local formatters = string.formatters
+
+local otf = fonts.handlers.otf
+local otfregister = otf.features.register
+local bpfactor = number.dimenfactors.bp
+local typethree = { }
+
+callback.register("provide_charproc_data",function(action,f,...)
+ local registered = typethree[f]
+ if registered then
+ return registered(action,f,...)
+ else
+ return 0, 0 -- this will also disable further calls
+ end
+end)
+
+local defaults = {
+ [1] = function() return 0, 0 end,
+ [2] = function() return 0, 0 end,
+ [3] = function() return 0.001, "" end,
+}
+
+local function registeractions(t)
+ return {
+ [1] = t.preroll or defaults[1],
+ [2] = t.collect or defaults[2],
+ [3] = t.wrapup or defaults[3],
+ }
+end
+
+local function registertypethreeresource(specification,n,o)
+ specification.usedobjects["X"..n] = lpdf.reference(o)
+end
+
+local function registertypethreefont(specification,n,o)
+ specification.usedfonts["F"..n] = lpdf.reference(o)
+end
+
+local function typethreeresources(specification)
+ local usedobjects = specification.usedobjects
+ local usedfonts = specification.usedfonts
+ local resources = { }
+ if next(usedobjects) then
+ resources[#resources+1] = "/XObject << " .. usedobjects() .. " >>"
+ end
+ if next(usedfonts) then
+ resources[#resources+1] = "/Font << " .. usedfonts() .. " >>"
+ end
+ -- resources[#resources+1] = lpdf.collectedresources()
+ specification.usedfonts = nil
+ specification.usedobjects = nil
+ return concat(resources, " ")
+end
+
+local function registerfont(specification,actions)
+ specification.usedfonts = lpdf.dictionary()
+ specification.usedobjects = lpdf.dictionary()
+ typethree[specification.id] = function(action,f,c)
+ return actions[action](specification,f,c)
+ end
+end
+
+fonts.handlers.typethree = {
+ register = function(id,handler)
+ -- needed for manual
+ if not typethree[id] then
+ logs.report("fonts","low level Type3 handler registered for font with id %i",id)
+ typethree[id] = handler
+ end
+ end
+}
+
+local initializeoverlay do
+
+ local f_color = formatters["%.3f %.3f %.3f rg"]
+ local f_gray = formatters["%.3f g"]
+ local sharedpalettes = { }
+ local colors = attributes.list[attributes.private('color')] or { }
+ local transparencies = attributes.list[attributes.private('transparency')] or { }
+
+ function otf.registerpalette(name,values)
+ sharedpalettes[name] = values
+ local color = lpdf.color
+ local transparency = lpdf.transparency
+ local register = colors.register
+ for i=1,#values do
+ local v = values[i]
+ if v == "textcolor" then
+ values[i] = false
+ else
+ local c = nil
+ local t = nil
+ if type(v) == "table" then
+ c = register(name,"rgb",
+ max(round((v.r or 0)*255),255)/255,
+ max(round((v.g or 0)*255),255)/255,
+ max(round((v.b or 0)*255),255)/255
+ )
+ else
+ c = colors[v]
+ t = transparencies[v]
+ end
+ if c and t then
+ values[i] = color(1,c) .. " " .. transparency(t)
+ elseif c then
+ values[i] = color(1,c)
+ elseif t then
+ values[i] = color(1,t)
+ end
+ end
+ end
+ end
+
+ local function convert(t,k)
+ local v = { }
+ for i=1,#k do
+ local p = k[i]
+ local r, g, b = p[1], p[2], p[3]
+ if r == g and g == b then
+ v[i] = f_gray(r/255)
+ else
+ v[i] = f_color(r/255,g/255,b/255)
+ end
+ end
+ t[k] = v
+ return v
+ end
+
+ -- This is by no means watertight (the id mess) especially because we
+ -- don't know it yet. Instead we can just assemble here and avoid the
+ -- box approach. I might do that (so then we need to pass fonts and
+ -- extra resource entries.
+
+ local f_stream = formatters["%s 0 d0 %s 0 0 %s 0 %s cm /X%i Do"]
+ local fontorder = 0
+ local actions = registeractions {
+
+ preroll = function(specification,f,c)
+ local data = specification.delegated[c]
+ local colorlist = data.colorlist
+ local colorvalues = specification.colorvalues
+ local default = specification.default
+ local mainid = specification.mainid
+ local t = { "\\typethreefont{", mainid, "}" }
+ local n = 3
+ local l = nil
+ local m = #colorlist
+ for i=1,m do
+ local entry = colorlist[i]
+ local v = colorvalues[entry.class] or default
+ if v and l ~= v then
+ n = n + 1 ; t[n] = "\\typethreecode{"
+ n = n + 1 ; t[n] = v
+ n = n + 1 ; t[n] = "}"
+ l = v
+ end
+ if i < m then
+ n = n + 1 ; t[n] = "\\typethreechar{"
+ else
+ n = n + 1 ; t[n] = "\\typethreelast{"
+ end
+ n = n + 1 ; t[n] = entry.slot
+ n = n + 1 ; t[n] = "}"
+ end
+ token.set_macro("typethreemacro",concat(t))
+ tex.runlocal("typethreetoks")
+ registertypethreeresource(specification,c,tex.saveboxresource(0,nil,lpdf.collectedresources(),true))
+ -- registertypethreefont(specification,mainid,lpdf.reference(lpdf.getfontobjnumber(mainid)))
+ return 0, 0
+ end,
+
+ collect = function(specification,f,c)
+ local parameters = specification.parameters
+ local data = specification.delegated[c]
+ local factor = parameters.hfactor
+ local units = parameters.units
+ local width = (data.width or 0) / factor
+ local scale = 100
+ local factor = units * bpfactor -- / scale
+ local depth = (data.depth or 0)*factor
+ local shift = - depth / (10*units/1000)
+ local object = pdf.immediateobj("stream",f_stream(width,scale,scale,shift,c))
+ return object, width
+ end,
+
+ wrapup = function(specification,f)
+ return 0.001, typethreeresources(specification)
+ end,
+
+ }
+
+ local function register(specification)
+ registerfont(specification,actions)
+ end
+
+ initializeoverlay = function(tfmdata,kind,value)
+ if value then
+ local resources = tfmdata.resources
+ local palettes = resources.colorpalettes
+ if palettes then
+ local converted = resources.converted
+ if not converted then
+ converted = setmetatableindex(convert)
+ resources.converted = converted
+ end
+ local colorvalues = sharedpalettes[value]
+ local default = false -- so the text color (bad for icon overloads)
+ if colorvalues then
+ default = colorvalues[#colorvalues]
+ else
+ colorvalues = converted[palettes[tonumber(value) or 1] or palettes[1]] or { }
+ end
+ local classes = #colorvalues
+ if classes == 0 then
+ return
+ end
+ --
+ local characters = tfmdata.characters
+ local descriptions = tfmdata.descriptions
+ local properties = tfmdata.properties
+ local parameters = tfmdata.parameters
+ --
+ properties.virtualized = true
+ --
+ local delegated = { }
+ local index = 0
+ local fonts = tfmdata.fonts or { }
+ local fontindex = #fonts + 1
+ tfmdata.fonts = fonts
+
+ local function flush()
+ if index > 0 then
+ fontorder = fontorder + 1
+ local f = {
+ characters = delegated,
+ parameters = parameters,
+ tounicode = true,
+ format = "type3",
+ name = "InternalTypeThreeFont" , -- .. fontorder,
+ psname = "none",
+ }
+ fonts[fontindex] = {
+ id = font.define(f),
+ delegated = delegated,
+ parameters = parameters,
+ colorvalues = colorvalues,
+ default = default,
+ }
+ end
+ fontindex = fontindex + 1
+ index = 0
+ delegated = { }
+ end
+
+ for unicode, character in sortedhash(characters) do
+ local description = descriptions[unicode]
+ if description then
+ local colorlist = description.colors
+ if colorlist then
+ if index == 255 then
+ flush()
+ end
+ index = index + 1
+ delegated[index] = {
+ width = character.width,
+ height = character.height,
+ depth = character.depth,
+ tounicode = character.tounicode,
+ colorlist = colorlist,
+ }
+ character.commands = {
+ { "slot", fontindex, index },
+ }
+ end
+ end
+ end
+
+ flush()
+ local mainid = font.nextid()
+ for i=1,#fonts do
+ local f = fonts[i]
+ if f.delegated then
+ f.mainid = mainid
+ register(f)
+ end
+ end
+
+ return true
+ end
+ end
+ end
+
+ otfregister {
+ name = "colr",
+ description = "color glyphs",
+ manipulators = {
+ base = initializeoverlay,
+ node = initializeoverlay,
+ }
+ }
+
+end
+
+do
+
+ local nofstreams = 0
+ local f_name = formatters[ [[pdf-glyph-%05i]] ]
+ local f_used = context and formatters[ [[original:///%s]] ] or formatters[ [[%s]] ]
+ local hashed = { }
+ local cache = { }
+
+ local openpdf = pdfe.new
+
+ function otf.storepdfdata(pdf)
+ if pdf then
+ local done = hashed[pdf]
+ if not done then
+ nofstreams = nofstreams + 1
+ local f = f_name(nofstreams)
+ local n = openpdf(pdf,#pdf,f)
+ done = f_used(n)
+ hashed[pdf] = done
+ end
+ return done
+ end
+ end
+
+end
+
+local pdftovirtual do
+
+ local f_stream = formatters["%s 0 d0 %s 0 0 %s %s %s cm /X%i Do"]
+ local fontorder = 0
+ local shared = { }
+ local actions = registeractions {
+
+ preroll = function(specification,f,c)
+ return 0, 0
+ end,
+
+ collect = function(specification,f,c)
+ local parameters = specification.parameters
+ local data = specification.delegated[c]
+ local desdata = data.desdata
+ local pdfdata = data.pdfdata
+ local width = desdata.width or 0
+ local height = desdata.height or 0
+ local depth = desdata.depth or 0
+ local factor = parameters.hfactor
+ local units = parameters.units
+ local typ = type(pdfdata)
+
+ local dx = 0
+ local dy = 0
+ local scale = 1
+
+ if typ == "table" then
+ data = pdfdata.data
+ dx = pdfdata.x or pdfdata.dx or 0
+ dy = pdfdata.y or pdfdata.dy or 0
+ scale = pdfdata.scale or 1
+ elseif typ == "string" then
+ data = pdfdata
+ dx = 0
+ dy = 0
+ else
+ return 0, 0
+ end
+
+ if not data then
+ return 0, 0
+ end
+
+ local name = otf.storepdfdata(data)
+ local xform = shared[name]
+
+ if not xform then
+ xform = images.embed(images.create { filename = name })
+ shared[name] = xform
+ end
+
+ registertypethreeresource(specification,c,xform.objnum)
+
+ scale = scale * (width / (xform.width * bpfactor))
+ dy = - depth + dy
+-- dx = 0
+-- dy = 0
+ local object = pdf.immediateobj("stream",f_stream(width,scale,scale,dx,dy,c)), width
+
+ return object, width
+ end,
+
+ wrapup = function(specification,f)
+ return 1/specification.parameters.units, typethreeresources(specification)
+ end,
+
+ }
+
+ local function register(specification)
+ registerfont(specification,actions)
+ end
+
+ pdftovirtual = function(tfmdata,pdfshapes,kind) -- kind = png|svg
+ if not tfmdata or not pdfshapes or not kind then
+ return
+ end
+ --
+ local characters = tfmdata.characters
+ local descriptions = tfmdata.descriptions
+ local properties = tfmdata.properties
+ local parameters = tfmdata.parameters
+ local hfactor = parameters.hfactor
+ --
+ properties.virtualized = true
+ --
+ local storepdfdata = otf.storepdfdata
+ --
+ local delegated = { }
+ local index = 0
+ local fonts = tfmdata.fonts or { }
+ local fontindex = #fonts + 1
+ tfmdata.fonts = fonts
+
+ local function flush()
+ if index > 0 then
+ fontorder = fontorder + 1
+ local f = {
+ characters = delegated,
+ parameters = parameters,
+ tounicode = true,
+ format = "type3",
+ name = "InternalTypeThreeFont" .. fontorder,
+ psname = "none",
+ size = parameters.size,
+ }
+ fonts[fontindex] = {
+ id = font.define(f),
+ delegated = delegated,
+ parameters = parameters,
+ }
+ end
+ fontindex = fontindex + 1
+ index = 0
+ delegated = { }
+ end
+
+ for unicode, character in sortedhash(characters) do
+ local idx = character.index
+ if idx then
+ local pdfdata = pdfshapes[idx]
+ local description = descriptions[unicode]
+ if pdfdata and description then
+ if index == 255 then
+ flush()
+ end
+ index = index + 1
+ delegated[index] = {
+ desdata = description,
+ width = character.width,
+ height = character.width,
+ depth = character.width,
+ tounicode = character.tounicode,
+ pdfdata = pdfdata,
+ }
+ character.commands = {
+ { "slot", fontindex, index },
+ }
+ end
+ end
+ end
+ --
+ flush()
+ local mainid = font.nextid()
+ for i=1,#fonts do
+ local f = fonts[i]
+ if f.delegated then
+ f.mainid = mainid
+ register(f)
+ end
+ end
+ --
+ end
+
+end
+
+local initializesvg do
+
+ local otfsvg = otf.svg or { }
+ otf.svg = otfsvg
+ otf.svgenabled = true
+
+ local report_svg = logs.reporter("fonts","svg conversion")
+
+ local loaddata = io.loaddata
+ local savedata = io.savedata
+ local remove = os.remove
+
+ local xmlconvert = xml.convert
+ local xmlfirst = xml.first
+
+ function otfsvg.filterglyph(entry,index)
+ local d = entry.data
+ if gzip.compressed(d) then
+ d = gzip.decompress(d) or d
+ end
+ local svg = xmlconvert(d)
+ local root = svg and xmlfirst(svg,"/svg[@id='glyph"..index.."']")
+ local data = root and tostring(root)
+ return data
+ end
+
+ local runner = sandbox and sandbox.registerrunner {
+ name = "otfsvg",
+ program = "inkscape",
+ method = "pipeto",
+ template = "--export-area-drawing --shell > temp-otf-svg-shape.log",
+ reporter = report_svg,
+ }
+
+ if not runner then
+ --
+ -- poor mans variant for generic:
+ --
+ runner = function()
+ return io.popen("inkscape --export-area-drawing --shell > temp-otf-svg-shape.log","w")
+ end
+ end
+
+ -- There are svg out there with bad viewBox specifications where shapes lay outside that area,
+ -- but trying to correct that didn't work out well enough so I discarded that code. BTW, we
+ -- decouple the inskape run and the loading run because inkscape is working in the background
+ -- in the files so we need to have unique files.
+ --
+ -- Because a generic setup can be flawed we need to catch bad inkscape runs which add a bit of
+ -- ugly overhead. Bah.
+
+ local new = nil
+
+ local function inkscapeformat(suffix)
+ if new == nil then
+ new = os.resultof("inkscape --version") or ""
+ new = new == "" or not find(new,"Inkscape%s*0")
+ end
+ return new and "filename" or suffix
+ end
+
+ function otfsvg.topdf(svgshapes,tfmdata)
+ local pdfshapes = { }
+ local inkscape = runner()
+ if inkscape then
+ -- local indices = fonts.getindices(tfmdata)
+ local descriptions = tfmdata.descriptions
+ local nofshapes = #svgshapes
+ local f_svgfile = formatters["temp-otf-svg-shape-%i.svg"]
+ local f_pdffile = formatters["temp-otf-svg-shape-%i.pdf"]
+ local f_convert = formatters["%s --export-%s=%s\n"]
+ local filterglyph = otfsvg.filterglyph
+ local nofdone = 0
+ local processed = { }
+ report_svg("processing %i svg containers",nofshapes)
+ statistics.starttiming()
+ for i=1,nofshapes do
+ local entry = svgshapes[i]
+ for index=entry.first,entry.last do
+ local data = filterglyph(entry,index)
+ if data and data ~= "" then
+ local svgfile = f_svgfile(index)
+ local pdffile = f_pdffile(index)
+ savedata(svgfile,data)
+ inkscape:write(f_convert(svgfile,inkscapeformat("pdf"),pdffile))
+ processed[index] = true
+ nofdone = nofdone + 1
+ if nofdone % 25 == 0 then
+ report_svg("%i shapes submitted",nofdone)
+ end
+ end
+ end
+ end
+ if nofdone % 25 ~= 0 then
+ report_svg("%i shapes submitted",nofdone)
+ end
+ report_svg("processing can be going on for a while")
+ inkscape:write("quit\n")
+ inkscape:close()
+ report_svg("processing %i pdf results",nofshapes)
+ for index in next, processed do
+ local svgfile = f_svgfile(index)
+ local pdffile = f_pdffile(index)
+ -- local fntdata = descriptions[indices[index]]
+ -- local bounds = fntdata and fntdata.boundingbox
+ local pdfdata = loaddata(pdffile)
+ if pdfdata and pdfdata ~= "" then
+ pdfshapes[index] = {
+ data = pdfdata,
+ -- x = bounds and bounds[1] or 0,
+ -- y = bounds and bounds[2] or 0,
+ }
+ end
+ remove(svgfile)
+ remove(pdffile)
+ end
+ local characters = tfmdata.characters
+ for k, v in next, characters do
+ local d = descriptions[k]
+ local i = d.index
+ if i then
+ local p = pdfshapes[i]
+ if p then
+ local w = d.width
+ local l = d.boundingbox[1]
+ local r = d.boundingbox[3]
+ p.scale = (r - l) / w
+ p.x = l
+ end
+ end
+ end
+ if not next(pdfshapes) then
+ report_svg("there are no converted shapes, fix your setup")
+ end
+ statistics.stoptiming()
+ if statistics.elapsedseconds then
+ report_svg("svg conversion time %s",statistics.elapsedseconds() or "-")
+ end
+ end
+ return pdfshapes
+ end
+
+ initializesvg = function(tfmdata,kind,value) -- hm, always value
+ if value and otf.svgenabled then
+ local svg = tfmdata.properties.svg
+ local hash = svg and svg.hash
+ local timestamp = svg and svg.timestamp
+ if not hash then
+ return
+ end
+ local pdffile = containers.read(otf.pdfcache,hash)
+ local pdfshapes = pdffile and pdffile.pdfshapes
+ if not pdfshapes or pdffile.timestamp ~= timestamp or not next(pdfshapes) then
+ -- the next test tries to catch errors in generic usage but of course can result
+ -- in running again and again
+ local svgfile = containers.read(otf.svgcache,hash)
+ local svgshapes = svgfile and svgfile.svgshapes
+ pdfshapes = svgshapes and otfsvg.topdf(svgshapes,tfmdata,otf.pdfcache.writable,hash) or { }
+ containers.write(otf.pdfcache, hash, {
+ pdfshapes = pdfshapes,
+ timestamp = timestamp,
+ })
+ end
+ pdftovirtual(tfmdata,pdfshapes,"svg")
+ return true
+ end
+ end
+
+ otfregister {
+ name = "svg",
+ description = "svg glyphs",
+ manipulators = {
+ base = initializesvg,
+ node = initializesvg,
+ }
+ }
+
+end
+
+-- This can be done differently e.g. with ffi and gm and we can share code anway. Using
+-- batchmode in gm is not faster and as it accumulates we would need to flush all
+-- individual shapes. But ... in context lmtx (and maybe the backport) we will use
+-- a different and more efficient method anyway. I'm still wondering if I should
+-- keep color code in generic. Maybe it should be optional.
+
+local initializepng do
+
+ local otfpng = otf.png or { }
+ otf.png = otfpng
+ otf.pngenabled = true
+
+ local report_png = logs.reporter("fonts","png conversion")
+
+ local loaddata = io.loaddata
+ local savedata = io.savedata
+ local remove = os.remove
+
+ local runner = sandbox and sandbox.registerrunner {
+ name = "otfpng",
+ program = "gm",
+ template = "convert -quality 100 temp-otf-png-shape.png temp-otf-png-shape.pdf > temp-otf-svg-shape.log",
+ -- reporter = report_png,
+ }
+
+ if not runner then
+ --
+ -- poor mans variant for generic:
+ --
+ runner = function()
+ return os.execute("gm convert -quality 100 temp-otf-png-shape.png temp-otf-png-shape.pdf > temp-otf-svg-shape.log")
+ end
+ end
+
+ -- Alternatively we can create a single pdf file with -adjoin and then pick up pages from
+ -- that file but creating thousands of small files is no fun either.
+
+ local files = utilities.files
+ local openfile = files.open
+ local closefile = files.close
+ local setposition = files.setposition
+ local readstring = files.readstring
+
+ function otfpng.topdf(pngshapes,filename)
+ if pngshapes and filename then
+ local pdfshapes = { }
+ local pngfile = "temp-otf-png-shape.png"
+ local pdffile = "temp-otf-png-shape.pdf"
+ local nofdone = 0
+ local indices = sortedkeys(pngshapes) -- can be sparse
+ local nofindices = #indices
+ report_png("processing %i png containers",nofindices)
+ statistics.starttiming()
+ local filehandle = openfile(filename)
+ for i=1,nofindices do
+ local index = indices[i]
+ local entry = pngshapes[index]
+ -- local data = entry.data -- or placeholder
+ local offset = entry.o
+ local size = entry.s
+ local x = entry.x
+ local y = entry.y
+ local data = nil
+ if offset and size then
+ setposition(filehandle,offset)
+ data = readstring(filehandle,size)
+ savedata(pngfile,data)
+ runner()
+ data = loaddata(pdffile)
+ end
+ pdfshapes[index] = {
+-- x = x ~= 0 and x or nil,
+-- y = y ~= 0 and y or nil,
+ data = data,
+ }
+ nofdone = nofdone + 1
+ if nofdone % 100 == 0 then
+ report_png("%i shapes processed",nofdone)
+ end
+ end
+ closefile(filehandle)
+ report_png("processing %i pdf results",nofindices)
+ remove(pngfile)
+ remove(pdffile)
+ statistics.stoptiming()
+ if statistics.elapsedseconds then
+ report_png("png conversion time %s",statistics.elapsedseconds() or "-")
+ end
+ return pdfshapes
+ end
+ end
+
+ initializepng = function(tfmdata,kind,value) -- hm, always value
+ if value and otf.pngenabled then
+ local png = tfmdata.properties.png
+ local hash = png and png.hash
+ local timestamp = png and png.timestamp
+ if not hash then
+ return
+ end
+ local pdffile = containers.read(otf.pdfcache,hash)
+ local pdfshapes = pdffile and pdffile.pdfshapes
+ if not pdfshapes or pdffile.timestamp ~= timestamp then
+ local pngfile = containers.read(otf.pngcache,hash)
+ local filename = tfmdata.resources.filename
+ local pngshapes = pngfile and pngfile.pngshapes
+ pdfshapes = pngshapes and otfpng.topdf(pngshapes,filename) or { }
+ containers.write(otf.pdfcache, hash, {
+ pdfshapes = pdfshapes,
+ timestamp = timestamp,
+ })
+ end
+ --
+ pdftovirtual(tfmdata,pdfshapes,"png")
+ return true
+ end
+ end
+
+ otfregister {
+ name = "sbix",
+ description = "sbix glyphs",
+ manipulators = {
+ base = initializepng,
+ node = initializepng,
+ }
+ }
+
+ otfregister {
+ name = "cblc",
+ description = "cblc glyphs",
+ manipulators = {
+ base = initializepng,
+ node = initializepng,
+ }
+ }
+
+end
+
+do
+
+ local function initializecolor(tfmdata,kind,value)
+ if value == "auto" then
+ return
+ initializeoverlay(tfmdata,kind,value) or
+ initializesvg (tfmdata,kind,value) or
+ initializepng (tfmdata,kind,value)
+ elseif value == "overlay" then
+ return initializeoverlay(tfmdata,kind,value)
+ elseif value == "svg" then
+ return initializesvg(tfmdata,kind,value)
+ elseif value == "png" or value == "bitmap" then
+ return initializepng(tfmdata,kind,value)
+ else
+ -- forget about it
+ end
+ end
+
+ otfregister {
+ name = "color",
+ description = "color glyphs",
+ manipulators = {
+ base = initializecolor,
+ node = initializecolor,
+ }
+ }
+
+end
+
+-- Old stuff:
+
+do
+
+ local startactualtext = nil
+ local stopactualtext = nil
+
+ function otf.getactualtext(s)
+ if not startactualtext then
+ startactualtext = backends.codeinjections.startunicodetoactualtextdirect
+ stopactualtext = backends.codeinjections.stopunicodetoactualtextdirect
+ end
+ return startactualtext(s), stopactualtext()
+ end
+
+end
+
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-ogr.lua b/Master/texmf-dist/tex/context/base/mkiv/font-ogr.lua
deleted file mode 100644
index 94cf9149401..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/font-ogr.lua
+++ /dev/null
@@ -1,672 +0,0 @@
-if not modules then modules = { } end modules ['font-ogr'] = {
- 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"
-}
-
--- Here we deal with graphic variants and for now also color support ends up here
--- but that might change. It's lmtx only code.
-
-if not context then
- return
-elseif CONTEXTLMTXMODE == 0 then
- return
-end
-
-local tostring, tonumber, next, type = tostring, tonumber, next, type
-local round, max, mod, div = math.round, math.max, math.mod, math.div
-local find = string.find
-local concat, setmetatableindex, sortedhash = table.concat, table.setmetatableindex, table.sortedhash
-local utfbyte = utf.byte
-local formatters = string.formatters
-local settings_to_hash_strict, settings_to_array = utilities.parsers.settings_to_hash_strict, utilities.parsers.settings_to_array
-
-local otf = fonts.handlers.otf
-local otfregister = otf.features.register
-otf.svgenabled = true
-otf.pngenabled = true
-
--- Just to remind me ... rewritten around the time this was posted on YT which
--- was also around the 2019 ctx meeting:
---
--- Gavin Harrison - "Threatening War" by The Pineapple Thief
--- https://www.youtube.com/watch?v=ENF9wth4kwM
-
--- todo: svg color plugin
--- todo: get rid of double cm in svg (tricky as also elsewhere)
--- todo: png offsets (depth)
--- todo: maybe collapse indices so that we have less files (harder to debug)
--- todo: manage (read: assign) font id's in lua so we know in advance
-
--- what here and what in backend ...
-
-do
-
- -- This is a prelude to something better but I'm still experimenting.
-
- local dropins = { }
- fonts.dropins = dropins
- local droppedin = 0
- local identifiers = fonts.hashes.identifiers
-
- function dropins.nextid()
- droppedin = droppedin - 1
- return droppedin
- end
-
- -- todo: pass specification table instead
-
- function dropins.provide(method,t_tfmdata,indexdata,...)
- local droppedin = dropins.nextid()
- local t_characters = t_tfmdata.characters
- local t_descriptions = t_tfmdata.descriptions
- local t_properties = t_tfmdata.properties
- local d_tfmdata = setmetatableindex({ },t_tfmdata)
- local d_properties = setmetatableindex({ },t_properties)
- d_tfmdata.properties = d_properties
- local d_characters = { } -- setmetatableindex({ },t_characters) -- hm, index vs unicode
- local d_descriptions = { } -- setmetatableindex({ },t_descriptions) -- hm, index vs unicode
- d_tfmdata.characters = d_characters
- d_tfmdata.descriptions = d_descriptions
- d_properties.instance = - droppedin -- will become an extra element in the hash
- t_properties.virtualized = true
- identifiers[droppedin] = d_tfmdata
- local fonts = t_tfmdata.fonts or { }
- t_tfmdata.fonts = fonts
- d_properties.format = "type3"
- d_properties.method = method
- d_properties.indexdata = { indexdata, ... } -- can take quite some memory
- local slot = #fonts + 1
- fonts[slot] = { id = droppedin }
- return slot, droppedin, d_tfmdata, d_properties
- end
-
- -- todo: delay this, in which case we can be leaner and meaner
-
- function dropins.clone(method,tfmdata,shapes,...) -- by index
- if method and shapes then
- local characters = tfmdata.characters
- local descriptions = tfmdata.descriptions
- local droppedin, tfmdrop, dropchars, dropdescs, colrshapes
- local idx = 255
- local slot = 0
- for k, v in next, characters do
- local index = v.index
- if index then
- local description = descriptions[k]
- if description then
- local shape = shapes[index]
- if shape then
- if idx >= 255 then
- idx = 1
- colrshapes = setmetatableindex({ },shapes)
- slot, droppedin, tfmdrop = dropins.provide(method,tfmdata,colrshapes)
- dropchars = tfmdrop.characters
- dropdescs = tfmdrop.descriptions
- else
- idx = idx + 1
- end
- colrshapes[idx] = shape -- so not: description
- -- todo: prepend
- v.commands = { { "slot", slot, idx } }
- -- hack to prevent that type 3 also gets 'use' flags .. todo
- local c = { commands = false, index = idx, dropin = tfmdrop }
- local d = { } -- { index = idx, dropin = tfmdrop }
- setmetatableindex(c,v)
- setmetatableindex(d,description)
- dropchars[idx] = c
- dropdescs[idx] = d -- not needed
- end
- end
- end
- end
- else
- -- error
- end
- end
-
- function dropins.swap(method,tfmdata,shapes,...) -- by unicode
- if method and shapes then
- local characters = tfmdata.characters
- local descriptions = tfmdata.descriptions
- local droppedin, tfmdrop, dropchars, dropdescs, colrshapes
- local idx = 255
- local slot = 0
- -- we can have a variant where shaped are by unicode and not by index
- for k, v in next, characters do
- local description = descriptions[k]
- if description then
- local shape = shapes[k]
- if shape then
- if idx >= 255 then
- idx = 1
- colrshapes = setmetatableindex({ },shapes)
- slot, droppedin, tfmdrop = dropins.provide(method,tfmdata,colrshapes)
- dropchars = tfmdrop.characters
- dropdescs = tfmdrop.descriptions
- else
- idx = idx + 1
- end
- colrshapes[idx] = shape -- so not: description
- -- todo: prepend
- v.commands = { { "slot", slot, idx } }
- -- hack to prevent that type 3 also gets 'use' flags .. todo
- local c = { commands = false, index = idx, dropin = tfmdrop }
- local d = { } -- index = idx, dropin = tfmdrop }
- setmetatableindex(c,v)
- setmetatableindex(d,description)
- dropchars[idx] = c
- dropdescs[idx] = d -- not needed
- end
- end
- end
- else
- -- error
- end
- end
-
-end
-
-do -- this will move to its own module
-
- local dropins = fonts.dropins
-
- local shapes = setmetatableindex(function(t,k)
- local v = {
- glyphs = { },
- parameters = {
- units = 1000
- },
- }
- t[k] = v
- return v
- end)
-
- function dropins.registerglyphs(parameters)
- local category = parameters.name
- local target = shapes[category].parameters
- for k, v in next, parameters do
- if k ~= "glyphs" then
- target[k] = v
- end
- end
- end
-
- function dropins.registerglyph(parameters)
- local category = parameters.category
- local unicode = parameters.unicode
- local private = parameters.private
- local unichar = parameters.unichar
- if private then
- unicode = fonts.helpers.newprivateslot(private)
- elseif type(unichar) == "string" then
- unicode = utfbyte(unichar)
- else
- local unitype = type(unicode)
- if unitype == "string" then
- local uninumber = tonumber(unicode)
- if uninumber then
- unicode = round(uninumber)
- else
- unicode = utfbyte(unicode)
- end
- elseif unitype == "number" then
- unicode = round(unicode)
- end
- end
- if unicode then
- parameters.unicode = unicode
- -- print(category,unicode)
- shapes[category].glyphs[unicode] = parameters
- else
- -- error
- end
- end
-
- -- local function hascolorspec(t)
- -- if (t.color or "") ~= "" then
- -- return true
- -- elseif (t.fillcolor or "") ~= "" then
- -- return true
- -- elseif (t.drawcolor or "") ~= "" then
- -- return true
- -- elseif (t.linecolor or "") ~= "" then
- -- return true
- -- else
- -- return false
- -- end
- -- end
-
- local function hascolorspec(t)
- for k, v in next, t do
- if find(k,"color") then
- return true
- end
- end
- return false
- end
-
- local function initializemps(tfmdata,kind,value)
- if value then
- local specification = settings_to_hash_strict(value)
- if not specification or not next(specification) then
- specification = { category = value }
- end
- -- todo: multiple categories but then maybe also different
- -- clones because of the units .. for now we assume the same
- -- units
- local category = specification.category
- if category and category ~= "" then
- local categories = settings_to_array(category)
- local usedshapes = nil
- local index = 0
- local spread = tonumber(specification.spread or 0)
- local hascolor = hascolorspec(specification)
- specification.spread = spread -- now a number
- for i=1,#categories do
- local category = categories[i]
- local mpsshapes = shapes[category]
- if mpsshapes then
- local properties = tfmdata.properties
- local parameters = tfmdata.parameters
- local characters = tfmdata.characters
- local descriptions = tfmdata.descriptions
- local mpsparameters = mpsshapes.parameters
- local units = mpsparameters.units or 1000
- local defaultwidth = mpsparameters.width or 0
- local defaultheight = mpsparameters.height or 0
- local defaultdepth = mpsparameters.depth or 0
- local usecolor = mpsparameters.usecolor
- local spread = spread * units
- local defaultcode = mpsparameters.code or ""
- local scale = parameters.size / units
- if hascolor then
- -- the graphic has color
- usecolor = false
- else
- -- do whatever is specified
- end
- usedshapes = usedshapes or {
- instance = "simplefun",
- units = units,
- usecolor = usecolor,
- specification = specification,
- shapes = mpsshapes,
- }
- -- todo: deal with extensibles and more properties
- for unicode, shape in sortedhash(mpsshapes.glyphs) do
- -- local oldc = characters[unicode]
- -- if oldc then
- index = index + 1 -- todo: somehow we end up with 2 as first entry after 0
- local wd = shape.width or defaultwidth
- local ht = shape.height or defaultheight
- local dp = shape.depth or defaultdepth
- local newc = {
- index = index, -- into usedshapes
- width = scale * (wd + spread),
- height = scale * ht,
- depth = scale * dp,
- unicode = unicode,
- }
- --
- characters [unicode] = newc
- descriptions[unicode] = newc
- --
- usedshapes[unicode] = shape.code or defaultcode
- -- end
- end
- end
- end
- if usedshapes then
- -- todo: different font when units and usecolor changes, maybe move into loop
- -- above
- dropins.swap("mps",tfmdata,usedshapes)
- end
- end
- end
- end
-
- -- This kicks in quite late, after features have been checked. So if needed
- -- substitutions need to be defined with force.
-
- otfregister {
- name = "metapost",
- description = "metapost glyphs",
- manipulators = {
- base = initializemps,
- node = initializemps,
- }
- }
-
-end
-
--- This sits here for historcal reasons so for now we keep it here.
-
-local startactualtext = nil
-local stopactualtext = nil
-
-function otf.getactualtext(s)
- if not startactualtext then
- startactualtext = backends.codeinjections.startunicodetoactualtextdirect
- stopactualtext = backends.codeinjections.stopunicodetoactualtextdirect
- end
- return startactualtext(s), stopactualtext()
-end
-
--- This is also somewhat specific.
-
-local sharedpalettes do
-
- sharedpalettes = { }
-
- local colors = attributes.list[attributes.private('color')] or { }
- local transparencies = attributes.list[attributes.private('transparency')] or { }
-
- function otf.registerpalette(name,values)
- sharedpalettes[name] = values
- local color = lpdf.color
- local transparency = lpdf.transparency
- local register = colors.register
- for i=1,#values do
- local v = values[i]
- if v == "textcolor" then
- values[i] = false
- else
- local c = nil
- local t = nil
- if type(v) == "table" then
- c = register(name,"rgb",
- max(round((v.r or 0)*255),255)/255,
- max(round((v.g or 0)*255),255)/255,
- max(round((v.b or 0)*255),255)/255
- )
- else
- c = colors[v]
- t = transparencies[v]
- end
- if c and t then
- values[i] = color(1,c) .. " " .. transparency(t)
- elseif c then
- values[i] = color(1,c)
- elseif t then
- values[i] = color(1,t)
- end
- end
- end
- end
-
-end
-
-local initializeoverlay do
-
- -- we should use the proper interface instead but for now:
-
- local colors = attributes.colors
- local rgbtocmyk = colors.rgbtocmyk
-
- local f_cmyk = formatters["%.3N %.3f %.3N %.3N k"]
- local f_rgb = formatters["%.3N %.3f %.3N rg"]
- local f_gray = formatters["%.3N g"]
-
- local function convert(t,k)
- local v = { }
- local m = colors.model
- for i=1,#k do
- local p = k[i]
- local r, g, b = p[1]/255, p[2]/255, p[3]/255
- if r == g and g == b then
- p = f_gray(r)
- elseif m == "cmyk" then
- p = f_cmyk(rgbtocmyk(r,g,b))
- else
- p = f_rgb(r,g,b)
- end
- v[i] = p
- end
- t[k] = v
- return v
- end
-
- initializeoverlay = function(tfmdata,kind,value) -- we really need the id ... todo
- if value then
- local resources = tfmdata.resources
- local palettes = resources.colorpalettes
- if palettes then
- --
- local converted = resources.converted
- if not converted then
- converted = setmetatableindex(convert)
- resources.converted = converted
- end
- local colorvalues = sharedpalettes[value]
- local default = false -- so the text color (bad for icon overloads)
- if colorvalues then
- default = colorvalues[#colorvalues]
- else
- colorvalues = converted[palettes[tonumber(value) or 1] or palettes[1]] or { }
- end
- local classes = #colorvalues
- if classes == 0 then
- return
- end
- --
- local characters = tfmdata.characters
- local descriptions = tfmdata.descriptions
- local droppedin, tfmdrop, dropchars, dropdescs, colrshapes
- local idx = 255
- local slot = 0
- --
- -- maybe delay in which case we have less fonts as we can be sparse
- --
- for k, v in next, characters do
- local index = v.index
- if index then
- local description = descriptions[k]
- if description then
- local colorlist = description.colors
- if colorlist then
- if idx >= 255 then
- idx = 1
- colrshapes = { }
- slot, droppedin, tfmdrop = fonts.dropins.provide("color",tfmdata,colrshapes,colorvalues)
- dropchars = tfmdrop.characters
- dropdescs = tfmdrop.descriptions
- else
- idx = idx + 1
- end
- --
- colrshapes[idx] = description
- -- todo: use extender
- local u = { "use", 0 }
- for i=1,#colorlist do
- u[i+2] = colorlist[i].slot
- end
- v.commands = { u, { "slot", slot, idx } }
- -- hack to prevent that type 3 also gets 'use' flags .. todo
- local c = { commands = false, index = idx, dropin = tfmdata }
- local d = { } -- index = idx, dropin = tfmdrop
- setmetatableindex(c,v)
- setmetatableindex(d,description)
- dropchars[idx] = c
- dropdescs[idx] = d -- not needed
- end
- end
- end
- end
- return true
- end
- end
- end
-
- fonts.handlers.otf.features.register {
- name = "colr",
- description = "color glyphs",
- manipulators = {
- base = initializeoverlay,
- node = initializeoverlay,
- }
- }
-
-end
-
-local initializesvg do
-
- local report_svg = logs.reporter("fonts","svg")
-
- local cached = true -- maybe always false (after i've optimized the lot)
-
- directives.register("fonts.svg.cached", function(v) cached = v end)
-
- initializesvg = function(tfmdata,kind,value) -- hm, always value
- if value then
- local properties = tfmdata.properties
- local svg = properties.svg
- local hash = svg and svg.hash
- local timestamp = svg and svg.timestamp
- if not hash then
- return
- end
- local shapes = nil
- local method = nil
- local enforce = attributes.colors.model == "cmyk"
- if cached and not enforce then
- -- we need a different hash than for mkiv, so we append:
- local pdfhash = hash .. "-svg"
- local pdffile = containers.read(otf.pdfcache,pdfhash)
- local pdfshapes = pdffile and pdffile.pdfshapes
- local pdftarget = file.join(otf.pdfcache.writable,file.addsuffix(pdfhash,"pdf"))
- if not pdfshapes or pdffile.timestamp ~= timestamp or not next(pdfshapes) or not lfs.isfile(pdftarget) then
- local svgfile = containers.read(otf.svgcache,hash)
- local svgshapes = svgfile and svgfile.svgshapes
- pdfshapes = svgshapes and metapost.svgshapestopdf(svgshapes,pdftarget,report_svg,tfmdata.parameters.units) or { }
- -- look at ocl: we should store scale and x and y
- containers.write(otf.pdfcache, pdfhash, {
- pdfshapes = pdfshapes,
- timestamp = timestamp,
- })
- end
- shapes = pdfshapes
- method = "pdf"
- else
- local mpsfile = containers.read(otf.mpscache,hash)
- local mpsshapes = mpsfile and mpsfile.mpsshapes
- if not mpsshapes or mpsfile.timestamp ~= timestamp or not next(mpsshapes) then
- local svgfile = containers.read(otf.svgcache,hash)
- local svgshapes = svgfile and svgfile.svgshapes
- -- still suboptimal
- mpsshapes = svgshapes and metapost.svgshapestomp(svgshapes,report_svg,tfmdata.parameters.units) or { }
- if enforce then
- -- cheap conversion, no black component generation
- mpsshapes.preamble = "interim svgforcecmyk := 1;"
- end
- containers.write(otf.mpscache, hash, {
- mpsshapes = mpsshapes,
- timestamp = timestamp,
- })
- end
- shapes = mpsshapes
- method = "mps"
- end
- if shapes then
- shapes.fixdepth = value == "fixdepth"
- fonts.dropins.clone(method,tfmdata,shapes)
- end
- return true
- end
- end
-
- otfregister {
- name = "svg",
- description = "svg glyphs",
- manipulators = {
- base = initializesvg,
- node = initializesvg,
- }
- }
-
-end
-
-local initializepng do
-
- -- If this is really critical we can also use a pdf file as cache but I don't expect
- -- png fonts to remain used.
-
- local colors = attributes.colors
-
- local report_png = logs.reporter("fonts","png conversion")
-
- initializepng = function(tfmdata,kind,value) -- hm, always value
- if value then
- local properties = tfmdata.properties
- local png = properties.png
- local hash = png and png.hash
- local timestamp = png and png.timestamp
- if not hash then
- return
- end
- local pngfile = containers.read(otf.pngcache,hash)
- local pngshapes = pngfile and pngfile.pngshapes
- if pngshapes then
- if colors.model == "cmyk" then
- pngshapes.enforcecmyk = true
- end
- fonts.dropins.clone("png",tfmdata,pngshapes)
- end
- return true
- end
- end
-
- otfregister {
- name = "sbix",
- description = "sbix glyphs",
- manipulators = {
- base = initializepng,
- node = initializepng,
- }
- }
-
- otfregister {
- name = "cblc",
- description = "cblc glyphs",
- manipulators = {
- base = initializepng,
- node = initializepng,
- }
- }
-
-end
-
-do
-
- -- I need to check jpeg and such but will do that when I run into
- -- it.
-
- local function initializecolor(tfmdata,kind,value)
- if value == "auto" then
- return
- initializeoverlay(tfmdata,kind,value) or
- initializesvg(tfmdata,kind,value) or
- initializepng(tfmdata,kind,value)
- elseif value == "overlay" then
- return initializeoverlay(tfmdata,kind,value)
- elseif value == "svg" then
- return initializesvg(tfmdata,kind,value)
- elseif value == "png" or value == "bitmap" then
- return initializepng(tfmdata,kind,value)
- else
- -- forget about it
- end
- end
-
- otfregister {
- name = "color",
- description = "color glyphs",
- manipulators = {
- base = initializecolor,
- node = initializecolor,
- }
- }
-
-end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-one.lua b/Master/texmf-dist/tex/context/base/mkiv/font-one.lua
index 5387516b4d5..829f52ea043 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-one.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-one.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['font-one'] = {
version = 1.001,
+ optimize = true,
comment = "companion to font-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
@@ -591,15 +592,18 @@ local function copytotfm(data)
parameters.descender = abs(metadata.descender or 0)
parameters.units = 1000
--
- properties.spacer = spacer
+ properties.spacer = spacer
+ properties.format = fonts.formats[filename] or "type1"
+ properties.filename = filename
+ properties.fontname = fontname
+ properties.fullname = fullname
+ properties.psname = fullname
+ properties.name = filename or fullname or fontname
+ properties.private = properties.private or data.private or privateoffset
+ --
+if not CONTEXTLMTXMODE or CONTEXTLMTXMODE == 0 then
properties.encodingbytes = 2
- properties.format = fonts.formats[filename] or "type1"
- properties.filename = filename
- properties.fontname = fontname
- properties.fullname = fullname
- properties.psname = fullname
- properties.name = filename or fullname or fontname
- properties.private = properties.private or data.private or privateoffset
+end
--
if next(characters) then
return {
@@ -723,6 +727,7 @@ local function read_from_afm(specification)
local tfmdata = afmtotfm(specification)
if tfmdata then
tfmdata.properties.name = specification.name
+ tfmdata.properties.id = specification.id
tfmdata = constructors.scale(tfmdata, specification)
local allfeatures = tfmdata.shared.features or specification.features.normal
constructors.applymanipulators("afm",tfmdata,allfeatures,trace_features,report_afm)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-onr.lua b/Master/texmf-dist/tex/context/base/mkiv/font-onr.lua
index fc6bead5889..c33b09f9e2a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-onr.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-onr.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['font-onr'] = {
version = 1.001,
+ optimize = true,
comment = "companion to font-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-ota.lua b/Master/texmf-dist/tex/context/base/mkiv/font-ota.lua
index 6cbf4bb86fe..ce1b22b50d7 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-ota.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-ota.lua
@@ -9,6 +9,7 @@ if not modules then modules = { } end modules ['font-ota'] = {
-- context only
local type = type
+local setmetatableindex = table.setmetatableindex
if not trackers then trackers = { register = function() end } end
@@ -285,7 +286,7 @@ if not classifiers then
local f_nko, l_nko = characters.blockrange("nko")
local f_ext_a, l_ext_a = characters.blockrange("arabicextendeda")
- classifiers = table.setmetatableindex(function(t,k)
+ classifiers = setmetatableindex(function(t,k)
if type(k) == "number" then
local c = chardata[k]
local v = false
@@ -461,6 +462,119 @@ methods.syrc = methods.arab
methods.mand = methods.arab
methods.nko = methods.arab
+-- a quick first attemp .. more later
+
+do
+
+ -- https://github.com/n8willis/opentype-shaping-documents/blob/master/opentype-shaping-mongolian.md#joining-properties
+ -- todo syrc
+
+ local joining = setmetatableindex(function(t,k)
+ if type(k) == "number" then
+ local c = chardata[k]
+ local v = false
+ if c then
+ local mongolian = c.mongolian
+ --
+ v = mongolian
+ end
+ t[k] = v
+ return v
+ end
+ end)
+
+ function methods.mong(head,font,attr)
+ local first, last
+ local current = head
+ local done = false
+ local prevjoin = nil
+ local prestate = nil
+ current = tonut(current)
+
+ local function wrapup()
+ if last then
+ if last ~= first then
+ local s = getstate(last)
+ if s == s_medi then
+ setstate(last,s_fina)
+ elseif s == s_init then
+ setstate(last,s_isol)
+ end
+ end
+ last = nil
+ first = nil
+ prevjoin = nil
+ prestate = nil
+ end
+ end
+
+ while current do
+ local char, id = ischar(current,font)
+ if char and not getstate(current) then
+ local currjoin = joining[char]
+ done = true
+ if not last then
+ setstate(current,s_isol)
+ prevjoin = currjoin
+ first = current
+ last = current
+ prevstate = s_isol
+ elseif currjoin == "t" then -- transparent
+ -- keep state
+ last = current
+ elseif prevjoin == "d" or prevjoin == "jc" or prevjoin == "l" then
+ if currjoin == "d" or prevjoin == "jc" or prevjoin == "r" then
+ local s = getstate(last)
+ if s == s_isol then
+ setstate(last,s_init)
+ elseif s == s_fina then
+ setstate(last,s_medi)
+ end
+ setstate(current,s_fina)
+ prevstate = s_fina
+ elseif prevjoin == "nj" or prevjoin == "l" then
+ local s = getstate(last)
+ if s == s_medi then
+ setstate(last,s_fina)
+ elseif s == s_init then
+ setstate(last,s_isol)
+ end
+ setstate(current,s_isol)
+ prevstate = s_isol
+ end
+ prevjoin = currjoin
+ last = current
+ elseif prevjoin == "nj" or prevjoin == "r" then
+ if s == s_medi then
+ setstate(last,s_fina)
+ elseif s == s_init then
+ setstate(last,s_isol)
+ end
+ setstate(current,s_isol)
+ prevjoin = currjoin
+ prevstate = s_isol
+ last = current
+ elseif last then
+ wrapup()
+ end
+ else
+ if last then
+ wrapup()
+ end
+ if id == math_code then -- a bit duplicate as we test for glyphs twice
+ current = end_of_math(current)
+ end
+ end
+ current = getnext(current)
+ end
+ if last then
+ wrapup()
+ end
+ return head, done
+ end
+
+end
+
directives.register("otf.analyze.useunicodemarks",function(v)
analyzers.useunicodemarks = v
end)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-otd.lua b/Master/texmf-dist/tex/context/base/mkiv/font-otd.lua
index 2633c6caec5..3f1b212dbb3 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-otd.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-otd.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['font-otd'] = {
version = 1.001,
+ optimize = true,
comment = "companion to font-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-otj.lua b/Master/texmf-dist/tex/context/base/mkiv/font-otj.lua
index 2e7878d3dfd..bb02044dca6 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-otj.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-otj.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['font-otj'] = {
version = 1.001,
+ optimize = true,
comment = "companion to font-lib.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
@@ -110,7 +111,7 @@ local properties = nodes.properties.data
local fontkern = nuts.pool and nuts.pool.fontkern -- context
local italickern = nuts.pool and nuts.pool.italickern -- context
-local useitalickerns = false
+local useitalickerns = false -- context only
directives.register("fonts.injections.useitalics", function(v)
if v then
@@ -119,7 +120,7 @@ directives.register("fonts.injections.useitalics", function(v)
useitalickerns = v
end)
-do if not fontkern then -- generic
+if not fontkern then -- generic
local thekern = nuts.new("kern",0) -- fontkern
local setkern = nuts.setkern
@@ -131,9 +132,9 @@ do if not fontkern then -- generic
return n
end
-end end
+end
-do if not italickern then -- generic
+if not italickern then -- generic
local thekern = nuts.new("kern",3) -- italiccorrection
local setkern = nuts.setkern
@@ -145,7 +146,7 @@ do if not italickern then -- generic
return n
end
-end end
+end
function injections.installnewkern() end -- obsolete
@@ -664,7 +665,15 @@ local function inject_kerns_only(head,where)
-- left|glyph|right
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- head = insert_node_before(head,current,fontkern(leftkern))
+ if prev and getid(prev) == glue_code then
+ if useitalickerns then
+ head = insert_node_before(head,current,italickern(leftkern))
+ else
+ setwidth(prev, getwidth(prev) + leftkern)
+ end
+ else
+ head = insert_node_before(head,current,fontkern(leftkern))
+ end
end
end
if prevdisc then
@@ -819,12 +828,26 @@ local function inject_positions_only(head,where)
if rightkern and leftkern == -rightkern then
setoffsets(current,leftkern,false)
rightkern = 0
+ elseif prev and getid(prev) == glue_code then
+ if useitalickerns then
+ head = insert_node_before(head,current,italickern(leftkern))
+ else
+ setwidth(prev, getwidth(prev) + leftkern)
+ end
else
head = insert_node_before(head,current,fontkern(leftkern))
end
end
if rightkern and rightkern ~= 0 then
- insert_node_after(head,current,fontkern(rightkern))
+ if next and getid(next) == glue_code then
+ if useitalickerns then
+ insert_node_after(head,current,italickern(rightkern))
+ else
+ setwidth(next, getwidth(next) + rightkern)
+ end
+ else
+ insert_node_after(head,current,fontkern(rightkern))
+ end
end
else
local i = p.emptyinjections
@@ -1270,12 +1293,26 @@ local function inject_everything(head,where)
if rightkern and leftkern == -rightkern then
setoffsets(current,leftkern,false)
rightkern = 0
+ elseif prev and getid(prev) == glue_code then
+ if useitalickerns then
+ head = insert_node_before(head,current,italickern(leftkern))
+ else
+ setwidth(prev, getwidth(prev) + leftkern)
+ end
else
head = insert_node_before(head,current,fontkern(leftkern))
end
end
if rightkern and rightkern ~= 0 then
- insert_node_after(head,current,fontkern(rightkern))
+ if next and getid(next) == glue_code then
+ if useitalickerns then
+ insert_node_after(head,current,italickern(rightkern))
+ else
+ setwidth(next, getwidth(next) + rightkern)
+ end
+ else
+ insert_node_after(head,current,fontkern(rightkern))
+ end
end
end
else
@@ -1518,7 +1555,7 @@ local function inject_everything(head,where)
end
--
if keepregisteredcounts then
- keepregisteredcounts = false
+ keepregisteredcounts = false
else
nofregisteredkerns = 0
nofregisteredpositions = 0
@@ -1707,16 +1744,18 @@ local function injectspaces(head)
if useitalickerns then
local new = rightkern * factor
if trace_spaces then
- report_spaces("%C [%p + %p]",nextchar,old,new)
+ report_spaces("[%p + %p] %C",old,new,nextchar)
end
insert_node_after(head,n,italickern(new))
else
local new = old + rightkern * factor
if trace_spaces then
- report_spaces("[%p -> %p] %C",nextchar,old,new)
+ report_spaces("[%p -> %p] %C",old,new,nextchar)
end
setwidth(n,new)
end
+ else
+ -- message
end
rightkern = false
end
@@ -1753,3 +1792,4 @@ function injections.handler(head,where)
return head
end
end
+
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-otl.lua b/Master/texmf-dist/tex/context/base/mkiv/font-otl.lua
index aff4cc8c8d9..8159db180d6 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-otl.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-otl.lua
@@ -52,7 +52,7 @@ local report_otf = logs.reporter("fonts","otf loading")
local fonts = fonts
local otf = fonts.handlers.otf
-otf.version = 3.111 -- beware: also sync font-mis.lua and in mtx-fonts
+otf.version = 3.113 -- beware: also sync font-mis.lua and in mtx-fonts
otf.cache = containers.define("fonts", "otl", otf.version, true)
otf.svgcache = containers.define("fonts", "svg", otf.version, true)
otf.pngcache = containers.define("fonts", "png", otf.version, true)
@@ -486,23 +486,26 @@ local function copytotfm(data,cache_id)
end
end
--
- parameters.designsize = (designsize/10)*65536
- parameters.minsize = (minsize /10)*65536
- parameters.maxsize = (maxsize /10)*65536
- parameters.ascender = abs(metadata.ascender or 0)
- parameters.descender = abs(metadata.descender or 0)
- parameters.units = units
- parameters.vheight = metadata.defaultvheight
+ parameters.designsize = (designsize/10)*65536
+ parameters.minsize = (minsize /10)*65536
+ parameters.maxsize = (maxsize /10)*65536
+ parameters.ascender = abs(metadata.ascender or 0)
+ parameters.descender = abs(metadata.descender or 0)
+ parameters.units = units
+ parameters.vheight = metadata.defaultvheight
--
- properties.space = spacer
+ properties.space = spacer
+ properties.format = data.format or formats.otf
+ properties.filename = filename
+ properties.fontname = fontname
+ properties.fullname = fullname
+ properties.psname = psname
+ properties.name = filename or fullname
+ properties.subfont = subfont
+ --
+if not CONTEXTLMTXMODE or CONTEXTLMTXMODE == 0 then
properties.encodingbytes = 2
- properties.format = data.format or formats.otf
- properties.filename = filename
- properties.fontname = fontname
- properties.fullname = fullname
- properties.psname = psname
- properties.name = filename or fullname
- properties.subfont = subfont
+end
--
-- properties.name = specification.name
-- properties.sub = specification.sub
@@ -605,6 +608,7 @@ local function read_from_otf(specification)
-- this late ? .. needs checking
tfmdata.properties.name = specification.name
tfmdata.properties.sub = specification.sub
+ tfmdata.properties.id = specification.id
--
tfmdata = constructors.scale(tfmdata,specification)
local allfeatures = tfmdata.shared.features or specification.features.normal
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-otr.lua b/Master/texmf-dist/tex/context/base/mkiv/font-otr.lua
index e726053202f..531f665de72 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-otr.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-otr.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['font-otr'] = {
version = 1.001,
+ optimize = true,
comment = "companion to font-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
@@ -2084,8 +2085,6 @@ local function readtable(tag,f,fontdata,specification,...)
end
end
-local variablefonts_supported = (context and true) or (logs and logs.application and true) or false
-
local function readdata(f,offset,specification)
local fontdata, tables = loadtables(f,specification,offset)
@@ -2094,12 +2093,6 @@ local function readdata(f,offset,specification)
prepareglyps(fontdata)
end
- if not variablefonts_supported then
- specification.instance = nil
- specification.variable = nil
- specification.factors = nil
- end
-
fontdata.temporary = { }
readtable("name",f,fontdata,specification)
@@ -2118,71 +2111,66 @@ local function readdata(f,offset,specification)
readtable("avar",f,fontdata,specification)
readtable("fvar",f,fontdata,specification)
- if variablefonts_supported then
-
- local variabledata = fontdata.variabledata
-
- if variabledata then
- local instances = variabledata.instances
- local axis = variabledata.axis
- if axis and (not instances or #instances == 0) then
- instances = { }
- variabledata.instances = instances
- local function add(n,subfamily,value)
- local values = { }
- for i=1,#axis do
- local a = axis[i]
- values[i] = {
- axis = a.tag,
- value = i == n and value or a.default,
- }
- end
- instances[#instances+1] = {
- subfamily = subfamily,
- values = values,
- }
- end
+ local variabledata = fontdata.variabledata
+
+ if variabledata then
+ local instances = variabledata.instances
+ local axis = variabledata.axis
+ if axis and (not instances or #instances == 0) then
+ instances = { }
+ variabledata.instances = instances
+ local function add(n,subfamily,value)
+ local values = { }
for i=1,#axis do
- local a = axis[i]
- local tag = a.tag
- add(i,"default"..tag,a.default)
- add(i,"minimum"..tag,a.minimum)
- add(i,"maximum"..tag,a.maximum)
+ local a = axis[i]
+ values[i] = {
+ axis = a.tag,
+ value = i == n and value or a.default,
+ }
end
- -- report("%i fake instances added",#instances)
+ instances[#instances+1] = {
+ subfamily = subfamily,
+ values = values,
+ }
end
- end
-
- if not specification.factors then
- local instance = specification.instance
- if type(instance) == "string" then
- local factors = helpers.getfactors(fontdata,instance)
- if factors then
- specification.factors = factors
- fontdata.factors = factors
- fontdata.instance = instance
- report("user instance: %s, factors: % t",instance,factors)
- else
- report("user instance: %s, bad factors",instance)
- end
+ for i=1,#axis do
+ local a = axis[i]
+ local tag = a.tag
+ add(i,"default"..tag,a.default)
+ add(i,"minimum"..tag,a.minimum)
+ add(i,"maximum"..tag,a.maximum)
end
+ -- report("%i fake instances added",#instances)
end
-
- if not fontdata.factors then
- if fontdata.variabledata then
- local factors = helpers.getfactors(fontdata,true)
- if factors then
- specification.factors = factors
- fontdata.factors = factors
- -- report("factors: % t",factors)
- -- else
- -- report("bad factors")
- end
+ end
+ if not specification.factors then
+ local instance = specification.instance
+ if type(instance) == "string" then
+ local factors = helpers.getfactors(fontdata,instance)
+ if factors then
+ specification.factors = factors
+ fontdata.factors = factors
+ fontdata.instance = instance
+ report("user instance: %s, factors: % t",instance,factors)
else
- -- report("unknown instance")
+ report("user instance: %s, bad factors",instance)
end
end
+ end
+ if not fontdata.factors then
+ if fontdata.variabledata then
+ local factors = helpers.getfactors(fontdata,true)
+ if factors then
+ specification.factors = factors
+ fontdata.factors = factors
+ -- report("factors: % t",factors)
+ -- else
+ -- report("bad factors")
+ end
+ else
+ -- report("unknown instance")
+ end
end
readtable("os/2",f,fontdata,specification)
@@ -2433,6 +2421,7 @@ function readers.loadfont(filename,n,instance)
hascolor = fontdata.hascolor or false,
instance = fontdata.instance,
factors = fontdata.factors,
+ nofsubfonts = fontdata.subfonts and #fontdata.subfonts or nil,
},
resources = {
-- filename = fontdata.filename,
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-ots.lua b/Master/texmf-dist/tex/context/base/mkiv/font-ots.lua
index f20a349eeb2..880bcb6d50a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-ots.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-ots.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['font-ots'] = { -- sequences
version = 1.001,
+ optimize = true,
comment = "companion to font-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
@@ -12,7 +13,7 @@ with plain <l n='tex'/> it has to be so. This module is part of <l n='context'/>
and discussion about improvements and functionality mostly happens on the
<l n='context'/> mailing list.</p>
-<p>The specification of OpenType is (or at least a decade ago was) kind of vague.
+<p>The specification of OpenType is (or at least decades ago was) kind of vague.
Apart from a lack of a proper free specifications there's also the problem that
Microsoft and Adobe may have their own interpretation of how and in what order to
apply features. In general the Microsoft website has more detailed specifications
@@ -25,7 +26,7 @@ effect that suddenly fonts behave differently. We don't want to catch all font
issues.</p>
<p>After a lot of experiments (mostly by Taco, me and Idris) the first implementation
-becaus quite useful. When it did most of what we wanted, a more optimized version
+was already quite useful. When it did most of what we wanted, a more optimized version
evolved. Of course all errors are mine and of course the code can be improved. There
are quite some optimizations going on here and processing speed is currently quite
acceptable and has been improved over time. Many complex scripts are not yet supported
@@ -217,6 +218,7 @@ local copy_only_glyphs = nuts.copy_only_glyphs
local count_components = nuts.count_components
local set_components = nuts.set_components
local get_components = nuts.get_components
+local flush_components = nuts.flush_components
---------------------------------------------------------------------------------------
@@ -250,7 +252,10 @@ local glue_code = nodecodes.glue
local disc_code = nodecodes.disc
local math_code = nodecodes.math
local dir_code = nodecodes.dir
-local localpar_code = nodecodes.localpar
+local par_code = nodecodes.par
+
+local lefttoright_code = nodes.dirvalues.lefttoright
+local righttoleft_code = nodes.dirvalues.righttoleft
local discretionarydisc_code = disccodes.discretionary
local ligatureglyph_code = glyphcodes.ligature
@@ -484,6 +489,7 @@ local function markstoligature(head,start,stop,char)
setsubtype(base,ligatureglyph_code)
set_components(base,start)
setlink(prev,base,next)
+ flush_components(start)
return head, base
end
end
@@ -496,9 +502,25 @@ end
-- in the not discfound branch then. We now have skiphash too so we can be more
-- selective if needed (todo).
+-- we can have more granularity here but for now we only do a simple check
+
+local no_left_ligature_code = 1
+local no_right_ligature_code = 2
+local no_left_kern_code = 4
+local no_right_kern_code = 8
+
+local has_glyph_option = node.direct.has_glyph_option or function(n,c)
+ if c == no_left_ligature_code or c == no_right_ligature_code then
+ return getattr(n,a_noligature) == 1
+ else
+ return false
+ end
+end
+
+-- in lmtx we need to check the components and can be slightly more clever
+
local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfound,hasmarks) -- brr head
- if getattr(start,a_noligature) == 1 then
- -- so we can do: e\noligature{ff}e e\noligature{f}fie (we only look at the first)
+ if has_glyph_option(start,no_right_ligature_code) then
return head, start
end
if start == stop and getchar(start) == char then
@@ -533,19 +555,19 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
if not marks[char] then
baseindex = baseindex + componentindex
componentindex = count_components(start,marks)
- -- we can be more clever here: "not deletemarks or (skiphash and not skiphash[char])"
- -- and such:
+ -- we can be more clever here: "not deletemarks or (skiphash and not skiphash[char])"
+ -- and such:
elseif not deletemarks then
-- we can get a loop when the font expects otherwise (i.e. unexpected deletemarks)
setligaindex(start,baseindex + getligaindex(start,componentindex))
if trace_marks then
- logwarning("%s: keep mark %s, gets index %s",pref(dataset,sequence),gref(char),getligaindex(start))
+ logwarning("%s: keep ligature mark %s, gets index %s",pref(dataset,sequence),gref(char),getligaindex(start))
end
local n = copy_node(start)
copyinjection(n,start) -- is this ok ? we position later anyway
head, current = insert_node_after(head,current,n) -- unlikely that mark has components
elseif trace_marks then
- logwarning("%s: delete mark %s",pref(dataset,sequence),gref(char))
+ logwarning("%s: delete ligature mark %s",pref(dataset,sequence),gref(char))
end
start = getnext(start)
end
@@ -558,7 +580,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
if marks[char] then
setligaindex(start,baseindex + getligaindex(start,componentindex))
if trace_marks then
- logwarning("%s: set mark %s, gets index %s",pref(dataset,sequence),gref(char),getligaindex(start))
+ logwarning("%s: set ligature mark %s, gets index %s",pref(dataset,sequence),gref(char),getligaindex(start))
end
start = getnext(start)
else
@@ -568,6 +590,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
break
end
end
+ flush_components(components)
else
-- discfound ... forget about marks .. probably no scripts that hyphenate and have marks
local discprev, discnext = getboth(discfound)
@@ -806,6 +829,9 @@ function handlers.gsub_ligature(head,start,dataset,sequence,ligature,rlmode,skip
-- of{f-}{}{f}e o{f-}{}{f}fe o{-}{}{ff}e (oe and ff ligature)
-- we can end up here when we have a start run .. testruns start at a disc but
-- so here we have the other case: char + disc
+ --
+ -- Challenge for Kai (latinmodern): \hyphenation{fii-f-f-iif} fiiffiif
+ --
if discfound then
-- don't assume marks in a disc and we don't run over a disc (for now)
local pre, post, replace = getdisc(discfound)
@@ -898,81 +924,89 @@ function handlers.gsub_ligature(head,start,dataset,sequence,ligature,rlmode,skip
end
function handlers.gpos_single(head,start,dataset,sequence,kerns,rlmode,skiphash,step,injection)
- local startchar = getchar(start)
- local format = step.format
- if format == "single" or type(kerns) == "table" then -- the table check can go
- local dx, dy, w, h = setposition(0,start,factor,rlmode,kerns,injection)
- if trace_kerns then
- logprocess("%s: shifting single %s by %s xy (%p,%p) and wh (%p,%p)",pref(dataset,sequence),gref(startchar),format,dx,dy,w,h)
- end
+ if has_glyph_option(start,no_right_kern_code) then
+ return head, start, false
else
- local k = (format == "move" and setmove or setkern)(start,factor,rlmode,kerns,injection)
- if trace_kerns then
- logprocess("%s: shifting single %s by %s %p",pref(dataset,sequence),gref(startchar),format,k)
+ local startchar = getchar(start)
+ local format = step.format
+ if format == "single" or type(kerns) == "table" then -- the table check can go
+ local dx, dy, w, h = setposition(0,start,factor,rlmode,kerns,injection)
+ if trace_kerns then
+ logprocess("%s: shifting single %s by %s xy (%p,%p) and wh (%p,%p)",pref(dataset,sequence),gref(startchar),format,dx,dy,w,h)
+ end
+ else
+ local k = (format == "move" and setmove or setkern)(start,factor,rlmode,kerns,injection)
+ if trace_kerns then
+ logprocess("%s: shifting single %s by %s %p",pref(dataset,sequence),gref(startchar),format,k)
+ end
end
+ return head, start, true
end
- return head, start, true
end
function handlers.gpos_pair(head,start,dataset,sequence,kerns,rlmode,skiphash,step,injection)
- local snext = getnext(start)
- if not snext then
+ if has_glyph_option(start,no_right_kern_code) then
return head, start, false
else
- local prev = start
- while snext do
- local nextchar = ischar(snext,currentfont)
- if nextchar then
- if skiphash and skiphash[nextchar] then -- includes marks too when flag
- prev = snext
- snext = getnext(snext)
- else
- local krn = kerns[nextchar]
- if not krn then
- break
- end
- local format = step.format
- if format == "pair" then
- local a = krn[1]
- local b = krn[2]
- if a == true then
- -- zero
- elseif a then -- #a > 0
- local x, y, w, h = setposition(1,start,factor,rlmode,a,injection)
- if trace_kerns then
- local startchar = getchar(start)
- logprocess("%s: shifting first of pair %s and %s by xy (%p,%p) and wh (%p,%p) as %s",pref(dataset,sequence),gref(startchar),gref(nextchar),x,y,w,h,injection or "injections")
- end
+ local snext = getnext(start)
+ if not snext then
+ return head, start, false
+ else
+ local prev = start
+ while snext do
+ local nextchar = ischar(snext,currentfont)
+ if nextchar then
+ if skiphash and skiphash[nextchar] then -- includes marks too when flag
+ prev = snext
+ snext = getnext(snext)
+ else
+ local krn = kerns[nextchar]
+ if not krn then
+ break
end
- if b == true then
- -- zero
- start = snext -- cf spec
- elseif b then -- #b > 0
- local x, y, w, h = setposition(2,snext,factor,rlmode,b,injection)
+ local format = step.format
+ if format == "pair" then
+ local a = krn[1]
+ local b = krn[2]
+ if a == true then
+ -- zero
+ elseif a then -- #a > 0
+ local x, y, w, h = setposition(1,start,factor,rlmode,a,injection)
+ if trace_kerns then
+ local startchar = getchar(start)
+ logprocess("%s: shifting first of pair %s and %s by xy (%p,%p) and wh (%p,%p) as %s",pref(dataset,sequence),gref(startchar),gref(nextchar),x,y,w,h,injection or "injections")
+ end
+ end
+ if b == true then
+ -- zero
+ start = snext -- cf spec
+ elseif b then -- #b > 0
+ local x, y, w, h = setposition(2,snext,factor,rlmode,b,injection)
+ if trace_kerns then
+ local startchar = getchar(start)
+ logprocess("%s: shifting second of pair %s and %s by xy (%p,%p) and wh (%p,%p) as %s",pref(dataset,sequence),gref(startchar),gref(nextchar),x,y,w,h,injection or "injections")
+ end
+ start = snext -- cf spec
+ elseif forcepairadvance then
+ start = snext -- for testing, not cf spec
+ end
+ return head, start, true
+ elseif krn ~= 0 then
+ local k = (format == "move" and setmove or setkern)(snext,factor,rlmode,krn,injection)
if trace_kerns then
- local startchar = getchar(start)
- logprocess("%s: shifting second of pair %s and %s by xy (%p,%p) and wh (%p,%p) as %s",pref(dataset,sequence),gref(startchar),gref(nextchar),x,y,w,h,injection or "injections")
+ logprocess("%s: inserting %s %p between %s and %s as %s",pref(dataset,sequence),format,k,gref(getchar(prev)),gref(nextchar),injection or "injections")
end
- start = snext -- cf spec
- elseif forcepairadvance then
- start = snext -- for testing, not cf spec
- end
- return head, start, true
- elseif krn ~= 0 then
- local k = (format == "move" and setmove or setkern)(snext,factor,rlmode,krn,injection)
- if trace_kerns then
- logprocess("%s: inserting %s %p between %s and %s as %s",pref(dataset,sequence),format,k,gref(getchar(prev)),gref(nextchar),injection or "injections")
+ return head, start, true
+ else -- can't happen
+ break
end
- return head, start, true
- else -- can't happen
- break
end
+ else
+ break
end
- else
- break
end
+ return head, start, false
end
- return head, start, false
end
end
@@ -1501,92 +1535,98 @@ function chainprocs.gsub_ligature(head,start,stop,dataset,sequence,currentlookup
end
function chainprocs.gpos_single(head,start,stop,dataset,sequence,currentlookup,rlmode,skiphash,chainindex)
- local mapping = currentlookup.mapping
- if mapping == nil then
- mapping = getmapping(dataset,sequence,currentlookup)
- end
- if mapping then
- local startchar = getchar(start)
- local kerns = mapping[startchar]
- if kerns then
- local format = currentlookup.format
- if format == "single" then
- local dx, dy, w, h = setposition(0,start,factor,rlmode,kerns) -- currentlookup.flags ?
- if trace_kerns then
- logprocess("%s: shifting single %s by %s (%p,%p) and correction (%p,%p)",cref(dataset,sequence),gref(startchar),format,dx,dy,w,h)
- end
- else -- needs checking .. maybe no kerns format for single
- local k = (format == "move" and setmove or setkern)(start,factor,rlmode,kerns,injection)
- if trace_kerns then
- logprocess("%s: shifting single %s by %s %p",cref(dataset,sequence),gref(startchar),format,k)
+ -- we actually should check no_left_kern_code with next
+ if not has_glyph_option(start,no_right_kern_code) then
+ local mapping = currentlookup.mapping
+ if mapping == nil then
+ mapping = getmapping(dataset,sequence,currentlookup)
+ end
+ if mapping then
+ local startchar = getchar(start)
+ local kerns = mapping[startchar]
+ if kerns then
+ local format = currentlookup.format
+ if format == "single" then
+ local dx, dy, w, h = setposition(0,start,factor,rlmode,kerns) -- currentlookup.flags ?
+ if trace_kerns then
+ logprocess("%s: shifting single %s by %s (%p,%p) and correction (%p,%p)",cref(dataset,sequence),gref(startchar),format,dx,dy,w,h)
+ end
+ else -- needs checking .. maybe no kerns format for single
+ local k = (format == "move" and setmove or setkern)(start,factor,rlmode,kerns,injection)
+ if trace_kerns then
+ logprocess("%s: shifting single %s by %s %p",cref(dataset,sequence),gref(startchar),format,k)
+ end
end
+ return head, start, true
end
- return head, start, true
end
end
return head, start, false
end
function chainprocs.gpos_pair(head,start,stop,dataset,sequence,currentlookup,rlmode,skiphash,chainindex) -- todo: injections ?
- local mapping = currentlookup.mapping
- if mapping == nil then
- mapping = getmapping(dataset,sequence,currentlookup)
- end
- if mapping then
- local snext = getnext(start)
- if snext then
- local startchar = getchar(start)
- local kerns = mapping[startchar] -- always 1 step
- if kerns then
- local prev = start
- while snext do
- local nextchar = ischar(snext,currentfont)
- if not nextchar then
- break
- end
- if skiphash and skiphash[nextchar] then
- prev = snext
- snext = getnext(snext)
- else
- local krn = kerns[nextchar]
- if not krn then
+ -- we actually should check no_left_kern_code with next
+ if not has_glyph_option(start,no_right_kern_code) then
+ local mapping = currentlookup.mapping
+ if mapping == nil then
+ mapping = getmapping(dataset,sequence,currentlookup)
+ end
+ if mapping then
+ local snext = getnext(start)
+ if snext then
+ local startchar = getchar(start)
+ local kerns = mapping[startchar] -- always 1 step
+ if kerns then
+ local prev = start
+ while snext do
+ local nextchar = ischar(snext,currentfont)
+ if not nextchar then
break
end
- local format = currentlookup.format
- if format == "pair" then
- local a = krn[1]
- local b = krn[2]
- if a == true then
- -- zero
- elseif a then
- local x, y, w, h = setposition(1,start,factor,rlmode,a,"injections") -- currentlookups flags?
- if trace_kerns then
- local startchar = getchar(start)
- logprocess("%s: shifting first of pair %s and %s by (%p,%p) and correction (%p,%p)",cref(dataset,sequence),gref(startchar),gref(nextchar),x,y,w,h)
- end
+ if skiphash and skiphash[nextchar] then
+ prev = snext
+ snext = getnext(snext)
+ else
+ local krn = kerns[nextchar]
+ if not krn then
+ break
end
- if b == true then
- -- zero
- start = snext -- cf spec
- elseif b then -- #b > 0
- local x, y, w, h = setposition(2,snext,factor,rlmode,b,"injections")
+ local format = currentlookup.format
+ if format == "pair" then
+ local a = krn[1]
+ local b = krn[2]
+ if a == true then
+ -- zero
+ elseif a then
+ local x, y, w, h = setposition(1,start,factor,rlmode,a,"injections") -- currentlookups flags?
+ if trace_kerns then
+ local startchar = getchar(start)
+ logprocess("%s: shifting first of pair %s and %s by (%p,%p) and correction (%p,%p)",cref(dataset,sequence),gref(startchar),gref(nextchar),x,y,w,h)
+ end
+ end
+ if b == true then
+ -- zero
+ start = snext -- cf spec
+ elseif b then -- #b > 0
+ local x, y, w, h = setposition(2,snext,factor,rlmode,b,"injections")
+ if trace_kerns then
+ local startchar = getchar(start)
+ logprocess("%s: shifting second of pair %s and %s by (%p,%p) and correction (%p,%p)",cref(dataset,sequence),gref(startchar),gref(nextchar),x,y,w,h)
+ end
+ start = snext -- cf spec
+ elseif forcepairadvance then
+ start = snext -- for testing, not cf spec
+ end
+ return head, start, true
+ elseif krn ~= 0 then
+ local k = (format == "move" and setmove or setkern)(snext,factor,rlmode,krn)
if trace_kerns then
- local startchar = getchar(start)
- logprocess("%s: shifting second of pair %s and %s by (%p,%p) and correction (%p,%p)",cref(dataset,sequence),gref(startchar),gref(nextchar),x,y,w,h)
+ logprocess("%s: inserting %s %p between %s and %s",cref(dataset,sequence),format,k,gref(getchar(prev)),gref(nextchar))
end
- start = snext -- cf spec
- elseif forcepairadvance then
- start = snext -- for testing, not cf spec
- end
- return head, start, true
- elseif krn ~= 0 then
- local k = (format == "move" and setmove or setkern)(snext,factor,rlmode,krn)
- if trace_kerns then
- logprocess("%s: inserting %s %p between %s and %s",cref(dataset,sequence),format,k,gref(getchar(prev)),gref(nextchar))
+ return head, start, true
+ else
+ break
end
- return head, start, true
- else
- break
end
end
end
@@ -2056,6 +2096,7 @@ local function chaindisk(head,start,dataset,sequence,rlmode,skiphash,ck)
local sweepnode = sweepnode
local sweeptype = sweeptype
local sweepoverflow = false
+ local checkdisc = getprev(head)
local keepdisc = not sweepnode
local lookaheaddisc = nil
local backtrackdisc = nil
@@ -2089,6 +2130,7 @@ local function chaindisk(head,start,dataset,sequence,rlmode,skiphash,ck)
sweepnode = current
current = getnext(current)
else
+ -- we can use an iterator
while replace and i <= l do
if getid(replace) == glyph_code then
i = i + 1
@@ -2189,7 +2231,7 @@ local function chaindisk(head,start,dataset,sequence,rlmode,skiphash,ck)
local current = prev
local i = f
local t = sweeptype == "pre" or sweeptype == "replace"
- if not current and t and current == checkdisk then
+ if not current and t and current == checkdisc then
current = getprev(sweepnode)
end
while current and i > 1 do -- missing getprev added / moved outside
@@ -2218,7 +2260,7 @@ local function chaindisk(head,start,dataset,sequence,rlmode,skiphash,ck)
end
end
current = getprev(current)
- if t and current == checkdisk then
+ if t and current == checkdisc then
current = getprev(sweepnode)
end
end
@@ -2443,6 +2485,10 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s
local current = start
local last = start
+ if s == 1 then
+ goto next
+ end
+
-- current match
if l > f then
@@ -2512,10 +2558,9 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s
break
end
end
- -- commented, for Kai to check
- -- if n <= l then
- -- notmatchpre[last] = true
- -- end
+ if n <= l then
+ notmatchpre[last] = true
+ end
else
notmatchpre[last] = true
end
@@ -3287,6 +3332,7 @@ local nesting = 0
local function c_run_single(head,font,attr,lookupcache,step,dataset,sequence,rlmode,skiphash,handler)
local done = false
local sweep = sweephead[head]
+ local start
if sweep then
start = sweep
-- sweephead[head] = nil
@@ -3448,6 +3494,7 @@ end
local function c_run_multiple(head,font,attr,steps,nofsteps,dataset,sequence,rlmode,skiphash,handler)
local done = false
local sweep = sweephead[head]
+ local start
if sweep then
start = sweep
-- sweephead[head] = nil
@@ -3618,8 +3665,6 @@ end
local txtdirstate, pardirstate do -- this might change (no need for nxt in pardirstate)
local getdirection = nuts.getdirection
- local lefttoright = 0
- local righttoleft = 1
txtdirstate = function(start,stack,top,rlparmode)
local dir, pop = getdirection(start)
@@ -3628,19 +3673,19 @@ local txtdirstate, pardirstate do -- this might change (no need for nxt in pard
return 0, rlparmode
else
top = top - 1
- if stack[top] == righttoleft then
+ if stack[top] == righttoleft_code then
return top, -1
else
return top, 1
end
end
- elseif dir == lefttoright then
+ elseif dir == lefttoright_code then
top = top + 1
- stack[top] = lefttoright
+ stack[top] = lefttoright_code
return top, 1
- elseif dir == righttoleft then
+ elseif dir == righttoleft_code then
top = top + 1
- stack[top] = righttoleft
+ stack[top] = righttoleft_code
return top, -1
else
return top, rlparmode
@@ -3649,14 +3694,9 @@ local txtdirstate, pardirstate do -- this might change (no need for nxt in pard
pardirstate = function(start)
local dir = getdirection(start)
- if dir == lefttoright then
- return 1, 1
- elseif dir == righttoleft then
- return -1, -1
- -- for old times sake we we handle strings too
- elseif dir == "TLT" then
+ if dir == lefttoright_code then
return 1, 1
- elseif dir == "TRT" then
+ elseif dir == righttoleft_code then
return -1, -1
else
return 0, 0
@@ -3755,9 +3795,9 @@ do
local initialrl = 0
- if getid(head) == localpar_code and start_of_par(head) then
+ if getid(head) == par_code and start_of_par(head) then
initialrl = pardirstate(head)
- elseif direction == 1 or direction == "TRT" then
+ elseif direction == righttoleft_code then
initialrl = -1
end
@@ -3909,7 +3949,7 @@ do
elseif id == dir_code then
topstack, rlmode = txtdirstate(start,dirstack,topstack,rlparmode)
start = getnext(start)
- -- elseif id == localpar_code and start_of_par(start) then
+ -- elseif id == par_code and start_of_par(start) then
-- rlparmode, rlmode = pardirstate(start)
-- start = getnext(start)
else
@@ -3993,7 +4033,7 @@ do
elseif id == dir_code then
topstack, rlmode = txtdirstate(start,dirstack,topstack,rlparmode)
start = getnext(start)
- -- elseif id == localpar_code and start_of_par(start) then
+ -- elseif id == par_code and start_of_par(start) then
-- rlparmode, rlmode = pardirstate(start)
-- start = getnext(start)
else
@@ -4052,7 +4092,7 @@ do
local done = false
local dirstack = { nil } -- could move outside function but we can have local runs (maybe a few more nils)
local start = head
- local initialrl = (direction == 1 or direction == "TRT") and -1 or 0
+ local initialrl = (direction == righttoleft_code) and -1 or 0
local rlmode = initialrl
local rlparmode = initialrl
local topstack = 0
@@ -4104,7 +4144,7 @@ do
elseif id == dir_code then
topstack, rlmode = txtdirstate(start,dirstack,topstack,rlparmode)
start = getnext(start)
- -- elseif id == localpar_code and start_of_par(start) then
+ -- elseif id == par_code and start_of_par(start) then
-- rlparmode, rlmode = pardirstate(start)
-- start = getnext(start)
else
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-ott.lua b/Master/texmf-dist/tex/context/base/mkiv/font-ott.lua
index c9e467f2253..f4d7e05a137 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-ott.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-ott.lua
@@ -1117,41 +1117,6 @@ local checkers = {
end
}
--- Keep this:
---
--- function otf.features.normalize(features)
--- if features then
--- local h = { }
--- for k, v in next, features do
--- k = lower(k)
--- if k == "language" then
--- v = gsub(lower(v),"[^a-z0-9]","")
--- h.language = rawget(verboselanguages,v) or (languages[v] and v) or "dflt" -- auto adds
--- elseif k == "script" then
--- v = gsub(lower(v),"[^a-z0-9]","")
--- h.script = rawget(verbosescripts,v) or (scripts[v] and v) or "dflt" -- auto adds
--- else
--- if type(v) == "string" then
--- local b = is_boolean(v)
--- if type(b) == "nil" then
--- v = tonumber(v) or lower(v)
--- else
--- v = b
--- end
--- end
--- if not rawget(features,k) then
--- k = rawget(verbosefeatures,k) or k
--- end
--- local c = checkers[k]
--- h[k] = c and c(v) or v
--- end
--- end
--- return h
--- end
--- end
-
--- inspect(fonts.handlers.otf.statistics.usedfeatures)
-
if not storage then
return
end
@@ -1178,9 +1143,6 @@ function otffeatures.normalize(features,wrap) -- wrap is for context
h.script = rawget(verbosescripts,v) or (scripts[v] and v) or "dflt" -- auto adds
elseif k == "axis" then
h[k] = normalizedaxis(value)
- if not callbacks.supported.glyph_stream_provider then
- h.variableshapes = true -- for the moment
- end
else
local uk = usedfeatures[key]
local uv = uk[value]
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-pre.mkiv b/Master/texmf-dist/tex/context/base/mkiv/font-pre.mkiv
index 8e2e0a7a9f3..445dedd2543 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-pre.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-pre.mkiv
@@ -174,9 +174,14 @@
[fin2=yes,fin3=yes,med2=yes]
\definefontfeature
+ [reordercombining]
+ [reordercombining=yes]
+
+\definefontfeature
[hebrew]
[semitic-complete]
- [script=hebr]
+ [script=hebr,
+ reordercombining=yes] % seems to work best with reasonable fonts
\definefontfeature
[simplearabic]
@@ -320,6 +325,17 @@
\definefontfeature [tamil-two] [tamil-one] [script=tml2]
\definefontfeature [telugu-two] [telugu-one] [script=tel2]
+% mongolian
+
+\definefontfeature
+ [mongolian]
+ [default]
+ [script=mong,
+ init=yes,medi=yes,fina=yes,isol=yes,
+ rlig=yes,rclt=yes,calt=yes,
+ %dlig=yes,cswh=yes, % optional
+ mset]
+
% tibetan
\definefontfeature
@@ -389,10 +405,17 @@
mathalternates=yes,
mathitalics=yes, % we pass them
mathdimensions=all,
+ % mathkerns=yes,
% mathgaps=yes,
language=dflt,
script=math]
+% Users can define this:
+%
+% \definefontfeature
+% [oldmath]
+% [oldmath=yes]
+
\ifdefined\mathnolimitsmode
\mathnolimitsmode\plusone % font driven (only opentype)
\fi
@@ -915,10 +938,14 @@
\unexpanded\def\normalss{\font_helpers_set_current_font_style{\s!ss}}
\unexpanded\def\normaltt{\font_helpers_set_current_font_style{\s!tt}}
+\pushoverloadmode
+
\let\rm\normalrm
\let\ss\normalss
\let\tt\normaltt
+\popoverloadmode
+
\protect \endinput
% LM math vs CM math (analysis by Taco):
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-prv.lua b/Master/texmf-dist/tex/context/base/mkiv/font-prv.lua
index c3323ca743e..15057e2554e 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-prv.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-prv.lua
@@ -80,3 +80,36 @@ end
function helpers.newprivateslot(name)
return sharedprivates[name]
end
+
+do
+
+ local context = context
+ local utfchar = utf.char
+
+ interfaces.implement {
+ name = "privatecharacter",
+ public = true,
+ -- protected = true,
+ arguments = "string",
+ actions = function(name)
+ local c = sharedprivates[name]
+ if c then
+ context(utfchar(c))
+ end
+ end
+ }
+
+ interfaces.implement {
+ name = "privatecharactercode",
+ public = true,
+ -- protected = true,
+ arguments = "string",
+ actions = function(name)
+ local c = sharedprivates[name]
+ if c then
+ context(c) -- serialized, not a number
+ end
+ end
+ }
+
+end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-run.mkiv b/Master/texmf-dist/tex/context/base/mkiv/font-run.mkiv
index 2f6cd32df9f..6bfa7ee7267 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-run.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-run.mkiv
@@ -350,7 +350,7 @@
\ifdefined\databox \else \newbox\databox \fi
-\unexpanded\gdef\testminimalbaseline#1% to be used in a 10 column tabulate
+\unexpanded\gdef\font_show_minimal_baseline#1% to be used in a 10 column tabulate
{\setbox\databox\ruledhbox{#1}%
\scratchdimen\htdp\databox
\normalexpanded {
@@ -374,18 +374,14 @@
\font_show_only_english\showminimalbaseline
\else
\starttabulate[|l|T|T|T|T|T|T|T|T|T|]
- \testminimalbaseline{\hbox to \emwidth{\hss\showstruts\strut\hss}}%
- \testminimalbaseline{(/)}%
- \testminimalbaseline{\normalstartimath\frac{1}{2}x\normalsuperscript2\normalsubscript3\normalstopimath}
+ \font_show_minimal_baseline{\hbox to \emwidth{\hss\showstruts\strut\hss}}%
+ \font_show_minimal_baseline{(/)}%
+ \font_show_minimal_baseline{\normalstartimath\frac{1}{2}x\normalsuperscript2\normalsubscript3\normalstopimath}
\stoptabulate
\fi}
-\unexpanded\gdef\showkerning#1%
- {\bgroup
- \let\MPfshowcommand\ruledhbox
- \setMPtext\s!dummy{#1}%
- \startMPcode draw textext(\MPstring\s!dummy);\stopMPcode
- \egroup}
+\unexpanded\gdef\showkerning
+ {\groupedcommandcs\showfontkerns\relax}
\unexpanded\gdef\showcharratio
{\dowithnextboxcontent
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-sel.lua b/Master/texmf-dist/tex/context/base/mkiv/font-sel.lua
index 15d3838f6d0..9a611f9faa3 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-sel.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-sel.lua
@@ -96,7 +96,7 @@ extras["features"] = function(data,alternative,features)
local e = gsub(gsub(features,"*",d),"{(.*)}","%1")
local f = data.features
if trace_features then
- report_features("Alternative '%s': Saving features '%s'",alternative,e)
+ report_features("alternative '%s': saving features '%s'",alternative,e)
end
if not f then
f = { }
@@ -109,7 +109,7 @@ extras["goodies"] = function(data,alternative,goodies)
local e = gsub(goodies,"{(.*)}","%1")
local g = data.goodies
if trace_goodies then
- report_goodies("Alternative '%s': Saving goodies '%s'",alternative,e)
+ report_goodies("alternative '%s': saving goodies '%s'",alternative,e)
end
if not g then
g = { }
@@ -137,7 +137,7 @@ local function selectfont_savefile(data,alternative,bodyfontsize,size,file)
end
a[bodyfontsize] = { size, n }
if trace_files then
- report_files("Alternative '%s': Saving file '%s' for size '%s'",alternative,n,size)
+ report_files("alternative '%s': saving file '%s' for size '%s'",alternative,n,size)
end
end
@@ -145,7 +145,7 @@ methods["name"] = function(data,alternative,name)
local family = data.metadata.family
local filename = cleanname(gsub(name,"*",family))
if trace_alternatives then
- report_selectfont("Alternative '%s': Using method 'name' with argument '%s'",alternative,filename)
+ report_selectfont("alternative '%s': using method 'name' with argument '%s'",alternative,filename)
end
local fontname = getlookups{ fontname = filename }
local fullname = getlookups{ fullname = filename }
@@ -155,7 +155,7 @@ methods["name"] = function(data,alternative,name)
selectfont_savefile(data,alternative,0,"default",fullname[1])
else
if trace_alternatives then
- report_selectfont("Alternative '%s': No font was found for the requested name '%s'",alternative,filename)
+ report_selectfont("alternative '%s': no font was found for the requested name '%s'",alternative,filename)
end
end
end
@@ -164,14 +164,14 @@ methods["file"] = function(data,alternative,file)
local family = data.metadata.family
local filename = cleanname(gsub(removesuffix(file),"*",family))
if trace_alternatives then
- report_selectfont("Alternative '%s': Using method 'file' with argument '%s'",alternative,filename)
+ report_selectfont("alternative '%s': using method 'file' with argument '%s'",alternative,filename)
end
local filename = getlookups{ cleanfilename = cleanname(filename) }
if #filename > 0 then
selectfont_savefile(data,alternative,0,"default",filename[1])
else
if trace_alternatives then
- report_selectfont("Alternative '%s': No font was found for the requested file '%s'",alternative,cleanname(gsub(removesuffix(file),"*",family)))
+ report_selectfont("alternative '%s': no font was found for the requested file '%s'",alternative,cleanname(gsub(removesuffix(file),"*",family)))
end
end
end
@@ -243,7 +243,7 @@ local function m_style_family(family)
return family
elseif #fontname > 0 then
local fontfamily = fontname[1]["familyname"]
- report_selectfont("The name '%s' is not a proper family name, use '%s' instead.",askedname,fontfamily)
+ report_selectfont("the name '%s' is not a proper family name, use '%s' instead.",askedname,fontfamily)
return nil
else
return nil
@@ -353,7 +353,7 @@ local function m_style_size(data,alternative,entries)
end
else
if trace_alternatives then
- report_selectfont("Alternative '%s': Multiple files are available for the requested style '%s' from '%s'",alternative,style,family)
+ report_selectfont("alternative '%s': multiple files are available for the requested style '%s' from '%s'",alternative,style,family)
end
end
end
@@ -386,7 +386,7 @@ methods["style"] = function(data,alternative,style)
m_style_size(data,alternative,entries)
else
if trace_alternatives then
- report_selectfont("Alternative '%s': No font was found for the requested style '%s' from '%s'",alternative,style,family)
+ report_selectfont("alternative '%s': no font was found for the requested style '%s' from '%s'",alternative,style,family)
end
end
end
@@ -394,21 +394,21 @@ end
methods[v_default] = function(data,alternative)
local family = data.metadata.family
if trace_alternatives then
- report_selectfont("Alternative '%s': Using method 'default'",alternative)
+ report_selectfont("alternative '%s': using method 'default'",alternative)
end
local result = getlookups{ familyname = cleanname(family) }
if #result == 1 and alternative == "tf" then
if trace_alternatives then
- report_selectfont("Alternative '%s': The family '%s' contains only one font",alternative,family)
+ report_selectfont("alternative '%s': the family '%s' contains only one font",alternative,family)
end
selectfont_savefile(data,alternative,0,"default",result[1])
-- if trace_alternatives then
- -- report_selectfont("Alternative '%s': Changing method 'default' to method 'style'",alternative)
+ -- report_selectfont("alternative '%s': changing method 'default' to method 'style'",alternative)
-- end
-- methods["file"](data,alternative,result[1]["filename"])
else
if trace_alternatives then
- report_selectfont("Alternative '%s': Changing method 'default' to method 'style'",alternative)
+ report_selectfont("alternative '%s': changing method 'default' to method 'style'",alternative)
end
methods["style"](data,alternative,alternative)
end
@@ -478,7 +478,7 @@ function selectfont.registerfontalternative(alternative)
local a = alternatives[alternative]
if not a then
if trace_register then
- report_selectfont("Register alternative '%s'",alternative)
+ report_selectfont("register alternative '%s'",alternative)
end
a = true
alternatives[alternative] = a
@@ -598,23 +598,23 @@ function selectfont.fontsynonym(data,class,style,alternative,index)
local fontfallback = formatters["fallback-%s-%s-%s"](fontclass,style,alternative)
for _, fontsize in next, fontsizes do
-- if trace_typescript then
- -- report_typescript("Synonym: '%s', Size: '%s', File: '%s'",fontfile,fontfiles[fontsize][1],fontfiles[fontsize][2])
+ -- report_typescript("synonym: '%s', size: '%s', file: '%s'",fontfile,fontfiles[fontsize][1],fontfiles[fontsize][2])
-- end
registerdesignsizes(fontfile,fontfiles[fontsize][1],fontfiles[fontsize][2])
end
if fallback then
-- if trace_typescript then
- -- report_typescript("Synonym: '%s', File: '%s', Features: '%s'",fontsynonym,fontfile,fontfeature)
+ -- report_typescript("synonym: '%s', file: '%s', features: '%s'",fontsynonym,fontfile,fontfeature)
-- end
ctx_definefontsynonym( { fontsynonym }, { fontfile }, { features = fontfeature } )
else
-- if trace_typescript then
- -- report_typescript("Synonym: '%s', File: '%s', Features: '%s', Goodies: '%s', Fallbacks: '%s'",fontsynonym,fontfile,fontfeature,fontgoodie,fontfallback)
+ -- report_typescript("synonym: '%s', file: '%s', features: '%s', goodies: '%s', fallbacks: '%s'",fontsynonym,fontfile,fontfeature,fontgoodie,fontfallback)
-- end
ctx_definefontsynonym( { fontsynonym }, { fontfile }, { features = fontfeature, goodies = fontgoodie, fallbacks = fontfallback } )
if synonym then
-- if trace_typescript then
- -- report_typescript("Synonym: '%s', File: '%s'",synonym,fontsynonym)
+ -- report_typescript("synonym: '%s', file: '%s'",synonym,fontsynonym)
-- end
ctx_definefontsynonym( { synonym }, { fontsynonym } )
end
@@ -628,13 +628,13 @@ function selectfont.fontfallback(data,class,style,alternative,index)
local force = data.options.force ~= "" and data.options.force or ""
local fontfeature = data.features and data.features[alternative] or data.options.features
local fontclass = lower(class)
- local fontsynonym = formatters ["synonym-%s-%s-%s-%s"](fontclass,style,alternative,index)
- local fontfallback = formatters["fallback-%s-%s-%s"] (fontclass,style,alternative)
+ local fontsynonym = formatters["synonym-%s-%s-%s-%s"](fontclass,style,alternative,index)
+ local fontfallback = formatters["fallback-%s-%s-%s"] (fontclass,style,alternative)
if index == 1 then
ctx_resetfontfallback( { fontfallback } )
end
-- if trace_typescript then
- -- report_typescript("Fallback: '%s', Synonym: '%s', Range: '%s', Scale: '%s', Check: '%s', Force: '%s'",fontfallback,fontsynonym,range,scale,check,force)
+ -- report_typescript("fallback: '%s', synonym: '%s', range: '%s', scale: '%s', check: '%s', force: '%s'",fontfallback,fontsynonym,range,scale,check,force)
-- end
ctx_definefontfallback( { fontfallback }, { fontsynonym }, { range }, { rscale = scale, check = check, force = force } )
end
@@ -653,7 +653,7 @@ function selectfont.filefallback(data,class,style,alternative,index)
ctx_resetfontfallback( { fontfallback } )
end
-- if trace_typescript then
- -- report_typescript("Fallback: '%s', File: '%s', Features: '%s', Range: '%s', Scale: '%s', Check: '%s', Force: '%s', Offset: '%s'",fontfallback,fontfile[2],fontfeature,range,scale,check,force,offset)
+ -- report_typescript("fallback: '%s', file: '%s', features: '%s', range: '%s', scale: '%s', check: '%s', force: '%s', offset: '%s'",fontfallback,fontfile[2],fontfeature,range,scale,check,force,offset)
-- end
ctx_definefontfallback( { fontfallback }, { formatters["file:%s*%s"](fontfile[2],fontfeature) }, { range }, { rscale = scale, check = check, force = force, offset = offset } )
end
@@ -737,7 +737,7 @@ function selectfont.bodyfont(data)
fontsynonym = formatters["synonym-%s-%s-%s"](fontclass,fontstyle,alternative)
fontlist[#fontlist+1] = formatters["%s=%s sa 1"] (alternative,fontsynonym)
-- if trace_typescript then
- -- report_typescript("Alternative '%s': Synonym '%s'",alternative,fontsynonym)
+ -- report_typescript("alternative '%s': synonym '%s'",alternative,fontsynonym)
-- end
end
fontlist = concat(fontlist,",")
@@ -760,7 +760,7 @@ function selectfont.typeface(data)
local size = data.options.designsize ~= "" and data.options.designsize or "default"
local scale = data.options.rscale ~= "" and data.options.rscale or 1
-- if trace_typescript then
- -- report_typescript("Class: '%s', Style: '%s', Size: '%s', Scale: '%s'",fontclass,fontstyle,size,scale)
+ -- report_typescript("class: '%s', style: '%s', size: '%s', scale: '%s'",fontclass,fontstyle,size,scale)
-- end
ctx_definetypeface( { fontclass }, { fontstyle }, { style }, { "" }, { "default" }, { designsize = size, rscale = scale } )
end
@@ -770,7 +770,7 @@ function selectfont.default(data)
local fontclass = data.metadata.typeface
local fontstyle = data.metadata.style
local style = m_style[fontstyle]
- report_selectfont("The requested font '%s' has no files for the 'tf' alternative, Latin Modern is used instead.",family)
+ report_selectfont("the requested font '%s' has no files for the 'tf' alternative, Latin Modern is used instead.",family)
ctx_definetypeface( { fontclass }, { fontstyle }, { style }, { "modern" }, { "default" } )
end
@@ -799,7 +799,7 @@ function selectfont.definefallbackfamily(index)
if fontfiles then
selectfont.registerfallback(index)
else
- report_selectfont("The requested fallback font '%s' for typeface '%s' style '%s' was ignored because no files where found.",family,fontclass,fontstyle)
+ report_selectfont("the requested fallback font '%s' for typeface '%s' style '%s' was ignored because no files where found.",family,fontclass,fontstyle)
end
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-shp.lua b/Master/texmf-dist/tex/context/base/mkiv/font-shp.lua
index 3d2e5b7c902..78e8597b937 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-shp.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-shp.lua
@@ -8,7 +8,7 @@ if not modules then modules = { } end modules ['font-shp'] = {
local tonumber, next = tonumber, next
local concat = table.concat
-local formatters = string.formatters
+local formatters, lower = string.formatters, string.lower
local otf = fonts.handlers.otf
local afm = fonts.handlers.afm
@@ -221,7 +221,7 @@ end
local function loadstreams(cache,filename,sub,instance)
local base = file.basename(filename)
local name = file.removesuffix(base)
- local kind = file.suffix(filename)
+ local kind = lower(file.suffix(filename))
local attr = lfs.attributes(filename)
local size = attr and attr.size or 0
local time = attr and attr.modification or 0
@@ -346,7 +346,7 @@ local function getstreamhash(fontid)
local fontdata = identifiers[fontid]
if fontdata then
local properties = fontdata.properties
- return makehash(properties.filename,fontdata.subindex,properties.instance)
+ return makehash(properties.filename,properties.subfont,properties.instance)
end
end
@@ -379,124 +379,17 @@ otf.loadstreamdata = loadstreamdata -- not public
otf.loadshapes = loadshapes
otf.getstreamhash = getstreamhash -- not public, might move to other namespace
-local f_c = formatters["%.6N %.6N %.6N %.6N %.6N %.6N c"]
-local f_l = formatters["%.6N %.6N l"]
-local f_m = formatters["%.6N %.6N m"]
-
-local function segmentstopdf(segments,factor,bt,et)
- local t = { }
- local m = 0
- local n = #segments
- local d = false
- for i=1,n do
- local s = segments[i]
- local w = s[#s]
- if w == "c" then
- m = m + 1
- t[m] = f_c(s[1]*factor,s[2]*factor,s[3]*factor,s[4]*factor,s[5]*factor,s[6]*factor)
- elseif w == "l" then
- m = m + 1
- t[m] = f_l(s[1]*factor,s[2]*factor)
- elseif w == "m" then
- m = m + 1
- t[m] = f_m(s[1]*factor,s[2]*factor)
- elseif w == "q" then
- local p = segments[i-1]
- local n = #p
- local l_x = factor*p[n-2]
- local l_y = factor*p[n-1]
- local m_x = factor*s[1]
- local m_y = factor*s[2]
- local r_x = factor*s[3]
- local r_y = factor*s[4]
- m = m + 1
- t[m] = f_c (
- l_x + 2/3 * (m_x-l_x), l_y + 2/3 * (m_y-l_y),
- r_x + 2/3 * (m_x-r_x), r_y + 2/3 * (m_y-r_y),
- r_x, r_y
- )
- end
- end
- m = m + 1
- t[m] = "h f" -- B*
- if bt and et then
- t[0] = bt
- t[m+1] = et
- return concat(t,"\n",0,m+1)
- else
- return concat(t,"\n")
- end
-end
-
-local function initialize(tfmdata,key,value)
- if value then
- local shapes = otf.loadoutlinedata(tfmdata)
- if not shapes then
- return
- end
- local glyphs = shapes.glyphs
- if not glyphs then
- return
- end
- local characters = tfmdata.characters
- local parameters = tfmdata.parameters
- local hfactor = parameters.hfactor * (7200/7227)
- local factor = hfactor / 65536
- local getactualtext = otf.getactualtext
- for unicode, char in next, characters do
- if char.commands then
- -- can't happen as we're doing this before other messing around
- else
- local shape = glyphs[char.index]
- if shape then
- local segments = shape.segments
- if segments then
- -- we need inline in order to support color
- local bt, et = getactualtext(char.tounicode or char.unicode or unicode)
- char.commands = {
- { "pdf", "origin", segmentstopdf(segments,factor,bt,et) }
- }
- end
- end
- end
- end
- end
-end
-
-otf.features.register {
- name = "variableshapes", -- enforced for now
- description = "variable shapes",
- manipulators = {
- base = initialize,
- node = initialize,
- }
-}
-
--- In the end it is easier to just provide the new charstring (cff) and points (ttf). First
--- of all we already have the right information so there is no need to patch the already complex
--- backend code (we only need to make sure the cff is valid). Also, I prototyped support for
--- these fonts using (converted to) normal postscript shapes, a functionality that was already
--- present for a while for metafun. This solution even permits us to come up with usage of such
--- fonts in unexpected ways. It also opens the road to shapes generated with metafun includes
--- as real cff (or ttf) shapes instead of virtual in-line shapes.
---
--- This is probably a prelude to writing a complete backend font inclusion plugin in lua. After
--- all I already have most info. For this we just need to pass a list of used glyphs (or analyze
--- them ourselves).
-
local streams = fonts.hashes.streams
-if callbacks.supported.glyph_stream_provider then
+-- we can now assume that luatex has this one
- callback.register("glyph_stream_provider",function(id,index,mode)
- if id > 0 then
- local streams = streams[id].streams
- -- print(id,index,streams[index])
- if streams then
- return streams[index] or ""
- end
+callback.register("glyph_stream_provider",function(id,index,mode)
+ if id > 0 then
+ local streams = streams[id].streams
+ -- print(id,index,streams[index])
+ if streams then
+ return streams[index] or ""
end
- return ""
- end)
-
-end
+ end
+ return ""
+end)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-sol.lua b/Master/texmf-dist/tex/context/base/mkiv/font-sol.lua
index 2017afcb225..c618739959f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-sol.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-sol.lua
@@ -105,12 +105,14 @@ local disc_code = nodecodes.disc
local kern_code = nodecodes.kern
local hlist_code = nodecodes.hlist
local dir_code = nodecodes.dir
-local localpar_code = nodecodes.localpar
+local par_code = nodecodes.par
local whatsit_code = nodecodes.whatsit
local fontkern_code = kerncodes.fontkern
+local righttoleft_code = nodes.dirvalues.righttoleft
+
local userdefinedwhatsit_code = whatsitcodes.userdefined
local nodeproperties = nodes.properties.data
@@ -379,7 +381,7 @@ function splitters.split(head) -- best also pass the direction
end
end
if r2l then
- local dirnode = new_direction(righttoleft) -- brrr, we don't pop ... to be done (when used at all)
+ local dirnode = new_direction(righttoleft_code) -- brrr, we don't pop ... to be done (when used at all)
setlink(dirnode,list)
list = dirnode
end
@@ -434,13 +436,13 @@ function splitters.split(head) -- best also pass the direction
flush()
end
local direction, pop = getdirection(current)
- r2l = not pop and direction == righttoleft
- elseif id == localpar_code and start_of_par(current) then
+ r2l = not pop and direction == righttoleft_code
+ elseif id == par_code and start_of_par(current) then
if start then
flush() -- very unlikely as this starts a paragraph
end
local direction = getdirection(current)
- r2l = direction == righttoleft or direction == "TRT" -- for old times sake
+ r2l = direction == righttoleft_code
else
if start then
flush()
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-sty.mklx b/Master/texmf-dist/tex/context/base/mkiv/font-sty.mklx
deleted file mode 100644
index 81884333bb1..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/font-sty.mklx
+++ /dev/null
@@ -1,458 +0,0 @@
-%D \module
-%D [ file=font-sty,
-%D version=2011.01.13, % (copied fron font-ini)
-%D title=\CONTEXT\ Font Macros,
-%D subtitle=Styles,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Font Macros / Styles}
-
-\unprotect
-
-%D \macros
-%D {definealternativestyle}
-%D
-%D In the main modules we are going to implement lots of parameterized commands and
-%D one of these parameters will concern the font to use. To suit consistent use of
-%D fonts we here implement a mechanism for defining the keywords that present a
-%D particular style or alternative.
-%D
-%D \starttyping
-%D \definealternativestyle [keywords] [\style] [\nostyle]
-%D \stoptyping
-%D
-%D The first command is used in the normal textflow, while the second command takes
-%D care of headings and alike. Consider the next two definitions:
-%D
-%D \starttyping
-%D \definealternativestyle [bold] [\bf] []
-%D \definealternativestyle [cap] [\cap] [\cap]
-%D \stoptyping
-%D
-%D A change \type {\bf} in a heading which is to be set in \type {\tfd} does not look
-%D that well, so therefore we leave the second argument of \type
-%D {\definealternativestyle} empty. When we capatalize characters using the pseudo
-%D small cap command \type {\cap}, we want this to take effect in both text and
-%D headings, which is accomplished by assigning both arguments.
-
-\installcorenamespace{alternativestyles} % settings
-\installcorenamespace{alternativestyle} % instances
-
-\installsetuponlycommandhandler \??alternativestyles {alternativestyles}
-
-\setnewconstant \c_font_current_alternative_style_index \plusone
-
-\unexpanded\def\definealternativestyle
- {\dotripleempty\font_basics_define_alternative_style}
-
-\def\font_basics_define_alternative_style[#commands][#variantone][#varianttwo]%
- {\processcommalist[#commands]{\font_basics_define_alternative_style_indeed{#variantone}{#varianttwo}}}
-
-\let\definestyle\definealternativestyle % later redefined
-
-\newconstant\c_fonts_basics_alternative_style_method
-
-\def\font_basics_define_alternative_style_indeed#variantone#varianttwo#command%
- {\setuvalue{\??alternativestyle#command}{\font_helpers_apply_alternative_style{#variantone}{#varianttwo}}%
- \ifcsname#command\endcsname
- % no redefinition
- \orelse\ifnum\c_fonts_basics_alternative_style_method=\plusone
- \ifthirdargument
- \setuevalue{#command}{\triggergroupedcommandcs\begincsname\??alternativestyle#command\endcsname}%
- \else
- \setuvalue{#command}{\triggergroupedcommand{#variantone}}%
- \fi
- \else
- \setuvalue{#command}{\triggergroupedcommand{#variantone}}%
- \fi}
-
-\def\font_helpers_apply_alternative_style
- {\ifcase\c_font_current_alternative_style_index
- \expandafter\gobbletwoarguments
- \or
- \expandafter\firstoftwoarguments
- \or
- \expandafter\secondoftwoarguments
- \else
- \expandafter\firstoftwoarguments
- \fi}
-
-\def\applyalternativestyle#name% public
- {\begincsname\??alternativestyle#name\endcsname}
-
-\appendtoks
- \doifelse{\alternativestylesparameter\c!method}\v!auto
- {\c_fonts_basics_alternative_style_method\plusone}%
- {\c_fonts_basics_alternative_style_method\zerocount}%
-\to \everysetupalternativestyles
-
-%D Maybe too generic, but probably ok is the following. (Maybe one day we will use a
-%D dedicated grouped command for styles.)
-
-% \appendtoks
-% \let\groupedcommand\thirdofthreearguments
-% \to \everysimplifycommands
-
-%D This command also defines the keyword as command. This means that the example
-%D definition of \type {bold} we gave before, results in a command \type {\bold}
-%D which can be used as:
-%D
-%D \startbuffer
-%D He's a \bold{bold} man with a {\bold head}.
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D or
-%D
-%D \startexample
-%D \definealternativestyle[bold][\bf][]\getbuffer
-%D \stopexample
-%D
-%D Such definitions are of course unwanted for \type {\cap} because this would
-%D result in an endless recursive call. Therefore we check on the existance of both
-%D the command and the substitution. The latter is needed because for instance \type
-%D {\type} is an entirely diferent command. That command handles verbatim, while the
-%D style command would just switch to teletype font. This is just an example of a
-%D tricky naming coincidence.
-%D
-%D \macros
-%D {doconvertfont,noconvertfont,
-%D dontconvertfont,redoconvertfont}
-%D
-%D After having defined such keywords, we can call for them by using
-%D
-%D \starttyping
-%D \doconvertfont{keyword}{text}
-%D \stoptyping
-%D
-%D We deliberately pass an argument. This enables us to assign converters that
-%D handle one argument, like \type {\cap}.
-%D
-%D By default the first specification is used to set the style, exept when we say
-%D \type {\dontconvertfont}, after which the second specification is used. We can
-%D also directly call for \type {\noconvertfont}. In nested calls, we can restore
-%D the conversion by saying \type {\redoconvertfont}.
-%D
-%D These commands are not grouped! Grouping is most probably done by the calling
-%D macro's and would lead to unnecessary overhead.
-
-\let\m_current_convert_font \empty
-\let\m_current_convert_font_dt\empty
-
-\unexpanded\def\doconvertfont#specification% takes second argument / this command is obsolete
- {\edef\m_current_convert_font{#specification}%
- \ifx\m_current_convert_font\empty
- %\expandafter\firstofoneargument
- \else
- \expandafter\font_helpers_do_convert_font
- \fi}
-
-\def\font_helpers_do_convert_font
- {\edef\m_current_convert_font_dt{\detokenize\expandafter{\m_current_convert_font}}%
- \ifcsname\??alternativestyle\m_current_convert_font_dt\endcsname
- \expandafter\lastnamedcs
- \orelse\ifcsname\m_current_convert_font_dt\endcsname
- \expandafter\lastnamedcs
- \else
- \expandafter\m_current_convert_font
- \fi}
-
-%D Low level switches (downward compatible, but we keep them as one can use them in
-%D styles):
-%D
-%D \starttyping
-%D \usemodule[abr-02]
-%D \setuphead[chapter][style=\bfb]
-%D \setupfooter[style=\dontconvertfont\bf]
-%D \chapter{This is \TEX}
-%D \stoptyping
-
-\unexpanded\def\dontconvertfont{\c_font_current_alternative_style_index\plustwo} % needs checking in usage
-\unexpanded\def\redoconvertfont{\c_font_current_alternative_style_index\plusone} % needs checking in usage
-
-%D The new one:
-
-\setfalse\fontattributeisset
-
-\unexpanded\def\dousestyleparameter#value%
- {\edef\currentstyleparameter{#value}%
- \ifx\currentstyleparameter\empty\else
- \expandafter\dousecurrentstyleparameter
- \fi}
-
-\unexpanded\def\dousestylehashparameter#hash#parameter%
- {\ifcsname#hash#parameter\endcsname
- \expandafter\dousestyleparameter\lastnamedcs
- \fi}
-
-\unexpanded\def\dousecurrentstyleparameter % empty check outside here
- {\edef\detokenizedstyleparameter{\detokenize\expandafter{\currentstyleparameter}}%
- \settrue\fontattributeisset % reset is done elsewhere
- \ifcsname\??alternativestyle\detokenizedstyleparameter\endcsname
- \lastnamedcs
- \orelse\ifcsname\detokenizedstyleparameter\endcsname
- \lastnamedcs
- \else
- \currentstyleparameter
- \fi}
-
-\let\dosetfontattribute\dousestylehashparameter % for a while
-
-%D New commands (not yet interfaced):
-%D
-%D \startbuffer
-%D \definestyle[one][style=bold,color=darkblue]
-%D
-%D test \one{test} test
-%D test \style[one]{test} test
-%D test \style[color=red]{test} test
-%D test \style[Serif at 20pt]{test} test
-%D \stopbuffer
-%D
-%D \typebuffer \startlines \getbuffer \stoplines
-
-% definitions .. no tagging here
-
-\installcorenamespace{style}
-\installcorenamespace{stylecheck}
-\installcorenamespace{stylehack}
-
-\installcommandhandler \??style {style} \??style
-
-\setupstyle
- [%\c!style=,
- %\c!color=,
- \c!method=\v!command]
-
-\appendtoks
- \letvalue{\??stylecheck\currentstyle}\relax
- \edef\p_method{\styleparameter\c!method}%
- \ifx\p_method\v!command
- \setuevalue{\e!start\currentstyle}{\font_styles_apply_start{\currentstyle}}%
- \setuevalue{\e!stop \currentstyle}{\font_styles_apply_stop}%
- \setuevalue {\currentstyle}{\font_styles_apply_grouped{\currentstyle}}% no longer groupedcommand here
- \fi
-\to \everydefinestyle
-
-\unexpanded\def\font_styles_apply_start#name%
- {\begingroup
- \font_styles_use_defined{#name}}
-
-\unexpanded\def\font_styles_apply_stop
- {\endgroup}
-
-\unexpanded\def\font_styles_apply_grouped#name% assumes that the next is { or \bgroup
- {\bgroup
- \def\g_style{\font_styles_use_defined{#name}}%
- \afterassignment\g_style
- \let\nexttoken}
-
-\unexpanded\def\font_styles_use_defined#name%
- {\edef\currentstyle{#name}%
- \usestylestyleandcolor\c!style\c!color}
-
-\unexpanded\def\font_styles_use_generic#specification%
- {\let\currentstyle\s!unknown % reasonable generic tag
- \letstyleparameter\c!style\empty
- \letstyleparameter\c!color\empty
- \setupcurrentstyle[#specification]%
- \usestylestyleandcolor\c!style\c!color}
-
-% commands
-
-\installcorenamespace{styleargument}
-
-\unexpanded\def\style[#name]% as this is can be a switch we use groupedcommand
- {\csname\??styleargument
- \ifcsname\??stylecheck#name\endcsname
- 2% defined as style
- \orelse\ifcsname\??stylehack#name\endcsname
- 4% defined as command
- \orelse\ifcsname#name\endcsname
- 1% defined as command
- \else
- 3% specification
- \fi
- \endcsname{#name}}
-
-% \setvalue{\??styleargument1}#name%
-% {\groupedcommand{\begincsname#name\endcsname}{}}
-
-\setvalue{\??styleargument1}#name%
- {\expandafter\triggergroupedcommandcs\begincsname#name\endcsname}
-
-% \setvalue{\??styleargument2}#name%
-% {\groupedcommand{\font_styles_use_defined{#name}}{}} % or {\font_styles_apply_grouped{#name}}
-
-\setvalue{\??styleargument2}#name%
- {\triggergroupedcommand{\font_styles_use_defined{#name}}} % or {\font_styles_apply_grouped{#name}}
-
-\setvalue{\??styleargument3}#specification%
- {\doifelseassignment{#specification}\font_styles_assignment\font_styles_direct{#specification}}
-
-\setvalue{\??styleargument4}#name%
- {\expandafter\triggergroupedcommandcs\begincsname\??stylehack#name\endcsname}
-
-\setvalue{\??stylehack\s!math}% dirty trick
- {\groupedcommand\normalstartimath\normalstopimath}
-
-% \def\font_styles_assignment#specification{\groupedcommand{\font_styles_use_generic{#specification}}{}}
-% \def\font_styles_direct #specification{\groupedcommand{\definedfont[#specification]}{}}
-
-\def\font_styles_assignment#specification{\triggergroupedcommand{\font_styles_use_generic{#specification}}}
-\def\font_styles_direct #specification{\triggergroupedcommand{\definedfont[#specification]}}
-
-% environments
-
-\installcorenamespace{styleenvironment}
-
-\unexpanded\def\startstyle[#name]%
- {\begingroup
- \csname\??styleenvironment
- \ifcsname\??stylecheck#name\endcsname
- 2% defined as style
- \orelse\ifcsname#name\endcsname
- 1% defined as command
- \else
- 3% specification
- \fi
- \endcsname{#name}}
-
-\unexpanded\def\stopstyle
- {\endgroup
- \autoinsertnextspace} % will be configurable, maybe also in \definestartstop
-
-\setvalue{\??styleenvironment1}#name%
- {\csname#name\endcsname}
-
-\setvalue{\??styleenvironment2}#name%
- {\font_styles_use_defined{#name}}
-
-\setvalue{\??styleenvironment3}#specification%
- {\doifelseassignment{#specification}\font_styles_start_assignment\font_styles_start_direct{#specification}}
-
-\def\font_styles_start_assignment#specification{\font_styles_use_generic{#specification}}
-\def\font_styles_start_direct #specification{\definedfont[#specification]\relax}
-
-%D Still experimental (might even go away).
-
-% \definestylecollection[mine]
-
-% \definestyleinstance[mine][default][sorry]
-% \definestyleinstance[mine][tt][bs][ttbs:\rm\sl]
-% \definestyleinstance[mine][tt][bf][ttbf:\rm\sl]
-% \definestyleinstance[mine][bf][\sl]
-% \definestyleinstance[mine][sl][\tt]
-
-% {\bf test \mine test \sl test \mine test \bs oeps \mine oeps {\tt test \mine \bf test}}
-
-\installcorenamespace{stylecollection}
-
-\unexpanded\def\definestylecollection
- {\dosingleargument\font_styles_define_style_collection}
-
-\def\font_styles_define_style_collection[#name]%
- {\iffirstargument
- \setuvalue{#name}{\styleinstance[#name]}%
- \def\font_styles_define_style_collection_a#style%
- {\def\font_styles_define_style_collection_b#alternative{\undefinevalue{\??stylecollection#name:#style:#alternative}}%
- \font_helpers_process_alternative_list\font_styles_define_style_collection_b
- \font_styles_define_style_collection_b\s!default}%
- \font_helpers_process_style_list\font_styles_define_style_collection_a
- \font_styles_define_style_collection_a\s!default
- \fi}
-
-\let\font_styles_define_style_collection_a\relax
-\let\font_styles_define_style_collection_b\relax
-
-\unexpanded\def\definestyleinstance
- {\doquadrupleargument\font_styles_define_style_instance}
-
-\def\font_styles_define_style_instance[#instance][#2][#3][#4]% [name] [rm|ss|tt|..] [sl|bf|...] [whatever]
- {\iffirstargument
- \ifcsname#instance\endcsname\else\font_styles_define_style_collection[#instance]\fi
- \fi
- \iffourthargument
- \setvalue{\??stylecollection#instance:#2:#3}{#4}%
- \orelse\ifthirdargument
- \setvalue{\??stylecollection#instance::#2}{#3}%
- \orelse\ifsecondargument
- \letvalueempty{\??stylecollection#instance::#2}%
- \fi}
-
-% \unexpanded\def\styleinstance[#instance]% will be made faster
-% {%\begingroup\normalexpanded{\noexpand\infofont[#1:\fontstyle:\fontalternative]}\endgroup
-% \executeifdefined{\??stylecollection#instance:\fontstyle:\fontalternative}%
-% {\executeifdefined{\??stylecollection#instance:\fontstyle:\s!default}%
-% {\executeifdefined{\??stylecollection#instance::\fontalternative}
-% {\getvalue {\??stylecollection#instance::\s!default}}}}}
-
-\unexpanded\def\styleinstance[#instance]% maybe \lastnamedcs here too
- {\csname\??stylecollection#instance:%
- \ifcsname\??stylecollection#instance:\fontstyle:\fontalternative\endcsname
- \fontstyle:\fontalternative
- \orelse\ifcsname\??stylecollection#instance:\fontstyle:\s!default\endcsname
- \fontstyle:\s!default
- \orelse\ifcsname\??stylecollection#instance::\fontalternative\endcsname
- :\fontalternative
- \else
- :\s!default
- \fi
- \endcsname}
-
-%D Variant selectors
-%D
-%D \starttyping
-%D \mathematics {\vsone{\utfchar{0x2229}}}
-%D \mathematics {\utfchar{0x2229}\vsone{}}
-%D \stoptyping
-
-\unexpanded\edef\vsone#character{#character\normalUchar"FE00 } % used
-\unexpanded\edef\vstwo#character{#character\normalUchar"FE01 } % not used but handy for testing
-
-%D For historic reasons we keep the following around but they are no longer that
-%D relevant for \MKIV.
-
-\unexpanded\def\doattributes#1#2#3#4%
- {\begingroup % geen \bgroup, anders in mathmode lege \hbox
- \dousestylehashparameter{#1}{#2}%
- \dousecolorhashparameter{#1}{#3}%
- #4%
- \endgroup}
-
-\unexpanded\def\dostartattributes#1#2#3%
- {\begingroup % geen \bgroup, anders in mathmode lege \hbox
- \dousestylehashparameter{#1}{#2}%
- \dousecolorhashparameter{#1}{#3}}
-
-\let\dostopattributes\endgroup
-
-%D New but it needs to be supported explicitly (as in natural tables).
-
-\newconditional\c_font_styles_math
-
-\unexpanded\def\font_styles_math_reset
- {\setfalse\c_font_styles_math}
-
-\unexpanded\def\font_styles_math_start
- {\ifconditional\c_font_styles_math
- \startimath
- \fi
- \relax}
-
-\unexpanded\def\font_styles_math_stop
- {\relax
- \ifconditional\c_font_styles_math
- \stopimath
- \fi}
-
-\definealternativestyle[\v!math][\settrue\c_font_styles_math]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-sty.mkvi b/Master/texmf-dist/tex/context/base/mkiv/font-sty.mkvi
index a24194355e2..519381a2e1a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-sty.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-sty.mkvi
@@ -181,6 +181,9 @@
\setfalse\fontattributeisset
+\let\currentstyleparameter \empty % these might become private
+\let\currentdetokenizedstyleparameter\empty % these might become private
+
\unexpanded\def\dousestyleparameter#value%
{\edef\currentstyleparameter{#value}%
\ifx\currentstyleparameter\empty\else
@@ -193,11 +196,11 @@
\fi}
\unexpanded\def\dousecurrentstyleparameter % empty check outside here
- {\edef\detokenizedstyleparameter{\detokenize\expandafter{\currentstyleparameter}}%
+ {\edef\currentdetokenizedstyleparameter{\detokenize\expandafter{\currentstyleparameter}}%
\settrue\fontattributeisset % reset is done elsewhere
- \ifcsname\??alternativestyle\detokenizedstyleparameter\endcsname
+ \ifcsname\??alternativestyle\currentdetokenizedstyleparameter\endcsname
\lastnamedcs
- \else\ifcsname\detokenizedstyleparameter\endcsname
+ \else\ifcsname\currentdetokenizedstyleparameter\endcsname
\lastnamedcs
\else
\currentstyleparameter
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-sym.mklx b/Master/texmf-dist/tex/context/base/mkiv/font-sym.mklx
deleted file mode 100644
index 33f8a62da7b..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/font-sym.mklx
+++ /dev/null
@@ -1,245 +0,0 @@
-%D \module
-%D [ file=font-mat,
-%D version=2011.01.13, % (copied fron font-ini)
-%D title=\CONTEXT\ Font Macros,
-%D subtitle=Symbolic Access,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Font Macros / Symbolic Access}
-
-\unprotect
-
-%D \macros
-%D {getglyph, symbolicfont}
-%D
-%D Individual glyphs can be accessed by using
-%D
-%D \starttyping
-%D \getglyph{fontname}{character}
-%D \stoptyping
-%D
-%D This macro is used in for instance the symbol modules and as one can see, it does
-%D obey the small and even smaller sizes. The \type {\symbolicfont} macro can be
-%D used to switch to a font named \type {fontname} (see \type {cont-log} and \type
-%D {symb-eur} for examples of symbolic definitions.
-
-\def\v_font_string_a
- {\ifx\fontstyle\s!rm \s!Serif \orelse
- \ifx\fontstyle\s!ss \s!Sans \orelse
- \ifx\fontstyle\s!tt \s!Mono \else
- \s!Serif \fi}
-
-\def\v_font_string_b
- {\ifx\fontstyle\s!rm \s!Regular \orelse
- \ifx\fontstyle\s!ss \s!Support \orelse
- \ifx\fontstyle\s!tt \s!Type \else
- \s!Serif \fi}
-
-\def\v_font_string_c
- {\ifx\fontalternative\s!bf \s!Bold \orelse
- \ifx\fontalternative\s!sl \s!Slanted \orelse
- \ifx\fontalternative\s!it \s!Italic \orelse
- \ifx\fontalternative\s!bs \s!BoldSlanted \orelse
- \ifx\fontalternative\s!bi \s!BoldItalic \fi}
-
-\let\v_font_string_d\s!Serif % default fontstyle (will be redefined in type-ini)
-
-\definefontsynonym
- [CurrentFont]
- [\noexpand\v_font_string_a\noexpand\v_font_string_c]
-
-% potential generalization:
-%
-% \letvalue{\??fontfile:t:\s!rm}\s!Serif
-% \letvalue{\??fontfile:t:\s!ss}\s!Sans
-% \letvalue{\??fontfile:t:\s!tt}\s!Mono
-%
-% \letvalue{\??fontfile:a:\s!rm}\s!Regular
-% \letvalue{\??fontfile:a:\s!ss}\s!Support
-% \letvalue{\??fontfile:a:\s!tt}\s!Type
-%
-% \letvalue{\??fontfile:s:\s!bf}\s!Bold
-% \letvalue{\??fontfile:s:\s!sl}\s!Slanted
-% \letvalue{\??fontfile:s:\s!it}\s!Italic
-% \letvalue{\??fontfile:s:\s!bs}\s!BoldSlanted
-% \letvalue{\??fontfile:s:\s!bi}\s!BoldItalic
-%
-% \def\v_font_string_a{\executeifdefined{\??fontfile:t:\fontstyle}\s!Serif}
-% \def\v_font_string_a{\executeifdefined{\??fontfile:t:\fontstyle}\s!Serif}
-% \def\v_font_string_b{\executeifdefined{\??fontfile:a:\fontstyle}\s!Serif}
-% \def\v_font_string_c{\executeifdefined{\??fontfile:s:\fontstyle}\empty}
-% \def\v_font_string_d{\executeifdefined{\??fontfile:t:\csname\??typescriptdefaultstyles\fontclass\endcsname}\s!Serif}
-
-%D \macros
-%D {fontstylesuffix}
-%D
-%D The next macro is used to map non latin fontnames on fonts. See \type
-%D {font-uni} for an example of its use.
-
-\def\fontstylesuffix% why the \s!Regular ? see \getglyph
- {\ifx\fontalternative\s!tf \s!Regular \orelse
- \ifx\fontalternative\s!bf \s!Bold \orelse
- \ifx\fontalternative\s!sl \s!Slanted \orelse
- \ifx\fontalternative\s!it \s!Italic \orelse
- \ifx\fontalternative\s!bs \s!BoldSlanted \orelse
- \ifx\fontalternative\s!bi \s!BoldItalic \orelse
- \ifx\fontalternative\s!sc \s!Caps \else
- \s!Regular \fi}
-
-\def\glyphfontfile#base% appends
- {#base%
- \ifcsname\??fontfile#base\v_font_string_a\v_font_string_c\endcsname
- \v_font_string_a\v_font_string_c
- \orelse\ifcsname\??fontfile#base\v_font_string_b\v_font_string_c\endcsname
- \v_font_string_b\v_font_string_c
- \orelse\ifcsname\??fontfile#base\v_font_string_a\endcsname
- \v_font_string_a
- \orelse\ifcsname\??fontfile#base\v_font_string_b\endcsname
- \v_font_string_b
- \orelse\ifcsname\??fontfile#base\v_font_string_c\endcsname
- \v_font_string_c
- \fi}
-
-%D The next macro can be used to make decisions based on the shape:
-
-\def\doifelseitalic#yes#nop%
- {\ifx\fontalternative\s!sl#yes\orelse
- \ifx\fontalternative\s!it#yes\orelse
- \ifx\fontalternative\s!bs#yes\orelse
- \ifx\fontalternative\s!bi#yes\else#nop\fi}
-
-\let\doifitalicelse\doifelseitalic
-
-%D For an example of usage of the following command, see \type {cont-log.tex}.
-%D
-%D \starttyping
-%D \def\symbolicfont#specification{\definedfont[\glyphfontfile{#specification} sa *]}
-%D \stoptyping
-%D
-%D Since we know what scaling it to be applied, we can implement a much faster
-%D alternative:
-
-\installcorenamespace{symbolfont}
-
-\let\thedefinedfont\relax
-
-\def\setscaledstyledsymbolicfont#1#2#3% quite a slowdown, glyphfontfile
- {\edef\askedsymbolfont{\truefontname{\glyphfontfile{#3}} at \the\dimexpr#2\dimexpr\currentfontbodyscale\dimexpr#1}%
- \ifcsname\??symbolfont\askedsymbolfont\endcsname
- \lastnamedcs
- \else
- \font_basics_define_symbolic_font
- \fi}
-
-\def\setscaleddirectsymbolicfont#1#2#3% quite a slowdown, glyphfontfile
- {\edef\askedsymbolfont{\truefontname{#3} at \the\dimexpr#2\dimexpr\currentfontbodyscale\dimexpr#1}%
- \ifcsname\??symbolfont\askedsymbolfont\endcsname
- \lastnamedcs
- \else
- \font_basics_define_symbolic_font
- \fi}
-
-\def\setstyledsymbolicfont#fontname% quite a slowdown, glyphfontfile
- {\edef\askedsymbolfont{\truefontname{\glyphfontfile{#fontname}} at \the\dimexpr\currentfontbodyscale\dimexpr\fontbody}%
- \ifcsname\??symbolfont\askedsymbolfont\endcsname
- \lastnamedcs
- \else
- \font_basics_define_symbolic_font
- \fi}
-
-\def\setdirectsymbolicfont#fontname%
- {\edef\askedsymbolfont{\truefontname{#fontname} at \the\dimexpr\currentfontbodyscale\dimexpr\fontbody}%
- \ifcsname\??symbolfont\askedsymbolfont\endcsname
- \lastnamedcs
- \else
- \font_basics_define_symbolic_font
- \fi}
-
-\def\font_basics_define_symbolic_font
- {\definefont[currentsymbolfont][\askedsymbolfont]%
- \currentsymbolfont
- \expandafter\glet\csname\??symbolfont\askedsymbolfont\endcsname\lastrawfontcall}
-
-\unexpanded\def\getnamedglyphstyled#fontname#character{{\setstyledsymbolicfont{#fontname}\clf_fontchar{#character}}}
-\unexpanded\def\getnamedglyphdirect#fontname#character{{\setdirectsymbolicfont{#fontname}\clf_fontchar{#character}}}
-\unexpanded\def\getglyphstyled #fontname#character{{\setstyledsymbolicfont{#fontname}\doifelsenumber{#character}\char\donothing#character}}
-\unexpanded\def\getglyphdirect #fontname#character{{\setdirectsymbolicfont{#fontname}\doifelsenumber{#character}\char\donothing#character}}
-\unexpanded\def\resolvedglyphstyled#fontname#character{{\setstyledsymbolicfont{#fontname}\clf_tochar{#character}}}
-\unexpanded\def\resolvedglyphdirect#fontname#character{{\setdirectsymbolicfont{#fontname}\clf_tochar{#character}}}
-
-% this one is wrong:
-
-\unexpanded\def\getscaledglyph#scale#name#content%
- {{\setscaledstyledsymbolicfont\fontbody{#scale}{#name}\doifelsenumber{#content}\char\donothing#content}}
-
-\let\getglyph \getglyphstyled % old
-\let\getrawglyph \getglyphdirect % old
-\let\symbolicsizedfont\setscaledstyledsymbolicfont % old
-\let\symbolicfont \setstyledsymbolicfont % old
-
-\unexpanded\def\symbolicscaledfont{\setsscaledstyledsymbolicfont\fontbody}
-\unexpanded\def\symbolicscaledfont{\setscaledstyledsymbolicfont\fontbody}
-
-%D The last implementation of \type {\getglyph} permits definitions like:
-%D
-%D \starttyping
-%D \definefontsynonym [EuroSans] [eurose]
-%D \definefontsynonym [EuroSansBold] [euroseb]
-%D \definefontsynonym [EuroSansItalic] [eurosei]
-%D \definefontsynonym [EuroSansSlanted] [eurosei]
-%D \definefontsynonym [EuroSansBoldItalic] [eurosebi]
-%D \definefontsynonym [EuroSansBoldSlanted] [eurosebi]
-%D
-%D \definesymbol [euro] [\getglyph{Euro}{\char160}]
-%D
-%D \def\euro{\symbol[euro]}
-%D \stoptyping
-%D
-%D These definitions guarantee that the next calls work okay:
-%D
-%D \starttyping
-%D \ss \tf\euro \bf\euro \sla\euro \itd\euro \bs\euro \bic\euro
-%D \stoptyping
-%D
-%D The shape as well as the size is adapted to the current environment.
-
-%D \macros
-%D {setfont}
-%D
-%D Every now and then we want to define a font directly, for instance when we
-%D typeset title pages. The next macro saves some typing:
-
-\unexpanded\def\setfont% geen \font_helpers_set_font mogelijk
- {\afterassignment\font_basics_set_font\font\nextfont=}
-
-\def\font_basics_set_font
- {\nextfont\setupinterlinespace}% hm, we need to use \setuplocalinterlinespace
-
-%D One can call this macro as:
-%D
-%D \starttyping
-%D \setfont cmr10 at 60pt
-%D \stoptyping
-%D
-%D After which the font is active and the baselines and struts are set.
-
-%D \macros{doiffontcharelse}
-
-\unexpanded\def\doifelsefontchar#specification#unicode% this could be a direct lua call
- {\begingroup
- \font_basics_define_font_without_parameters{thedefinedfont}{#specification}%
- \iffontchar\font#unicode\relax
- \endgroup\expandafter\firstoftwoarguments
- \else
- \endgroup\expandafter\secondoftwoarguments
- \fi}
-
-\let\doiffontcharelse\doifelsefontchar
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-tfm.lua b/Master/texmf-dist/tex/context/base/mkiv/font-tfm.lua
index e2f0d22f2a8..945421a4219 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-tfm.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-tfm.lua
@@ -139,16 +139,17 @@ local function read_from_tfm(specification)
-- If reencode returns a new table, we assume that we're doing something
-- special. An 'auto' reencode picks up its vector from the pfb file.
- if lpdf and lpdf.getmapentry and not features.reencode then
+ local getmapentry = fonts.mappings.getentry
+
+ if getmapentry and not features.reencode then
-- This can happen multiple times but not that often so we don't
-- optimize this.
- local encoding, pfbfile, encfile = lpdf.getmapentry(filename)
+ local encoding, pfbfile, encfile = getmapentry(filename)
if encoding and pfbfile then
features.reencode = encfile
features.pfbfile = pfbfile
end
end
-
local newtfmdata = (depth[filename] == 1) and tfm.reencode(tfmdata,specification)
if newtfmdata then
tfmdata = newtfmdata
@@ -162,6 +163,7 @@ local function read_from_tfm(specification)
shared.features = features
shared.resources = resources
--
+ properties.id = specification.id
properties.name = tfmdata.name -- todo: fallback
properties.fontname = tfmdata.fontname -- todo: fallback
properties.psname = tfmdata.psname -- todo: fallback
@@ -170,9 +172,9 @@ local function read_from_tfm(specification)
properties.format = tfmdata.format or fonts.formats.tfm -- better than nothing
properties.usedbitmap = tfmdata.usedbitmap
--
-if lpdf and lpdf.getmapentry and newtfmdata then
- properties.filename = features.pfbfile
-end
+ if getmapentry and newtfmdata then
+ properties.filename = features.pfbfile
+ end
--
tfmdata.properties = properties
tfmdata.resources = resources
@@ -234,8 +236,10 @@ end
--
-- The tounicode data is passed to the backend that constructs the vectors for us.
--
- tfmdata.tounicode = 1
- local tounicode = fonts.mappings.tounicode
+if not CONTEXTLMTXMODE or CONTEXTLMTXMODE == 0 then
+ tfmdata.tounicode = 1
+end
+ local tounicode = fonts.mappings.tounicode
for unicode, v in next, tfmdata.characters do
local u = v.unicode
if u then
@@ -439,7 +443,7 @@ do
local characters = { }
local originals = tfmdata.characters
local indices = { }
- local parentfont = { "font", 1 }
+ local parentfont = { "font", 1 } -- can be zero (self referencing)
local private = tfmdata.privateoffset or constructors.privateoffset
local reported = encdone[tfmfile][encfile] -- bah, encdone for tfm or pfb ?
-- create characters table
@@ -447,6 +451,14 @@ do
-- vector : pfbindex -> name
-- encoding : tfmindex -> name
+ -- we store the order also because some tex encodings (see math-vfu) needs
+ -- that for remapping with non standard glyphs names cq. lack of unicode
+ -- slot information
+
+ for k, v in next, originals do
+ v.order = k
+ end
+
local backmap = vector and table.swapped(vector)
local done = { } -- prevent duplicate
for tfmindex, name in sortedhash(encoding) do -- predictable order
@@ -458,7 +470,7 @@ do
else
unicode = private
private = private + 1
- if not reported then
+ if trace_defining and not reported then
report_tfm("glyph %a in font %a with encoding %a gets unicode %U",name,tfmfile,encfile,unicode)
end
end
@@ -514,11 +526,13 @@ do
tfmdata.fullname = tfmdata.fullname or tfmdata.name
tfmdata.psname = file.nameonly(pfbfile or tfmdata.name)
tfmdata.filename = pfbfile
- tfmdata.encodingbytes = 2
-- tfmdata.format = bitmap and "type3" or "type1"
tfmdata.format = "type1"
+if not CONTEXTLMTXMODE or CONTEXTLMTXMODE == 0 then
+ tfmdata.encodingbytes = 2
tfmdata.tounicode = 1
tfmdata.embedding = "subset"
+end
tfmdata.usedbitmap = bitmap and virtualid
tfmdata.private = private
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-tpk.lua b/Master/texmf-dist/tex/context/base/mkiv/font-tpk.lua
index 05ecdd45ce1..16b89c3932c 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-tpk.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-tpk.lua
@@ -1,5 +1,6 @@
- if not modules then modules = { } end modules ['font-tpk'] = {
+if not modules then modules = { } end modules ['font-tpk'] = {
version = 1.001,
+ optimize = true,
comment = "companion to font-lib.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
@@ -847,7 +848,6 @@ do
direction = direction,
-- checksum = checksum,
-- embedding = "unknown",
- -- encodingbytes = 0,
-- extend = 1000,
-- slant = 0,
-- squeeze = 0,
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-tra.mkiv b/Master/texmf-dist/tex/context/base/mkiv/font-tra.mkiv
index 89a50c5aeb2..99c7ab3c822 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-tra.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-tra.mkiv
@@ -20,8 +20,8 @@
%D \macros
%D {showbodyfont}
%D
-%D One can call for a rather simple overview of a bodyfont and the
-%D relations between its alternative fonts.
+%D One can call for a rather simple overview of a bodyfont and the relations between
+%D its alternative fonts.
%D
%D \showsetup{showbodyfont}
%D
@@ -37,9 +37,8 @@
%D \macros
%D {showfontstrip, testminimalbaseline, showminimalbaseline}
%D
-%D The next command can come in handy when combining
-%D different fonts into a collection (typeface) and
-%D determining optimal baseline distances.
+%D The next command can come in handy when combining different fonts into a
+%D collection (typeface) and determining optimal baseline distances.
%D
%D \showfontstrip \blank \showminimalbaseline
@@ -109,10 +108,8 @@
\unexpanded\def\stopotfcollecting {\ctxlua{nodes.tracers.steppers.stop()}}
\unexpanded\def\resetotfcollecting{\ctxlua{nodes.tracers.steppers.reset()}}
-% Rather experimental:
-%
% \page \showotfcomposition{arabtype*arab-default at 48pt}{-1}{الضَّرَّ} \page
-% \page \showotfcomposition{arabtype*arab-default at 48pt}{-1}{لِلّٰهِ} \page
+% \page \showotfcomposition{arabtype*arab-default at 48pt}{-1}{لِلّٰهِ} \page
\unexpanded\def\showotfstepglyphs#1%
{\ctxlua{nodes.tracers.steppers.glyphs(\number\otfcollector,#1)}%
@@ -360,7 +357,7 @@
% new
-\unexpanded\def\savefont[#1]% not yet in i-*.xml
+\unexpanded\def\savefontdata[#1]% not yet in i-*.xml
{\begingroup
\getdummyparameters[#1]%
\clf_savefont {
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-ttf.lua b/Master/texmf-dist/tex/context/base/mkiv/font-ttf.lua
index 651ede17e21..a2732aa5f2e 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-ttf.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-ttf.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['font-ttf'] = {
version = 1.001,
+ optimize = true,
comment = "companion to font-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
@@ -162,8 +163,7 @@ local function mergecomposites(glyphs,shapes)
return contours, points
end
--- for index=1,#glyphs do
- for index=0,#glyphs-1 do
+ for index=0,#glyphs do
local shape = shapes[index]
if shape then
local components = shape.components
@@ -658,7 +658,7 @@ local function repackpoints(glyphs,shapes)
local result = { } -- reused
local xpoints = { } -- reused
local ypoints = { } -- reused
- for index=0,#glyphs-1 do
+ for index=0,#glyphs do
local shape = shapes[index]
if shape then
local r = 0
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-vfc.lua b/Master/texmf-dist/tex/context/base/mkiv/font-vfc.lua
index dfe6b3afc46..eff0aa6c636 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-vfc.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-vfc.lua
@@ -13,7 +13,7 @@ local fonts = fonts
local helpers = fonts.helpers
local setmetatableindex = table.setmetatableindex
-local makeweak = table.makeweak
+----- makeweak = table.makeweak
-- Helpers dealing with virtual fonts: beware, these are final values so
-- don't change the content of tables gotten this way!
diff --git a/Master/texmf-dist/tex/context/base/mkiv/good-ctx.lua b/Master/texmf-dist/tex/context/base/mkiv/good-ctx.lua
index 82ef25e29de..80672676c7b 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/good-ctx.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/good-ctx.lua
@@ -32,6 +32,7 @@ local fontgoodies = fonts.goodies or { }
local nuts = nodes.nuts
local tonut = nuts.tonut
local getattr = nuts.getattr
+local getprop = nuts.getprop
local nextglyph = nuts.traversers.glyph
-- colorschemes
@@ -61,8 +62,10 @@ local function setcolorscheme(tfmdata,scheme)
local characters = tfmdata.characters
for i=1,#what do
local w = what[i]
- for j=1,#w do
- local name = w[j]
+ local force = w.force
+ local list = w.list or w
+ for j=1,#list do
+ local name = list[j]
local kind = type(name)
if name == "*" then
-- inefficient but only used for tracing anyway
@@ -81,10 +84,16 @@ local function setcolorscheme(tfmdata,scheme)
-- limited usage: we only deal with non reassigned
-- maybe some day I'll also support the ones with a
-- tounicode in this range
- for unicode=start,stop do
- if characters[unicode] then
+ if force then
+ for unicode=start,stop do
reverse[unicode] = i
end
+ else
+ for unicode=start,stop do
+ if characters[unicode] then
+ reverse[unicode] = i
+ end
+ end
end
end
else
@@ -150,6 +159,13 @@ function colorschemes.coloring(head)
if f ~= lastfont then
lastfont = f
lastscheme = fontproperties[f].colorscheme
+ if not lastscheme then
+ local p = getprop(n, "original")
+ if p then
+ lastfont = p.font
+ lastscheme = fontproperties[lastfont].colorscheme
+ end
+ end
end
if a ~= lastattr then
lastattr = a
@@ -158,6 +174,7 @@ function colorschemes.coloring(head)
if lastscheme then
local sc = lastscheme[char]
if sc then
+ -- todo: use new lmtx mechanism instead
setnodecolor(n,lastcache[sc]) -- we could inline this one
end
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/good-mth.lua b/Master/texmf-dist/tex/context/base/mkiv/good-mth.lua
index 18a97976fd3..3473cc205c4 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/good-mth.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/good-mth.lua
@@ -6,8 +6,9 @@ if not modules then modules = { } end modules ['good-mth'] = {
license = "see context related readme files"
}
-local type, next = type, next
+local type, next, tonumber, unpack = type, next, tonumber, unpack
local ceil = math.ceil
+local match = string.match
local fonts = fonts
@@ -20,6 +21,10 @@ local fontgoodies = fonts.goodies or { }
local fontcharacters = fonts.hashes.characters
+local trace_defining = false trackers.register("math.defining", function(v) trace_defining = v end)
+
+local report_math = logs.reporter("mathematics","initializing")
+
local nuts = nodes.nuts
local setlink = nuts.setlink
@@ -33,11 +38,149 @@ local new_vlist = nodepool.vlist
local insert_node_after = nuts.insert_after
+local helpers = fonts.helpers
+local upcommand = helpers.commands.up
+local rightcommand = helpers.commands.right
+local charcommand = helpers.commands.char
+local prependcommands = helpers.prependcommands
+
-- experiment, we have to load the definitions immediately as they precede
-- the definition so they need to be initialized in the typescript
+local function withscriptcode(tfmdata,unicode,data,action)
+ if type(unicode) == "string" then
+ local p, u = match(unicode,"^(.-):(.-)$")
+ if u then
+ u = tonumber(u)
+ if u then
+ local slots = fonts.helpers.mathscriptslots(tfmdata,u)
+ if slots then
+ if p == "*" then
+ action(u,data)
+ for i=1,#slots do
+ action(slots[i],data)
+ end
+ else
+ p = tonumber(p)
+ if p then
+ action(slots[p],data)
+ end
+ end
+ end
+ end
+ end
+ else
+ action(unicode,data)
+ end
+end
+
local function finalize(tfmdata,feature,value)
- mathematics.overloaddimensions(tfmdata,tfmdata,value)
+-- if tfmdata.mathparameters then -- funny, cambria text has this
+ local goodies = tfmdata.goodies
+ if goodies then
+ local virtualized = mathematics.virtualized
+ for i=1,#goodies do
+ local goodie = goodies[i]
+ local mathematics = goodie.mathematics
+ local dimensions = mathematics and mathematics.dimensions
+ if dimensions then
+ if trace_defining then
+ report_math("overloading dimensions in %a @ %p",tfmdata.properties.fullname,tfmdata.parameters.size)
+ end
+ local characters = tfmdata.characters
+ local descriptions = tfmdata.descriptions
+ local parameters = tfmdata.parameters
+ local factor = parameters.factor
+ local hfactor = parameters.hfactor
+ local vfactor = parameters.vfactor
+ local function overloadone(unicode,data)
+ local character = characters[unicode]
+ if not character then
+ local c = virtualized[unicode]
+ if c then
+ character = characters[c]
+ end
+ end
+ if character then
+ local width = data.width
+ local height = data.height
+ local depth = data.depth
+ if trace_defining and (width or height or depth) then
+ report_math("overloading dimensions of %C, width %p, height %p, depth %p",
+ unicode,width or 0,height or 0,depth or 0)
+ end
+ if width then character.width = width * hfactor end
+ if height then character.height = height * vfactor end
+ if depth then character.depth = depth * vfactor end
+ --
+ local xoffset = data.xoffset
+ local yoffset = data.yoffset
+ if xoffset == "llx" then
+ local d = descriptions[unicode]
+ if d then
+ xoffset = - d.boundingbox[1] * hfactor
+ character.width = character.width + xoffset
+ xoffset = rightcommand[xoffset]
+ else
+ xoffset = nil
+ end
+ elseif xoffset and xoffset ~= 0 then
+ xoffset = rightcommand[xoffset * hfactor]
+ else
+ xoffset = nil
+ end
+ if yoffset and yoffset ~= 0 then
+ yoffset = upcommand[yoffset * vfactor]
+ else
+ yoffset = nil
+ end
+ if xoffset or yoffset then
+ local commands = characters.commands
+ if commands then
+ prependcommands(commands,yoffset,xoffset)
+ else
+ local slot = charcommand[unicode]
+ if xoffset and yoffset then
+ character.commands = { xoffset, yoffset, slot }
+ elseif xoffset then
+ character.commands = { xoffset, slot }
+ else
+ character.commands = { yoffset, slot }
+ end
+ end
+ end
+ elseif trace_defining then
+ report_math("no overloading dimensions of %C, not in font",unicode)
+ end
+ end
+ local function overload(dimensions)
+ for unicode, data in next, dimensions do
+ withscriptcode(tfmdata,unicode,data,overloadone)
+ end
+ end
+ if value == nil then
+ value = { "default" }
+ end
+ if value == "all" or value == true then
+ for name, value in next, dimensions do
+ overload(value)
+ end
+ else
+ if type(value) == "string" then
+ value = utilities.parsers.settings_to_array(value)
+ end
+ if type(value) == "table" then
+ for i=1,#value do
+ local d = dimensions[value[i]]
+ if d then
+ overload(d)
+ end
+ end
+ end
+ end
+ end
+ end
+ end
end
registerotffeature {
@@ -58,7 +201,7 @@ local function initialize(goodies)
local maplines = mathgoodies.maplines
if virtuals then
for name, specification in next, virtuals do
- -- beware, they are all constructed
+ -- beware, they are all constructed ... we should be more selective
mathematics.makefont(name,specification,goodies)
end
end
@@ -77,10 +220,11 @@ end
fontgoodies.register("mathematics", initialize)
-local enabled = false directives.register("fontgoodies.mathkerning",function(v) enabled = v end)
+-- local enabled = false directives.register("fontgoodies.mathkerning",function(v) enabled = v end)
local function initialize(tfmdata)
- if enabled and tfmdata.mathparameters then -- funny, cambria text has this
+-- if enabled and tfmdata.mathparameters then -- funny, cambria text has this
+ if tfmdata.mathparameters then -- funny, cambria text has this
local goodies = tfmdata.goodies
if goodies then
local characters = tfmdata.characters
@@ -91,12 +235,15 @@ local function initialize(tfmdata)
if mathgoodies then
local kerns = mathgoodies.kerns
if kerns then
- for unicode, specification in next, kerns do
+ local function kernone(unicode,data)
local chardata = characters[unicode]
- if chardata and (not chardata.mathkerns or specification.force) then
- chardata.mathkerns = specification
+ if chardata and (not chardata.mathkerns or data.force) then
+ chardata.mathkerns = data
end
end
+ for unicode, data in next, kerns do
+ withscriptcode(tfmdata,unicode,data,kernone)
+ end
return
end
end
@@ -109,9 +256,9 @@ local function initialize(tfmdata)
end
registerotffeature {
- name = "mathkerns",
- description = "math kerns",
- default = true,
+ name = "mathkerns",
+ description = "math kerns",
+ -- default = true,
initializers = {
base = initialize,
node = initialize,
diff --git a/Master/texmf-dist/tex/context/base/mkiv/grph-bmp.lua b/Master/texmf-dist/tex/context/base/mkiv/grph-bmp.lua
index e10b01aa4b6..6669b5db1d4 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/grph-bmp.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/grph-bmp.lua
@@ -39,10 +39,6 @@ function bitmaps.new(xsize,ysize,colorspace,colordepth,mask,index)
}
end
--- function backends.codeinjections.bitmap(bitmap)
--- return lpdf.injectors.bitmap(bitmap)
--- end
-
local function flush(bitmap)
local specification = backends.codeinjections.bitmap(bitmap)
if specification then
@@ -89,7 +85,7 @@ local function placeholder(nx,ny)
end
end
- return lpdf.injectors.bitmap(bitmap)
+ return backends.codeinjections.bitmap(bitmap)
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/grph-chk.lua b/Master/texmf-dist/tex/context/base/mkiv/grph-chk.lua
index ed78b856c60..0cfc9ba085b 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/grph-chk.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/grph-chk.lua
@@ -35,7 +35,7 @@ function checkers.pdf(data)
local request = data.request
local used = data.used
if request and used and not request.scanimage then
- local image = lpdf.epdf.image
+ local image = lpdf.epdf.image -- ok, this is a pdf specific main function
local openpdf = image.open
local closepdf = image.close
local querypdf = image.query
@@ -127,9 +127,9 @@ function checkers.pdf(data)
return genericchecker(data)
end
-local function wrappedidentify(identify,filename)
+local function wrappedidentify(identify,filename,filetype)
local wrapup = function() report_inclusion("fatal error reading %a",filename) end
- local _, result = xpcall(identify,wrapup,filename)
+ local _, result = xpcall(identify,wrapup,filename,filetype)
if result then
local xsize = result.xsize or 0
local ysize = result.ysize or 0
@@ -163,10 +163,9 @@ function checkers.jpg(data)
local used = data.used
if request and used and not request.scanimage then
local identify = graphics.identify
- local inject = lpdf.injectors.jpg
local found = false
request.scanimage = function(t)
- local result = wrappedidentify(identify,t.filename)
+ local result = wrappedidentify(identify,t.filename,"jpg")
found = not result.error
return {
filename = result.filename,
@@ -187,7 +186,7 @@ function checkers.jpg(data)
request.copyimage = function(t)
if found then
found = false
- return inject(t)
+ return backends.codeinjections.jpg(t)
end
end
end
@@ -199,10 +198,9 @@ function checkers.jp2(data) -- idem as jpg
local used = data.used
if request and used and not request.scanimage then
local identify = graphics.identify
- local inject = lpdf.injectors.jp2
local found = false
request.scanimage = function(t)
- local result = wrappedidentify(identify,t.filename)
+ local result = wrappedidentify(identify,t.filename,"jp2")
found = not result.error
return {
filename = result.filename,
@@ -223,7 +221,7 @@ function checkers.jp2(data) -- idem as jpg
request.copyimage = function(t)
if found then
found = false
- return inject(t)
+ return backends.codeinjections.jp2(t)
end
end
end
@@ -235,10 +233,9 @@ function checkers.png(data) -- same as jpg (for now)
local used = data.used
if request and used and not request.scanimage then
local identify = graphics.identify
- local inject = lpdf.injectors.png -- currently pdf specific
local found = false
request.scanimage = function(t)
- local result = wrappedidentify(identify,t.filename)
+ local result = wrappedidentify(identify,t.filename,"png")
found = not result.error
return {
filename = result.filename,
@@ -263,7 +260,7 @@ function checkers.png(data) -- same as jpg (for now)
t.colorref = used.colorref -- this is a bit of a hack
if found then
found = false
- local ok, result = pcall(inject,t)
+ local ok, result = pcall(backends.codeinjections.png,t)
if ok then
return result
else
diff --git a/Master/texmf-dist/tex/context/base/mkiv/grph-con.lua b/Master/texmf-dist/tex/context/base/mkiv/grph-con.lua
index c3c711b0c72..b3d39f0bd93 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/grph-con.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/grph-con.lua
@@ -9,6 +9,7 @@ if not modules then modules = { } end modules ['grph-con'] = {
local P, R, S, Cc, C, Cs, Ct, lpegmatch = lpeg.P, lpeg.R, lpeg.S, lpeg.Cc, lpeg.C, lpeg.Cs, lpeg.Ct, lpeg.match
local tonumber = tonumber
+local find = string.find
local longtostring = string.longtostring
local formatters = string.formatters
local expandfilename = dir.expandname
@@ -194,6 +195,22 @@ do -- svg
-- arguments change again? Ok, it's weirder, with -A then it's a name only when
-- not . (current)
+ -- Beware: the order of printed output lines is a bit random depending on the
+ -- method of calling (bin or pipe) because part of the message prints to stdout
+ -- and part to stderr. Also, on Windows, a second call to the old binaries
+ -- doesn't return anything at all, so that is also a signal of it being old.
+ -- This test will be dropped in 2021 anyway.
+
+ local new = nil
+
+ local function inkscapeformat(suffix)
+ if new == nil then
+ new = os.resultof("inkscape --version") or ""
+ new = new == "" or not find(new,"Inkscape%s*0")
+ end
+ return new and "filename" or suffix
+ end
+
local runner = sandbox.registerrunner {
name = "svg to something",
program = "inkscape",
@@ -209,7 +226,7 @@ do -- svg
resolution = "string",
},
defaults = {
- format = "pdf",
+ format = format,
resolution = "600",
}
}
@@ -220,7 +237,7 @@ do -- svg
function svgconverter.pdf(oldname,newname)
runner {
- format = "pdf",
+ format = inkscapeformat("pdf"),
resolution = "600",
newname = expandfilename(newname),
oldname = expandfilename(oldname),
@@ -229,7 +246,7 @@ do -- svg
function svgconverter.png(oldname,newname)
runner {
- format = "png",
+ format = inkscapeformat("png"),
resolution = "600",
newname = expandfilename(newname),
oldname = expandfilename(oldname),
diff --git a/Master/texmf-dist/tex/context/base/mkiv/grph-epd.lua b/Master/texmf-dist/tex/context/base/mkiv/grph-epd.lua
index f8fa62953dc..0993270f14a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/grph-epd.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/grph-epd.lua
@@ -40,7 +40,7 @@ local function mergegoodies(optionlist)
end
function figures.mergegoodies(optionlist)
- -- todo: we can use runtoks instead
+ -- todo: we can use runlocal instead
context.stepwise(function()
-- we use stepwise because we might need to define symbols
-- for stamps that have no default appearance
diff --git a/Master/texmf-dist/tex/context/base/mkiv/grph-fig.mkiv b/Master/texmf-dist/tex/context/base/mkiv/grph-fig.mkiv
index 3bf3248a6b4..9d34a841794 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/grph-fig.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/grph-fig.mkiv
@@ -256,6 +256,9 @@
\tpack{\vskip12\points\box2\vskip6\points}}%
\endgroup}
+\definesystemconstant {vwa}
+\definesystemconstant {vwb}
+
\unexpanded\def\grph_steps_three_referring(#1,#2)#3(#4,#5)#6[#7]%
{\advance\c_grph_steps_reference\plusone
\position(#1,#2)
@@ -324,7 +327,7 @@
\thisissomeinternal\s!vwb
{#8}%
\gotosomeinternal\s!vwa{#8}\realfolio
- {\hbox to 1.5em{\the\c_grph_steps_reference\presetgoto\hfill}}%
+ {\hbox to 1.5em{\the\c_grph_steps_reference\hfill}}%
\quad#1 (#2,#3) (#5,#6) [#8]\hfill}%
\endgraf}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/grph-img.lua b/Master/texmf-dist/tex/context/base/mkiv/grph-img.lua
index 4b4bee1fc08..0dc5efa7038 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/grph-img.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/grph-img.lua
@@ -97,6 +97,13 @@ do
[0x01] = { name = "TEM", zerolength = true }, -- temporary use
}
+ setmetatableindex(tags, function(t,k)
+ -- we can add some tracing if needed (global) to get an idea
+ local v = "tag " .. k
+ t[k] = v
+ return v
+ end)
+
-- More can be found in http://www.exif.org/Exif2-2.PDF but basically we have
-- good old tiff tags here.
@@ -254,7 +261,7 @@ do
local length = 0
local tagdata = tags[category]
if not tagdata then
- specification.error = "invalid tag"
+ specification.error = "invalid tag " .. (category or "?")
break
elseif tagdata.supported == false then
specification.error = "unsupported " .. tagdata.comment
@@ -602,8 +609,11 @@ do
local y = f:readcardinal4()
local u = f:readcardinal()
if u == 1 then -- meters
- -- x = round(0.0254 * x)
- -- y = round(0.0254 * y)
+ -- there was a reason why this was commented
+ x = round(0.0254 * x)
+ y = round(0.0254 * y)
+ if x == 0 then x = 1 end
+ if y == 0 then y = 1 end
end
specification.xres = x
specification.yres = y
diff --git a/Master/texmf-dist/tex/context/base/mkiv/grph-inc.lua b/Master/texmf-dist/tex/context/base/mkiv/grph-inc.lua
index 8032f3c240f..6fdf74c08da 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/grph-inc.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/grph-inc.lua
@@ -703,11 +703,11 @@ implement { name = "figurestatus", actions = { get, context }, arguments = { "
implement { name = "figurerequest", actions = { get, context }, arguments = { "'request'", "string", "string" } }
implement { name = "figureused", actions = { get, context }, arguments = { "'used'", "string", "string" } }
-implement { name = "figurefilepath", actions = { get, file.dirname, context }, arguments = { "'used'", "'fullname'" } }
-implement { name = "figurefilename", actions = { get, file.nameonly, context }, arguments = { "'used'", "'fullname'" } }
-implement { name = "figurefiletype", actions = { get, file.extname, context }, arguments = { "'used'", "'fullname'" } }
+implement { name = "figurefilepath", public = true, actions = { get, file.dirname, context }, arguments = { "'used'", "'fullname'" } }
+implement { name = "figurefilename", public = true, actions = { get, file.nameonly, context }, arguments = { "'used'", "'fullname'" } }
+implement { name = "figurefiletype", public = true, actions = { get, file.extname, context }, arguments = { "'used'", "'fullname'" } }
-implement { name = "figuresetdimensions", actions = setdimensions, arguments = { "integer" } }
+implement { name = "figuresetdimensions", actions = setdimensions, arguments = "integer" }
-- todo: local path or cache path
@@ -1377,7 +1377,6 @@ function figures.dummy(data)
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
diff --git a/Master/texmf-dist/tex/context/base/mkiv/grph-inc.mkiv b/Master/texmf-dist/tex/context/base/mkiv/grph-inc.mkiv
index 578bad1d067..0b8065989fc 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/grph-inc.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/grph-inc.mkiv
@@ -23,11 +23,6 @@
\registerctxluafile{grph-img}{}
\registerctxluafile{grph-inc}{}
-\ifcase\contextlmtxmode \else
- \registerctxluafile{grph-bmp}{}
- \registerctxluafile{grph-chk}{}
-\fi
-
\registerctxluafile{grph-con}{}
\registerctxluafile{grph-fil}{}
\registerctxluafile{grph-mem}{}
@@ -416,7 +411,7 @@
\else\ifx\p_crossreference\v!no
% nothing
\else\ifx\p_crossreference\v!yes
- \ifassignment
+ \ifcondition\validassignment{#2}%
\scratchcounter\clf_figure_register_page{#1}{}{#2}\relax
\else
\scratchcounter\clf_figure_register_page{#1}{#2}{#3}\relax
@@ -568,9 +563,9 @@
\def\figurefullname {\clf_figureused{fullname}{}}
\def\noffigurepages {\clf_figureused{pages}{0}}
-\def\figurefilepath {\clf_figurefilepath}
-\def\figurefilename {\clf_figurefilename}
-\def\figurefiletype {\clf_figurefiletype}
+% \def\figurefilepath {\clf_figurefilepath} % public in lua
+% \def\figurefilename {\clf_figurefilename} % public in lua
+% \def\figurefiletype {\clf_figurefiletype} % public in lua
\let\naturalfigurewidth \figurenaturalwidth
\let\naturalfigureheight \figurenaturalheight
@@ -687,7 +682,6 @@
% \vss
\vkern\ht\foundexternalfigure
%
- % \parfillskip\zeropoint
\ht\foundexternalfigure\zeropoint
\dp\foundexternalfigure\zeropoint
\hpack to \wd\foundexternalfigure\bgroup
@@ -904,25 +898,6 @@
\unexpanded\def\overlayfigure#1%
{\externalfigure[#1][\c!width=\d_overlay_width,\c!height=\d_overlay_height]}
-% Experimental (will become cleaner):
-
-\ifcase\contextlmtxmode \else
-
- \unexpanded\def\includesvgfile {\dontleavehmode\begingroup\dodoubleempty\grph_include_svg_file}
- \unexpanded\def\includesvgbuffer{\dontleavehmode\begingroup\dodoubleempty\grph_include_svg_buffer}
-
- \def\grph_include_svg_file[#1][#2]%
- {\getdummyparameters[\c!offset=\zeropoint,#2]%
- \clf_includesvgfile{#1}\dimexpr\dummyparameter\c!offset\relax
- \endgroup}
-
- \def\grph_include_svg_buffer[#1][#2]%
- {\getdummyparameters[\c!offset=\zeropoint,#2]%
- \clf_includesvgbuffer{#1}\dimexpr\dummyparameter\c!offset\relax
- \endgroup}
-
-\fi
-
% Bonus:
\useexternalfigure
diff --git a/Master/texmf-dist/tex/context/base/mkiv/grph-pat.lua b/Master/texmf-dist/tex/context/base/mkiv/grph-pat.lua
index e38a9a674d6..4310af672b7 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/grph-pat.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/grph-pat.lua
@@ -38,7 +38,7 @@ interfaces.implement {
return
end
nodes.handlers.finalizebox(number)
- names[name] = lpdf.registerpattern {
+ names[name] = backends.codeinjections.registerpattern {
number = number,
width = specification.width or box.width,
height = specification.height or (box.height + box.depth) ,
diff --git a/Master/texmf-dist/tex/context/base/mkiv/grph-rul.lua b/Master/texmf-dist/tex/context/base/mkiv/grph-rul.lua
index 5067b0165ee..0582a0ad0c8 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/grph-rul.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/grph-rul.lua
@@ -87,6 +87,8 @@ do
local replacer = utilities.templates.replacer
+ -- todo: RuleColor -> just string ?
+
local predefined = {
["fake:word"] = replacer [[
FakeWord(%width%,%height%,%depth%,%line%,%color%);
@@ -133,7 +135,9 @@ def RuleColor = %color% enddef ;
initialized = true
simplemetapost("rulefun",formatters["randomseed := %s;"](getrandom("rulefun",0,4095)))
end
- local pdf = caching and cache[code] or simplemetapost("rulefun",code) -- w, h, d
+ -- we enable extensions but we could also consider to delegate colors
+ -- to the node finalizer
+ local pdf = caching and cache[code] or simplemetapost("rulefun",code,true)
if trace_mp then
report_mp("code: %s",code)
report_mp("pdf : %s",pdf)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/grph-trf.lua b/Master/texmf-dist/tex/context/base/mkiv/grph-trf.lua
new file mode 100644
index 00000000000..b152a54dba0
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkiv/grph-trf.lua
@@ -0,0 +1,126 @@
+if not modules then modules = { } end modules ['grph-trf'] = {
+ version = 1.001,
+ comment = "companion to grph-trf.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- see grph-trf-todo.lua for older preliminary code for the rest
+
+local sind, cosd, tand, abs = math.sind, math.cosd, math.tand, math.abs
+
+local texsetdimen = tex.setdimen
+
+local function analyzerotate(rotation,width,height,depth,total,notfit,obeydepth)
+ --
+ -- print(rotation,width,height,depth,notfit,obeydepth)
+ --
+ local sin = sind(rotation)
+ local cos = cosd(rotation)
+ local abssin = abs(sin)
+ local abscos = abs(cos)
+ local xsize = 0
+ local ysize = 0
+ local xposition = 0
+ local yposition = 0
+ local xoffset = 0
+ local yoffset = 0
+ local newwidth = width
+ local newheight = height
+ local newdepth = depth
+ -- print(sin,cos)
+ if sin > 0 then
+ if cos > 0 then
+ xsize = cos * width + sin * total
+ ysize = sin * width + cos * total
+ yposition = cos * total
+ if notfit then
+ xoffset = - sin * height
+ newwidth = sin * depth + cos * width
+ else
+ newwidth = xsize + xposition - xoffset
+ end
+ if obeydepth then
+ yoffset = cos * depth
+ end
+ newheight = ysize - yoffset
+ newdepth = yoffset
+ -- print("case 1, done")
+ else
+ xsize = abscos * width + sin * total
+ ysize = sin * width + abscos * total
+ xposition = abscos * width
+ if notfit then
+ xoffset = - xsize + sin * depth
+ end
+ if obeydepth then
+ yoffset = abscos * height
+ newwidth = abssin * total + abscos * width + xoffset
+ else
+ newwidth = xsize
+ end
+ newheight = ysize - yoffset
+ newdepth = yoffset
+ -- print("case 2, done")
+ end
+ else
+ if cos < 0 then
+ xsize = abscos * width + abssin * total
+ ysize = abssin * width + abscos * total
+ xposition = xsize
+ yposition = abssin * width
+ if notfit then
+ xoffset = - xsize + abssin * height
+ end
+ if obeydepth then
+ yoffset = ysize + cos * depth
+ end
+ newwidth = notfit and (abssin * height) or xsize
+ newheight = ysize - yoffset
+ newdepth = yoffset
+ -- print("case 3, done")
+ else
+ xsize = cos * width + abssin * total
+ ysize = abssin * width + cos * total
+ xposition = abssin * total
+ yposition = cos * total
+ if notfit then
+ xoffset = - abssin * depth
+ newwidth = xsize + xoffset
+ else
+ newwidth = xsize
+ end
+ if obeydepth then
+ yoffset = cos * depth
+ end
+ newheight = ysize - yoffset + sin * width
+ newdepth = yoffset - sin * width
+ -- print("case 4, done")
+ end
+ end
+ texsetdimen("d_grph_rotate_x_size", xsize)
+ texsetdimen("d_grph_rotate_y_size", ysize)
+ texsetdimen("d_grph_rotate_x_position", xposition)
+ texsetdimen("d_grph_rotate_y_position", yposition)
+ texsetdimen("d_grph_rotate_x_offset", xoffset)
+ texsetdimen("d_grph_rotate_y_offset", yoffset)
+ texsetdimen("d_grph_rotate_new_width", newwidth)
+ texsetdimen("d_grph_rotate_new_height", newheight)
+ texsetdimen("d_grph_rotate_new_depth", newdepth)
+end
+
+interfaces.implement {
+ name = "analyzerotate",
+ actions = analyzerotate,
+ arguments = {
+-- "integer",
+ "number",
+ "dimension",
+ "dimension",
+ "dimension",
+ "dimension",
+ "conditional",
+ "conditional",
+ },
+}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/grph-trf.mkiv b/Master/texmf-dist/tex/context/base/mkiv/grph-trf.mkiv
index f9218036c33..d6a6acd78ca 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/grph-trf.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/grph-trf.mkiv
@@ -24,6 +24,8 @@
%D We could move the calculations to \LUA\ and clean up this lot anyway. On the
%D other hand, there is some danger of messing up so it has a real low priority.
+\registerctxluafile{grph-trf}{}
+
% local:
\newdimen\d_grph_scale_x_size
@@ -794,6 +796,8 @@
\installcorenamespace {rotatelocation}
\installcorenamespace {rotatepreset}
+% todo: scratchcounters
+
\newdimen\d_grph_rotate_x_size
\newdimen\d_grph_rotate_y_size
\newdimen\d_grph_rotate_x_offset
@@ -811,6 +815,10 @@
\let\d_grph_rotate_saved_height\!!heightb
\let\d_grph_rotate_saved_depth \!!depthb
+\let\d_grph_rotate_new_width \!!widthc
+\let\d_grph_rotate_new_height\!!heightc
+\let\d_grph_rotate_new_depth \!!depthc
+
\newconditional\c_grph_rotate_obey_depth
\newconditional\c_grph_rotate_not_fit
\newconditional\c_grph_rotate_center
@@ -948,111 +956,30 @@
\d_grph_rotate_saved_width \wd\nextbox
\d_grph_rotate_saved_height\ht\nextbox
\d_grph_rotate_saved_depth \dp\nextbox
- \setbox\nextbox\naturalvpack{\vskip.5\ht\nextbox\hskip-.5\wd\nextbox\box\nextbox}%
+ \setbox\nextbox\naturalhpack{\hskip-.5\wd\nextbox\lower.5\ht\nextbox\box\nextbox}%
\smashbox\nextbox
\fi
+ %
\d_grph_rotate_width \wd\nextbox
\d_grph_rotate_height\ht\nextbox
\d_grph_rotate_depth \dp\nextbox
- \setbox\nextbox\naturalvpack{\naturalhpack{\raise\dp\nextbox\box\nextbox}}%
- \d_grph_rotate_used_height \ht\nextbox
- % much of the next happens in lua (all the sin and cos) so we can do that in
- % one go if needed
- \setcalculatedcos\cos\p_rotation_rotation
- \setcalculatedsin\sin\p_rotation_rotation
- \ifdim\sin\points>\zeropoint
- \ifdim\cos\points>\zeropoint
- \grph_rotate_calculate_a
- \grph_rotate_apply
- \else
- \grph_rotate_calculate_b
- \grph_rotate_apply
- \wd\nextbox\ifconditional\c_grph_rotate_not_fit\sin\d_grph_rotate_depth\else\d_grph_rotate_x_size\fi
- \fi
- \else
- \ifdim\cos\points<\zeropoint
- \grph_rotate_calculate_c
- \grph_rotate_apply
- \wd\nextbox\ifconditional\c_grph_rotate_not_fit\negated\sin\d_grph_rotate_height\else\d_grph_rotate_x_size\fi
- \else\ifdim\sin\points=\zeropoint
- \grph_rotate_calculate_d
- \grph_rotate_apply
- % no wd ?
- \else
- \grph_rotate_calculate_e
- \grph_rotate_apply
- \wd\nextbox\ifconditional\c_grph_rotate_not_fit\negated\sin\d_grph_rotate_height\else\d_grph_rotate_x_size\fi
- \fi\fi
- \fi
- \ifconditional\c_grph_rotate_center
- \setbox\nextbox\naturalvpack{\vskip-.5\d_grph_rotate_saved_height\hskip.5\d_grph_rotate_saved_height\box\nextbox}%
- \wd\nextbox\d_grph_rotate_saved_width
- \ht\nextbox\d_grph_rotate_saved_height
- \dp\nextbox\d_grph_rotate_saved_depth
- \fi
- \boxcursor\box\nextbox}
-
-\def\grph_rotate_calculate_a
- {\d_grph_rotate_x_size\dimexpr\cos\d_grph_rotate_width+\sin\d_grph_rotate_used_height\relax
- \d_grph_rotate_y_size\dimexpr\sin\d_grph_rotate_width+\cos\d_grph_rotate_used_height\relax
- \d_grph_rotate_x_position\zeropoint
- \d_grph_rotate_y_position\cos\d_grph_rotate_used_height
- \ifconditional\c_grph_rotate_not_fit
- \d_grph_rotate_x_offset\dimexpr\negated\sin\d_grph_rotate_used_height+\sin\d_grph_rotate_depth\relax
- \fi
- \ifconditional\c_grph_rotate_obey_depth
- \d_grph_rotate_y_offset\cos\d_grph_rotate_depth
- \fi}
-
-\def\grph_rotate_calculate_b
- {\d_grph_rotate_x_size\dimexpr\negated\cos\d_grph_rotate_width+\sin\d_grph_rotate_used_height\relax
- \d_grph_rotate_y_size\dimexpr\sin\d_grph_rotate_width+\negated\cos\d_grph_rotate_used_height\relax
- \d_grph_rotate_x_position\negated\cos\d_grph_rotate_width
- \d_grph_rotate_y_position\zeropoint
- \ifconditional\c_grph_rotate_not_fit
- \d_grph_rotate_x_offset\dimexpr-\d_grph_rotate_x_size+\sin\d_grph_rotate_depth\relax
- \fi
- \ifconditional\c_grph_rotate_obey_depth
- \d_grph_rotate_y_offset\negated\cos\d_grph_rotate_height
- \fi}
-
-\def\grph_rotate_calculate_c
- {\d_grph_rotate_x_size\dimexpr\negated\cos\d_grph_rotate_width+\negated\sin\d_grph_rotate_used_height\relax
- \d_grph_rotate_y_size\dimexpr\negated\sin\d_grph_rotate_width+\negated\cos\d_grph_rotate_used_height\relax
- \d_grph_rotate_x_position\d_grph_rotate_x_size
- \d_grph_rotate_y_position\negated\sin\d_grph_rotate_width
- \ifconditional\c_grph_rotate_not_fit
- \d_grph_rotate_x_offset\dimexpr-\d_grph_rotate_x_size+\negated\sin\d_grph_rotate_height\relax
- \fi
- \ifconditional\c_grph_rotate_obey_depth
- \d_grph_rotate_y_offset\dimexpr\d_grph_rotate_y_size+\cos\d_grph_rotate_depth\relax
- \fi}
-
-\def\grph_rotate_calculate_d
- {\d_grph_rotate_x_size\dimexpr\cos\d_grph_rotate_width+\negated\sin\d_grph_rotate_used_height\relax
- \d_grph_rotate_y_size\dimexpr\negated\sin\d_grph_rotate_width+\cos\d_grph_rotate_used_height\relax
- \d_grph_rotate_x_position\zeropoint
- \d_grph_rotate_y_position\d_grph_rotate_y_size
- \d_grph_rotate_x_offset\zeropoint
- \ifconditional\c_grph_rotate_obey_depth
- \d_grph_rotate_y_offset\d_grph_rotate_depth
- \fi}
-
-\def\grph_rotate_calculate_e
- {\d_grph_rotate_x_size\dimexpr\cos\d_grph_rotate_width+\negated\sin\d_grph_rotate_used_height\relax
- \d_grph_rotate_y_size\dimexpr\negated\sin\d_grph_rotate_width+\cos\d_grph_rotate_used_height\relax
- \d_grph_rotate_x_position\negated\sin\d_grph_rotate_used_height
- \d_grph_rotate_y_position\d_grph_rotate_y_size
- \ifconditional\c_grph_rotate_not_fit
- \d_grph_rotate_x_offset\dimexpr-\d_grph_rotate_x_size+\negated\sin\d_grph_rotate_height\relax
- \fi
- \ifconditional\c_grph_rotate_obey_depth
- \d_grph_rotate_y_offset\negated\sin\d_grph_rotate_depth
- \fi}
-
-\def\grph_rotate_apply
- {\setbox\nextbox\naturalvpack to \d_grph_rotate_y_size
- {\vfill
+ %
+ \setbox\nextbox\naturalvpack{\naturalhpack{\raise\dp\nextbox\box\nextbox}}% can we do without
+ %
+ \d_grph_rotate_used_height\ht\nextbox
+ %
+ \clf_analyzerotate % rather accurate
+ \p_rotation_rotation\space
+ \d_grph_rotate_width
+ \d_grph_rotate_height
+ \d_grph_rotate_depth
+ \d_grph_rotate_used_height
+ \c_grph_rotate_not_fit
+ \c_grph_rotate_obey_depth
+ \relax
+ %
+ \setbox\nextbox\naturalvpack to \d_grph_rotate_y_size
+ {\vfilll
\naturalhpack to \d_grph_rotate_x_size
{\dostartrotation\p_rotation_rotation
\wd\nextbox\zeropoint
@@ -1061,9 +988,24 @@
\dostoprotation
\hfill}%
\kern\d_grph_rotate_y_position}%
+ %
\setbox\nextbox\naturalhpack
{\kern\dimexpr\d_grph_rotate_x_position+\d_grph_rotate_x_offset\relax
- \lower\d_grph_rotate_y_offset\box\nextbox}}
+ \lower\d_grph_rotate_y_offset
+ \box\nextbox}%
+ %
+ \ifconditional\c_grph_rotate_center
+ \setbox\nextbox\naturalhpack{\hskip.5\d_grph_rotate_saved_width\lower-.5\d_grph_rotate_saved_height\box\nextbox}%
+ \wd\nextbox\d_grph_rotate_saved_width
+ \ht\nextbox\d_grph_rotate_saved_height
+ \dp\nextbox\d_grph_rotate_saved_depth
+ \else
+ \wd\nextbox\d_grph_rotate_new_width
+ \ht\nextbox\d_grph_rotate_new_height
+ \dp\nextbox\d_grph_rotate_new_depth
+ \fi
+ %
+ \boxcursor\box\nextbox}
% \dostepwiserecurse{0}{360}{10}
% {\startlinecorrection[blank]
@@ -1077,4 +1019,23 @@
% \hbox to .2\hsize{\hss\ruledhbox{\rotate[location=high] {\ruledhbox{\bfb (high)}}}}}
% \stoplinecorrection}
+% \def\Test{\ruledhbox{%
+% \def\DemoX{\vl\kern.5\emwidth\vl}%
+% \kern\emwidth\ruledhpack{\green\rotate[rotation=20] {\ruledhpack{\DemoX}}}%
+% \kern\emwidth\ruledhpack{\blue \rotate[rotation=0] {\ruledhpack{\DemoX}}}%
+% \kern\emwidth\ruledhpack{\red \rotate[rotation=-20] {\ruledhpack{\DemoX}}}%
+% \kern\emwidth\ruledhpack{\green\rotate[rotation=200] {\ruledhpack{\DemoX}}}%
+% \kern\emwidth\ruledhpack{\blue \rotate[rotation=180] {\ruledhpack{\DemoX}}}%
+% \kern\emwidth\ruledhpack{\red \rotate[rotation=-200]{\ruledhpack{\DemoX}}}%
+% \kern\emwidth}}
+
+% \startTEXpage[offset=10pt,align=middle]
+% \setuprotate[location=fit] \Test \par {\infofont\setstrut\strut fit} \par
+% \setuprotate[location=depth] \Test \par {\infofont\setstrut\strut depth} \par
+% \setuprotate[location=broad] \Test \par {\infofont\setstrut\strut broad} \par
+% \setuprotate[location=high] \Test \par {\infofont\setstrut\strut high} \par
+% \setuprotate[location=middle] \Test \par {\infofont\setstrut\strut middle} \par
+% \setuprotate[location=default] \Test \par {\infofont\setstrut\strut default} \par
+% \stopTEXpage
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/hand-ini.mkxl b/Master/texmf-dist/tex/context/base/mkiv/hand-ini.mkxl
deleted file mode 100644
index ca6922dddeb..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/hand-ini.mkxl
+++ /dev/null
@@ -1,111 +0,0 @@
-%D \module
-%D [ file=hand-ini,
-%D version=2008.02.12,
-%D title=\CONTEXT\ Handling Macros,
-%D subtitle=Initialization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-%D Handling is implemented differently in \MKIV. Maybe I'll cook up
-%D some compatibility hack.
-
-% \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.
-
-\unexpanded\def\setupfontexpansion {\dodoubleargument\font_expansion_setup }
-\unexpanded\def\setupfontprotrusion{\dodoubleargument\font_protrusion_setup}
-
-\def\font_expansion_setup [#1][#2]{\clf_setupfontexpansion {#1}{#2}}
-\def\font_protrusion_setup[#1][#2]{\clf_setupfontprotrusion{#1}{#2}}
-
-% \setupfontprotrusion[quality-upright][vector=quality]
-% \setupfontprotrusion[quality-slanted][vector=quality,right=1.5]
-
-\let\adjustspacing\relax \newcount\adjustspacing % a little bit protection
-\let\protrudechars\relax \newcount\protrudechars % a little bit protection
-
-% at some point we can introduce extreme expansion, i.e. \normaladjustspacing\plustwo
-
-% 0 = disabled
-% 1 = notused (thesis)
-% 2 = glyph + kern
-% 3 = glyph only
-
-\def\font_expansion_enable {\normaladjustspacing\plusthree}
-\def\font_expansion_enable_k{\normaladjustspacing\plustwo}
-%def\font_expansion_enable_n{\normaladjustspacing\plusone}
-\def\font_expansion_disable {\normaladjustspacing\zerocount}
-
-\def\font_protruding_enable_b{\normalprotrudechars\plusthree} % also deal with r2l (experimental lmtx)
-\def\font_protruding_enable {\normalprotrudechars\plustwo }
-\def\font_protruding_disable {\normalprotrudechars\zerocount}
-
-\appendtoks \font_expansion_disable \to \everyforgetall % Here or not here?
-\appendtoks \font_protruding_disable \to \everyforgetall % Here or not here?
-
-% \def\fonthandlingerror{\writestatus\m!fonts{font handling is replaced by features in mkiv}}
-%
-% \let\fonthandling\empty
-%
-% \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}
-
-\installcorenamespace{expansion}
-
-\installcommandhandler \??expansion {expansion} \??expansion
-
-\appendtoks
- \setuevalue{\??expansion:\currentexpansion}%
- {\adjustspacingstep \expansionparameter\c!step\relax
- \adjustspacingstretch\expansionparameter\c!stretch\relax
- \adjustspacingshrink \expansionparameter\c!shrink\relax}%
-\to \everydefineexpansion
-
-\defineexpansion
- [\c!step=1,
- \c!stretch=40,
- \c!shrink=20]
-
-% \defineexpansion
-% [myexpansion]
-% [\c!stretch=50,
-% \c!shrink=20]
-
-\unexpanded\def\setexpansion
- {\dosingleempty\font_expansion_set}
-
-\unexpanded\def\font_expansion_set[#1]%
- {\begincsname\??expansion:#1\endcsname}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/l-lpeg.lua b/Master/texmf-dist/tex/context/base/mkiv/l-lpeg.lua
index 7979a40fb94..b0868ba4886 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/l-lpeg.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/l-lpeg.lua
@@ -203,12 +203,14 @@ local collapser = Cs(spacer^0/"" * nonspacer^0 * ((spacer^0/" " * nonspac
local nospacer = Cs((whitespace^1/"" + nonwhitespace^1)^0)
local b_collapser = Cs( whitespace^0 /"" * (nonwhitespace^1 + whitespace^1/" ")^0)
-local e_collapser = Cs((whitespace^1 * endofstring/"" + nonwhitespace^1 + whitespace^1/" ")^0)
local m_collapser = Cs( (nonwhitespace^1 + whitespace^1/" ")^0)
+local e_collapser = Cs((whitespace^1 * endofstring/"" + nonwhitespace^1 + whitespace^1/" ")^0)
+local x_collapser = Cs( (nonwhitespace^1 + whitespace^1/"" )^0)
local b_stripper = Cs( spacer^0 /"" * (nonspacer^1 + spacer^1/" ")^0)
-local e_stripper = Cs((spacer^1 * endofstring/"" + nonspacer^1 + spacer^1/" ")^0)
local m_stripper = Cs( (nonspacer^1 + spacer^1/" ")^0)
+local e_stripper = Cs((spacer^1 * endofstring/"" + nonspacer^1 + spacer^1/" ")^0)
+local x_stripper = Cs( (nonspacer^1 + spacer^1/"" )^0)
patterns.stripper = stripper
patterns.fullstripper = fullstripper
@@ -218,10 +220,12 @@ patterns.nospacer = nospacer
patterns.b_collapser = b_collapser
patterns.m_collapser = m_collapser
patterns.e_collapser = e_collapser
+patterns.x_collapser = x_collapser
patterns.b_stripper = b_stripper
patterns.m_stripper = m_stripper
patterns.e_stripper = e_stripper
+patterns.x_stripper = x_stripper
patterns.lowercase = lowercase
patterns.uppercase = uppercase
diff --git a/Master/texmf-dist/tex/context/base/mkiv/l-lua.lua b/Master/texmf-dist/tex/context/base/mkiv/l-lua.lua
index f411230d4aa..00989c5cea7 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/l-lua.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/l-lua.lua
@@ -195,12 +195,6 @@ function optionalrequire(...)
end
end
--- nice for non ascii scripts (this might move):
-
-if lua then
- lua.mask = load([[τεχ = 1]]) and "utf" or "ascii"
-end
-
local flush = io.flush
if flush then
diff --git a/Master/texmf-dist/tex/context/base/mkiv/l-os.lua b/Master/texmf-dist/tex/context/base/mkiv/l-os.lua
index 9aa8b8aa78c..73841074c46 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/l-os.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/l-os.lua
@@ -358,6 +358,8 @@ elseif name == "macosx" then
platform = "osx-intel"
elseif find(architecture,"x86_64",1,true) then
platform = "osx-64"
+ elseif find(architecture,"arm64",1,true) then
+ platform = "osx-64"
else
platform = "osx-ppc"
end
@@ -604,11 +606,19 @@ os.isleapyear = isleapyear
local days = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
-local function nofdays(year,month)
+local function nofdays(year,month,day)
if not month then
return isleapyear(year) and 365 or 364
- else
+ elseif not day then
return month == 2 and isleapyear(year) and 29 or days[month]
+ else
+ for i=1,month-1 do
+ day = day + days[i]
+ end
+ if month > 2 and isleapyear(year) then
+ day = day + 1
+ end
+ return day
end
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/l-package.lua b/Master/texmf-dist/tex/context/base/mkiv/l-package.lua
index 0dd71e5eca8..ef37aebe74e 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/l-package.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/l-package.lua
@@ -16,7 +16,7 @@ if not modules then modules = { } end modules ['l-package'] = {
-- -- local mylib = require("libtest")
-- -- local mysql = require("luasql.mysql")
-local type = type
+local type, unpack = type, unpack
local gsub, format, find = string.gsub, string.format, string.find
local insert, remove = table.insert, table.remove
@@ -54,7 +54,7 @@ local function lualibfile(name)
return lpegmatch(pattern,name) or name
end
-local offset = luarocks and 1 or 0 -- todo: also check other extras
+local offset = luarocks and 1 or 0 -- todo: also check other extras ... we'll drop this luarocks anyway
local helpers = package.helpers or {
cleanpath = cleanpath,
@@ -70,6 +70,7 @@ local helpers = package.helpers or {
methods = {
},
sequence = {
+ "reset loaded",
"already loaded",
"preload table",
"qualified path", -- beware, lua itself doesn't handle qualified paths (prepends ./)
@@ -91,6 +92,7 @@ local builtin = helpers.builtin
local extraluapaths = { }
local extralibpaths = { }
+local checkedfiles = { }
local luapaths = nil -- delayed
local libpaths = nil -- delayed
local oldluapath = nil
@@ -245,10 +247,17 @@ local function loadedaslib(resolved,rawname) -- todo: strip all before first -
-- so, we can do a require("foo/bar") and initialize bar
-- local base = gsub(file.basename(rawname),"%.","_")
local init = "luaopen_" .. gsub(base,"%.","_")
+ local data = { resolved, init, "" }
+ checkedfiles[#checkedfiles+1] = data
if helpers.trace then
helpers.report("calling loadlib with '%s' with init '%s'",resolved,init)
end
- return package.loadlib(resolved,init)
+ local a, b, c = package.loadlib(resolved,init)
+ if not a and type(b) == "string" then
+-- data[3] = gsub(b or "unknown error","[\n\r]","")
+ data[3] = string.fullstrip(b or "unknown error")
+ end
+ return a, b, c -- c can be 'init'
end
helpers.loadedaslib = loadedaslib
@@ -295,12 +304,21 @@ end
helpers.loadedbyname = loadedbyname
+methods["reset loaded"] = function(name)
+ checkedfiles = { }
+ return false
+end
+
+
methods["already loaded"] = function(name)
return package.loaded[name]
end
methods["preload table"] = function(name)
- return builtin["preload table"](name)
+ local f = builtin["preload table"]
+ if f then
+ return f(name)
+ end
end
methods["qualified path"]=function(name)
@@ -316,22 +334,34 @@ methods["lib extra list"] = function(name)
end
methods["path specification"] = function(name)
- getluapaths() -- triggers list building and tracing
- return builtin["path specification"](name)
+ local f = builtin["path specification"]
+ if f then
+ getluapaths() -- triggers list building and tracing
+ return f(name)
+ end
end
methods["cpath specification"] = function(name)
- getlibpaths() -- triggers list building and tracing
- return builtin["cpath specification"](name)
+ local f = builtin["cpath specification"]
+ if f then
+ getlibpaths() -- triggers list building and tracing
+ return f(name)
+ end
end
methods["all in one fallback"] = function(name)
- return builtin["all in one fallback"](name)
+ local f = builtin["all in one fallback"]
+ if f then
+ return f(name)
+ end
end
methods["not loaded"] = function(name)
if helpers.trace then
helpers.report("unable to locate '%s'",name or "?")
+ for i=1,#checkedfiles do
+ helpers.report("checked file '%s', initializer '%s', message '%s'",unpack(checkedfiles[i]))
+ end
end
return nil
end
@@ -346,19 +376,22 @@ function helpers.loaded(name)
level = level + 1
for i=1,#sequence do
local method = sequence[i]
- if helpers.trace then
- helpers.report("%s, level '%s', method '%s', name '%s'","locating",level,method,name)
- end
- local result, rest = methods[method](name)
- if type(result) == "function" then
+ local lookup = method and methods[method]
+ if type(lookup) == "function" then
if helpers.trace then
- helpers.report("%s, level '%s', method '%s', name '%s'","found",level,method,name)
+ helpers.report("%s, level '%s', method '%s', name '%s'","locating",level,method,name)
end
- if helpers.traceused then
- used[#used+1] = { level = level, name = name }
+ local result, rest = lookup(name)
+ if type(result) == "function" then
+ if helpers.trace then
+ helpers.report("%s, level '%s', method '%s', name '%s'","found",level,method,name)
+ end
+ if helpers.traceused then
+ used[#used+1] = { level = level, name = name }
+ end
+ level = level - 1
+ return result, rest
end
- level = level - 1
- return result, rest
end
end
-- safeguard, we never come here
diff --git a/Master/texmf-dist/tex/context/base/mkiv/l-unicode.lua b/Master/texmf-dist/tex/context/base/mkiv/l-unicode.lua
index c57aaf33ebc..03016ed9010 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/l-unicode.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/l-unicode.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['l-unicode'] = {
version = 1.001,
+ optimize = true,
comment = "companion to luat-lib.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-def.mkiv b/Master/texmf-dist/tex/context/base/mkiv/lang-def.mkiv
index 7f3e85f0812..85c1f3ac775 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lang-def.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/lang-def.mkiv
@@ -256,17 +256,18 @@
\c!date={\v!day,{.},\space,\v!month,\space,\v!year}]
\installlanguage
- [\s!sl]
- [\c!spacing=\v!packed,
- \c!leftsentence=\hbox{\endash\space},
- \c!rightsentence=\hbox{\space\endash},
- \c!leftsubsentence=\endash,
- \c!rightsubsentence=\endash,
- \c!leftquote=\guilsingleright,
- \c!rightquote=\guilsingleleft,
- \c!leftquotation=\rightguillemot,
- \c!rightquotation=\leftguillemot,
- \c!date={\v!day,{.},\space,\v!month,\space,\v!year}]
+ [\s!sl]
+ [\c!command=\v!no,
+ \c!spacing=\v!packed,
+ \c!leftsentence=\hbox{\endash\space},
+ \c!rightsentence=\hbox{\space\endash},
+ \c!leftsubsentence=\endash,
+ \c!rightsubsentence=\endash,
+ \c!leftquote=\guilsingleright,
+ \c!rightquote=\guilsingleleft,
+ \c!leftquotation=\rightguillemot,
+ \c!rightquotation=\leftguillemot,
+ \c!date={\v!day,{.},\space,\v!month,\space,\v!year}]
\installlanguage [\s!polish] [\s!pl]
\installlanguage [\s!czech] [\s!cs]
@@ -308,8 +309,55 @@
\c!date={\v!day,\space,\v!month,\space,\v!year},
\s!patterns=\s!uk]
-\installlanguage [\s!russian] [\s!ru]
-\installlanguage [\s!ukrainian] [\s!ua]
+\installlanguage
+ [\s!be]
+ [\s!lefthyphenmin=2,
+ \s!righthyphenmin=2,
+ \c!spacing=\v!packed,
+ \c!leftsentence=\leftguillemot,
+ \c!rightsentence=\rightguillemot,
+ \c!leftsubsentence=\lowerleftdoubleninequote,
+ \c!rightsubsentence=\upperrightdoublesixquote,
+ \c!leftquote=\lowerleftdoubleninequote,
+ \c!rightquote=\upperrightdoublesixquote,
+ \c!leftquotation=\leftguillemot,
+ \c!rightquotation=\rightguillemot,
+ \c!date={\v!day,\space,\v!month,\space,\v!year}]
+
+ \installlanguage
+ [\s!sr]
+ [\c!spacing=\v!packed,
+ \c!leftsentence=\hbox{\endash\space},
+ \c!rightsentence=\hbox{\space\endash},
+ \c!leftsubsentence=\endash,
+ \c!rightsubsentence=\endash,
+ \c!leftquote=\upperrightsingleninequote,
+ \c!rightquote=\upperrightsingleninequote,
+ \c!leftquotation=\lowerleftdoubleninequote,
+ \c!rightquotation=\upperleftdoubleninequote,
+ \c!date={\v!day,{.},\space,\v!month,\space,\v!year}]
+
+\installlanguage
+ [\s!mk]
+ [\c!spacing=\v!packed,
+ \c!leftsentence=\endash,
+ \c!rightsentence=\endash,
+ \c!leftsubsentence=\endash,
+ \c!rightsubsentence=\endash,
+ \c!leftquote=\upperleftsingleninequote,
+ \c!rightquote=\upperrightsinglesixquote,
+ \c!leftquotation=\lowerleftdoubleninequote,
+ \c!rightquotation=\upperrightdoublesixquote,
+ \c!date={\v!day,\space,\v!month,\space,\v!year}]
+
+\installlanguage [\s!russian] [\s!ru]
+\installlanguage [\s!ukrainian] [\s!ua]
+\installlanguage [\s!belarussian][\s!be]
+\installlanguage [\s!serbian] [\s!sr]
+\installlanguage [\s!sr-latn] [\s!sr]
+\installlanguage [\s!sr-cyrl] [\s!sr]
+\installlanguage [\s!macedonian] [\s!mk]
+
% Uralic Languages: Cheremiss, Estonian, Finnish, Karelian, Laap,
% Mordvinian, Permian tongues, Hungarian, Ostyak, Vogul, Samoyed
@@ -413,7 +461,12 @@
\c!rightquotation=\upperrightdoubleninequote,
\c!date={\v!day,\space,\v!month,{،\space},\v!year}]
-\installlanguage [\s!hebrew] [\s!he]
+\installlanguage % same as arabic now .. someone needs to fix this
+ [\s!yi]
+ [\s!he]
+
+\installlanguage [\s!hebrew] [\s!he]
+\installlanguage [\s!yiddish] [\s!yi]
% Arabic Languages
@@ -484,11 +537,28 @@
% Artificial Languages: Esperanto
+\installlanguage
+ [\s!esperanto]
+ [%\c!spacing=\v!packed,
+ %\c!leftsentence=\emdash,
+ %\c!rightsentence=\emdash,
+ %\c!leftsubsentence=\emdash,
+ %\c!rightsubsentence=\emdash,
+ %\c!leftquote=\lowerleftdoubleninequote,
+ %\c!rightquote=\upperrightdoublesixquote,
+ %\c!leftquotation=\lowerleftdoubleninequote,
+ %\c!rightquotation=\upperrightdoublesixquote,
+ %\c!date={\v!year,~m.,\space,\v!month,\space,\v!day,~d.},
+ \s!patterns=eo,
+ \s!lefthyphenmin=2,
+ \s!righthyphenmin=2]
+
% Baltic Languages: Lettish/Latvian, Lietuvių/Lithuanian
\installlanguage
[\s!lt]
- [\c!spacing=\v!packed,
+ [\c!command=\v!no,
+ \c!spacing=\v!packed,
\c!leftsentence=\emdash,
\c!rightsentence=\emdash,
\c!leftsubsentence=\emdash,
@@ -583,9 +653,6 @@
% Sardian, Catalan, French, Ladino, Portuguese, Proven\c{c}al,
% Spanish
-\ifdefined\guillemotspace \else \let\guillemotspace\empty \fi
-\ifdefined\sentencespace \else \let\sentencespace \empty \fi
-
\installlanguage
[\s!fr]
[\c!spacing=\v!packed,
@@ -632,7 +699,8 @@
\installlanguage
[\s!it]
- [\c!spacing=\v!packed,
+ [\c!command=\v!no,
+ \c!spacing=\v!packed,
\c!leftsentence=\emdash,
\c!rightsentence=\emdash,
\c!leftsubsentence=\endash,
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-dis.lua b/Master/texmf-dist/tex/context/base/mkiv/lang-dis.lua
index 90e84f65d42..3e4678801f5 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lang-dis.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lang-dis.lua
@@ -28,7 +28,7 @@ local getchar = nuts.getchar
local setchar = nuts.setchar
local getdisc = nuts.getdisc
local setdisc = nuts.setdisc
-local getlang = nuts.setlang
+local getlanguage = nuts.getlanguage
local getboth = nuts.getboth
local setlist = nuts.setlist
local setlink = nuts.setlink
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-exp.lua b/Master/texmf-dist/tex/context/base/mkiv/lang-exp.lua
index 254961ee6f9..c2eb46990aa 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lang-exp.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lang-exp.lua
@@ -116,7 +116,7 @@ if LUATEXVERSION < 1.005 then -- not loaded any more
end
end
if template then
- local language = template and getlang(template)
+ local language = template and getlanguage(template)
local data = getlanguagedata(language)
local prechar = data.prehyphenchar
local postchar = data.posthyphenchar
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-hyp.lua b/Master/texmf-dist/tex/context/base/mkiv/lang-hyp.lua
index 93457c7a22c..ca9f519cee4 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lang-hyp.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lang-hyp.lua
@@ -644,7 +644,7 @@ if context then
local getprev = nuts.getprev
local getsubtype = nuts.getsubtype
local getlist = nuts.getlist
- local getlang = nuts.getlang
+ local getlanguage = nuts.getlanguage
local getattrlist = nuts.getattrlist
local setattrlist = nuts.setattrlist
local isglyph = nuts.isglyph
@@ -1410,7 +1410,7 @@ featureset.hyphenonly = hyphenonly == v_yes
if skipping then
current = getnext(current)
else
- local lang = getlang(current)
+ local lang = getlanguage(current)
local font = getfont(current)
if lang ~= language or font ~= lastfont then
if dictionary and size > charmin and leftmin + rightmin <= size then
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-hyp.mkiv b/Master/texmf-dist/tex/context/base/mkiv/lang-hyp.mkiv
index 9301fd1d873..d8fbb0b229a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lang-hyp.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/lang-hyp.mkiv
@@ -30,8 +30,8 @@
\writestatus{loading}{ConTeXt Language Macros / Initialization}
-\registerctxluafile{lang-dis}{}
-\registerctxluafile{lang-hyp}{}
+\registerctxluafile{lang-dis}{autosuffix}
+\registerctxluafile{lang-hyp}{autosuffix}
\unprotect
@@ -45,8 +45,10 @@
\newcount\compoundhyphenpenalty
-\automatichyphenmode \plusone
-\hyphenpenaltymode \plusfour
+\ifcase\contextlmtxmode
+ \hyphenpenaltymode\plusfour
+ \automatichyphenmode\plusone
+\fi
\hyphenpenalty 50 % hyphenator
\automatichyphenpenalty 50 % -
@@ -150,7 +152,7 @@ rightedge {\dummyparameter\c!rightedge}%
{\clf_sethyphenationfeatures{#1}}
\unexpanded\def\resethyphenationfeatures
- {\hyphenationattribute\attributeunsetvalue}
+ {\attribute\hyphenationattribute\attributeunsetvalue}
\resethyphenationfeatures
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-imp-serbian.lua b/Master/texmf-dist/tex/context/base/mkiv/lang-imp-serbian.lua
new file mode 100644
index 00000000000..377d6dfde1d
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkiv/lang-imp-serbian.lua
@@ -0,0 +1,38 @@
+return {
+ transliterations = {
+ ["serbian to latin"] = {
+ mapping = {
+ ["А"] = "A", ["а"] = "a",
+ ["Б"] = "B", ["б"] = "b",
+ ["В"] = "V", ["в"] = "v",
+ ["Г"] = "G", ["г"] = "g",
+ ["Д"] = "D", ["д"] = "d",
+ ["Е"] = "E", ["е"] = "e",
+ ["Ж"] = "Ž", ["ж"] = "ž",
+ ["З"] = "Z", ["з"] = "z",
+ ["И"] = "I", ["и"] = "i",
+ ["Й"] = "J", ["й"] = "j",
+ ["К"] = "K", ["к"] = "k",
+ ["Л"] = "L", ["л"] = "l",
+ ["М"] = "M", ["м"] = "m",
+ ["Н"] = "N", ["н"] = "n",
+ ["О"] = "O", ["о"] = "o",
+ ["П"] = "P", ["п"] = "p",
+ ["Р"] = "R", ["р"] = "r",
+ ["С"] = "S", ["с"] = "s",
+ ["Т"] = "T", ["т"] = "t",
+ ["У"] = "U", ["у"] = "u",
+ ["Ф"] = "F", ["ф"] = "f",
+ ["Х"] = "Ch", ["х"] = "ch",
+ ["Ц"] = "C", ["ц"] = "c",
+ ["Ч"] = "Č", ["ч"] = "č",
+ ["Ш"] = "Š", ["ш"] = "š",
+ ["Щ"] = "Št", ["щ"] = "št",
+ ["Ъ"] = "Ă", ["ъ"] = "ă",
+ ["Ь"] = "′", ["ь"] = "′",
+ ["Ю"] = "Ju", ["ю"] = "ju",
+ ["Я"] = "Ja", ["я"] = "ja",
+ }
+ }
+ }
+}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/lang-ini.lua
index ce2b89f3c97..7a8aab8183f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lang-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lang-ini.lua
@@ -48,8 +48,7 @@ local sethjcode = lang.sethjcode
local uccodes = characters.uccodes
local lccodes = characters.lccodes
-lang.exceptions = lang.hyphenation
-local new_langage = lang.new
+local new_language = lang.new
languages = languages or {}
local languages = languages
@@ -85,7 +84,7 @@ local function resolve(tag)
if data then
instance = data.instance
if not instance then
- instance = new_langage(data.number)
+ instance = new_language(data.number)
data.instance = instance
end
end
@@ -101,7 +100,7 @@ local function tolang(what) -- returns lang object
if data then
local instance = data.lang
if not instance then
- instance = new_langage(data.number)
+ instance = new_language(data.number)
data.instance = instance
end
return instance
@@ -502,6 +501,14 @@ else
end
end
+ if CONTEXTLMTXMODE > 0 then
+ numbers[0] = "null"
+ registered.null = {
+ number = 0,
+ instance = new_language(0),
+ }
+ end
+
end
-- not that usefull, global values
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-ini.mkiv b/Master/texmf-dist/tex/context/base/mkiv/lang-ini.mkiv
index f9d7e0f510f..ffa280b053d 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lang-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/lang-ini.mkiv
@@ -311,7 +311,7 @@
\c!time={h,:,m},
\c!date={\v!year,\ ,\v!month,\ ,\v!day},
\c!text=Ag,
- \s!font=] % \v!auto : experimental !
+ \c!font=] % \v!auto : experimental !
% to be tested:
%
@@ -430,6 +430,12 @@
\let\dohyphens\relax
+\unexpanded\def\usehyphensparameter#1%
+ {\edef\p_hyphens{#1\c!hyphens}%
+ \ifx\p_hyhens\v!no
+ \nohyphens
+ \fi}
+
\unexpanded\def\lang_basics_synchronize_min_max % maybe store this at the lua end
{% these values are stored along with glyph nodes
\lefthyphenmin \numexpr0\languageparameter\s!lefthyphenmin +\hyphenminoffset\relax
@@ -486,12 +492,12 @@
\unexpanded\def\setuplanguages
{\setuplanguage[\s!default]}
-% \setuplanguages[\s!font=\v!auto]
-% \setuplanguage[\s!default][\s!font=\v!auto]
-% \setuplanguage[nl][\s!font=\v!auto]
+% \setuplanguages[\c!font=\v!auto]
+% \setuplanguage[\s!default][\c!font=\v!auto]
+% \setuplanguage[nl][\c!font=\v!auto]
\appendtoks
- \edef\p_language_font{\languageparameter\s!font}%
+ \edef\p_language_font{\languageparameter\c!font}%
\ifx\p_language_font\empty\else
\ifx\p_language_font\v!auto
\doaddfeature\currentlanguage
@@ -717,9 +723,16 @@
%D New:
-\unexpanded\def\traceddiscretionary#1#2#3%
- {\dontleavehmode
- \discretionary{\darkred#1}{\darkgreen#2}{\darkblue#3}}
+\unexpanded\def\traceddiscretionary#1#%
+ {\dontleavehmode\lang_basics_traced_discretionary{#1}}
+
+\unexpanded\def\lang_basics_traced_discretionary#1#2#3#4%
+ {\normaldiscretionary#1{\darkred#2}{\darkgreen#3}{\darkblue#4}}
+
+\installtextracker
+ {discretionaries}
+ {\let\discretionary\traceddiscretionary}
+ {\let\discretionary\normaldiscretionary}
\unexpanded\def\samplediscretionary
{\traceddiscretionary
@@ -727,6 +740,4 @@
{\clf_currentposthyphenchar post}%
{replace}}
-% todo: make this configurable
-
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-ini.mkxl b/Master/texmf-dist/tex/context/base/mkiv/lang-ini.mkxl
deleted file mode 100644
index 8bcba01d8d0..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/lang-ini.mkxl
+++ /dev/null
@@ -1,730 +0,0 @@
-%D \module
-%D [ file=lang-ini,
-%D version=1996.01.25,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Initialization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-%D This module needs a further cleanup (real split between ii/iv).
-
-% \cldcontext{languages.numbers[tex.count.mainlanguagenumber]}
-
-%D This module implements multi||language support of \CONTEXT, which should not be
-%D confused with the multi||lingual interface. This support will be extended when
-%D needed. Properties of languages are defined in \TEX\ files as well as \LUA\
-%D files.
-
-\writestatus{loading}{ConTeXt Language Macros / Initialization}
-
-\registerctxluafile{lang-ini}{}
-\registerctxluafile{lang-def}{}
-\registerctxluafile{lang-cnt}{}
-
-\unprotect
-
-\ifdefined\nonfrenchspacing\else \let\nonfrenchspacing\relax \fi
-\ifdefined\frenchspacing \else \let\frenchspacing \relax \fi
-
-%D When loading hyphenation patterns, \TEX\ assign a number to each loaded table,
-%D starting with~0. Switching to a specific table is done by assigning the relevant
-%D number to the predefined \COUNTER\ \type {\language}. However, in \MKIV\ a lot
-%D of management is delegated to \LUA.
-
-%D We keep track of the last loaded patterns by means of a pseudo \COUNTER. This
-%D just one of those situations in which we don't want to spent a real one. Language
-%D zero has no patterns, first of all because I like to start numbering at one. It
-%D may come in handy for special purposes as well.
-
-\normallanguage\zerocount \def\loadedlanguage{1}
-
-%D \macros
-%D {currentlanguage, setupcurrentlanguage}
-%D
-%D Instead of numbers,we are going to use symbolic names for the languages. The
-%D current langage is saved in the macro \type {\currentlanguage}. The setup macro
-%D is mainly used for cosmetic purposes.
-%D
-%D \starttyping
-%D \dorecurse{3}
-%D {\language[nl]
-%D \startmode[*en] english \stopmode
-%D \startmode[*nl] dutch \stopmode
-%D \language[en]
-%D \startmode[*en] english \stopmode
-%D \startmode[*nl] dutch \stopmode}
-%D \stoptyping
-
-\let\currentlanguage \empty
-\let\currentmainlanguage\empty
-
-%D \macros
-%D {defaultlanguage,languageparameter,specificlanguageparameter}
-%D
-%D We don't use the commandhandler here (yet) because we have a rather special
-%D fallback mechanism so quite some compatibility testing is needed.
-
-\installcorenamespace{language}
-\installcorenamespace{languagelinked}
-
-\def\currentusedlanguage{\currentlanguage}
-
-\def\defaultlanguage#1%
- {\ifcsname\??language#1\s!default\endcsname
- \expandafter\defaultlanguage\lastnamedcs
- \else
- #1%
- \fi}
-
-\def\languageparameter#1%
- {\ifcsname\??language\currentlanguage#1\endcsname
- \lastnamedcs
- \orelse\ifcsname\??language\currentlanguage\s!default\endcsname
- \expandafter\specificlanguageparameter\lastnamedcs{#1}%
- \orelse\ifcsname\??language\s!default#1\endcsname
- \lastnamedcs
- \fi}
-
-\def\specificlanguageparameter#1#2%
- {\ifcsname\??language#1#2\endcsname
- \lastnamedcs
- \orelse\ifcsname\??language#1\s!default\endcsname
- \expandafter\specificlanguageparameter\lastnamedcs{#2}%
- \orelse\ifcsname\??language\s!default#2\endcsname
- \lastnamedcs
- \fi}
-
-\def\mainlanguageparameter#1%
- {\ifcsname\??language\currentmainlanguage#1\endcsname
- \lastnamedcs
- \orelse\ifcsname\??language\currentmainlanguage\s!default\endcsname
- \expandafter\specificlanguageparameter\lastnamedcs{#1}%
- \orelse\ifcsname\??language\s!default#1\endcsname
- \lastnamedcs
- \fi}
-
-\let\usedlanguageparameter\languageparameter
-
-\def\askedlanguageparameter#1% assumes \currentusedlanguage being set
- {\ifcsname\??language\currentusedlanguage#1\endcsname
- \lastnamedcs
- \orelse\ifcsname\??language\currentusedlanguage\s!default\endcsname
- \expandafter\specificlanguageparameter\lastnamedcs{#1}%
- \orelse\ifcsname\??language\s!default#1\endcsname
- \lastnamedcs
- \fi}
-
-\unexpanded\def\setusedlanguage#1%
- {\edef\currentusedlanguage{\reallanguagetag{#1}}%
- \ifx\currentusedlanguage\empty
- \let\currentusedlanguage \currentlanguage
- \let\usedlanguageparameter\languageparameter
- \orelse\ifx\currentusedlanguage\v!global
- \let\currentusedlanguage \currentmainlanguage
- \let\usedlanguageparameter\mainlanguageparameter
- \orelse\ifx\currentusedlanguage\v!local
- \let\currentusedlanguage \currentlanguage
- \let\usedlanguageparameter\languageparameter
- \else
- \let\usedlanguageparameter\askedlanguageparameter
- \fi}
-
-\unexpanded\def\setupcurrentlanguage[#1]%
- {\setcurrentlanguage\currentmainlanguage{#1}}
-
-\unexpanded\def\setcurrentlanguage#1#2% sets modes: **id (currentmain) *id (current)
- {\edef\xaskedlanguage{#1}% otherwise clash with \askedlanguage
- \ifx\xaskedlanguage\empty \else
- \ifx\currentmainlanguage\empty\else\resetsystemmode{\systemmodeprefix\currentmainlanguage}\fi
- \let\currentmainlanguage\xaskedlanguage
- \setsystemmode{\systemmodeprefix\currentmainlanguage}%
- \fi
- \edef\xaskedlanguage{#2}%
- \ifx\xaskedlanguage\empty \else
- \ifx\currentlanguage\empty\else\resetsystemmode\currentlanguage\fi
- \let\currentlanguage\xaskedlanguage
- \setsystemmode\currentlanguage
- \fi}
-
-%D The internal macros will be defined later.
-
-%D \macros
-%D {installlanguage}
-%D
-%D Hyphenation patterns can only be loaded when the format file is prepared. The
-%D next macro takes care of this loading. A language is specified with
-%D
-%D \showsetup{installlanguage}
-%D
-%D When \type {state} equals \type {start}, both patterns and additional hyphenation
-%D specifications are loaded. These files are seached for in the patterns path
-%D have names like \type {lang-nl.lua}.
-%D
-%D The \type {spacing} variable specifies how the spaces after punctuation has to be
-%D handled. English is by tradition more tolerant to inter||sentence spacing than
-%D other languages.
-%D
-%D This macro also defines \type {\identifier} as a shortcut switch to the language.
-%D Furthermore the command defined as being language specific, are executed. With
-%D \type {default} we can default to another language (patterns) at format
-%D generation time. Patterns are loaded at runtime.
-
-\newtoks \everysetuplanguage
-
-\def\installedlanguages{\clf_installedlanguages}
-
-\unexpanded\def\doifelselanguage#1%
- {\ifcsname\??language#1\c!state\endcsname
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\let\doiflanguageelse\doifelselanguage
-
-\def\reallanguagetag#1%
- {\ifcsname\??languagelinked#1\endcsname\lastnamedcs\else#1\fi}
-
-% \language[#1] gave unwanted side effect of loading language specifics
-
-\unexpanded\def\installlanguage
- {\dodoubleargument\lang_basics_install}
-
-% \def\lang_basics_install[#1][#2]%
-% {\doifelseassignment{#2}
-% {\doifelselanguage{#1}
-% {\getparameters[\??language#1][#2]}
-% {\setvalue{\??languagelinked#1}{#1}%
-% \lang_basics_install_indeed{#1}{#1}%
-% \getparameters[\??language#1][\c!state=\v!start,#2]}%
-% \edef\currentsetuplanguage{#1}%
-% \clf_definelanguage{#1}{\specificlanguageparameter{#1}\s!default}%
-% \the\everysetuplanguage}
-% {\setvalue{\??languagelinked#1}{#2}%
-% \clf_setlanguagesynonym{#1}{#2}%
-% \lang_basics_install_indeed{#1}{#2}}}
-
-\def\lang_basics_install[#1][#2]%
- {\ifcondition\validassignment{#2}%
- \doifelselanguage{#1}
- {\getparameters[\??language#1][#2]}
- {\setvalue{\??languagelinked#1}{#1}%
- \lang_basics_install_indeed{#1}{#1}%
- \getparameters[\??language#1][\c!state=\v!start,#2]}%
- \edef\currentsetuplanguage{#1}%
- \clf_definelanguage{#1}{\specificlanguageparameter{#1}\s!default}%
- \the\everysetuplanguage
- \else
- \setvalue{\??languagelinked#1}{#2}%
- \clf_setlanguagesynonym{#1}{#2}%
- \lang_basics_install_indeed{#1}{#2}%
- \fi}
-
-\def\lang_basics_install_indeed#1#2%
- {\ifcsname#1\endcsname\else\setuvalue{#1}{\lang_basics_set_current[#2]}\fi}
-
-%D When the second argument is a language identifier, a synonym is created. This
-%D feature is present because we used dutch mnemonics in the dutch version, but
-%D nowadays conform a standard.
-
-\unexpanded\def\doifelsepatterns#1%
- {\begingroup % will change
- \lang_basics_set_current[#1]%
- \ifnum\normallanguage>\zerocount
- \endgroup\expandafter\firstoftwoarguments
- \else
- \endgroup\expandafter\secondoftwoarguments
- \fi}
-
-\let\doifpatternselse\doifelsepatterns
-
-%D \macros
-%D {setuplanguage}
-%D
-%D Quick and dirty, but useful:
-%D
-%D \showsetup{setuplanguage}
-%D
-%D Beware, this command can only be used when a language is installed.
-
-\unexpanded\def\setuplanguage
- {\dodoubleempty\lang_basics_setup}
-
-\ifdefined\lang_basics_synchronize \else
- \let\lang_basics_synchronize\relax % be nice for setups till we have one
-\fi
-
-\installmacrostack\currentlanguage
-
-\def\lang_basics_setup[#1][#2]%
- {\ifsecondargument
- \push_macro_currentlanguage % can be default
- \edef\currentsetuplanguage{\reallanguagetag{#1}}%
- \getparameters[\??language\currentsetuplanguage][#2]%
- \the\everysetuplanguage
- \pop_macro_currentlanguage
- %\doif\currentsetuplanguage\currentlanguage we can have influenced inheritance (default)
- \else
- \let\currentsetuplanguage\currentlanguage
- \getparameters[\??language\currentsetuplanguage][#1]%
- \the\everysetuplanguage
- \fi
- \lang_basics_synchronize}
-
-\appendtoks
- \clf_unloadlanguage{\currentsetuplanguage}%
-\to \everysetuplanguage
-
-\setuplanguage
- [\s!default]
- [\s!patterns=,
- \s!lefthyphenmin=2,
- \s!righthyphenmin=2,
- \s!lefthyphenchar=-1,
- \s!righthyphenchar=45,
- % used in compound i.e. interfaced with c! and can be anything so no numbers
- \c!lefthyphen=,
- \c!righthyphen=-,
- \c!hyphen=-,
- \c!spacing=\v!packed,
- \c!compoundhyphen=\compoundhyphen,
- \c!rightcompoundhyphen=\compoundhyphen,
- \c!leftcompoundhyphen=,
- \c!midsentence=---,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\upperleftsinglesixquote,
- \c!rightquote=\upperrightsingleninequote,
- \c!leftquotation=\upperleftdoublesixquote,
- \c!rightquotation=\upperrightdoubleninequote,
- \c!leftspeech=\languageparameter\c!leftquotation,
- \c!middlespeech=,
- \c!rightspeech=\languageparameter\c!rightquotation,
- \c!limittext=\unknown,
- \c!time={h,:,m},
- \c!date={\v!year,\ ,\v!month,\ ,\v!day},
- \c!text=Ag,
- \s!font=] % \v!auto : experimental !
-
-% to be tested:
-%
-% \setuplanguage
-% [\s!default]
-% [\c!righthyphenchar="AD]
-
-%D The values \type {leftsentence} and \type {rightsentence} can be (and are) used
-%D to implement automatic subsentence boundary glyphs, like in {\fr |<|french
-%D guillemots|>|} or {\de |<|german guillemots|>|} or {\nl |<|dutch dashes|>|} like
-%D situations. Furthermore \type {leftquotation} and \type {leftquote} come into
-%D view \quotation {when we quote} or \quote {quote} something.
-
-%D \macros
-%D {currentdatespecification, currenttimespecification}
-%D
-%D Just to make things easy we can ask for the current date specification by saying:
-
-\def\currentdatespecification{\languageparameter\c!date}
-\def\currenttimespecification{\languageparameter\c!time}
-
-%D Carefull reading of these macros shows that it's legal to say
-%D
-%D \starttyping
-%D \installlanguage [du] [de]
-%D \stoptyping
-
-%D \macros
-%D {language,mainlanguage}
-%D
-%D Switching to another language (actually another hyphenation pattern) is done
-%D with:
-%D
-%D \starttyping
-%D \language[identifier]
-%D \stoptyping
-%D
-%D or with \type {\identifier}. Just to be compatible with \PLAIN\ \TEX, we still
-%D support the original meaning, so
-%D
-%D \starttyping
-%D \language=1
-%D \stoptyping
-%D
-%D is a valid operation, where the relation between number and language depends on
-%D the order in installing languages.
-%D
-%D \showsetup{language}
-%D \showsetup{mainlanguage}
-%D
-%D Both commands take a predefined language identifier as argument. We can use \type
-%D {\mainlanguage[identifier]} for setting the (indeed) main language. This is the
-%D language used for translating labels like {\em figure} and {\em table}. The main
-%D language defaults to the current language.
-
-\newtoks \everylanguage
-
-\installcorenamespace{languagenumbers}
-
-\appendtoks
- % we need to reassign the number because new patterns can be defined later on
- % so let's hope not that many \setups happen during a run
- \expandafter\glet\csname\??languagenumbers\currentlanguage\endcsname\undefined
-\to \everysetuplanguage
-
-\def\lang_basics_synchronize_yes
- {\zerocount % see below
- \global\expandafter\chardef\csname\??languagenumbers\currentlanguage\endcsname
- \clf_languagenumber
- {\currentlanguage}%
- {\defaultlanguage\currentlanguage}%
- {\languageparameter\s!patterns}%
- {\languageparameter\c!factor}%
- \relax
- \normallanguage\csname\??languagenumbers\currentlanguage\endcsname}
-
-\let\lang_basics_synchronize_nop\zerocount % not loaded anyway
-
-\letvalue{\??languagenumbers}\lang_basics_synchronize_nop % initime
-
-\appendtoks
- \letvalue{\??languagenumbers}\lang_basics_synchronize_yes % runtime
-\to \everydump
-
-\def\lang_basics_synchronize
- {\normallanguage\csname\??languagenumbers
- \ifcsname\??languagenumbers\currentlanguage\endcsname
- \currentlanguage
- \fi
- \endcsname
- \relax
- \the\everylanguage
- \relax}
-
-\newcount\hyphenstate
-\newcount\hyphenminoffset
-
-\unexpanded\def\lesshyphens
- {\advance\hyphenminoffset\plusone
- \lang_basics_synchronize_min_max}
-
-\unexpanded\def\morehyphens
- {\ifcase\hyphenminoffset \else
- \advance\hyphenminoffset\minusone
- \fi
- \lang_basics_synchronize_min_max}
-
-\unexpanded\def\nohyphens % nicer for url's
- {\ifx\dohyphens\relax
- \unexpanded\edef\dohyphens
- {\hyphenminoffset\the\hyphenminoffset\relax
- \lang_basics_synchronize_min_max}%
- \fi
- \hyphenminoffset\plusthousand
- \lang_basics_synchronize_min_max}
-
-\let\dohyphens\relax
-
-\unexpanded\def\lang_basics_synchronize_min_max % maybe store this at the lua end
- {% these values are stored along with glyph nodes
- \lefthyphenmin \numexpr0\languageparameter\s!lefthyphenmin +\hyphenminoffset\relax
- \righthyphenmin\numexpr0\languageparameter\s!righthyphenmin+\hyphenminoffset\relax
- \hyphenationmin\numexpr0\languageparameter\s!hyphenmin\relax
- % these values are stored with the language (global!)
- \prehyphenchar \languageparameter\s!righthyphenchar\relax
- \posthyphenchar\languageparameter\s!lefthyphenchar \relax}
-
-\appendtoks
- \lang_basics_synchronize_min_max
-\to \everylanguage
-
-\unexpanded\def\unhyphenated
- {\groupedcommand{\lefthyphenmin\maxdimen}\donothing}
-
-% \appendtoks
-% \setups[\languageparameter\c!setups]%
-% \to \everylanguage
-
-%D You can setup the default language to reset settings.
-
-\appendtoks
- \edef\currentlanguagesetups{\languageparameter\c!setups}%
- \ifx\currentlanguagesetups\empty \else
- \setups[\currentlanguagesetups]%
- \fi
-\to \everylanguage
-
-% new
-
-\appendtoks
- \usebidiparameter\languageparameter
-\to \everylanguage
-
-% this will move to core-spa !
-
-\appendtoks
- \edef\p_spacing{\languageparameter\c!spacing}%
- \ifx\p_spacing\v!broad
- \nonfrenchspacing
- \else
- \frenchspacing
- \fi
-\to \everylanguage
-
-% \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\ }
-
-% new experimental feature
-
-\unexpanded\def\setuplanguages
- {\setuplanguage[\s!default]}
-
-% \setuplanguages[\s!font=\v!auto]
-% \setuplanguage[\s!default][\s!font=\v!auto]
-% \setuplanguage[nl][\s!font=\v!auto]
-
-\appendtoks
- \edef\p_language_font{\languageparameter\s!font}%
- \ifx\p_language_font\empty
- \orelse\ifx\p_language_font\v!auto
- \doaddfeature\currentlanguage
- \else
- \doaddfeature\p_language_font
- \fi
-\to \everylanguage
-
-%D Fast switcher
-
-\def\lang_basics_switch_asked
- {\ifcsname\??languagelinked\askedlanguage\endcsname
- \edef\askedlanguage{\lastnamedcs}%
- \ifx\currentlanguage\askedlanguage \else
- \setcurrentlanguage\currentmainlanguage\askedlanguage
- \lang_basics_synchronize
- \fi
- \fi}
-
-\unexpanded\def\uselanguageparameter#1%
- {\edef\askedlanguage{#1\c!language}%
- \ifx\askedlanguage\empty\else\lang_basics_switch_asked\fi}
-
-\unexpanded\def\douselanguageparameter#1% fast setter
- {\edef\askedlanguage{#1}%
- \ifx\askedlanguage\empty\else\lang_basics_switch_asked\fi}
-
-\unexpanded\def\lang_basics_set_current[#1]%
- {\edef\askedlanguage{#1}%
- \ifx\askedlanguage\empty\else\lang_basics_switch_asked\fi}
-
-\unexpanded\def\language
- {\doifelsenextoptionalcs\lang_basics_set_current\normallanguage}
-
-\let\setlanguage\language % we make these synonyms
-
-\let\patterns\gobbleoneargument
-
-\newcount\mainlanguagenumber
-
-%D Beware: you might need to use \type {\dontleavehmode} outside and|/|or \type {\par}
-%D inside the group!
-
-\unexpanded\def\startlanguage
- {\begingroup\language}
-
-\let\stoplanguage\endgroup
-
-\unexpanded\def\mainlanguage[#1]%
- {\edef\askedlanguage{#1}%
- \ifx\askedlanguage\empty
- \orelse\ifcsname\??languagelinked\askedlanguage\endcsname
- %\edef\askedlanguage{\csname\??languagelinked\askedlanguage\endcsname}%
- \edef\askedlanguage{\lastnamedcs}%
- \ifx\currentlanguage\askedlanguage
- \ifx\currentmainlanguage\askedlanguage \else
- \setcurrentlanguage\askedlanguage\askedlanguage
- \lang_basics_synchronize
- \fi
- \else
- \setcurrentlanguage\askedlanguage\askedlanguage
- \lang_basics_synchronize
- \fi
- \fi
- \mainlanguagenumber\normallanguage}
-
-\appendtoks
- \normallanguage\mainlanguagenumber
-\to \everybeforepagebody
-
-%D Used at all?
-
-\def\splitsequence#1#2%
- {\doifelse{#1}\v!no{#2}{\doifelse{#1}\v!yes{\languageparameter\c!limittext}{#1}}}
-
-\def\splitsymbol#1%
- {\splitsequence{#1}{\languageparameter\c!limittext}}
-
-%D Just like with subsentence boundary symbols, quotes placement depends on the
-%D current language, therefore we show the defaults here.
-%D
-%D \def\ShowLanguageValues [#1] [#2] #3 #4
-%D {\blank
-%D \startlinecorrection
-%D \vbox\bgroup
-%D \language[#1]
-%D \midaligned{\bf#2 subsentence symbol and quotes}
-%D \framed[width=\hsize,frame=off,topframe=on,bottomframe=on,offset=.5ex]
-%D {\hfil\quotation{#3 #4}\hfil\quote{#2}\hfil
-%D \startsubsentence\startsubsentence#3\stopsubsentence#4\stopsubsentence\hfil}
-%D \egroup
-%D \stoplinecorrection
-%D \blank}
-%D
-%D \ShowLanguageValues [af] [afrikaans] afrikaanse ...
-%D \ShowLanguageValues [ca] [catalan] catalan ...
-%D \ShowLanguageValues [cs] [czech] tjechisch tex
-%D \ShowLanguageValues [cs] [slovak] slowaakse ...
-%D \ShowLanguageValues [da] [danish] deense ...
-%D \ShowLanguageValues [de] [german] duitse degelijkheid
-%D \ShowLanguageValues [en] [english] engelse humor
-%D \ShowLanguageValues [et] [estonian] ...
-%D \ShowLanguageValues [fi] [finnish] finse ...
-%D \ShowLanguageValues [fr] [french] franse slag
-%D \ShowLanguageValues [it] [italian] italiaanse ...
-%D \ShowLanguageValues [la] [latin] latijnse missen
-%D \ShowLanguageValues [nl] [dutch] nederlandse zuinigheid
-%D \ShowLanguageValues [nb] [bokmal] noorse zalm
-%D \ShowLanguageValues [nn] [nnynorsk] noorse zalm
-%D \ShowLanguageValues [pl] [polish] poolse vlag
-%D \ShowLanguageValues [pt] [portuguese] portugese ...
-%D \ShowLanguageValues [es] [spanish] spaans benauwd
-%D \ShowLanguageValues [sv] [swedish] zweedse ...
-%D \ShowLanguageValues [tr] [turkish] turks fruit
-
-%D We support a lot of languages. These are specified and loaded in separate files,
-%D according to their roots. Here we only take care of (postponed) setting of the
-%D current language.
-%D
-%D \unprotect
-%D \placetable{The germanic languages (\type{lang-ger})}
-%D \starttable[||||]
-%D \HL
-%D \NC \bf mnemonic \NC \bf language \NC \bf group \NC\SR
-%D \HL
-%D \NC \s!nl \NC dutch \NC germanic \NC\FR
-%D \NC \s!en \NC english \NC germanic \NC\MR
-%D \NC \s!de \NC german \NC germanic \NC\MR
-%D \NC \s!da \NC danish \NC germanic \NC\MR
-%D \NC \s!sv \NC swedish \NC germanic \NC\MR
-%D \NC \s!af \NC afrikaans \NC germanic \NC\MR
-%D \NC \s!nb \NC bokmal \NC germanic \NC\LR
-%D \NC \s!nn \NC nynorsk \NC germanic \NC\LR
-%D \HL
-%D \stoptable
-%D \protect
-%D
-%D \unprotect
-%D \placetable{The italic languages (\type{lang-ita})}
-%D \starttable[||||]
-%D \HL
-%D \NC \bf mnemonic \NC \bf language \NC \bf group \NC\SR
-%D \HL
-%D \NC \s!fr \NC french \NC italic \NC\FR
-%D \NC \s!ca \NC catalan \NC italic \NC\MR
-%D \NC \s!es \NC spanish \NC italic \NC\MR
-%D \NC \s!it \NC italian \NC italic \NC\MR
-%D \NC \s!la \NC latin \NC italic \NC\MR
-%D \NC \s!pt \NC portuguese \NC italic \NC\LR
-%D \HL
-%D \stoptable
-%D \protect
-%D
-%D \unprotect
-%D \placetable{The slavic languages (\type{lang-sla})}
-%D \starttable[||||]
-%D \HL
-%D \NC \bf mnemonic \NC \bf language \NC \bf group \NC\SR
-%D \HL
-%D \NC \s!pl \NC polish \NC slavic \NC\FR
-%D \NC \s!cs \NC czech \NC slavic \NC\MR
-%D \NC \s!sk \NC slavik \NC slavic \NC\LR
-%D \HL
-%D \stoptable
-%D \protect
-%D \unprotect
-%D
-%D \placetable{The altaic languages (\type{lang-alt})}
-%D \starttable[||||]
-%D \HL
-%D \NC \bf mnemonic \NC \bf language \NC \bf group \NC\SR
-%D \HL
-%D \NC \s!tr \NC turkish \NC altaic \NC\SR
-%D \HL
-%D \stoptable
-%D
-%D \placetable{The uralic languages (\type{lang-ura})}
-%D \starttable[||||]
-%D \HL
-%D \NC \bf mnemonic \NC \bf language \NC \bf group \NC\SR
-%D \HL
-%D \NC \s!fi \NC finnish \NC uralic \NC\SR
-%D \HL
-%D \stoptable
-%D \protect
-
-\unexpanded\def\nopatterns{\normallanguage\minusone}
-
-%D We default to the language belonging to the interface. This is one of the few
-%D places outside the interface modules where \type {\startinterface} is used.
-
-\setupcurrentlanguage[\s!en]
-
-\unexpanded\def\initializemainlanguage
- {\mainlanguage[\currentlanguage]%
- \showmessage\m!languages9\currentlanguage}
-
-%D New:
-
-\let\stopexceptions\relax
-
-\unexpanded\def\startexceptions
- {\dosingleempty\lang_basics_start_exceptions}
-
-\def\lang_basics_start_exceptions[#1]#2\stopexceptions % multilingual or not?
- {\begingroup
- \edef\askedlanguage{\reallanguagetag{#1}}%
- \ifx\askedlanguage\empty
- \let\askedlanguage\currentlanguage
- \fi
- \clf_setlanguageexceptions{\askedlanguage}{#2}%
- \endgroup}
-
-\unexpanded\def\hyphenation
- {\clf_setlanguageexceptions{\currentlanguage}}
-
-%D For the moment here:
-
-\uchyph 1 % also treat uppercase
-\exhyphenchar 45 % to permit breaking at explicit hyphens
-
-%D New:
-
-\unexpanded\def\traceddiscretionary#1#2#3%
- {\dontleavehmode
- \discretionary{\darkred#1}{\darkgreen#2}{\darkblue#3}}
-
-\unexpanded\def\samplediscretionary
- {\traceddiscretionary
- {pre\clf_currentprehyphenchar}%
- {\clf_currentposthyphenchar post}%
- {replace}}
-
-% todo: make this configurable
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-lab.mkxl b/Master/texmf-dist/tex/context/base/mkiv/lang-lab.mkxl
deleted file mode 100644
index a527224e9dc..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/lang-lab.mkxl
+++ /dev/null
@@ -1,390 +0,0 @@
-%D \module
-%D [ file=lang-lab,
-%D version=1997.08.27,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Labels,
-%D author=Hans Hagen / Tobias Burnus,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Language Macros / Labels}
-
-\registerctxluafile{lang-lab}{}
-\registerctxluafile{lang-txt}{}
-
-\unprotect
-
-%D Left-overs:
-
-\ifdefined\sixperemspace \else
- \def\sixperemspace{\normalUchar"2006}
-\fi
-
-%D In this module we deal with language dependant labels and prefixes, like in {\em
-%D Figure~12} and {\em Chapter 1}. In this file we set the default values. Users can
-%D easily overrule these.
-%D
-%D This module is dedicated to the grandfather of Tobias Burnus, who's extensive
-%D languages oriented library helped us a lot in finding the right translations. All
-%D those labels are collected in files that reflect their common ancestor.
-%D
-%D Not all languages can be satisfied with the labeling mechanism as provided here.
-%D Chinese for instance put a label in front as well as after a part number. This is
-%D why the current implementation of labels supports two labels too.
-
-%D \macros
-%D {setupheadtext, setuplabeltext}
-%D
-%D First we present some macros that deal with what we will call head and label
-%D texts. Such texts are defines by:
-%D
-%D \showsetup{setupheadtext}
-%D \showsetup{setuplabeltext}
-%D
-%D A regular \CONTEXT\ stores some 1500 labels at most.
-%D
-%D These commands accept all kind of inputs:
-%D
-%D \starttyping
-%D \setuplabeltext [language] [labellabel=text]
-%D \setuplabeltext [language] [labellabel=text,labellabel=text,...]
-%D \setuplabeltext [labellabel=text]
-%D \setuplabeltext [labellabel=text,labellabel=text,...]
-%D \stoptyping
-%D
-%D The last two cases concern the current language.
-
-\installcorenamespace{label}
-
-\let\currentlabelcategory\empty
-
-\unexpanded\def\definelabelclass
- {\dodoubleempty\lang_labels_define_class}
-
-\def\lang_labels_define_class[#1][#2]%
- {\normalexpanded
- {\lang_labels_define_class_indeed
- {#1}%
- {\ifsecondargument#2\else\zerocount\fi}%
- \expandafter\noexpand\csname dogetupsome#1text\endcsname
- \expandafter\noexpand\csname #1language\endcsname
- \expandafter\noexpand\csname dodogetupsome#1text\endcsname
- \expandafter\noexpand\csname left#1text\endcsname
- \expandafter\noexpand\csname right#1text\endcsname
- \expandafter\noexpand\csname #1texts\endcsname
- \expandafter\noexpand\csname #1text\endcsname}}
-
-% hm, not interfaced
-
-\let\thetextprefix\empty
-
-\unexpanded\def\lang_labels_define_class_indeed#1#2#3#4#5#6#7#8#9%
- {\setuvalue{setup#1text}{\protecttextprefixes#2\def\currenttextprefixclass{#1}\dodoubleempty\lang_labels_text_prefix_setup}%
- \setuvalue{preset#1text}{\protecttextprefixes1\def\currenttextprefixclass{#1}\dodoubleempty\lang_labels_text_prefix_setup}%
- \setuvalue{copy#1text}{\protecttextprefixes1\def\currenttextprefixclass{#1}\dodoubleempty\lang_labels_text_prefix_copy}%
- \setuvalue{start#1text}{\protecttextprefixes1\def\currenttextprefixclass{#1}\dotripleempty\lang_labels_text_prefix_start[#1]}%
- \letvalue{stop#1text}\relax
- \def#4{\reallanguagetag{\defaultlanguage\currentmainlanguage}}%
- \ifnum#2=\plustwo % used for math and tags
- \def#3{#5#4}%
- \def#5##1##2% ##1=language
- {\ifcsname\??label\currentlabelcategory#1:##1:##2\endcsname
- \lastnamedcs
- \orelse\ifcsname\??label#1:##1:##2\endcsname
- \lastnamedcs
- % \orelse\ifcsname\??language#4\s!default\endcsname
- % \expandafter#5\csname\??language#4\s!default\endcsname{##2}%
- \orelse\ifcsname\??language##1\s!default\endcsname
- %\expandafter#5\csname\??language##1\s!default\endcsname{##2}%
- \expandafter#5\lastnamedcs{##2}%
- \orelse\ifcsname\??label\currentlabelcategory#1:##2\endcsname
- \lastnamedcs
- \orelse\ifcsname\??label#1:##2\endcsname
- \lastnamedcs
- \orelse\ifcsname\??label\currentlabelcategory#1:\s!en:##2\endcsname
- \lastnamedcs
- \orelse\ifcsname\??label#1:\s!en:##2\endcsname
- \lastnamedcs
- \else
- ##2%
- \fi}%
- \let#6\gobbleoneargument
- \let#7\gobbleoneargument
- \let#8\gobbletwoarguments
- \let#9#3%
- \else
- \unexpanded\def#3{#5#4}%
- \unexpanded\def#5##1##2%
- {\ifcsname\??label#1:##1:##2\endcsname
- %\expandafter\let\expandafter\thetextprefix\csname\??label#1:##1:##2\endcsname
- \expandafter\let\expandafter\thetextprefix\lastnamedcs
- \orelse\ifcsname\??language#4\s!default\endcsname
- %\expandafter#5\csname\??language#4\s!default\endcsname{##2}%
- \expandafter#5\lastnamedcs{##2}%
- \orelse\ifcsname\??label#1:##2\endcsname
- %\expandafter\let\expandafter\thetextprefix\csname\??label#1:##2\endcsname
- \expandafter\let\expandafter\thetextprefix\lastnamedcs
- \orelse\ifcsname\??label#1:\s!en:##2\endcsname
- %\expandafter\let\expandafter\thetextprefix\csname\??label#1:\s!en:##2\endcsname
- \expandafter\let\expandafter\thetextprefix\lastnamedcs
- \else
- \let\thetextprefix\dummytextprefix
- \fi}%
- \unexpanded\def#6##1{#3{##1}\expandafter\flushleftlabelclass \thetextprefix}%
- \unexpanded\def#7##1{#3{##1}\expandafter\flushrightlabelclass\thetextprefix}%
- \unexpanded\def#8##1{#3{##1}\expandafter\flushbothlabelclass \thetextprefix}% #2
- \unexpanded\def#9##1{#3{##1}\expandafter\flushleftlabelclass \thetextprefix}%
- \fi
- \appendtoks
- \let#6\firstofoneargument % to be checked
- \let#7\firstofoneargument % to be checked
- \let#8\firstofoneargument % to be checked
- \let#9\firstofoneargument % to be checked
- \to \everysimplifycommands}
-
-\let\flushleftlabelclass \firstoftwoarguments
-\let\flushrightlabelclass\secondoftwoarguments
-\def\flushbothlabelclass #1#2#3{#1#3#2}
-\def\dummytextprefix {\empty\empty}
-
-%D \macros
-%D {headtext, labeltext, leftlabeltext, rightlabeltext, labeltexts}
-%D
-%D Once defined, head and label texts can be called upon using:
-%D
-%D \showsetup{headtext}
-%D \showsetup{labeltext}
-%D
-%D \macros
-%D {presetheadtext,presetlabeltext}
-%D
-%D These macros enable us to automatically define head and label texts without
-%D replacing predefined ones. They are internal macros.
-
-\appendtoks \let\labellanguage\currentlanguage \to \everycurrentdate
-
-\newconstant\protecttextprefixes
-
-\let\currenttextprefixtag \s!unknown
-\let\currenttextprefixclass\s!unknown
-
-\def\lang_labels_text_prefix_start[#1][#2][#3]% class language name
- {\ifthirdargument
- \edef\currenttextprefixtag{\reallanguagetag{#2}}%
- \edef\currenttextprefixname{#3}%
- \else
- \edef\currenttextprefixtag{\reallanguagetag\currentmainlanguage}%
- \edef\currenttextprefixname{#2}%
- \fi
- \grabuntil{stop#1text}\lang_labels_text_prefix_start_indeed}
-
-\def\lang_labels_text_prefix_start_indeed#1% text (not special checking done here yet, only for long texts anyway)
- {\expandafter\edef\csname\??label\currenttextprefixclass:\currenttextprefixtag:\currenttextprefixname\endcsname%
- {{\clf_strip{#1}}\empty}}
-
-\def\lang_labels_text_prefix_setup[#1][#2]%
- {\ifsecondargument
- \edef\currenttextprefixtag{\reallanguagetag{#1}}%
- \processcommalist[#2]\lang_labels_text_prefix_setup_indeed
- \else
- \edef\currenttextprefixtag{\reallanguagetag\currentmainlanguage}%
- \processcommalist[#1]\lang_labels_text_prefix_setup_indeed
- \fi}
-
-\def\lang_labels_text_prefix_setup_indeed#1%
- {\lang_labels_text_prefix_assign[#1]}
-
-\def\lang_labels_text_prefix_assign[#1=#2]%
- {\lang_labels_text_prefix_assign_indeed{#1}[#2,,]}
-
-\def\lang_labels_text_prefix_assign_indeed#1%
- {\ifcase\protecttextprefixes
- % no checking
- \expandafter\lang_labels_text_prefix_assign_yes
- \or
- % checking
- \ifcsname\??label\currenttextprefixclass:\currenttextprefixtag:#1\endcsname
- \expandafter\expandafter\expandafter\lang_labels_text_prefix_assign_nop
- \else
- \expandafter\expandafter\expandafter\lang_labels_text_prefix_assign_yes
- \fi
- \or
- % simple assignment (a bit overkill but it fits in the whole)
- \expandafter\lang_labels_text_prefix_assign_dumb
- \fi{#1}}
-
-\let\m_lang_labels_left \empty
-\let\m_lang_labels_right\empty
-
-% \def\lang_labels_text_prefix_assign_yes#1[#2,#3,#4]%
-% {\def\m_lang_labels_left {#2}% no longer an edef ... else \Word undefined expansion issues
-% \def\m_lang_labels_right{#3}% no longer an edef ... else \Word undefined expansion issues
-% \ifx\m_lang_labels_right\empty
-% \ifx\m_lang_labels_left\empty
-% \expandafter\def\csname\??label\currenttextprefixclass:\currenttextprefixtag:#1\endcsname{\empty\empty}%
-% \else
-% \expandafter\def\csname\??label\currenttextprefixclass:\currenttextprefixtag:#1\endcsname{{#2}\empty}%
-% \fi
-% \else
-% \expandafter\def\csname\??label\currenttextprefixclass:\currenttextprefixtag:#1\endcsname{{#2}{#3}}%
-% \fi}
-%
-% how we love obscure efficicency ...
-
-\def\lang_labels_text_prefix_assign_yes#1[#2,#3,#4]%
- {\def\m_lang_labels_left {#2}% no longer an edef ... else \Word undefined expansion issues
- \def\m_lang_labels_right{#3}% no longer an edef ... else \Word undefined expansion issues
- \expandafter\def\csname\??label\currenttextprefixclass:\currenttextprefixtag:#1%
- \ifx\m_lang_labels_right\empty
- \ifx\m_lang_labels_left\empty
- \endcsname{\empty\empty}%
- \else
- \endcsname{{#2}\empty}%
- \fi
- \else
- \endcsname{{#2}{#3}}%
- \fi}
-
-\def\lang_labels_text_prefix_assign_nop#1[#2]%
- {}
-
-\def\lang_labels_text_prefix_assign_dumb#1[#2,#3]%
- {\expandafter\def\csname\??label\currenttextprefixclass:\currenttextprefixtag:#1\endcsname{#2}}
-
-\unexpanded\def\setlabeltextpair#1#2#3#4#5% a fast one for usage at the Lua end
- {%\writestatus{!!!!}{#1:\reallanguagetag{#2}:#3}%
- \expandafter\def\csname\??label#1:\reallanguagetag{#2}:#3\endcsname{{#4}{#5}}} % class tag key left right
-
-\def\lang_labels_text_prefix_copy[#1][#2]%
- {\ifsecondargument
- \edef\currenttextprefixtag{\reallanguagetag{#1}}%
- \processcommalist[#2]\lang_labels_text_prefix_copy_indeed
- \else
- \edef\currenttextprefixtag{\reallanguagetag\currentmainlanguage}%
- \processcommalist[#1]\lang_labels_text_prefix_copy_indeed
- \fi}
-
-\def\lang_labels_text_prefix_copy_indeed#1%
- {\lang_labels_text_prefix_copy_pair[#1]}
-
-\def\lang_labels_text_prefix_copy_pair[#1=#2]%
- {\lang_labels_text_prefix_copy_pair_indeed{#1}[#2,,]}
-
-% \def\lang_labels_text_prefix_copy_pair_indeed#1[#2,#3]%
-% {\expandafter\let
-% \csname\??label\currenttextprefixclass:\currenttextprefixtag:#1\expandafter\endcsname
-% \csname\??label\currenttextprefixclass:\currenttextprefixtag:#2\endcsname}
-%
-% this delays the aliasing so that we can switch maillanguage in between
-
-\def\lang_labels_text_prefix_copy_pair_indeed#1[#2,#3]%
- {\expandafter\edef\csname\??label\currenttextprefixclass:#1\endcsname
- {{\noexpand\csname\??label\currenttextprefixclass:\noexpand\reallanguagetag\noexpand\currentmainlanguage:#2\endcsname}{}}}
-
-\definelabelclass [head] [0] % titles
-\definelabelclass [label] [0] % texts
-\definelabelclass [mathlabel] [0] % functions
-\definelabelclass [taglabel] [2] % tags
-
-\clf_definelabels{head}{titles}\s!true\relax
-\clf_definelabels{label}{texts}\s!true\relax
-\clf_definelabels{mathlabel}{functions}\s!false\relax
-\clf_definelabels{taglabel}{tags}\s!false\relax
-
-%D \macros
-%D {translate}
-%D
-%D Sometimes macros contain language specific words that are to be typeset. Such
-%D macros can be made (more) language independant by using:
-%D
-%D \showsetup{translate}
-%D
-%D like for instance:
-%D
-%D \starttyping
-%D \translate[en=something,nl=iets]
-%D \stoptyping
-%D
-%D which expands to {\em something} or {\em iets}, depending on de current language.
-
-\installcorenamespace{translation}
-
-\unexpanded\def\translate
- {\dosingleempty\lang_translate}
-
-\def\lang_translate[#1]%
- {\getparameters[\??translation][#1]%
- \ifcsname\??translation\currentlanguage\endcsname
- \lastnamedcs
- \orelse\ifcsname\??translation\s!en\endcsname
- \lastnamedcs
- \else
- [translation #1]%
- \fi}
-
-%D When used without argument, the last defined values are used. This enables
-%D repetitive use like
-%D
-%D \starttyping
-%D \en \translate\ means \nl \translate
-%D \stoptyping
-
-%D \macros
-%D {assigntranslation}
-%D
-%D This macro is a system macro, and can be used to assign a translation to a macro.
-%D Its form is:
-%D
-%D \starttyping
-%D \assigntranslation[en=something,nl=iets]\to\command
-%D \stoptyping
-
-\unexpanded\def\assigntranslation[#1]\to#2% bad, this \to
- {\getparameters[\??translation][#1]%
- \edef#2{\begincsname\??translation\currentlanguage\endcsname}}
-
-%D \macros
-%D {commalistsentence}
-%D
-%D Redone in \LUA:
-%D
-%D \startbuffer
-%D \commalistsentence[aap,noot,mies]
-%D \commalistsentence[aap,noot]
-%D \commalistsentence[aap]
-%D \commalistsentence[a,b,c]
-%D \commalistsentence[a,b,c][{ \& },{ and }]
-%D \commalistsentence[a,b,c][+,-]
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \startlines
-%D \getbuffer
-%D \stoplines
-
-\unexpanded\def\commalistsentence
- {\dodoubleempty\typo_helpers_concat_comma_list}
-
-\def\typo_helpers_concat_comma_list[#1][#2]%
- {\clf_concatcommalist
- text {#1}%
- separators {#2}%
- separator {\detokenize\expandafter{\normalexpanded{\labeltext{and-1}}}}%
- last {\detokenize\expandafter{\normalexpanded{\labeltext{and-2}}}}%
- \relax}
-
-\setuplabeltext [\s!nl] [and-1={{, }}, and-2={{ en }}] % 1, 2 en 3
-\setuplabeltext [\s!en] [and-1={{, }}, and-2={{, }}] % 1, 2, 3
-\setuplabeltext [\s!de] [and-1={{, }}, and-2={{ und }}] % 1, 2 und 3
-\setuplabeltext [\s!hr] [and-1={{, }}, and-2={{ i }}] % 1, 2 i 3
-
-%D Goodie (handy at \LUA\ end):
-
-\unexpanded\def\LABELTEXT#1{\WORD{\labeltext{#1}}} % only for simple cases!
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-mis.mkiv b/Master/texmf-dist/tex/context/base/mkiv/lang-mis.mkiv
index 3ec29a782f8..4d81c01faa6 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lang-mis.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/lang-mis.mkiv
@@ -254,12 +254,12 @@
\def\lang_discretionaries_check_after
{\setfalse\punctafterdiscretionary
\setfalse\spaceafterdiscretionary
- \ifx\blankspace\nextnext \settrue \spaceafterdiscretionary \else
- \ifx\space \nextnext \settrue \spaceafterdiscretionary \else
- \ifx .\nextnext \settrue \punctafterdiscretionary \else
- \ifx ,\nextnext \settrue \punctafterdiscretionary \else
- \ifx :\nextnext \settrue \punctafterdiscretionary \else
- \ifx ;\nextnext \settrue \punctafterdiscretionary \fi\fi\fi\fi\fi\fi}
+ \ifx\blankspace\nexttoken \settrue \spaceafterdiscretionary \else
+ \ifx\space \nexttoken \settrue \spaceafterdiscretionary \else
+ \ifx .\nexttoken \settrue \punctafterdiscretionary \else
+ \ifx ,\nexttoken \settrue \punctafterdiscretionary \else
+ \ifx :\nexttoken \settrue \punctafterdiscretionary \else
+ \ifx ;\nexttoken \settrue \punctafterdiscretionary \fi\fi\fi\fi\fi\fi}
\letvalue{\??discretionarymode m}\handlemathmodediscretionary
@@ -268,7 +268,7 @@
\let\nextnextnext\egroup
\def\next##1#1%
{\def\next{\activedododotextmodediscretionary#1{##1}}%
- \futurelet\nextnext\next}%
+ \futurelet\nexttoken\next}%
\next}
\let\discretionarytoken \relax
@@ -279,7 +279,7 @@
\def\textmodediscretionary{\handletextmodediscretionary{#1}}%
\lang_discretionaries_check_after
\ifx\discretionarytoken\empty
- \ifx#1\nextnext % takes care of ||| and +++ and ......
+ \ifx#1\nexttoken % takes care of ||| and +++ and ......
\ifcsname\??discretionaryaction\string#1\endcsname
\lastnamedcs
\else\ifconditional\spaceafterdiscretionary
@@ -296,7 +296,7 @@
\else
\lang_discretionaries_check_before
% the next line has been changed (20050203)
- % \prewordbreak\hbox{\textmodediscretionary\nextnext}\postwordbreak
+ % \prewordbreak\hbox{\textmodediscretionary\nexttoken}\postwordbreak
% but an hbox blocks a possible \discretionary
\ifcsname\??discretionaryaction\endcsname
\lastnamedcs
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-rep.lua b/Master/texmf-dist/tex/context/base/mkiv/lang-rep.lua
index d0f6f6d5f24..9f89fa24848 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lang-rep.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lang-rep.lua
@@ -40,6 +40,10 @@ local trace_details = false trackers.register("languages.replacements.deta
local report_replacement = logs.reporter("languages","replacements")
local glyph_code = nodes.nodecodes.glyph
+local glue_code = nodes.nodecodes.glue
+
+local spaceskip_code = nodes.gluecodes.spaceskip
+local xspaceskip_code = nodes.gluecodes.xspaceskip
local nuts = nodes.nuts
@@ -47,6 +51,7 @@ local getnext = nuts.getnext
local getprev = nuts.getprev
local getattr = nuts.getattr
local getid = nuts.getid
+local getsubtype = nuts.getsubtype
local getchar = nuts.getchar
local isglyph = nuts.isglyph
@@ -82,7 +87,7 @@ local replacements = languages.replacements or { }
languages.replacements = replacements
local a_replacements = attributes.private("replacements")
-local a_noligature = attributes.private("noligature")
+local a_noligature = attributes.private("noligature") -- to be adapted to lmtx !
local lists = { }
local last = 0
@@ -105,7 +110,7 @@ lists[v_reset].attribute = unsetvalue -- so we discard 0
local function add(root,word,replacement)
local processor, replacement = splitprocessor(replacement,true) -- no check
replacement = lpegmatch(stripper,replacement) or replacement
- local list = utfsplit(word,true)
+ local list = utfsplit(word) -- ,true)
local size = #list
for i=1,size do
local l = utfbyte(list[i])
@@ -159,47 +164,6 @@ function languages.replacements.addlist(category,list)
end
end
-local function hit(a,head)
- local tree = trees[a]
- if tree then
- local root = tree[getchar(head)]
- if root then
- local current = getnext(head)
- local lastrun = false
- local lastfinal = false
- while current do
- local char, id = isglyph(current)
- -- if not char and id == glue_code then
- -- char = " " -- if needed we can also deal with spaces and special nbsp and such
- -- end
- if char then
- local newroot = root[char]
- if not newroot then
- return lastrun, lastfinal
- else
- local final = newroot.final
- if final then
- if trace_details then
- report_replacement("hitting word %a, replacement %a",final.word,final.replacement)
- end
- lastrun = current
- lastfinal = final
- else
- root = newroot
- end
- end
- current = getnext(current)
- else
- break
- end
- end
- if lastrun then
- return lastrun, lastfinal
- end
- end
- end
-end
-
local function tonodes(list,template)
local head, current
for i=1,#list do
@@ -214,120 +178,241 @@ local function tonodes(list,template)
return head
end
+local is_punctuation = characters.is_punctuation
+
+-- We can try to be clever and use the fact that there is no match to skip
+-- over to the next word but it is gives fuzzy code so for now I removed
+-- that optimization (when I really need a high performance version myself
+-- I will look into it (but so far I never used this mechanism myself).
+--
+-- We used to have the hit checker as function but is got messy when checks
+-- for punctuation was added.
+
+local function replace(head,first,last,final,hasspace,overload)
+ local current = first
+ local prefirst = getprev(first) or head
+ local postlast = getnext(last)
+ local oldlength = final.oldlength
+ local newcodes = final.newcodes
+ local newlength = newcodes and #newcodes or 0
+ if trace_replacements then
+ report_replacement("replacing word %a by %a",final.word,final.replacement)
+ end
+ if hasspace or final.special then
+ -- It's easier to delete and insert so we do just that. On the todo list is
+ -- turn injected spaces into glue but easier might be to let the char break
+ -- handler do that ...
+ local prev = getprev(current)
+ local next = getnext(last)
+ local list = current
+ setnext(last)
+ setlink(prev,next)
+ current = prev
+ if not current then
+ head = nil
+ end
+ local i = 1
+ while i <= newlength do
+ local codes = newcodes[i]
+ if type(codes) == "table" then
+ local method = codes[1]
+ if method == "discretionary" then
+ local pre, post, replace = codes[2], codes[3], codes[4]
+ if pre then
+ pre = tonodes(pre,first)
+ end
+ if post then
+ post = tonodes(post,first)
+ end
+ if replace then
+ replace = tonodes(replace,first)
+ end
+ -- todo: also set attr
+ local new = new_disc(pre,post,replace)
+ setattrlist(new,first)
+ head, current = insert_after(head,current,new)
+ elseif method == "noligature" then
+ -- not that efficient to copy but ok for testing
+ local list = codes[2]
+ if list then
+ for i=1,#list do
+ local new = copy_node(first)
+ setchar(new,list[i])
+ setattr(new,a_noligature,1)
+ head, current = insert_after(head,current,new)
+ end
+ else
+ local new = copy_node(first)
+ setchar(new,zwnj)
+ head, current = insert_after(head,current,new)
+ end
+ else
+ report_replacement("unknown method %a",method or "?")
+ end
+ else
+ local new = copy_node(first)
+ setchar(new,codes)
+ head, current = insert_after(head,current,new)
+ end
+ i = i + 1
+ end
+ flush_list(list)
+ elseif newlength == 0 then
+ -- we overload
+ elseif oldlength == newlength then
+ if final.word ~= final.replacement then
+ for i=1,newlength do
+ setchar(current,newcodes[i])
+ current = getnext(current)
+ end
+ end
+ current = getnext(final)
+ elseif oldlength < newlength then
+ for i=1,newlength-oldlength do
+ local n = copy_node(current)
+ setchar(n,newcodes[i])
+ head, current = insert_node_before(head,current,n)
+ current = getnext(current)
+ end
+ for i=newlength-oldlength+1,newlength do
+ setchar(current,newcodes[i])
+ current = getnext(current)
+ end
+ else
+ for i=1,oldlength-newlength do
+ head, current = remove_node(head,current,true)
+ end
+ for i=1,newlength do
+ setchar(current,newcodes[i])
+ current = getnext(current)
+ end
+ end
+ if overload then
+ overload(final,getnext(prefirst),getprev(postlast))
+ end
+ return head, postlast
+end
+
+-- we handle just one space
+
function replacements.handler(head)
- local current = head
- local overload = attributes.applyoverloads
+ local current = head
+ local overload = attributes.applyoverloads
+ local mode = false -- we're in word or punctuation mode
+ local wordstart = false
+ local wordend = false
+ local prevend = false
+ local prevfinal = false
+ local tree = false
+ local root = false
+ local hasspace = false
while current do
- if getid(current) == glyph_code then
+ local id = getid(current) -- or use the char getter
+ if id == glyph_code then
local a = getattr(current,a_replacements)
if a then
- local last, final = hit(a,current)
- if last then
- local precurrent = getprev(current) or head
- local oldlength = final.oldlength
- local newcodes = final.newcodes
- local newlength = newcodes and #newcodes or 0
- if trace_replacement then
- report_replacement("replacing word %a by %a",final.word,final.replacement)
- end
- if final.special then
- -- easier is to delete and insert (a simple callout to tex would be more efficient)
- -- maybe just walk over a replacement string instead
- local prev = getprev(current)
- local next = getnext(last)
- local list = current
- setnext(last)
- setlink(prev,next)
- current = prev
- if not current then
- head = nil
- end
- local i = 1
- while i <= newlength do
- local codes = newcodes[i]
- if type(codes) == "table" then
- local method = codes[1]
- if method == "discretionary" then
- local pre, post, replace = codes[2], codes[3], codes[4]
- if pre then
- pre = tonodes(pre,last)
- end
- if post then
- post = tonodes(post,last)
- end
- if replace then
- replace = tonodes(replace,last)
- end
- -- todo: also set attr
- local new = new_disc(pre,post,replace)
- setattrlist(new,last)
- head, current = insert_after(head,current,new)
- elseif method == "noligature" then
- -- not that efficient to copy but ok for testing
- local list = codes[2]
- if list then
- for i=1,#list do
- local new = copy_node(last)
- setchar(new,list[i])
- setattr(new,a_noligature,1)
- head, current = insert_after(head,current,new)
- end
- else
- local new = copy_node(last)
- setchar(new,zwnj)
- head, current = insert_after(head,current,new)
- end
- else
- -- todo
+ -- we have a run
+ tree = trees[a]
+ if tree then
+ local char = getchar(current)
+ local punc = is_punctuation[char]
+ if mode == "punc" then
+ if not punc then
+ if root then
+ local final = root.final
+ if final then
+ head = replace(head,wordstart,wordend,final,hasspace,overload)
+ elseif prevfinal then
+ head = replace(head,wordstart,prevend,prevfinal,hasspace,overload)
end
- else
- local new = copy_node(last)
- setchar(new,codes)
- head, current = insert_after(head,current,new)
+ prevfinal = false
+ root = false
end
- i = i + 1
+ mode = "word"
end
- flush_list(list)
- elseif newlength == 0 then
- -- nothing gets replaced
- current = getnext(last)
- elseif oldlength == newlength then -- #old == #new
- if final.word == final.replacement then
- -- nothing to do but skip
- else
- for i=1,newlength do
- setchar(current,newcodes[i])
- current = getnext(current)
+ elseif mode == "word" then
+ if punc then
+ if root then
+ local final = root.final
+ if final then
+ head = replace(head,wordstart,wordend,final,hasspace,overload)
+ elseif prevfinal then
+ head = replace(head,wordstart,prevend,prevfinal,hasspace,overload)
+ end
+ prevfinal = false
+ root = false
end
+ mode = "punc"
end
- elseif oldlength < newlength then -- #old < #new
- for i=1,newlength-oldlength do
- local n = copy_node(current)
- setchar(n,newcodes[i])
- head, current = insert_node_before(head,current,n)
- current = getnext(current)
- end
- for i=newlength-oldlength+1,newlength do
- setchar(current,newcodes[i])
- current = getnext(current)
+ else
+ mode = punc and "punc" or "word"
+ end
+ if root then
+ root = root[char]
+ if root then
+ wordend = current
end
- else -- #old > #new
- for i=1,oldlength-newlength do
- head, current = remove_node(head,current,true)
+ else
+ if prevfinal then
+ head = replace(head,wordstart,prevend,prevfinal,hasspace,overload)
+ prevfinal = false
end
- for i=1,newlength do
- setchar(current,newcodes[i])
- current = getnext(current)
+ root = tree[char]
+ if root then
+ wordstart = current
+ wordend = current
+ prevend = false
+ hasspace = false
end
end
- if overload then
- overload(final,getnext(precurrent),getprev(current))
+ else
+ root= false
+ end
+ else
+ tree = false
+ end
+ current = getnext(current)
+ elseif root then
+ local final = root.final
+ if mode == "word" and id == glue_code then
+ local s = getsubtype(current)
+ if s == spaceskip_code or s == xspaceskip_code then
+ local r = root[32] -- maybe more types
+ if r then
+ if not prevend then
+ local f = root.final
+ if f then
+ prevend = wordend
+ prevfinal = f
+ end
+ end
+ wordend = current
+ root = r
+ hasspace = true
+ goto moveon
end
end
end
+ if final then
+ head, current = replace(head,wordstart,wordend,final,hasspace,overload)
+ elseif prevfinal then
+ head, current = replace(head,wordstart,prevend,prevfinal,hasspace,overload)
+ end
+ prevfinal = false
+ root = false
+ ::moveon::
+ current = getnext(current)
+ else
+ current = getnext(current)
+ end
+ end
+ if root then
+ local final = root.final
+ if final then
+ head = replace(head,wordstart,wordend,final,hasspace,overload)
+ elseif prevfinal then
+ head = replace(head,wordstart,prevend,prevfinal,hasspace,overload)
end
- -- we're one ahead now but we need to because we handle words
- current = getnext(current)
end
return head
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-rep.mkiv b/Master/texmf-dist/tex/context/base/mkiv/lang-rep.mkiv
index 7864b029a7b..a3aaec8e95d 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lang-rep.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/lang-rep.mkiv
@@ -54,7 +54,7 @@
{\clf_setreplacements{#1}}
\unexpanded\def\resetreplacements
- {\attribute\replacementsattribute\attributeunsetvalue}
+ {\c_attr_replacements\attributeunsetvalue}
\unexpanded\def\replaceword
{\dotripleempty\languages_replacements_replace}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-tra.lua b/Master/texmf-dist/tex/context/base/mkiv/lang-tra.lua
new file mode 100644
index 00000000000..5fd123349a3
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkiv/lang-tra.lua
@@ -0,0 +1,123 @@
+if not modules then modules = { } end modules ['lang-tra'] = {
+ version = 1.001,
+ comment = "companion to lang-tra.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local utfbyte, utfsplit = utf.byte, utf.split
+
+local nuts = nodes.nuts
+
+local nextchar = nuts.traversers.char
+
+local getattr = nuts.getattr
+local setchar = nuts.setchar
+
+local insert_before = nuts.insert_before
+local copy_node = nuts.copy
+
+local texsetattribute = tex.setattribute
+
+local transliteration = { }
+languages.transliteration = transliteration
+
+local a_transliteration = attributes.private("transliteration")
+local unsetvalue = attributes.unsetvalue
+
+local lastmapping = 0
+local loadedmappings = { }
+
+function transliteration.define(name,vector)
+ local m = loadedmappings[vector]
+ if m == nil then
+ lastmapping = lastmapping + 1
+ local data = require("lang-imp-" .. name)
+ if data then
+ local transliterations = data.transliterations
+ if transliterations then
+ for name, d in next, transliterations do
+ local vector = d.vector
+ if not vector then
+ local mapping = d.mapping
+ if mapping then
+ vector = { }
+ for k, v in next, mapping do
+ local vv = utfsplit(v)
+ for i=1,#vv do
+ vv[i] = utfbyte(vv[i])
+ end
+ vector[utfbyte(k)] = vv
+ end
+ d.vector = vector
+ end
+ end
+ d.attribute = lastmapping
+ loadedmappings[name] = d
+ loadedmappings[lastmapping] = d
+ end
+ end
+ end
+ m = loadedmappings[vector] or false
+ end
+end
+
+local enabled = false
+
+function transliteration.set(vector)
+ if not enabled then
+ nodes.tasks.enableaction("processors", "languages.transliteration.handler")
+ enabled = true
+ end
+ local m = loadedmappings[vector]
+ texsetattribute(a_transliteration,m and m.attribute or unsetvalue)
+end
+
+function transliteration.handler(head)
+ local aprev = nil
+ local vector = nil
+ for current, char in nextchar, head do
+ local a = getattr(current,a_transliteration)
+ if a then
+ if a ~= aprev then
+ aprev = a
+ vector = loadedmappings[a]
+ if vector then
+ vector = vector.vector
+ end
+ end
+ if vector then
+ local t = vector[char]
+ if t then
+ local n = #t
+ setchar(current,t[n])
+ local p = current
+ if n > 1 then
+ for i = n-1,1,-1 do
+ local g = copy_node(current)
+ setchar(g,t[i])
+ head, p = insert_before(head, p, g)
+ end
+ end
+ end
+ end
+ end
+ end
+ return head
+end
+
+interfaces.implement {
+ name = "settransliteration",
+ arguments = "string",
+ actions = transliteration.set,
+}
+
+interfaces.implement {
+ name = "definedtransliteration",
+ arguments = "2 strings",
+ actions = transliteration.define,
+}
+
+nodes.tasks.prependaction("processors", "normalizers", "languages.transliteration.handler", nil, "nut", "disabled" )
+
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-tra.mkiv b/Master/texmf-dist/tex/context/base/mkiv/lang-tra.mkiv
new file mode 100644
index 00000000000..b8e64066166
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkiv/lang-tra.mkiv
@@ -0,0 +1,98 @@
+%D \module
+%D [ file=lang-tra,
+%D version=2020.10.31,
+%D title=\CONTEXT\ Language Macros,
+%D subtitle=Transliteration,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{ConTeXt Language Macros / Transliteration}
+
+\registerctxluafile{lang-tra}{}
+
+\unprotect
+
+\definesystemattribute[transliteration][public,global]
+
+\installcorenamespace {transliteration}
+
+\unexpanded\def\definetransliteration
+ {\dodoubleempty\lang_transliteration_define}
+
+\unexpanded\def\lang_transliteration_define[#1][#2]%
+ {\clf_definedtransliteration{#1}{#2}}
+
+\unexpanded\def\settransliteration[#1]%
+ {\clf_settransliteration{#1}}
+
+\unexpanded\def\starttransliteration[#1]%
+ {\begingroup
+ \clf_settransliteration{#1}}
+
+\unexpanded\def\stoptransliteration
+ {\endgroup}
+
+\unexpanded\def\resettransliteration
+ {\c_attr_transliteration\attributeunsetvalue}
+
+\appendtoks
+ \resettransliteration
+\to \everyinitializeverbatim
+
+\protect \endinput
+
+% \setupbodyfont[dejavu]
+%
+% \input lang-tra.mkiv
+%
+% \definetransliteration[serbian][serbian to latin]
+%
+% \starttext
+%
+% \settransliteration[serbian to latin]
+%
+% \startchapter[title={АБВ ГДЕ ЖЗИЙ КЛМНОП РСТУ ФХЦЧ ШЩЪЬ ЮЯ}]
+% АБВ ГДЕ ЖЗИЙ КЛМНОП РСТУ ФХЦЧ ШЩЪЬ ЮЯ
+% \start
+% \settransliteration[serbian to latin]
+% АБВ ГДЕ ЖЗИЙ КЛМНОП РСТУ ФХЦЧ ШЩЪЬ ЮЯ
+% \stop
+% АБВ ГДЕ ЖЗИЙ КЛМНОП РСТУ ФХЦЧ ШЩЪЬ ЮЯ
+% \stopchapter
+%
+% \resettransliteration
+%
+% \startchapter[title={АБВ ГДЕ ЖЗИЙ КЛМНОП РСТУ ФХЦЧ ШЩЪЬ ЮЯ}]
+% АБВ ГДЕ ЖЗИЙ КЛМНОП РСТУ ФХЦЧ ШЩЪЬ ЮЯ
+% \start
+% \settransliteration[serbian to latin]
+% АБВ ГДЕ ЖЗИЙ КЛМНОП РСТУ ФХЦЧ ШЩЪЬ ЮЯ
+% \stop
+% АБВ ГДЕ ЖЗИЙ КЛМНОП РСТУ ФХЦЧ ШЩЪЬ ЮЯ
+% \stopchapter
+%
+% \definehead[ChapterA][chapter]
+% \definehead[ChapterB][chapter]
+%
+% \startsetups s-to-l
+% \settransliteration[serbian to latin]
+% \red
+% \stopsetups
+%
+% % maybe we need a setups key for this
+% % hm, \definesetups [xxx] [aa,bb,cc]
+%
+% \setuphead[ChapterB][commandbefore=\setups{s-to-l}]
+%
+% \startChapterA[title={АБВ ГДЕ ЖЗИЙ КЛМНОП РСТУ ФХЦЧ ШЩЪЬ ЮЯ}]
+% \stopChapterA
+%
+% \startChapterB[title={АБВ ГДЕ ЖЗИЙ КЛМНОП РСТУ ФХЦЧ ШЩЪЬ ЮЯ}]
+% \stopChapterB
+%
+% \stoptext
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-txt.lua b/Master/texmf-dist/tex/context/base/mkiv/lang-txt.lua
index f89795e3972..026abbd0ed4 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lang-txt.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lang-txt.lua
@@ -18,6 +18,8 @@ if not modules then modules = { } end modules ['lang-txt'] = {
--
-- af Afrikaans ...
-- ar Arabic Idris Samawi Hamid, Khaled Hosny
+-- be Belarussian Darya Hryshkavets (2019)
+-- bg Bulgarian Vladislav Hinkin, Aleš Ďurčanský (2019)
-- ca Catalan ...
-- cn Chinese Wang Lei, ...
-- cs Czech Tom Hudec, Petr Sojka, Richard Gabriel
@@ -25,7 +27,7 @@ if not modules then modules = { } end modules ['lang-txt'] = {
-- de German Tobias Burnus, ...
-- en English Hans Hagen, ...
-- es Spanish Andrés Montoya, ...
--- et Estonian Clyde Johnston
+-- et Estonian Clyde Johnston (2018)
-- fi Finish ...
-- fr French Daniel Flipo, Arthur Reutenauer
-- gr Greek Apostolos Syropoulos, Thomas Schmitz
@@ -36,17 +38,19 @@ if not modules then modules = { } end modules ['lang-txt'] = {
-- kr Korean Jeong Dalyoung
-- la Latin ...
-- lt Lithuanian Marius Aleknevičius
--- mk Macedonian Jakub Loula, Tomáš Hála (2019), Stojan Trajanovski
+-- mk Macedonian Jakub Loula, Tomáš Hála (2019), Stojan Trajanovski (2019)
-- nb Norwegian Hans Fredrik Nordhaug, ...
-- nn Norwegian Hans Fredrik Nordhaug, ...
-- nl Dutch Hans Hagen
--- pe Persian Mohammad Hossein Bateni
--- pl Polish Grzegorz Sapijaszko
+-- pe Persian Mohammad Hossein Bateni (2016)
+-- pl Polish Grzegorz Sapijaszko (2011)
-- pt Portuguese Pedro F. M. Mendonça
-- ro Romanian Dan Seracu, ...
-- ru Russian Olga Briginets, Alexander Bokovoy, Victor Figurnov, ...
-- sk Slovak Tomáš Hála (2012)
-- sl Slovenian Mojca Miklavec
+-- sr Serbian Ivan Pešić (2020)
+-- sr-latn Serbian Ivan Pešić (2020)
-- sv Swedish ...
-- tk Turkish Tobias Burnus
-- tr Turkmen Nazar Annagurban
@@ -71,35 +75,49 @@ data.labels={
["btx"]={
["In"]={
["labels"]={
+ ["be"]="У",
+ ["bg"]="в",
["en"]="In",
["es"]="En",
["fr"]="Dans",
["mk"]="во",
["pe"]="در",
+ ["sr"]="У",
+ ["sr-latn"]="U",
},
},
["Number"]={
["labels"]={
+ ["be"]="Нумар",
+ ["bg"]="номер",
["de"]="Numer",
["en"]="Number",
["fr"]="Numéro",
["mk"]="Број",
["nl"]="Nummer",
["pe"]="شماره",
+ ["sr"]="Број",
+ ["sr-latn"]="Broj",
},
},
["Volume"]={
["labels"]={
+ ["be"]="Гук",
+ ["bg"]="обем",
["de"]="Band",
["en"]="Volume",
["et"]="Köide",
["mk"]="Том",
["nl"]="Deel",
["pe"]="جلد",
+ ["sr"]="Том",
+ ["sr-latn"]="Tom",
},
},
["and"]={
["labels"]={
+ ["be"]="i",
+ ["bg"]="a",
["de"]="und",
["en"]="and",
["es"]="y",
@@ -109,10 +127,14 @@ data.labels={
["mk"]="и",
["nl"]="en",
["pe"]="و",
+ ["sr"]="и",
+ ["sr-latn"]="i",
},
},
["edition"]={
["labels"]={
+ ["be"]="Выданне",
+ ["bg"]="издание",
["de"]="Auflage",
["en"]="edition",
["es"]="edición",
@@ -122,10 +144,14 @@ data.labels={
["mk"]="издание",
["nl"]="editie",
["pe"]="ویرایش",
+ ["sr"]="издање",
+ ["sr-latn"]="izdanje",
},
},
["editor"]={
["labels"]={
+ ["be"]="Рэдактар",
+ ["bg"]="редактор",
["de"]="Herausgeber",
["en"]="editor",
["et"]="toimetaja",
@@ -133,10 +159,14 @@ data.labels={
["it"]="a cura di",
["mk"]="уредник",
["pe"]="ویراستار",
+ ["sr"]="уредник",
+ ["sr-latn"]="urednik",
},
},
["editors"]={
["labels"]={
+ ["be"]="Рэдактары",
+ ["bg"]="редактори",
["de"]="Herausgeber",
["en"]="editors",
["es"]="editores",
@@ -144,20 +174,27 @@ data.labels={
["fr"]="éditeurs",
["it"]="a cura di",
["mk"]="уредници",
-
+ ["sr"]="уредници",
+ ["sr-latn"]="urednici",
},
},
["in"]={
["labels"]={
+ ["be"]="у",
+ ["bg"]="в",
["en"]="in",
["es"]="en",
["fr"]="dans",
["mk"]="во",
["pe"]="در",
+ ["sr"]="у",
+ ["sr-latn"]="u",
},
},
["mastersthesis"]={
["labels"]={
+ ["be"]="Дыпломная работа",
+ ["bg"]="дипломна работа",
["de"]="Masterarbeit",
["en"]="Master's thesis",
["es"]="Tesis de maestría",
@@ -167,55 +204,76 @@ data.labels={
["mk"]="Магистерска дисертација",
["nl"]="Masterproef",
["pe"]="پایان‌نامه کارشناسی ارشد",
+ ["sr"]="Мастер дисертација",
+ ["sr-latn"]="Master disertacija",
},
},
["number"]={
["labels"]={
+ ["be"]="нумар",
+ ["bg"]="номер",
["de"]="Numer",
["en"]="number",
["fr"]="numéro",
["mk"]="број",
["nl"]="nummer",
["pe"]="شماره",
+ ["sr"]="број",
+ ["sr-latn"]="broj",
},
},
["of"]={
["labels"]={
+ ["be"]="з",
+ ["bg"]="на",
["de"]="von",
["en"]="of",
["fr"]="de",
["mk"]="од",
["nl"]="van",
+ ["sr"]="од",
+ ["sr-latn"]="od",
},
},
["others"]={
["labels"]={
["en"]="et al.",
["et"]="jt",
- ["mk"]="и др.",
+ ["mk"]="и др.",
+ ["sr"]="и др.",
+ ["sr-latn"]="i dr.",
},
},
["p"]={
["labels"]={
+ ["be"]="стар.",
["de"]="S.",
["en"]="p.",
- ["mk"]="стр.",
["et"]="lk",
+ ["mk"]="стр.",
["pe"]="ص",
+ ["sr"]="стр.",
+ ["sr-latn"]="str.",
},
},
["pages"]={
["labels"]={
+ ["be"]="старонка",
+ ["bg"]="страни",
["de"]="Seiten",
["en"]="pages",
["et"]="leheküljed",
["mk"]="страници",
["nl"]="paginas",
["pe"]="صفحات",
+ ["sr"]="страницa",
+ ["sr-latn"]="stranica",
},
},
["patent"]={
["labels"]={
+ ["be"]="патэнт",
+ ["bg"]="патент",
["de"]="Patent",
["en"]="Patent",
["es"]="Patente",
@@ -224,10 +282,14 @@ data.labels={
["it"]="Brevetto",
["mk"]="Патент",
["nl"]="Octrooi",
+ ["sr"]="Патент",
+ ["sr-latn"]="Patent",
},
},
["phdthesis"]={
["labels"]={
+ ["be"]="Доктарская дысертацыя",
+ ["bg"]="дисертачна работа",
["de"]="Dissertation",
["en"]="PhD thesis",
["es"]="Tesis doctoral",
@@ -237,6 +299,8 @@ data.labels={
["mk"]="Докторска дисертација",
["nl"]="Proefschrift",
["pe"]="رساله دکتری",
+ ["sr"]="Докторска дисертација",
+ ["sr-latn"]="Doktorska disertacija",
},
},
["pp"]={
@@ -246,10 +310,14 @@ data.labels={
["et"]="lk-d",
["mk"]="стр.",
["pe"]="صص",
+ ["sr"]="стр.",
+ ["sr-latn"]="str.",
},
},
["technicalreport"]={
["labels"]={
+ ["be"]="Тэхнічны даклад",
+ ["bg"]="технически доклад",
["de"]="Technischer Bericht",
["en"]="Technical report",
["es"]="Informe técnico",
@@ -259,20 +327,28 @@ data.labels={
["mk"]="Технички извештај",
["nl"]="Technisch rapport",
["pe"]="گزارش فنی",
+ ["sr"]="Технички извештај",
+ ["sr-latn"]="Tehnički izveštaj",
},
},
["volume"]={
["labels"]={
+ ["be"]="гучнасць",
+ ["bg"]="обем",
["de"]="Band",
["en"]="volume",
["et"]="köide",
["mk"]="том",
["nl"]="deel",
["pe"]="جلد",
+ ["sr"]="том",
+ ["sr-latn"]="tom",
},
},
["with"]={
["labels"]={
+ ["be"]="з",
+ ["bg"]="със",
["de"]="mit",
["en"]="with",
["es"]="con",
@@ -281,177 +357,213 @@ data.labels={
["it"]="con",
["mk"]="со",
["nl"]="met",
+ ["sr"]="са",
+ ["sr-latn"]="sa",
},
},
},
["functions"]={
["Pr"]={
["labels"]={
- ["cz"]="P",
+ ["cs"]="P",
["en"]="Pr",
- ["mk"]="P",
+ ["mk"]="P",
["sk"]="P",
+ ["sr"]="P",
+ ["sr-latn"]="P",
},
},
["arccos"]={
["labels"]={
- ["cz"]="arccos",
+ ["cs"]="arccos",
["en"]="arccos",
["es"]="arc\\sixperemspace cos",
["hr"]="arc\\sixperemspace cos",
- ["mk"]="arccos",
+ ["mk"]="arccos",
["pl"]="arc\\sixperemspace cos",
["sk"]="arccos",
+ ["sr"]="arccos",
+ ["sr-latn"]="arccos",
},
},
["arccosh"]={
["labels"]={
- ["cz"]="arccosh",
+ ["cs"]="arccosh",
["en"]="arccosh",
["es"]="arc\\sixperemspace cosh",
["hr"]="arc\\sixperemspace cosh",
- ["mk"]="arccosh",
+ ["mk"]="arccosh",
["pl"]="arc\\sixperemspace cosh",
["sk"]="arccosh",
+ ["sr"]="arccosh",
+ ["sr-latn"]="arccosh",
},
},
["arcctg"]={
["labels"]={
- ["cz"]="arccotg",
+ ["cs"]="arccotg",
["en"]="arccot",
["es"]="arc\\sixperemspace cot",
["hr"]="arc\\sixperemspace ctg",
- ["mk"]="arccotg",
+ ["mk"]="arccotg",
["pl"]="arc\\sixperemspace ctg",
["sk"]="arccotg",
+ ["sr"]="arcctg",
+ ["sr-latn"]="arcctg",
},
},
["arcsin"]={
["labels"]={
- ["cz"]="arcsin",
+ ["cs"]="arcsin",
["en"]="arcsin",
["es"]="arc\\sixperemspace sen",
["hr"]="arc\\sixperemspace sin",
- ["mk"]="arcsin",
+ ["mk"]="arcsin",
["pl"]="arc\\sixperemspace sin",
["sk"]="arcsin",
+ ["sr"]="arcsin",
+ ["sr-latn"]="arcsin",
},
},
["arcsinh"]={
["labels"]={
- ["cz"]="arcsinh",
+ ["cs"]="arcsinh",
["en"]="arcsinh",
["es"]="arc\\sixperemspace senh",
["hr"]="arc\\sixperemspace sinh",
- ["mk"]="arcsinh",
+ ["mk"]="arcsinh",
["pl"]="arc\\sixperemspace sinh",
["sk"]="arcsinh",
+ ["sr"]="arcsinh",
+ ["sr-latn"]="arcsinh",
},
},
["arctan"]={
["labels"]={
- ["cz"]="arctg",
+ ["cs"]="arctg",
["en"]="arctan",
["es"]="arc\\sixperemspace tan",
["hr"]="arc\\sixperemspace tg",
- ["mk"]="arctg",
+ ["mk"]="arctg",
["pl"]="arc\\sixperemspace tg",
["sk"]="arctg",
+ ["sr"]="arctg",
+ ["sr-latn"]="arctg",
},
},
["arctanh"]={
["labels"]={
- ["cz"]="arctgh",
+ ["cs"]="arctgh",
["en"]="arctanh",
["es"]="arc\\sixperemspace tanh",
["hr"]="arc\\sixperemspace tgh",
- ["mk"]="arctgh",
+ ["mk"]="arctgh",
["pl"]="arc\\sixperemspace tgh",
["sk"]="arctgh",
+ ["sr"]="arctgh",
+ ["sr-latn"]="arctgh",
},
},
["arg"]={
["labels"]={
- ["cz"]="arg",
+ ["cs"]="arg",
["en"]="arg",
["es"]="arg",
- ["mk"]="arg",
+ ["mk"]="arg",
["sk"]="arg",
+ ["sr"]="arg",
+ ["sr-latn"]="arg",
},
},
["cos"]={
["labels"]={
- ["cz"]="cos",
+ ["cs"]="cos",
["en"]="cos",
["es"]="cos",
- ["mk"]="cos",
+ ["mk"]="cos",
["sk"]="cos",
+ ["sr"]="cos",
+ ["sr-latn"]="cos",
},
},
["cosh"]={
["labels"]={
- ["cz"]="cosh",
+ ["cs"]="cosh",
["en"]="cosh",
["es"]="cosh",
- ["mk"]="cosh",
+ ["mk"]="cosh",
["sk"]="cosh",
+ ["sr"]="cosh",
+ ["sr-latn"]="cosh",
},
},
["cot"]={
["labels"]={
- ["cz"]="cotg",
+ ["cs"]="cotg",
["en"]="cot",
["es"]="cot",
["hr"]="ctg",
- ["mk"]="ctg",
+ ["mk"]="ctg",
["pl"]="ctg",
["sk"]="cotg",
+ ["sr"]="ctg",
+ ["sr-latn"]="ctg",
},
},
["coth"]={
["labels"]={
- ["cz"]="cotgh",
+ ["cs"]="cotgh",
["en"]="coth",
["es"]="coth",
- ["mk"]="ctgh",
+ ["mk"]="ctgh",
["sk"]="cotgh",
+ ["sr"]="ctgh",
+ ["sr-latn"]="ctgh",
},
},
["csc"]={
["labels"]={
- ["cz"]="cosec",
+ ["cs"]="cosec",
["en"]="csc",
["es"]="csc",
- ["mk"]="cosec",
+ ["mk"]="cosec",
["sk"]="cosec",
+ ["sr"]="cosec",
+ ["sr-latn"]="cosec",
},
},
["ctg"]={
["labels"]={
- ["cz"]="cotg",
+ ["cs"]="cotg",
["en"]="cot",
["es"]="cot",
["hr"]="ctg",
- ["mk"]="ctg",
+ ["mk"]="ctg",
["pl"]="ctg",
["sk"]="cotg",
+ ["sr"]="ctg",
+ ["sr-latn"]="ctg",
},
},
["deg"]={
["labels"]={
- ["cz"]="deg",
+ ["cs"]="deg",
["en"]="deg",
["es"]="gr",
- ["mk"]="deg",
+ ["mk"]="deg",
["sk"]="deg",
+ ["sr"]="deg",
+ ["sr-latn"]="deg",
},
},
["det"]={
["labels"]={
- ["cz"]="det",
+ ["cs"]="det",
["en"]="det",
["es"]="det",
["sk"]="det",
+ ["sr"]="det",
+ ["sr-latn"]="det",
},
},
["diff"]={
@@ -461,35 +573,41 @@ data.labels={
},
["dim"]={
["labels"]={
- ["cz"]="dim",
+ ["cs"]="dim",
["en"]="dim",
["es"]="dim",
- ["mk"]="dim",
+ ["mk"]="dim",
["sk"]="dim",
+ ["sr"]="dim",
+ ["sr-latn"]="dim",
},
},
["exp"]={
["labels"]={
- ["cz"]="exp",
+ ["cs"]="exp",
["en"]="exp",
["es"]="exp",
["sk"]="exp",
+ ["sr"]="exp",
+ ["sr-latn"]="exp",
},
},
["gcd"]={
["labels"]={
- ["cz"]="NSD",
+ ["cs"]="NSD",
["en"]="gcd",
["es"]="mcd",
["hr"]="nzd",
- ["mk"]="НЗД",
+ ["mk"]="НЗД",
["nl"]="ggd",
["sk"]="NSD",
+ ["sr"]="НЗД",
+ ["sr-latn"]="NZD",
},
},
["hom"]={
["labels"]={
- ["cz"]="Hom",
+ ["cs"]="Hom",
["en"]="hom",
["es"]="hom",
["sk"]="Hom",
@@ -497,207 +615,237 @@ data.labels={
},
["inf"]={
["labels"]={
- ["cz"]="inf",
+ ["cs"]="inf",
["en"]="inf",
["es"]="inf",
- ["mk"]="inf",
+ ["mk"]="inf",
["sk"]="inf",
+ ["sr"]="inf",
+ ["sr-latn"]="inf",
},
},
["injlim"]={
["labels"]={
- ["cz"]="inj\\sixperemspace lim",
+ ["cs"]="inj\\sixperemspace lim",
["en"]="inj\\sixperemspace lim",
["es"]="lím\\sixperemspace iny",
["sk"]="inj\\sixperemspace lim",
+ ["sr"]="inj\\sixperemspace lim",
+ ["sr-latn"]="inj\\sixperemspace lim",
},
},
["ker"]={
["labels"]={
- ["cz"]="ker",
+ ["cs"]="ker",
["en"]="ker",
["es"]="Ker",
["sk"]="ker",
+ ["sr"]="ker",
+ ["sr-latn"]="ker",
},
},
["lcm"]={
["labels"]={
- ["cz"]="NSN",
+ ["cs"]="NSN",
["en"]="lcm",
["es"]="MCM",
["hr"]="nzv",
- ["mk"]="НЗС",
+ ["mk"]="НЗС",
["nl"]="kgv",
["sk"]="NSN",
+ ["sr"]="НЗС",
+ ["sr-latn"]="NZS",
},
},
["lg"]={
["labels"]={
- ["cz"]="log",
+ ["cs"]="log",
["en"]="lg",
["es"]="log",
- ["mk"]="lg",
+ ["mk"]="lg",
["sk"]="log",
+ ["sr"]="lg",
+ ["sr-latn"]="lg",
},
},
["lim"]={
["labels"]={
- ["cz"]="lim",
+ ["cs"]="lim",
["en"]="lim",
["es"]="lím",
- ["mk"]="lim",
+ ["mk"]="lim",
["sk"]="lim",
+ ["sr"]="lim",
+ ["sr-latn"]="lim",
},
},
["liminf"]={
["labels"]={
- ["cz"]="lim\\sixperemspace inf",
+ ["cs"]="lim\\sixperemspace inf",
["en"]="lim\\sixperemspace inf",
["es"]="lím\\sixperemspace inf",
- ["mk"]="lim\\sixperemspace inf",
+ ["mk"]="lim\\sixperemspace inf",
["sk"]="lim\\sixperemspace inf",
+ ["sr"]="lim\\sixperemspace inf",
+ ["sr-latn"]="lim\\sixperemspace inf",
},
},
["limsup"]={
["labels"]={
- ["cz"]="lim\\sixperemspace sup",
+ ["cs"]="lim\\sixperemspace sup",
["en"]="lim\\sixperemspace sup",
["es"]="lím\\sixperemspace sup",
- ["mk"]="lim\\sixperemspace sup",
+ ["mk"]="lim\\sixperemspace sup",
["sk"]="lim\\sixperemspace sup",
+ ["sr"]="lim\\sixperemspace sup",
+ ["sr-latn"]="lim\\sixperemspace sup",
},
},
["ln"]={
["labels"]={
- ["cz"]="ln",
+ ["cs"]="ln",
["en"]="ln",
["es"]="ln",
- ["mk"]="ln",
+ ["mk"]="ln",
["sk"]="ln",
+ ["sr"]="ln",
+ ["sr-latn"]="ln",
},
},
["log"]={
["labels"]={
- ["cz"]="log",
+ ["cs"]="log",
["en"]="log",
["es"]="log",
- ["mk"]="log",
+ ["mk"]="log",
["sk"]="log",
+ ["sr"]="log",
+ ["sr-latn"]="log",
},
},
["max"]={
["labels"]={
- ["cz"]="max",
+ ["cs"]="max",
["en"]="max",
["es"]="máx",
- ["mk"]="max",
+ ["mk"]="max",
["sk"]="max",
+ ["sr"]="max",
+ ["sr-latn"]="max",
},
},
["median"]={
["labels"]={
- ["cz"]="\\tilde",
+ ["cs"]="\\tilde",
["en"]="median",
["es"]="Mediana",
["sk"]="\\tilde",
+ ["sr"]="median",
+ ["sr-latn"]="median",
},
},
["min"]={
["labels"]={
- ["cz"]="min",
+ ["cs"]="min",
["en"]="min",
["es"]="mín",
- ["mk"]="min",
+ ["mk"]="min",
["sk"]="min",
+ ["sr"]="min",
+ ["sr-latn"]="min",
},
},
["mod"]={
["labels"]={
- ["cz"]="mod",
+ ["cs"]="mod",
["en"]="mod",
["es"]="mod",
- ["mk"]="mod",
+ ["mk"]="mod",
["sk"]="mod",
+ ["sr"]="mod",
+ ["sr-latn"]="mod",
},
},
["projlim"]={
["labels"]={
- ["cz"]="proj\\sixperemspace lim",
+ ["cs"]="proj\\sixperemspace lim",
["en"]="proj\\sixperemspace lim",
["es"]="lím\\sixperemspace proy",
["sk"]="proj\\sixperemspace lim",
+ ["sr"]="proj\\sixperemspace lim",
+ ["sr-latn"]="proj\\sixperemspace lim",
},
},
["sec"]={
["labels"]={
- ["cz"]="sec",
+ ["cs"]="sec",
["en"]="sec",
["es"]="sec",
- ["mk"]="sec",
+ ["mk"]="sec",
["sk"]="sec",
+ ["sr"]="sec",
+ ["sr-latn"]="sec",
},
},
["sin"]={
["labels"]={
- ["cz"]="sin",
+ ["cs"]="sin",
["en"]="sin",
["es"]="sen",
- ["mk"]="sin",
+ ["mk"]="sin",
["sk"]="sin",
+ ["sr"]="sin",
+ ["sr-latn"]="sin",
},
},
["sinh"]={
["labels"]={
- ["cz"]="sinh",
+ ["cs"]="sinh",
["en"]="sinh",
["es"]="senh",
- ["mk"]="sinh",
+ ["mk"]="sinh",
["sk"]="sinh",
+ ["sr"]="sinh",
+ ["sr-latn"]="sinh",
},
},
["sup"]={
["labels"]={
- ["cz"]="sup",
+ ["cs"]="sup",
["en"]="sup",
["es"]="sup",
- ["mk"]="sup",
+ ["mk"]="sup",
["sk"]="sup",
+ ["sr"]="sup",
+ ["sr-latn"]="sup",
},
},
["tan"]={
["labels"]={
- ["cz"]="tg",
+ ["cs"]="tg",
["en"]="tan",
["es"]="tan",
["hr"]="tg",
["mk"]="tg",
["pl"]="tg",
["sk"]="tg",
+ ["sr"]="tg",
+ ["sr-latn"]="tg",
},
},
["tanh"]={
["labels"]={
- ["cz"]="tgh",
+ ["cs"]="tgh",
["en"]="tanh",
["es"]="tanh",
- ["mk"]="tgh",
+ ["mk"]="tgh",
["sk"]="tgh",
+ ["sr"]="tgh",
+ ["sr-latn"]="tgh",
},
},
},
["texts"]={
- ["following:singular"]={
- ["labels"]={
- ["en"]="f.",
- ["fr"]=hairspace .. "sq",
- },
- },
- ["following:plural"]={
- ["labels"]={
- ["en"]="ff.",
- ["fr"]=hairspace .. "sqq",
- },
- },
["and"]={
["labels"]={
["af"]="",
@@ -727,6 +875,7 @@ data.labels={
["ru"]="",
["sk"]=" a ",
["sl"]="",
+ ["sr"]=" и ",
["sv"]="",
["tk"]="",
["tr"]="",
@@ -739,6 +888,7 @@ data.labels={
["labels"]={
["af"]="Bylae ",
["ar"]="ملحق ",
+ ["be"]="Апендыцыт",
["ca"]="Apèndix ",
["cn"]="附录",
["cs"]="Příloha ",
@@ -768,6 +918,8 @@ data.labels={
["ru"]="",
["sk"]="Príloha ",
["sl"]="Dodatek ",
+ ["sr"]="Додатак ",
+ ["sr-latn"]="Dodatak ",
["sv"]="",
["tk"]="Goşmaça",
["tr"]="",
@@ -781,6 +933,8 @@ data.labels={
["ar"]="أبريل",
["ar-dz"]="أفريل",
["ar-sy"]="نيسان",
+ ["be"]="красавіка",
+ ["bg"]="април",
["ca"]="abril",
["cn"]="四月",
["cs"]="dubna",
@@ -799,8 +953,8 @@ data.labels={
["kr"]="4",
["la"]="Aprilis",
["lt"]="balandžio",
- ["nb"]="april",
["mk"]="април",
+ ["nb"]="april",
["nl"]="april",
["nn"]="april",
["pe"]="آوریل",
@@ -810,6 +964,8 @@ data.labels={
["ru"]="апреля",
["sk"]="apríla",
["sl"]="april",
+ ["sr"]="aприл",
+ ["sr-latn"]="april",
["sv"]="april",
["tk"]="aprel",
["tr"]="nisan",
@@ -829,7 +985,7 @@ data.labels={
["ca"]="",
["cs"]="dub.",
["da"]="",
- ["de"]="",
+ ["de"]="Apr.",
["en"]="apr",
["es"]="abr.",
["et"]="apr",
@@ -851,6 +1007,8 @@ data.labels={
["ru"]="",
["sk"]="apr.",
["sl"]="",
+ ["sr"]="апр.",
+ ["sr-latn"]="apr.",
["sv"]="",
["tk"]="",
["tr"]="",
@@ -888,6 +1046,8 @@ data.labels={
["ru"]="на странице ",
["sk"]="na strane ",
["sl"]="na strani ",
+ ["sr"]="на страници ",
+ ["sr-latn"]="na stranici ",
["sv"]="på sida ",
["tk"]="",
["tr"]="",
@@ -902,6 +1062,8 @@ data.labels={
["ar-dz"]="أوت",
["ar-ma"]="غشت",
["ar-sy"]="آب",
+ ["be"]="жнівня",
+ ["bg"]="август",
["ca"]="agost",
["cn"]="八月",
["cs"]="srpna",
@@ -931,6 +1093,8 @@ data.labels={
["ru"]="августа",
["sk"]="augusta",
["sl"]="avgust",
+ ["sr"]="август",
+ ["sr-latn"]="avgust",
["sv"]="augusti",
["tk"]="awgust",
["tr"]="ağustos",
@@ -950,7 +1114,7 @@ data.labels={
["ca"]="",
["cs"]="srp.",
["da"]="",
- ["de"]="",
+ ["de"]="Aug.",
["en"]="aug",
["es"]="ago.",
["et"]="aug",
@@ -972,6 +1136,8 @@ data.labels={
["ru"]="",
["sk"]="aug.",
["sl"]="",
+ ["sr"]="авг.",
+ ["sr-latn"]="avg.",
["sv"]="",
["tk"]="",
["tr"]="",
@@ -984,6 +1150,8 @@ data.labels={
["labels"]={
["af"]="Hoofstuk ",
["ar"]="باب ",
+ ["be"]="Глава ",
+ ["bg"]="Eпизод ",
["ca"]="Capítol ",
["cn"]={ "第", "章" },
["cs"]="Kapitola ",
@@ -1013,6 +1181,9 @@ data.labels={
["ru"]="",
["sk"]="Kapitola ",
["sl"]="Poglavje ",
+ ["sr"]="Поглавље ",
+ ["sr"]="Глава ",
+ ["sr-latn"]="Glava ",
["sv"]="",
["tk"]="Bap",
["tr"]="",
@@ -1023,6 +1194,8 @@ data.labels={
["continued"]={
["labels"]={
["af"]="",
+ ["be"]=" (працяг)",
+ ["bg"]=" (продължение)",
["ca"]="",
["cs"]=" (pokračování)",
["da"]="",
@@ -1049,6 +1222,9 @@ data.labels={
["ru"]="",
["sk"]=" (pokračovanie)",
["sl"]="",
+ ["sr"]=" (наставио)",
+ ["sr"]=" (наставак)",
+ ["sr-latn"]=" (nastavak)",
["sv"]="",
["tk"]="",
["tr"]="",
@@ -1058,12 +1234,15 @@ data.labels={
},
["day"]={
["labels"]={
+ ["bg"]="ден",
["en"]="day",
["et"]="päev",
["kr"]="일",
["mk"]="ден",
["nl"]="dag",
["pe"]="روز",
+ ["sr"]="дан",
+ ["sr-latn"]="dan",
},
},
["december"]={
@@ -1072,6 +1251,8 @@ data.labels={
["ar"]="ديسمبر",
["ar-ma"]="دجنبر",
["ar-sy"]="كانون الأول",
+ ["be"]="снежня",
+ ["bg"]="декември",
["ca"]="desembre",
["cn"]="十二月",
["cs"]="prosince",
@@ -1090,8 +1271,8 @@ data.labels={
["kr"]="12",
["la"]="December",
["lt"]="gruodžio",
- ["nb"]="desember",
["mk"]="декември",
+ ["nb"]="desember",
["nl"]="december",
["nn"]="desember",
["pe"]="دسامبر",
@@ -1101,6 +1282,8 @@ data.labels={
["ru"]="декабря",
["sk"]="decembra",
["sl"]="december",
+ ["sr"]="децембар",
+ ["sr-latn"]="decembar",
["sv"]="december",
["tk"]="dekabr",
["tr"]="aralık",
@@ -1120,7 +1303,7 @@ data.labels={
["ca"]="",
["cs"]="pros.",
["da"]="",
- ["de"]="",
+ ["de"]="Dez.",
["en"]="dec",
["es"]="dic.",
["et"]="dets",
@@ -1142,6 +1325,8 @@ data.labels={
["ru"]="",
["sk"]="dec.",
["sl"]="",
+ ["sr"]="дец.",
+ ["sr-latn"]="dec.",
["sv"]="",
["tk"]="",
["tr"]="",
@@ -1155,6 +1340,8 @@ data.labels={
["ar"]="فبراير",
["ar-dz"]="فيفري",
["ar-sy"]="شباط",
+ ["be"]="лютага",
+ ["bg"]="февруари",
["ca"]="febrer",
["cn"]="二月",
["cs"]="února",
@@ -1184,6 +1371,8 @@ data.labels={
["ru"]="февраля",
["sk"]="februára",
["sl"]="februar",
+ ["sr"]="фебруар",
+ ["sr-latn"]="februar",
["sv"]="februari",
["tk"]="fewral",
["tr"]="Şubat",
@@ -1203,7 +1392,7 @@ data.labels={
["ca"]="",
["cs"]="ún.",
["da"]="",
- ["de"]="",
+ ["de"]="Feb.",
["en"]="feb",
["es"]="feb.",
["et"]="veebr",
@@ -1225,6 +1414,8 @@ data.labels={
["ru"]="",
["sk"]="feb.",
["sl"]="",
+ ["sr"]="феб.",
+ ["sr-latn"]="feb.",
["sv"]="",
["tk"]="",
["tr"]="",
@@ -1236,6 +1427,8 @@ data.labels={
["labels"]={
["af"]="Figuur ",
["ar"]="شكل ",
+ ["be"]="Малюнак",
+ ["bg"]="Фигура",
["ca"]="Figura ",
["cn"]="图",
["cs"]="Obrázek ",
@@ -1265,6 +1458,8 @@ data.labels={
["ru"]="Рисунок ",
["sk"]="Obrázok ",
["sl"]="Slika ",
+ ["sr"]="Слика ",
+ ["sr-latn"]="Slika ",
["sv"]="Figur ",
["tk"]="Surat",
["tr"]="Şekil ",
@@ -1272,6 +1467,18 @@ data.labels={
["vi"]="Hình ",
},
},
+ ["following:plural"]={
+ ["labels"]={
+ ["en"]="ff.",
+ ["fr"]=hairspace .. "sqq",
+ },
+ },
+ ["following:singular"]={
+ ["labels"]={
+ ["en"]="f.",
+ ["fr"]=hairspace .. "sq",
+ },
+ },
["followingpage"]={
["labels"]={
["en"]="on a following page",
@@ -1279,12 +1486,16 @@ data.labels={
["mk"]="на следната страница",
["nl"]="op een volgende bladzijde",
["pe"]="در صفحات آینده",
+ ["sr"]="на следећој страници",
+ ["sr-latn"]="na sledećoj stranici",
},
},
["friday"]={
["labels"]={
["af"]="vrydag",
["ar"]="الجمعة",
+ ["be"]="пятніца",
+ ["bg"]="петък",
["ca"]="divendres",
["cn"]="星期五",
["cs"]="pátek",
@@ -1314,6 +1525,8 @@ data.labels={
["ru"]="пятница",
["sk"]="piatok",
["sl"]="petek",
+ ["sr"]="петак",
+ ["sr-latn"]="petak",
["sv"]="fredag",
["tk"]="bäşinji gün",
["tr"]="cuma",
@@ -1321,10 +1534,20 @@ data.labels={
["vi"]="thứ sáu",
},
},
+ ["friday:mnem"]={
+ ["labels"]={
+ ["de"]="Fr.",
+ ["en"]="fri",
+ ["sr"]="пет.",
+ ["sr-latn"]="pet.",
+ },
+ },
["graphic"]={
["labels"]={
["af"]="Grafiek ",
["ar"]="رسم ",
+ ["be"]="Графіка ",
+ ["bg"]="Графичен ",
["ca"]="Gràfica ",
["cn"]="插图",
["cs"]="Graf ",
@@ -1353,6 +1576,8 @@ data.labels={
["ru"]="График ",
["sk"]="Graf ",
["sl"]="Slika ",
+ ["sr"]="График ",
+ ["sr-latn"]="Grafik ",
["sv"]="Grafik ",
["tk"]="Grafik",
["tr"]="Grafik",
@@ -1364,6 +1589,7 @@ data.labels={
["labels"]={
["af"]="",
["ar"]="كما وضحنا سابقا",
+ ["be"]="Графіка",
["ca"]="",
["cs"]="viz výše",
["da"]="se foroven",
@@ -1391,6 +1617,9 @@ data.labels={
["ru"]="см. выше",
["sk"]="pozri hore",
["sl"]="glej zgoraj",
+ ["sr"]="види горе",
+ ["sr"]="као што је показано изнад",
+ ["sr-latn"]="kao što je pokazano iznad",
["sv"]="se ovan",
["tk"]="",
["tr"]="",
@@ -1402,6 +1631,8 @@ data.labels={
["labels"]={
["af"]="",
["ar"]="كما نوضح لاحقا",
+ ["be"]="гл. вышэй",
+ ["bg"]="ў далейшым",
["ca"]="",
["cs"]="viz níže",
["da"]="se forneden",
@@ -1429,6 +1660,9 @@ data.labels={
["ru"]="см. ниже",
["sk"]="pozri ďalej",
["sl"]="glej spodaj",
+ ["sr"]="види доле",
+ ["sr"]="као што је показано ниже",
+ ["sr-latn"]="kao što je pokazano niže",
["sv"]="se nedan",
["tk"]="",
["tr"]="",
@@ -1440,6 +1674,8 @@ data.labels={
["labels"]={
["af"]="Intermezzo ",
["ar"]="فسحة ",
+ ["be"]="Устаўка",
+ ["bg"]="Aнтракт ",
["ca"]="Intermedi ",
["cn"]="퉣",
["cs"]="Intermezzo ",
@@ -1468,6 +1704,9 @@ data.labels={
["ru"]="Вставка ",
["sk"]="Intermezzo ",
["sl"]="Intermezzo ",
+ ["sr"]="Интермеззо ",
+ ["sr"]="Дигресија ",
+ ["sr-latn"]="Digresija ",
["sv"]="Intermezzo ",
["tk"]="Arakesme",
["tr"]="",
@@ -1481,6 +1720,8 @@ data.labels={
["ar"]="يناير",
["ar-dz"]="جانفي",
["ar-sy"]="كانون الثاني",
+ ["be"]="студзеня",
+ ["bg"]="януари",
["ca"]="gener",
["cn"]="一月",
["cs"]="ledna",
@@ -1510,6 +1751,8 @@ data.labels={
["ru"]="января",
["sk"]="januára",
["sl"]="januar",
+ ["sr"]="јануар",
+ ["sr-latn"]="januar",
["sv"]="januari",
["tk"]="ýanwar",
["tr"]="ocak",
@@ -1529,7 +1772,7 @@ data.labels={
["ca"]="",
["cs"]="led.",
["da"]="",
- ["de"]="",
+ ["de"]="Jan.",
["en"]="jan",
["es"]="ene.",
["et"]="jaan",
@@ -1551,6 +1794,8 @@ data.labels={
["ru"]="",
["sk"]="jan.",
["sl"]="",
+ ["sr"]="јан.",
+ ["sr-latn"]="jan.",
["sv"]="",
["tk"]="",
["tr"]="",
@@ -1565,6 +1810,8 @@ data.labels={
["ar-dz"]="جويلة",
["ar-ma"]="يوليوز",
["ar-sy"]="تموز",
+ ["be"]="ліпня",
+ ["bg"]="юли",
["ca"]="juliol",
["cn"]="七月",
["cs"]="července",
@@ -1594,6 +1841,8 @@ data.labels={
["ru"]="июля",
["sk"]="júla",
["sl"]="julij",
+ ["sr"]="jул",
+ ["sr-latn"]="jul",
["sv"]="juli",
["tk"]="iýul",
["tr"]="temmuz",
@@ -1613,7 +1862,7 @@ data.labels={
["ca"]="",
["cs"]="čce",
["da"]="",
- ["de"]="",
+ ["de"]="Jul.",
["en"]="jul",
["es"]="jul.",
["et"]="juuli",
@@ -1635,6 +1884,8 @@ data.labels={
["ru"]="",
["sk"]="júla",
["sl"]="",
+ ["sr"]="јул.",
+ ["sr-latn"]="jul.",
["sv"]="",
["tk"]="",
["tr"]="",
@@ -1648,6 +1899,8 @@ data.labels={
["ar"]="يونيو",
["ar-dz"]="جوان",
["ar-sy"]="حزيران",
+ ["be"]="чэрвня",
+ ["bg"]="юни",
["ca"]="juny",
["cn"]="六月",
["cs"]="června",
@@ -1677,6 +1930,8 @@ data.labels={
["ru"]="июня",
["sk"]="júna",
["sl"]="junij",
+ ["sr"]="јун",
+ ["sr-latn"]="jun",
["sv"]="juni",
["tk"]="iýun",
["tr"]="haziran",
@@ -1696,7 +1951,7 @@ data.labels={
["ca"]="",
["cs"]="čer.",
["da"]="",
- ["de"]="",
+ ["de"]="Jun.",
["en"]="jun",
["es"]="jun.",
["et"]="juuni",
@@ -1718,6 +1973,8 @@ data.labels={
["ru"]="",
["sk"]="júna",
["sl"]="",
+ ["sr"]="јун",
+ ["sr-latn"]="jun",
["sv"]="",
["tk"]="",
["tr"]="",
@@ -1729,6 +1986,8 @@ data.labels={
["labels"]={
["af"]="reël ",
["ar"]="سطر ",
+ ["be"]="радок ",
+ ["bg"]="ред ",
["ca"]="línia ",
["cn"]="行",
["cs"]="řádek ",
@@ -1758,6 +2017,8 @@ data.labels={
["ru"]="строка ",
["sk"]="riadok ",
["sl"]="vrstica ",
+ ["sr"]="линија ",
+ ["sr-latn"]="linija ",
["sv"]="rad ",
["tk"]="setir",
["tr"]="satır ",
@@ -1769,6 +2030,8 @@ data.labels={
["labels"]={
["af"]="reëls ",
["ar"]="السطور ",
+ ["be"]="радкi ",
+ ["bg"]="редове ",
["ca"]="línies ",
["cn"]="行",
["cs"]="řádky ",
@@ -1798,6 +2061,8 @@ data.labels={
["ru"]="строки ",
["sk"]="riadky ",
["sl"]="vrstice ",
+ ["sr"]="линије ",
+ ["sr-latn"]="linije ",
["sv"]="rader ",
["tk"]="setirler",
["tr"]="satırlar ",
@@ -1810,6 +2075,8 @@ data.labels={
["af"]="maart",
["ar"]="مارس",
["ar-sy"]="آذار",
+ ["be"]="сакавіка",
+ ["bg"]="март",
["ca"]="març",
["cn"]="三月",
["cs"]="března",
@@ -1839,6 +2106,8 @@ data.labels={
["ru"]="марта",
["sk"]="marca",
["sl"]="marec",
+ ["sr"]="март",
+ ["sr-latn"]="mart",
["sv"]="mars",
["tk"]="mart",
["tr"]="mart",
@@ -1858,7 +2127,7 @@ data.labels={
["ca"]="",
["cs"]="břez.",
["da"]="",
- ["de"]="",
+ ["de"]="Mrz.",
["en"]="mar",
["es"]="mar.",
["et"]="märts",
@@ -1880,6 +2149,8 @@ data.labels={
["ru"]="",
["sk"]="mar.",
["sl"]="",
+ ["sr"]="мар.",
+ ["sr-latn"]="mar.",
["sv"]="",
["tk"]="",
["tr"]="",
@@ -1894,6 +2165,8 @@ data.labels={
["ar-dz"]="ماي",
["ar-ma"]="ماي",
["ar-sy"]="أيار",
+ ["be"]="мая",
+ ["bg"]="маӣ",
["ca"]="maig",
["cn"]="五月",
["cs"]="května",
@@ -1923,6 +2196,8 @@ data.labels={
["ru"]="мая",
["sk"]="mája",
["sl"]="maj",
+ ["sr"]="мај",
+ ["sr-latn"]="maj",
["sv"]="maj",
["tk"]="maý",
["tr"]="mayıs",
@@ -1942,7 +2217,7 @@ data.labels={
["ca"]="",
["cs"]="květ.",
["da"]="",
- ["de"]="",
+ ["de"]="Mai",
["en"]="may",
["es"]="may.",
["et"]="mai",
@@ -1964,6 +2239,8 @@ data.labels={
["ru"]="",
["sk"]="mája",
["sl"]="",
+ ["sr"]="мај",
+ ["sr-latn"]="maj",
["sv"]="",
["tk"]="",
["tr"]="",
@@ -1975,6 +2252,8 @@ data.labels={
["labels"]={
["af"]="maandag",
["ar"]="الاثنين",
+ ["be"]="панядзелак",
+ ["bg"]="понеделник",
["ca"]="dilluns",
["cn"]="星期一",
["cs"]="pondělí",
@@ -2004,6 +2283,8 @@ data.labels={
["ru"]="понедельник",
["sk"]="pondelok",
["sl"]="ponedeljek",
+ ["sr"]="понедељак",
+ ["sr-latn"]="ponedeljak",
["sv"]="måndag",
["tk"]="birinji gün",
["tr"]="pazartesi",
@@ -2011,14 +2292,26 @@ data.labels={
["vi"]="thứ hai",
},
},
+ ["monday:mnem"]={
+ ["labels"]={
+ ["de"]="Mo.",
+ ["en"]="mon",
+ ["sr"]="пон.",
+ ["sr-latn"]="pon.",
+ },
+ },
["month"]={
["labels"]={
+ ["be"]="месяц",
+ ["bg"]="месец",
["en"]="month",
["et"]="kuu",
["kr"]="월",
["mk"]="месец",
["nl"]="maand",
["pe"]="ماه",
+ ["sr"]="месец",
+ ["sr-latn"]="mesec",
},
},
["november"]={
@@ -2027,6 +2320,8 @@ data.labels={
["ar"]="نوفمبر",
["ar-ma"]="نونبر",
["ar-sy"]="تشرين الثاني",
+ ["be"]="лістапада",
+ ["bg"]="ноември",
["ca"]="novembre",
["cn"]="十一月",
["cs"]="listopadu",
@@ -2056,6 +2351,8 @@ data.labels={
["ru"]="ноября",
["sk"]="novembra",
["sl"]="november",
+ ["sr"]="новембар",
+ ["sr-latn"]="novembar",
["sv"]="november",
["tk"]="noýabr",
["tr"]="kasım",
@@ -2075,7 +2372,7 @@ data.labels={
["ca"]="",
["cs"]="list.",
["da"]="",
- ["de"]="",
+ ["de"]="Nov.",
["en"]="nov",
["es"]="nov.",
["et"]="nov",
@@ -2097,6 +2394,8 @@ data.labels={
["ru"]="",
["sk"]="nov.",
["sl"]="",
+ ["sr"]="нов.",
+ ["sr-latn"]="nov.",
["sv"]="",
["tk"]="",
["tr"]="",
@@ -2109,6 +2408,8 @@ data.labels={
["af"]="oktober",
["ar"]="أكتوبر",
["ar-sy"]="تشرين الأول",
+ ["be"]="кастрычніка",
+ ["bg"]="октомври",
["ca"]="octubre",
["cn"]="十月",
["cs"]="října",
@@ -2138,6 +2439,8 @@ data.labels={
["ru"]="октября",
["sk"]="októbra",
["sl"]="oktober",
+ ["sr"]="октобар",
+ ["sr-latn"]="oktobar",
["sv"]="oktober",
["tk"]="oktýabr",
["tr"]="ekim",
@@ -2157,7 +2460,7 @@ data.labels={
["ca"]="",
["cs"]="říj.",
["da"]="",
- ["de"]="",
+ ["de"]="Okt.",
["en"]="oct",
["es"]="oct.",
["et"]="okt",
@@ -2179,6 +2482,8 @@ data.labels={
["ru"]="",
["sk"]="okt.",
["sl"]="",
+ ["sr"]="окт.",
+ ["sr-latn"]="okt.",
["sv"]="",
["tk"]="",
["tr"]="",
@@ -2190,6 +2495,8 @@ data.labels={
["labels"]={
["af"]="",
["ar"]="صفحة ",
+ ["be"]="старонка ",
+ ["bg"]="страна",
["ca"]="",
["cs"]="strana ",
["da"]="Side ",
@@ -2217,6 +2524,8 @@ data.labels={
["ru"]="страница ",
["sk"]="strana ",
["sl"]="stran ",
+ ["sr"]="страница ",
+ ["sr-latn"]="stranica ",
["sv"]="Sida ",
["tk"]="",
["tr"]="",
@@ -2228,6 +2537,8 @@ data.labels={
["labels"]={
["af"]="Deel ",
["ar"]="جزء ",
+ ["be"]="Частка ",
+ ["bg"]="Частка ",
["ca"]="Part ",
["cn"]={ "第", "部分" },
["cs"]="Část ",
@@ -2257,6 +2568,8 @@ data.labels={
["ru"]="Часть ",
["sk"]="Časť ",
["sl"]="Del ",
+ ["sr"]="Део ",
+ ["sr-latn"]="Deo ",
["sv"]="Del ",
["tk"]="Bölüm",
["tr"]="Cilt ",
@@ -2271,12 +2584,16 @@ data.labels={
["mk"]="на претходната страница",
["nl"]="op een voorgaande bladzijde",
["pe"]="در صفحات گذشته",
+ ["sr"]="на претходној страници",
+ ["sr-latn"]="na prethodnoj stranici",
},
},
["saturday"]={
["labels"]={
["af"]="saterdag",
["ar"]="السبت",
+ ["be"]="субота",
+ ["bg"]="сряда",
["ca"]="dissabte",
["cn"]="星期六",
["cs"]="sobota",
@@ -2306,6 +2623,8 @@ data.labels={
["ru"]="суббота",
["sk"]="sobota",
["sl"]="sobota",
+ ["sr"]="субота",
+ ["sr-latn"]="subota",
["sv"]="lördag",
["tk"]="altynjy gün",
["tr"]="cumartesi",
@@ -2313,11 +2632,20 @@ data.labels={
["vi"]="thứ bảy",
},
},
+ ["saturday:mnem"]={
+ ["labels"]={
+ ["de"]="Sa.",
+ ["en"]="sat",
+ ["sr"]="суб.",
+ ["sr-latn"]="sub.",
+ },
+ },
["section"]={
["hidden"]=true,
["labels"]={
["af"]="Paragraaf ",
["ar"]="فصل ",
+ ["bg"]="Cекция ",
["ca"]="Secció ",
["cn"]={ "第", "节" },
["cs"]="Sekce ",
@@ -2336,8 +2664,8 @@ data.labels={
["kr"]={ "제", "절" },
["la"]="",
["lt"]="",
- ["nb"]="",
["mk"]="Поглавје ",
+ ["nb"]="",
["nl"]="",
["nn"]="",
["pe"]="بخش ",
@@ -2347,6 +2675,8 @@ data.labels={
["ru"]="",
["sk"]="Sekcia ",
["sl"]="",
+ ["sr"]="Одељак ",
+ ["sr-latn"]="Odeljak ",
["sv"]="",
["tk"]="",
["tr"]="",
@@ -2358,6 +2688,8 @@ data.labels={
["labels"]={
["af"]="",
["ar"]="انظر ",
+ ["be"]="гл. ",
+ ["bg"]="погледни",
["ca"]="",
["cs"]="viz ",
["da"]="se ",
@@ -2385,6 +2717,8 @@ data.labels={
["ru"]="см. ",
["sk"]="pozri ",
["sl"]="glej ",
+ ["sr"]="види ",
+ ["sr-latn"]="vidi ",
["sv"]="se ",
["tk"]="",
["tr"]="",
@@ -2398,6 +2732,8 @@ data.labels={
["ar"]="سبتمبر",
["ar-ma"]="شتنبر",
["ar-sy"]="أيلول",
+ ["be"]="верасня",
+ ["bg"]="септември",
["ca"]="setembre",
["cn"]="九月",
["cs"]="září",
@@ -2427,6 +2763,8 @@ data.labels={
["ru"]="сентября",
["sk"]="septembra",
["sl"]="september",
+ ["sr"]="септембар",
+ ["sr-latn"]="septembar",
["sv"]="september",
["tk"]="sentýabr",
["tr"]="eylül",
@@ -2446,7 +2784,7 @@ data.labels={
["ca"]="",
["cs"]="září",
["da"]="",
- ["de"]="",
+ ["de"]="Sep.",
["en"]="sep",
["es"]="sep.",
["et"]="sept",
@@ -2468,6 +2806,8 @@ data.labels={
["ru"]="",
["sk"]="sept.",
["sl"]="",
+ ["sr"]="сеп.",
+ ["sr-latn"]="sep.",
["sv"]="",
["tk"]="",
["tr"]="",
@@ -2480,6 +2820,7 @@ data.labels={
["labels"]={
["af"]="",
["ar"]="فصل أدنى ",
+ ["bg"]="Подсекция ",
["ca"]="Subsecció ",
["cn"]="",
["cs"]="Podsekce ",
@@ -2508,6 +2849,8 @@ data.labels={
["ru"]="",
["sk"]="Podsekcia ",
["sl"]="",
+ ["sr"]="Пододељак ",
+ ["sr-latn"]="Pododeljak ",
["sv"]="",
["tk"]="",
["tr"]="",
@@ -2520,6 +2863,7 @@ data.labels={
["labels"]={
["af"]="",
["ar"]="فصل أدنى أدنى ",
+ ["bg"]="Подподсекция ",
["ca"]="Subsubsecció ",
["cn"]="",
["cs"]="Podpodsekce ",
@@ -2548,6 +2892,8 @@ data.labels={
["ru"]="",
["sk"]="Podpodsekcia ",
["sl"]="",
+ ["sr"]="Подпододељак ",
+ ["sr-latn"]="Podpododeljak ",
["sv"]="",
["tk"]="",
["tr"]="",
@@ -2560,6 +2906,7 @@ data.labels={
["labels"]={
["af"]="",
["ar"]="فصل أدنى أدنى أدنى ",
+ ["bg"]="Подподподсекция ",
["ca"]="Subsubsubsecció ",
["cn"]="",
["cs"]="Podpodpodsekce ",
@@ -2588,6 +2935,8 @@ data.labels={
["ru"]="",
["sk"]="Podpodpodsekcia ",
["sl"]="",
+ ["sr"]="Подподпододељак ",
+ ["sr-latn"]="Podpodpododeljak ",
["sv"]="",
["tk"]="",
["tr"]="",
@@ -2599,6 +2948,8 @@ data.labels={
["labels"]={
["af"]="sondag",
["ar"]="الأحد",
+ ["be"]="нядзеля",
+ ["bg"]="неделя",
["ca"]="diumenge",
["cn"]="星期日",
["cs"]="neděle",
@@ -2628,6 +2979,8 @@ data.labels={
["ru"]="воскресенье",
["sk"]="nedeľa",
["sl"]="nedelja",
+ ["sr"]="недеља",
+ ["sr-latn"]="nedelja",
["sv"]="söndag",
["tk"]="dynç gün",
["tr"]="pazar",
@@ -2635,10 +2988,20 @@ data.labels={
["vi"]="chủ nhật",
},
},
+ ["sunday:mnem"]={
+ ["labels"]={
+ ["de"]="So.",
+ ["en"]="sun",
+ ["sr"]="нед.",
+ ["sr-latn"]="ned.",
+ },
+ },
["table"]={
["labels"]={
["af"]="Tabel",
["ar"]="جدول ",
+ ["be"]="Табліца ",
+ ["bg"]="Таблица ",
["ca"]="Taula ",
["cn"]="表",
["cs"]="Tabulka ",
@@ -2668,6 +3031,8 @@ data.labels={
["ru"]="Таблица ",
["sk"]="Tabuľka ",
["sl"]="Tabela ",
+ ["sr"]="Табела ",
+ ["sr-latn"]="Tabela ",
["sv"]="Tabell ",
["tk"]="Tablisa",
["tr"]="Tablo ",
@@ -2679,6 +3044,8 @@ data.labels={
["labels"]={
["af"]="donderdag",
["ar"]="الخميس",
+ ["be"]="чацвер",
+ ["bg"]="четвъртък",
["ca"]="dijous",
["cn"]="星期四",
["cs"]="čtvrtek",
@@ -2708,6 +3075,8 @@ data.labels={
["ru"]="четверг",
["sk"]="štvrtok",
["sl"]="četrtek",
+ ["sr"]="четвртак",
+ ["sr-latn"]="četvrtak",
["sv"]="torsdag",
["tk"]="dördünji gün",
["tr"]="perşembe",
@@ -2715,10 +3084,20 @@ data.labels={
["vi"]="thứ năm",
},
},
+ ["thursday:mnem"]={
+ ["labels"]={
+ ["de"]="Do.",
+ ["en"]="thu",
+ ["sr"]="чет.",
+ ["sr-latn"]="čet.",
+ },
+ },
["tuesday"]={
["labels"]={
["af"]="dinsdag",
["ar"]="الثلاثاء",
+ ["be"]="аўторак",
+ ["bg"]="вторник",
["ca"]="dimarts",
["cn"]="星期二",
["cs"]="úterý",
@@ -2748,6 +3127,8 @@ data.labels={
["ru"]="вторник",
["sk"]="utorok",
["sl"]="torek",
+ ["sr"]="уторак",
+ ["sr-latn"]="utorak",
["sv"]="tisdag",
["tk"]="ikinji gün",
["tr"]="salı",
@@ -2755,10 +3136,20 @@ data.labels={
["vi"]="thứ ba",
},
},
+ ["tuesday:mnem"]={
+ ["labels"]={
+ ["de"]="Di.",
+ ["en"]="tue",
+ ["sr"]="уто.",
+ ["sr-latn"]="uto.",
+ },
+ },
["wednesday"]={
["labels"]={
["af"]="woensdag",
["ar"]="الأربعاء",
+ ["be"]="серада",
+ ["bg"]="сряда",
["ca"]="dimecres",
["cn"]="星期三",
["cs"]="středa",
@@ -2788,6 +3179,8 @@ data.labels={
["ru"]="среда",
["sk"]="streda",
["sl"]="sreda",
+ ["sr"]="среда",
+ ["sr-latn"]="sreda",
["sv"]="onsdag",
["tk"]="üçünji",
["tr"]="çarşamba",
@@ -2795,14 +3188,25 @@ data.labels={
["vi"]="thứ tư",
},
},
+ ["wednesday:mnem"]={
+ ["labels"]={
+ ["de"]="Mi.",
+ ["en"]="wed",
+ ["sr"]="сре.",
+ ["sr-latn"]="sre.",
+ },
+ },
["year"]={
["labels"]={
+ ["bg"]="година",
["en"]="year",
["et"]="aasta",
["kr"]="년",
["mk"]="година",
["nl"]="jaar",
["pe"]="سال",
+ ["sr"]="година",
+ ["sr-latn"]="godina",
},
},
},
@@ -2811,6 +3215,8 @@ data.labels={
["labels"]={
["af"]="Afkortings",
["ar"]="الاختصارات",
+ ["be"]="Спіс скарачэнняў",
+ ["bg"]="Съкращения",
["ca"]="Abreviacions",
["cn"]="缩略语",
["cs"]="Zkratky",
@@ -2840,6 +3246,8 @@ data.labels={
["ru"]="Список сокращений",
["sk"]="Skratky",
["sl"]="Kratice",
+ ["sr"]="Скраћенице",
+ ["sr-latn"]="Skraćenice",
["sv"]="Förkortningar",
["tk"]="Gysgaltmalar",
["tr"]="Kısaltmalar",
@@ -2851,6 +3259,8 @@ data.labels={
["labels"]={
["af"]="Inhoud",
["ar"]="المحتويات",
+ ["be"]="Змест",
+ ["bg"]="Съдържание",
["ca"]="Índex de continguts",
["cn"]="目录",
["cs"]="Obsah",
@@ -2880,6 +3290,8 @@ data.labels={
["ru"]="Содержание",
["sk"]="Obsah",
["sl"]="Kazalo",
+ ["sr"]="Садржај",
+ ["sr-latn"]="Sadržaj",
["sv"]="Innehåll",
["tk"]="Mazmuny",
["tr"]="Fihrist",
@@ -2891,6 +3303,7 @@ data.labels={
["labels"]={
["af"]="Figure",
["ar"]="الأشكال",
+ ["be"]="Спіс ілюстрацый",
["ca"]="Figures",
["cn"]="图形",
["cs"]="Seznam obrázků",
@@ -2920,6 +3333,8 @@ data.labels={
["ru"]="Список иллюстраций",
["sk"]="Zoznam obrázkov",
["sl"]="Slike",
+ ["sr"]="Слике",
+ ["sr-latn"]="Slike",
["sv"]="Figurer",
["tk"]="Suratlar",
["tr"]="Şekiller",
@@ -2931,6 +3346,7 @@ data.labels={
["labels"]={
["af"]="Grafieke",
["ar"]="الرسوم",
+ ["be"]="Графiка",
["ca"]="Gràfiques",
["cn"]="图",
["cs"]="Seznam grafů",
@@ -2960,6 +3376,8 @@ data.labels={
["ru"]="Список графиков",
["sk"]="Zoznam grafov",
["sl"]="Slike",
+ ["sr"]="Графици",
+ ["sr-latn"]="Grafici",
["sv"]="Grafik",
["tk"]="Grafikler",
["tr"]="Grafikler",
@@ -2971,6 +3389,8 @@ data.labels={
["labels"]={
["af"]="Indeks",
["ar"]="الفهرس",
+ ["be"]="Алфавітны паказальнік",
+ ["bg"]="Индэкс",
["ca"]="Índex alfabètic",
["cn"]="索引",
["cs"]="Rejstřík",
@@ -3000,6 +3420,9 @@ data.labels={
["ru"]="Алфавитный указатель",
["sk"]="Zoznam",
["sl"]="Stvarno kazalo",
+ ["sr"]="Индекс",
+ ["sr"]="Индекс појмова",
+ ["sr-latn"]="Indeks pojmova",
["sv"]="Sakregister",
["tk"]="Indeks",
["tr"]="İndex",
@@ -3011,6 +3434,7 @@ data.labels={
["labels"]={
["af"]="Intermezzos",
["ar"]="فسح",
+ ["be"]="Спіс уставак",
["ca"]="Intermedis",
["cn"]="퉣",
["cs"]="Intermezza",
@@ -3039,6 +3463,9 @@ data.labels={
["ru"]="Список вставок",
["sk"]="Intermezzá",
["sl"]="Intermezzi",
+ ["sr"]="Интермеззи",
+ ["sr"]="Списак дигресија",
+ ["sr-latn"]="Spisak digresija",
["sv"]="Intermezzon",
["tk"]="Arakesmeler",
["tr"]="",
@@ -3050,6 +3477,8 @@ data.labels={
["labels"]={
["af"]="Logos",
["ar"]="الشعارات",
+ ["be"]="Лагатыпы",
+ ["bg"]="Логотипи",
["ca"]="Logotips",
["cn"]="徽贬",
["cs"]="Loga",
@@ -3079,6 +3508,8 @@ data.labels={
["ru"]="Логотипы",
["sk"]="Logá",
["sl"]="Logotipi",
+ ["sr"]="Логотипи",
+ ["sr-latn"]="Logotipi",
["sv"]="Loggor",
["tk"]="Logolar",
["tr"]="Logolar",
@@ -3116,6 +3547,8 @@ data.labels={
["ru"]="",
["sk"]="Literatúra",
["sl"]="Literatura",
+ ["sr"]="Литература",
+ ["sr-latn"]="Literatura",
["sv"]="",
["tk"]="",
["tr"]="",
@@ -3127,6 +3560,7 @@ data.labels={
["labels"]={
["af"]="Tabelle",
["ar"]="الجداول",
+ ["be"]="Спіс табліц",
["ca"]="Taules",
["cn"]="表格",
["cs"]="Seznam tabulek",
@@ -3156,6 +3590,8 @@ data.labels={
["ru"]="Список таблиц",
["sk"]="Zoznam tabuliek",
["sl"]="Tabele",
+ ["sr"]="Табеле",
+ ["sr-latn"]="Tabele",
["sv"]="Tabeller",
["tk"]="Tablisalar",
["tr"]="Tablolar",
@@ -3167,6 +3603,8 @@ data.labels={
["labels"]={
["af"]="Eenhede",
["ar"]="الوحدات",
+ ["be"]="Адзінкі вымярэння",
+ ["bg"]="Адзінкі",
["ca"]="Unitats",
["cn"]="计量单位",
["cs"]="Jednotky",
@@ -3196,6 +3634,8 @@ data.labels={
["ru"]="Единицы измерения",
["sk"]="Jednotky",
["sl"]="Enote",
+ ["sr"]="Јединице",
+ ["sr-latn"]="Jedinice",
["sv"]="Enheter",
["tk"]="Birlikler",
["tr"]="Birimler",
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-url.lua b/Master/texmf-dist/tex/context/base/mkiv/lang-url.lua
index 7428d64ab24..7a8b7ca86c3 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lang-url.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lang-url.lua
@@ -9,7 +9,9 @@ if not modules then modules = { } end modules ['lang-url'] = {
local utfcharacters, utfbyte, utfchar = utf.characters, utf.byte, utf.char
local min, max = math.min, math.max
-local context = context
+local context = context
+local ctx_pushcatcodes = context.pushcatcodes
+local ctx_popcatcodes = context.popcatcodes
local implement = interfaces.implement
local variables = interfaces.variables
@@ -190,9 +192,9 @@ local function action(hyphenatedurl,str,left,right,disc)
end
end
if dodi then
- list[i] = "\\d"
+ list[i] = "\\lang_url_d "
else
- list[i] = "\\" .. what .. "{" .. utfbyte(char) .. "}"
+ list[i] = "\\lang_url_" .. what .. "{" .. utfbyte(char) .. "}"
end
prev = char
end
@@ -200,7 +202,9 @@ local function action(hyphenatedurl,str,left,right,disc)
report("old : %s",str)
report("new : %t",list)
end
+ ctx_pushcatcodes("prtcatcodes")
context("%t",list)
+ ctx_popcatcodes()
end
-- urls.action = function(_,...) action(...) end -- sort of obsolete
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-url.mkiv b/Master/texmf-dist/tex/context/base/mkiv/lang-url.mkiv
index 6afef63cee2..8f1a979dc56 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lang-url.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/lang-url.mkiv
@@ -100,22 +100,17 @@
{\dontleavehmode
\begingroup
\the\everyhyphenatedurl
- \normallanguage\zerocount
- \let\a\lang_url_a % after
- \let\b\lang_url_b % before
- \let\d\lang_url_d % disc
- \let\l\lang_url_l % letter
- \let\c\lang_url_c % character
- \let\L\lang_url_L % letter_nobreak
- \let\C\lang_url_C % character_nobreak
+ \normallanguage\zerocount % \nohyphens in mkiv
\scratchskipone\zeropoint\s!plus\dimexpr\emwidth/12\s!minus\dimexpr\emwidth/24\relax % 1.00pt @ 12pt
\scratchskiptwo\zeropoint\s!plus\dimexpr\emwidth/48\s!minus\dimexpr\emwidth/96\relax % 0.25pt @ 12pt
+ \unprotect
\normalexpanded{\noexpand\clf_hyphenatedurl
{\noexpand\detokenize{#1}}%
\hyphenatedurllefthyphenmin
\hyphenatedurlrighthyphenmin
{\hyphenatedurldiscretionary}%
}%
+ \protect
\endgroup}
%D \macros
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-wrd.lua b/Master/texmf-dist/tex/context/base/mkiv/lang-wrd.lua
index 9fbced2ce95..1c440bd7f2a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lang-wrd.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lang-wrd.lua
@@ -39,7 +39,7 @@ local getid = nuts.getid
local getchar = nuts.getchar
local setattr = nuts.setattr
----- getattr = nuts.getattr
-local getlang = nuts.getlang
+local getlanguage = nuts.getlanguage
local ischar = nuts.ischar
local nextnode = nuts.traversers.node
@@ -163,7 +163,7 @@ local function mark_words(head,whenfound) -- can be optimized and shared
while current do
local code, id = ischar(current) -- not isglyph because otherwise we can run into
if code then -- processed streams (\about[foo] does that)
- local a = getlang(current)
+ local a = getlanguage(current)
if a then
if a ~= language then
if s > 0 then
diff --git a/Master/texmf-dist/tex/context/base/mkiv/libs-imp-curl.lua b/Master/texmf-dist/tex/context/base/mkiv/libs-imp-curl.lua
deleted file mode 100644
index b307397948c..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/libs-imp-curl.lua
+++ /dev/null
@@ -1,296 +0,0 @@
-if not modules then modules = { } end modules ['libs-imp-curl'] = {
- version = 1.001,
- comment = "companion to luat-lib.mkxl",
- author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
- copyright = "PRAGMA ADE / ConTeXt Development Team",
- license = "see context related readme files"
-}
-
--- c:/data/develop/tex-context/tex/texmf-win64/bin/lib/luametatex/lua/copies/curl/libcurl.dll
-
-local libname = "curl"
-local libfile = "libcurl"
-
-local curllib = resolvers.libraries.validoptional(libname)
-
-if not curllib then return end
-
--- We're good, so we continue.
-
-local next, type = next, type
-local lower, gsub = string.lower, string.gsub
-
-local mapping = {
- ["acceptencoding"] = 102,
- ["accepttimeoutms"] = 212,
- ["addressscope"] = 171,
- ["append"] = 50,
- ["autoreferer"] = 58,
- ["buffersize"] = 98,
- ["cainfo"] = 65,
- ["capath"] = 97,
- ["certinfo"] = 172,
- -- ["chunkbgnfunction"] = 198,
- ["chunkdata"] = 201,
- -- ["chunkendfunction"] = 199,
- ["closepolicy"] = 72,
- ["closesocketdata"] = 209,
- -- ["closesocketfunction"] = 208,
- ["connectonly"] = 141,
- ["connecttimeout"] = 78,
- ["connecttimeoutms"] = 156,
- -- ["convfromnetworkfunction"] = 142,
- -- ["convfromutf8function"] = 144,
- -- ["convtonetworkfunction"] = 143,
- ["cookie"] = 22,
- ["cookiefile"] = 31,
- ["cookiejar"] = 82,
- ["cookielist"] = 135,
- ["cookiesessionv"] = 96,
- ["copypostfields"] = 165,
- ["crlf"] = 27,
- ["crlfile"] = 169,
- ["customrequest"] = 36,
- ["debugdata"] = 95,
- -- ["debugfunction"] = 94,
- ["dirlistonly"] = 48,
- ["dnscachetimeout"] = 92,
- ["dnsinterface"] = 221,
- ["dnslocalip4"] = 222,
- ["dnslocalip6"] = 223,
- ["dnsservers"] = 211,
- ["dnsuseglobalcache"] = 91,
- ["egdsocket"] = 77,
- ["errorbuffer"] = 10,
- ["expect100timeoutms"] = 227,
- ["failonerror"] = 45,
- ["file"] = 1,
- ["filetime"] = 69,
- ["fnmatchdata"] = 202,
- -- ["fnmatchfunction"] = 200,
- ["followlocation"] = 52,
- ["forbidreuse"] = 75,
- ["freshconnect"] = 74,
- ["ftpaccount"] = 134,
- ["ftpalternativetouser"] = 147,
- ["ftpcreatemissingdirs"] = 110,
- ["ftpfilemethod"] = 138,
- ["ftpresponsetimeout"] = 112,
- ["ftpskippasvip"] = 137,
- ["ftpsslccc"] = 154,
- ["ftpuseeprt"] = 106,
- ["ftpuseepsv"] = 85,
- ["ftpusepret"] = 188,
- ["ftpport"] = 17,
- ["ftpsslauth"] = 129,
- ["gssapidelegation"] = 210,
- ["header"] = 42,
- ["headerdata"] = 29,
- -- ["headerfunction"] = 79,
- ["http200aliases"] = 104,
- ["httpcontentdecoding"] = 158,
- ["httptransferdecoding"] = 157,
- ["httpversion"] = 84,
- ["httpauth"] = 107,
- ["httpget"] = 80,
- ["httpheader"] = 23,
- ["httppost"] = 24,
- ["httpproxytunnel"] = 61,
- ["ignorecontentlength"] = 136,
- ["infile"] = 9,
- ["infilesize"] = 14,
- ["infilesizelarge"] = 115,
- ["interface"] = 62,
- ["interleavedata"] = 195,
- -- ["interleavefunction"] = 196,
- ["ioctldata"] = 131,
- -- ["ioctlfunction"] = 130,
- ["ipresolve"] = 113,
- ["issuercert"] = 170,
- ["keypasswd"] = 26,
- ["krblevel"] = 63,
- ["localport"] = 139,
- ["localportrange"] = 140,
- ["loginoptions"] = 224,
- ["lowspeedlimit"] = 19,
- ["lowspeedtime"] = 20,
- ["mailauth"] = 217,
- ["mailfrom"] = 186,
- ["mailrcpt"] = 187,
- ["maxrecvspeedlarge"] = 146,
- ["maxsendspeedlarge"] = 145,
- ["maxconnects"] = 71,
- ["maxfilesize"] = 114,
- ["maxfilesizelarge"] = 117,
- ["maxredirs"] = 68,
- ["netrc"] = 51,
- ["netrcfile"] = 118,
- ["newdirectoryperms"] = 160,
- ["newfileperms"] = 159,
- ["nobody"] = 44,
- ["noprogress"] = 43,
- ["noproxy"] = 177,
- ["nosignal"] = 99,
- ["opensocketdata"] = 164,
- -- ["opensocketfunction"] = 163,
- ["password"] = 174,
- ["port"] = 3,
- ["post"] = 47,
- -- ["postfields"] = 15,
- -- ["postfieldsize"] = 60,
- -- ["postfieldsizelarge"] = 120,
- ["postquote"] = 39,
- ["postredir"] = 161,
- ["prequote"] = 93,
- ["private"] = 103,
- ["progressdata"] = 57,
- -- ["progressfunction"] = 56,
- ["protocols"] = 181,
- ["proxy"] = 4,
- ["proxytransfermode"] = 166,
- ["proxyauth"] = 111,
- ["proxypassword"] = 176,
- ["proxyport"] = 59,
- ["proxytype"] = 101,
- ["proxyusername"] = 175,
- ["proxyuserpwd"] = 6,
- ["put"] = 54,
- ["quote"] = 28,
- ["randomfile"] = 76,
- ["range"] = 7,
- ["readdata"] = 9,
- -- ["readfunction"] = 12,
- ["redirprotocols"] = 182,
- ["referer"] = 16,
- ["resolve"] = 203,
- ["resumefrom"] = 21,
- ["resumefromlarge"] = 116,
- ["rtspclientcseq"] = 193,
- ["rtsprequest"] = 189,
- ["rtspservercseq"] = 194,
- ["rtspsessionid"] = 190,
- ["rtspstreamuri"] = 191,
- ["rtsptransport"] = 192,
- ["rtspheader"] = 23,
- ["saslir"] = 218,
- ["seekdata"] = 168,
- -- ["seekfunction"] = 167,
- ["serverresponsetimeout"] = 112,
- ["share"] = 100,
- ["sockoptdata"] = 149,
- -- ["sockoptfunction"] = 148,
- ["socks5gssapinec"] = 180,
- ["socks5gssapiservice"] = 179,
- ["sshauthtypes"] = 151,
- ["sshhostpublickeymd5"] = 162,
- ["sshkeydata"] = 185,
- -- ["sshkeyfunction"] = 184,
- ["sshknownhosts"] = 183,
- ["sshprivatekeyfile"] = 153,
- ["sshpublickeyfile"] = 152,
- ["sslcipherlist"] = 83,
- ["sslctxdata"] = 109,
- -- ["sslctxfunction"] = 108,
- ["sslenablealpn"] = 226,
- ["sslenablenpn"] = 225,
- ["ssloptions"] = 216,
- ["sslsessionidcache"] = 150,
- ["sslverifyhost"] = 81,
- ["sslverifypeer"] = 64,
- ["sslcert"] = 25,
- ["sslcerttype"] = 86,
- ["sslengine"] = 89,
- ["sslenginedefault"] = 90,
- ["sslkey"] = 87,
- ["sslkeytype"] = 88,
- ["sslversion"] = 32,
- ["stderr"] = 37,
- ["tcpkeepalive"] = 213,
- ["tcpkeepidle"] = 214,
- ["tcpkeepintvl"] = 215,
- ["tcpnodelay"] = 121,
- ["telnetoptions"] = 70,
- ["tftpblksize"] = 178,
- ["timecondition"] = 33,
- ["timeout"] = 13,
- ["timeoutms"] = 155,
- ["timevalue"] = 34,
- ["tlsauthpassword"] = 205,
- ["tlsauthtype"] = 206,
- ["tlsauthusername"] = 204,
- ["transferencoding"] = 207,
- ["transfertext"] = 53,
- ["unrestrictedauth"] = 105,
- ["upload"] = 46,
- ["url"] = 2,
- ["usessl"] = 119,
- ["useragent"] = 18,
- ["username"] = 173,
- ["userpwd"] = 5,
- ["verbose"] = 41,
- ["wildcardmatch"] = 197,
- ["writedata"] = 1,
- -- ["writefunction"] = 11,
- ["writeheader"] = 29,
- ["writeinfo"] = 40,
- ["xferinfodata"] = 57,
- -- ["xferinfofunction"] = 219,
- ["xoauth2bearer"] = 220,
-}
-
-table.setmetatableindex(mapping,function(t,k)
- local s = gsub(lower(k),"[^a-z0-9]","")
- local v = rawget(t,s) or false
- t[k] = v
- return v
-end)
-
-local curl_fetch = curllib.fetch
-local curl_escape = curllib.escape
-local curl_unescape = curllib.unescape
-local curl_getversion = curllib.getversion
-
-local report = logs.reporter(libname)
-
-local function okay()
- if resolvers.libraries.optionalloaded(libname,libfile) then
- okay = function() return true end
- else
- okay = function() return false end
- end
- return okay()
-end
-
-local function fetch(options)
- if okay() then
- local t = type(options)
- if t == "table" then
- local o = { }
- for name, value in next, options do
- local index = mapping[name]
- if index then
- o[index] = value
- end
- end
- return curl_fetch(o)
- elseif t == "string" then
- return curl_fetch { [mapping.url] = options }
- else
- report("invalid argument")
- end
- end
-end
-
-local curl = {
- getversion = function () return okay() and curl_getversion() end,
- escape = function (s) return okay() and curl_escape (s) end,
- unescape = function (s) return okay() and curl_unescape (s) end,
- fetch = fetch,
-}
-
--- inspect(curl.fetch("http://www.pragma-ade.com/index.html"))
--- inspect(curl.fetch { url = "http://www.pragma-ade.com/index.html" })
-
-package.loaded[libname] = curl
-
-return curl
diff --git a/Master/texmf-dist/tex/context/base/mkiv/libs-imp-ghostscript.lua b/Master/texmf-dist/tex/context/base/mkiv/libs-imp-ghostscript.lua
deleted file mode 100644
index b129a58c143..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/libs-imp-ghostscript.lua
+++ /dev/null
@@ -1,111 +0,0 @@
-if not modules then modules = { } end modules ['libs-imp-ghostscript'] = {
- version = 1.001,
- comment = "companion to luat-lib.mkxl",
- author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
- copyright = "PRAGMA ADE / ConTeXt Development Team",
- license = "see context related readme files",
-}
-
-local libname = "ghostscript"
-local libfile = "gsdll64" -- what on unix?
-
-local gslib = resolvers.libraries.validoptional(libname)
-
-if not gslib then return end
-
-local function okay()
- if resolvers.libraries.optionalloaded(libname,libfile) then
- okay = function() return true end
- else
- okay = function() return false end
- end
- return okay()
-end
-
-local insert = table.insert
-local formatters = string.formatters
-
-local ghostscript = utilities.ghostscript or { }
-utilities.ghostscript = ghostscript
-
-local gs_execute = gslib.execute
-local nofruns = 0
-local report = logs.reporter(libname)
-
-function ghostscript.convert(specification)
- if okay() then
- --
- nofruns = nofruns + 1
- statistics.starttiming(ghostscript)
- --
- local inputname = specification.inputname
- if not inputname or inputname == "" then
- report("invalid run %s, no inputname specified",nofruns)
- statistics.stoptiming(ghostscript)
- return false
- end
- local outputname = specification.outputname
- if not outputname or outputname == "" then
- outputname = file.replacesuffix(inputname,"pdf")
- end
- --
- if not lfs.isfile(inputname) then
- report("invalid run %s, input file %a is not found",nofruns,inputname)
- statistics.stoptiming(ghostscript)
- return false
- end
- --
- local device = specification.device
- if not device or device == "" then
- device = "pdfwrite"
- end
- --
- local code = specification.code
- if not code or code == "" then
- code = ".setpdfwrite"
- end
- --
- local options = specification.options or { }
- --
- insert(options,"-dNOPAUSE")
- insert(options,"-dBATCH")
- insert(options,"-dSAFER")
- insert(options,formatters["-sDEVICE=%s"](device))
- insert(options,formatters["-sOutputFile=%s"](outputname))
- insert(options,"-c")
- insert(options,code)
- insert(options,"-f")
- insert(options,inputname)
- --
- report("run %s, input file %a, outputfile %a",nofruns,inputname,outputname)
- report("")
- local done = gslib_execute(options)
- report("")
- --
- statistics.stoptiming(ghostscript)
- if done then
- return outputname
- else
- report("run %s quit with errors",nofruns)
- return false
- end
- end
-end
-
-function ghostscript.statistics(report)
- local runtime = statistics.elapsedtime(ghostscript)
- if report then
- report("nofruns %s, runtime %s",nofruns,runtime)
- else
- return {
- runtime = runtime,
- nofruns = nofruns,
- }
- end
-end
-
--- for i=1,100 do
--- ghostscript.convert { inputname = "temp.eps" }
--- ghostscript.convert { inputname = "t:/escrito/tiger.eps" }
--- end
--- ghostscript.statistics(true)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/libs-imp-graphicsmagick.lua b/Master/texmf-dist/tex/context/base/mkiv/libs-imp-graphicsmagick.lua
deleted file mode 100644
index 6f5d1d967fd..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/libs-imp-graphicsmagick.lua
+++ /dev/null
@@ -1,77 +0,0 @@
-if not modules then modules = { } end modules ['libs-imp-graphicsmagick'] = {
- version = 1.001,
- comment = "companion to luat-lib.mkxl",
- author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
- copyright = "PRAGMA ADE / ConTeXt Development Team",
- license = "see context related readme files",
-}
-
-local libname = "graphicsmagick"
-local libfile = { "CORE_RL_magick_", "CORE_RL_wand_" }
-
-local gmlib = resolvers.libraries.validoptional(libname)
-
-if not gmlib then return end
-
-local function okay()
- if resolvers.libraries.optionalloaded(libname,libfile) then
- okay = function() return true end
- else
- okay = function() return false end
- end
- return okay()
-end
-
-local graphicsmagick = utilities.graphicsmagick or { }
-utilities.graphicsmagick = graphicsmagick
-utilities.graphicmagick = graphicsmagick
-
-local gm_execute = gmlib.execute
-local nofruns = 0
-local report = logs.reporter(libname)
-
-function graphicsmagick.convert(specification)
- if okay() then
- --
- nofruns = nofruns + 1
- statistics.starttiming(graphicsmagick)
- --
- local inputname = specification.inputname
- if not inputname or inputname == "" then
- report("invalid run %s, no inputname specified",nofruns)
- statistics.stoptiming(graphicsmagick)
- return false
- end
- local outputname = specification.outputname
- if not outputname or outputname == "" then
- outputname = file.replacesuffix(inputname,"pdf")
- end
- --
- if not lfs.isfile(inputname) then
- report("invalid run %s, input file %a is not found",nofruns,inputname)
- statistics.stoptiming(graphicsmagick)
- return false
- end
- --
- report("run %s, input file %a, outputfile %a",nofruns,inputname,outputname)
- --
- gm_execute { inputfile = inputname, outputfile = outputname }
- --
- statistics.stoptiming(graphicsmagick)
- end
-end
-
-function graphicsmagick.statistics(report)
- local runtime = statistics.elapsedtime(graphicsmagick)
- if report then
- report("nofruns %s, runtime %s",nofruns,runtime)
- else
- return {
- runtime = runtime,
- nofruns = nofruns,
- }
- end
-end
-
--- graphicsmagick.convert { inputname = "t:/sources/hacker.jpg", outputname = "e:/tmp/hacker.png" }
--- graphicsmagick.statistics(true)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/libs-imp-mujs.lua b/Master/texmf-dist/tex/context/base/mkiv/libs-imp-mujs.lua
deleted file mode 100644
index 264c8e53126..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/libs-imp-mujs.lua
+++ /dev/null
@@ -1,126 +0,0 @@
-if not modules then modules = { } end modules ['libs-imp-mujs'] = {
- version = 1.001,
- comment = "companion to luat-imp-mujs.mkxl",
- author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
- copyright = "PRAGMA ADE / ConTeXt Development Team",
- license = "see context related readme files"
-}
-
--- This is an experiment. When a new user knows \JAVASCRIPT\ it can be a
--- stepping stone to using \LUA.
-
--- local ecmascript = optional.mujs.initialize("libmujs")
--- local execute = optional.mujs.execute
-
-local libname = "mujs"
-local libfile = "libmujs"
-
-if package.loaded[libname] then
- return package.loaded[libname]
-end
-
-local mujslib = resolvers.libraries.validoptional(libname)
-
-if not mujslib then
- return
-end
-
-local files = { }
-local openfile = io.open
-local findfile = resolvers.findfile
-
-local mujs_execute = mujslib.execute
-local mujs_dofile = mujslib.dofile
-local mujs_reset = mujslib.reset
-
-local function okay()
- if resolvers.libraries.optionalloaded(libname,libfile) then
- mujs_execute(
- "var catcodes = { " ..
- "'tex': " .. tex.texcatcodes .. "," ..
- "'ctx': " .. tex.ctxcatcodes .. "," ..
- "'prt': " .. tex.prtcatcodes .. "," ..
- "'vrb': " .. tex.vrbcatcodes .. "," ..
- "};"
- )
- okay = function() return true end
- else
- okay = function() return false end
- end
- return okay()
-end
-
-mujslib.setfindfile(findfile)
-
-mujslib.setopenfile(function(name)
- local full = findfile(name)
- if full then
- local f = openfile(full,"rb")
- if f then
- for i=1,100 do
- if not files[i] then
- files[i] = f
- return i
- end
- end
- end
- end
-end)
-
-mujslib.setclosefile(function(id)
- local f = files[id]
- if f then
- f:close()
- files[id] = false
- end
-end)
-
-mujslib.setreadfile(function(id,how)
- local f = files[id]
- if f then
- return (f:read(how or "*l"))
- end
-end)
-
-mujslib.setseekfile(function(id,whence,offset)
- local f = files[id]
- if f then
- return (f:seek(whence,offset))
- end
-end)
-
-local reporters = {
- console = logs.reporter("mujs","console"),
- report = logs.reporter("mujs","report"),
-}
-
-mujslib.setconsole(function(category,name)
- reporters[category](name)
-end)
-
-local mujs = {
- ["execute"] = function(c,s) if okay() then mujs_execute(c,s) end end,
- ["dofile"] = function(n) if okay() then mujs_dofile(n) end end,
- ["reset"] = function(n) if okay() then mujs_reset(n) end end,
-}
-
-package.loaded[libname] = mujs
-
-optional.loaded.mujs = mujs
-
-interfaces.implement {
- name = "ecmacode",
- actions = mujs.execute,
- arguments = "string",
- public = true,
-}
-
-interfaces.implement {
- name = "ecmafile",
- actions = mujs.dofile,
- arguments = "string",
- public = true,
- protected = true,
-}
-
-return mujs
diff --git a/Master/texmf-dist/tex/context/base/mkiv/libs-imp-mujs.mkxl b/Master/texmf-dist/tex/context/base/mkiv/libs-imp-mujs.mkxl
deleted file mode 100644
index 0f278dff5b2..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/libs-imp-mujs.mkxl
+++ /dev/null
@@ -1,121 +0,0 @@
-%D \module
-%D [ file=libs-imp-mujs,
-%D version=2020.02.08,
-%D title=\CONTEXT\ Extra Modules,
-%D subtitle=MuJS interpreter,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-%D Just an experiment:
-%D
-%D \starttyping
-%D http://mujs.com
-%D \stoptyping
-
-\ifdefined\ecmacode
- \expandafter \endinput
-\fi
-
-\registerctxluafile{libs-imp-mujs}{}
-
-\unprotect
-
-% todo: environment
-
-\let\stopecmacode\relax
-
-\normalprotected\def\startecmacode % \stopecmacode
- {\begingroup
- \obeylualines
- \obeyluatokens
- \luat_start_ecma_code_indeed}
-
-\def\luat_start_ecma_code_indeed#1\stopecmacode
- {\normalexpanded{\endgroup\noexpand\ecmacode{#1}}}
-
-\protect
-
-\continueifinputfile{libs-imp-mujs.mkxl}
-
-\usemodule[article-basic,abbreviations-logos]
-
-\starttext
-
-\startbuffer
-\startluacode
- local mujs = require("libs-imp-mujs")
-
- mujs.execute [[
- var MyMax = 1000;
- ]]
-
- mujs.execute [[
- console("Example One!");
- texsprint("\\startpacked");
- for (var i = 1; i <= MyMax; i = i + 1) {
- texprint(
- "This is a buildbot compilation challenge for Mojca: "
- .concat(Math.sqrt(i/MyMax))
- .concat("!\\par")
- );
- }
- texsprint("\\stoppacked");
- ]]
-
- -- mujs.execute [[
- -- something very bad: an error
- -- ]]
-\stopluacode
-
-\startecmacode
- console("Example Two!");
- for (var i = 1; i <= MyMax; i = i + 1) {
- texsprint(
- "And an opportunity for Alan to attract highschool students to \\TeX: "
- .concat(i)
- .concat("! ")
- );
- }
-\stopecmacode
-
-\ecmacode {
- console("Example Three!");
- texprint("And otherwise a way to prototype \\JAVASCRIPT\\ code in \\PDF.")
-}
-
-\startecmacode
- var f = File("libs-imp-mujs.mkxl","r");
- console(f);
- // var l = f.read(400);
- var l = f.read("*a");
- console(l);
- f.close();
-\stopecmacode
-
-\startecmacode
- console("Example Four!");
- texsprint("\\startMPcode "
- .concat(' fill fullcircle scaled 6cm withcolor "darkred";')
- .concat(' fill fullcircle scaled 4cm withcolor "darkgreen";')
- .concat(' fill fullcircle scaled 2cm withcolor "darkblue";')
- .concat("\\stopMPcode ")
- );
-\stopecmacode
-
-\startluacode
- context.startMPcode()
- context('fill fullcircle scaled 6cm withcolor "middlecyan";')
- context('fill fullcircle scaled 4cm withcolor "middlemagenta";')
- context('fill fullcircle scaled 2cm withcolor "middleyellow";')
- context.stopMPcode()
-\stopluacode
-\stopbuffer
-
-\typebuffer \page \getbuffer
-
-\stoptext
diff --git a/Master/texmf-dist/tex/context/base/mkiv/libs-imp-mysql.lua b/Master/texmf-dist/tex/context/base/mkiv/libs-imp-mysql.lua
deleted file mode 100644
index 3e938a6de48..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/libs-imp-mysql.lua
+++ /dev/null
@@ -1,220 +0,0 @@
-if not modules then modules = { } end modules ['libs-imp-mysql'] = {
- version = 1.001,
- comment = "companion to util-sql.lua",
- author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
- copyright = "PRAGMA ADE / ConTeXt Development Team",
- license = "see context related readme files"
-}
-
--- c:/data/develop/tex-context/tex/texmf-win64/bin/lib/luametatex/lua/copies/mysql/libmysql.dll
-
-local libname = "mysql"
-local libfile = "libmysql"
-
-local mysqllib = resolvers.libraries.validoptional(libname)
-
-if not mysqllib then return end
-
-local function okay()
- if resolvers.libraries.optionalloaded(libname,libfile) then
- okay = function() return true end
- else
- okay = function() return false end
- end
- return okay()
-end
-
-local lpegmatch = lpeg.match
-local setmetatable = setmetatable
-
-local sql = utilities.sql or require("util-sql")
-local report = logs.reporter(libname)
-
-local trace_sql = false trackers.register("sql.trace", function(v) trace_sql = v end)
-local trace_queries = false trackers.register("sql.queries",function(v) trace_queries = v end)
-
-local mysql_open = mysqllib.open
-local mysql_close = mysqllib.close
-local mysql_execute = mysqllib.execute
-local mysql_getmessage = mysqllib.getmessage
-
-local helpers = sql.helpers
-local methods = sql.methods
-local validspecification = helpers.validspecification
-local preparetemplate = helpers.preparetemplate
-local querysplitter = helpers.querysplitter
-local cache = { }
-local timeout -- = 3600 -- to be tested
-
-local function connect(specification)
- local db = mysql_open(
- specification.database or "",
- specification.username or "",
- specification.password or "",
- specification.host or "",
- specification.port
- )
- if db and timeout then
- mysql_execute(db,formatters["SET SESSION connect_timeout=%s ;"](timeout))
- end
- return db
-end
-
-local function execute_once(specification,retry)
- if okay() then
- if trace_sql then
- report("executing mysql")
- end
- if not validspecification(specification) then
- report("error in specification")
- end
- local query = preparetemplate(specification)
- if not query then
- report("error in preparation")
- return
- else
- query = lpegmatch(querysplitter,query)
- end
- local base = specification.database -- or specification.presets and specification.presets.database
- if not base then
- report("no database specified")
- return
- end
- local result = { }
- local keys = { }
- local id = specification.id
- local db = nil
- if id then
- local session = cache[id]
- if session then
- db = session.db
- else
- db = connect(specification)
- if not db then
- report("no session database specified")
- else
- cache[id] = {
- specification = specification,
- db = db,
- }
- end
- end
- else
- db = connect(specification)
- end
- if not db then
- report("no database opened")
- else
- local converter = specification.converter
- local nofrows = 0
- local callback = nil
- if converter then
- local convert = converter.mysql
- callback = function(nofcolumns,values,fields)
- nofrows = nofrows + 1
- result[nofrows] = convert(values)
- end
- else
- callback = function(nofcolumns,values,fields)
- local column = { }
- for i=1,nofcolumns do
- local field
- if fields then
- field = fields[i]
- keys[i] = field
- else
- field = keys[i]
- end
- if field then
- column[field] = values[i]
- end
- end
- nofrows = nofrows + 1
- result[nofrows] = column
- end
- end
- for i=1,#query do
- local okay = mysql_execute(db,query[i],callback)
- if not okay then
- if id and retry and i == 1 then
- report("error: %s, retrying to connect",mysql_getmessage(db))
- mysql_close(db)
- cache[id] = nil
- return execute_once(specification,false)
- else
- report("error: %s",mysql_getmessage(db))
- end
- end
- end
- end
- if db and not id then
- mysql_close(db)
- end
- -- bonus
- local one = result[1]
- if one then
- setmetatable(result,{ __index = one } )
- end
- --
- return result, keys
- else
- report("error: ","no library loaded")
- end
-end
-
-local function execute(specification)
- return execute_once(specification,true)
-end
-
--- Here we build the dataset stepwise so we don't use the data hack that
--- is used in the client variant.
-
-local wraptemplate = [[
-local converters = utilities.sql.converters
-local deserialize = utilities.sql.deserialize
-
-local tostring = tostring
-local tonumber = tonumber
-local booleanstring = string.booleanstring
-
-%s
-
-return function(cells)
- -- %s (not needed)
- -- %s (not needed)
- return {
- %s
- }
-end
-]]
-
--- return function(result)
--- if not result then
--- return { }
--- end
--- local nofrows = #result
--- if nofrows == 0 then
--- return { }
--- end
--- local target = { } -- no %s needed here
--- for i=1,nofrows do
--- target[%s] = {
--- %s
--- }
--- end
--- return result
--- end
-
-local celltemplate = "cells[%s]"
-
-methods.mysql = {
- execute = execute,
- usesfiles = false,
- wraptemplate = wraptemplate,
- celltemplate = celltemplate,
-}
-
-package.loaded["util-sql-imp-ffi"] = methods.mysql
-package.loaded["util-sql-imp-mysql"] = methods.mysql
-package.loaded["util-sql-imp-library"] = methods.mysql
-package.loaded[libname] = methods.mysql
diff --git a/Master/texmf-dist/tex/context/base/mkiv/libs-imp-postgress.lua b/Master/texmf-dist/tex/context/base/mkiv/libs-imp-postgress.lua
deleted file mode 100644
index 629079b01a5..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/libs-imp-postgress.lua
+++ /dev/null
@@ -1,200 +0,0 @@
-if not modules then modules = { } end modules ['libs-imp-postgress'] = {
- version = 1.001,
- comment = "companion to util-sql.lua",
- author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
- copyright = "PRAGMA ADE / ConTeXt Development Team",
- license = "see context related readme files"
-}
-
--- Not yet untested !
-
--- c:/data/develop/tex-context/tex/texmf-win64/bin/lib/luametatex/lua/copies/postgress/libpq.dll
-
--- we can now share the code between mysql, postgress, sqlite ... todo
-
-local libname = "postgress"
-local libfile = "libpq"
-
-local postgresslib = resolvers.libraries.validoptional(libname)
-
-if not postgresslib then return end
-
-local function okay()
- if resolvers.libraries.optionalloaded(libname,libfile) then
- okay = function() return true end
- else
- okay = function() return false end
- end
- return okay()
-end
-
-local lpegmatch = lpeg.match
-local setmetatable = setmetatable
-
-local sql = utilities.sql or require("util-sql")
-local report = logs.reporter(libname)
-
-local trace_sql = false trackers.register("sql.trace", function(v) trace_sql = v end)
-local trace_queries = false trackers.register("sql.queries",function(v) trace_queries = v end)
-
-local postgress_open = postgresslib.open
-local postgress_close = postgresslib.close
-local postgress_execute = postgresslib.execute
-local postgress_getmessage = postgresslib.getmessage
-
-local helpers = sql.helpers
-local methods = sql.methods
-local validspecification = helpers.validspecification
-local preparetemplate = helpers.preparetemplate
-local querysplitter = helpers.querysplitter -- not needed
-local cache = { }
-
-local function connect(specification)
- return postgress_open(
- specification.database or "",
- specification.username or "",
- specification.password or "",
- specification.host or "",
- specification.port
- )
-end
-
-local function execute_once(specification,retry)
- if okay() then
- if trace_sql then
- report("executing postgress")
- end
- if not validspecification(specification) then
- report("error in specification")
- end
- local query = preparetemplate(specification)
- if not query then
- report("error in preparation")
- return
- else
- query = lpegmatch(querysplitter,query) -- not needed
- end
- local base = specification.database -- or specification.presets and specification.presets.database
- if not base then
- report("no database specified")
- return
- end
- local result = { }
- local keys = { }
- local id = specification.id
- local db = nil
- if id then
- local session = cache[id]
- if session then
- db = session.db
- else
- db = connect(specification)
- if not db then
- report("no session database specified")
- else
- cache[id] = {
- specification = specification,
- db = db,
- }
- end
- end
- else
- db = connect(specification)
- end
- if not db then
- report("no database opened")
- else
- local converter = specification.converter
- local nofrows = 0
- local callback = nil
- if converter then
- local convert = converter.postgress
- callback = function(nofcolumns,values,fields)
- nofrows = nofrows + 1
- result[nofrows] = convert(values)
- end
- else
- callback = function(nofcolumns,values,fields)
- local column = { }
- for i=1,nofcolumns do
- local field
- if fields then
- field = fields[i]
- keys[i] = field
- else
- field = keys[i]
- end
- if field then
- column[field] = values[i]
- end
- end
- nofrows = nofrows + 1
- result[nofrows] = column
- end
- end
- for i=1,#query do
- local okay = postgress_execute(db,query[i],callback)
- if not okay then
- if id and retry and i == 1 then
- report("error: %s, retrying to connect",postgress_getmessage(db))
- postgress_close(db)
- cache[id] = nil
- return execute_once(specification,false)
- else
- report("error: %s",postgress_getmessage(db))
- end
- end
- end
- end
- if db and not id then
- postgress_close(db)
- end
- -- bonus
- local one = result[1]
- if one then
- setmetatable(result,{ __index = one } )
- end
- --
- return result, keys
- else
- report("error: ","no library loaded")
- end
-end
-
-local function execute(specification)
- return execute_once(specification,true)
-end
-
--- Here we build the dataset stepwise so we don't use the data hack that
--- is used in the client variant.
-
-local wraptemplate = [[
-local converters = utilities.sql.converters
-local deserialize = utilities.sql.deserialize
-
-local tostring = tostring
-local tonumber = tonumber
-local booleanstring = string.booleanstring
-
-%s
-
-return function(cells)
- -- %s (not needed)
- -- %s (not needed)
- return {
- %s
- }
-end
-]]
-
-local celltemplate = "cells[%s]"
-
-methods.postgress = {
- execute = execute,
- usesfiles = false,
- wraptemplate = wraptemplate,
- celltemplate = celltemplate,
-}
-
-package.loaded["util-sql-imp-postgress"] = methods.postgress
-package.loaded[libname] = methods.postgress
diff --git a/Master/texmf-dist/tex/context/base/mkiv/libs-imp-sqlite.lua b/Master/texmf-dist/tex/context/base/mkiv/libs-imp-sqlite.lua
deleted file mode 100644
index 5d38986f347..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/libs-imp-sqlite.lua
+++ /dev/null
@@ -1,187 +0,0 @@
-if not modules then modules = { } end modules ['libs-imp-sqlite'] = {
- version = 1.001,
- comment = "companion to util-sql.lua",
- author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
- copyright = "PRAGMA ADE / ConTeXt Development Team",
- license = "see context related readme files"
-}
-
--- c:/data/develop/tex-context/tex/texmf-win64/bin/lib/luametatex/lua/copies/sqlite/sqlite3.dll
-
-local libname = "sqlite"
-local libfile = "sqlite3"
-
-local sqlitelib = resolvers.libraries.validoptional(libname)
-
-if not sqlitelib then return end
-
-local function okay()
- if resolvers.libraries.optionalloaded(libname,libfile) then
- okay = function() return true end
- else
- okay = function() return false end
- end
- return okay()
-end
-
-local next, tonumber = next, tonumber
-local setmetatable = setmetatable
-local formatters = string.formatters
-
-local sql = utilities.sql or require("util-sql")
-local report = logs.reporter(libname)
-
-local trace_sql = false trackers.register("sql.trace", function(v) trace_sql = v end)
-local trace_queries = false trackers.register("sql.queries",function(v) trace_queries = v end)
-
-local sqlite_open = sqlitelib.open
-local sqlite_close = sqlitelib.close
-local sqlite_execute = sqlitelib.execute
-local sqlite_getmessage = sqlitelib.getmessage
-
-local helpers = sql.helpers
-local methods = sql.methods
-local validspecification = helpers.validspecification
-local preparetemplate = helpers.preparetemplate
-local cache = { }
-
--- synchronous journal_mode locking_mode 1000 logger inserts
---
--- normal normal normal 6.8
--- off off normal 0.1
--- normal off normal 2.1
--- normal persist normal 5.8
--- normal truncate normal 4.2
--- normal truncate exclusive 4.1
-
-local f_preamble = formatters[ [[
-ATTACH `%s` AS `%s` ;
-PRAGMA `%s`.synchronous = normal ;
-]] ]
-
-local function execute(specification)
- if okay() then
- if trace_sql then
- report("executing sqlite")
- end
- if not validspecification(specification) then
- report("error in specification")
- end
- local query = preparetemplate(specification)
- if not query then
- report("error in preparation")
- return
- end
- local base = specification.database -- or specification.presets and specification.presets.database
- if not base then
- report("no database specified")
- return
- end
- local filename = file.addsuffix(base,"db")
- local result = { }
- local keys = { }
- local id = specification.id
- local db = nil
- local preamble = nil
- if id then
- local session = cache[id]
- if session then
- db = session.db
- else
- db = sqlite_open(filename)
- preamble = f_preamble(filename,base,base)
- if not db then
- report("no session database specified")
- else
- cache[id] = {
- name = filename,
- db = db,
- }
- end
- end
- else
- db = open_db(filename)
- preamble = f_preamble(filename,base,base)
- end
- if not db then
- report("no database opened")
- else
- local converter = specification.converter
- local nofrows = 0
- local callback = nil
- if preamble then
- query = preamble .. query -- only needed in open
- end
- if converter then
- local convert = converter.sqlite
- callback = function(nofcolumns,values,fields)
- nofrows = nofrows + 1
- result[nofrows] = convert(values)
- end
- else
- callback = function(nofcolumns,values,fields)
- local column = { }
- for i=1,nofcolumns do
- local field
- if fields then
- field = fields[i]
- keys[i] = field
- else
- field = keys[i]
- end
- if field then
- column[field] = values[i]
- end
- end
- nofrows = nofrows + 1
- result[nofrows] = column
- end
- end
- local okay = sqlite_execute(db,query,callback)
- if not okay then
- report("error: %s",sqlite_getmessage(db))
- -- elseif converter then
- -- result = converter.sqlite(result)
- end
- end
- if db and not id then
- sqlite_close(db)
- end
- return result, keys
- else
- report("error: ","no library loaded")
- end
-end
-
-local wraptemplate = [[
-local converters = utilities.sql.converters
-local deserialize = utilities.sql.deserialize
-
-local tostring = tostring
-local tonumber = tonumber
-local booleanstring = string.booleanstring
-
-%s
-
-return function(cells)
- -- %s (not needed)
- -- %s (not needed)
- return {
- %s
- }
-end
-]]
-
-local celltemplate = "cells[%s]"
-
-methods.sqlite = {
- execute = execute,
- usesfiles = false,
- wraptemplate = wraptemplate,
- celltemplate = celltemplate,
-}
-
-package.loaded["util-sql-imp-sqlite"] = methods.sqlite
-package.loaded[libname] = methods.sqlite
-
-return methods.sqlite
diff --git a/Master/texmf-dist/tex/context/base/mkiv/libs-imp-zint.lua b/Master/texmf-dist/tex/context/base/mkiv/libs-imp-zint.lua
deleted file mode 100644
index 2c346ae7d5f..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/libs-imp-zint.lua
+++ /dev/null
@@ -1,161 +0,0 @@
-if not modules then modules = { } end modules ['libs-imp-ghostscript'] = {
- version = 1.001,
- comment = "companion to luat-lib.mkxl",
- author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
- copyright = "PRAGMA ADE / ConTeXt Development Team",
- license = "see context related readme files",
-}
-
-local libname = "zint"
-local libfile = "libzint" -- what on unix?
--- local libfile = "/usr/local/lib/libzint.so"
-
-local zintlib = resolvers.libraries.validoptional(libname)
-
-if not zintlib then return end
-
-local function okay()
- if resolvers.libraries.optionalloaded(libname,libfile) then
- okay = function() return true end
- else
- okay = function() return false end
- end
- return okay()
-end
-
-local zint = utilities.zint or { }
-utilities.zint = zint
-
-local zintlib_execute = zintlib.execute
-
-local next, type, unpack = next, type, unpack
-local lower, gsub = string.lower, string.gsub
-
-local mapping = {
- ["code 11"] = 1, ["pharma one-track"] = 51, ["aztec code"] = 92,
- ["standard 2of5"] = 2, ["pzn"] = 52, ["daft code"] = 93,
- ["interleaved 2of5"] = 3, ["pharma two-track"] = 53, ["micro qr code"] = 97,
- ["iata 2of5"] = 4, ["pdf417"] = 55, ["hibc code 128"] = 98,
- ["data logic"] = 6, ["pdf417 trunc"] = 56, ["hibc code 39"] = 99,
- ["industrial 2of5"] = 7, ["maxicode"] = 57, ["hibc data matrix"] = 102,
- ["code 39"] = 8, ["qr code"] = 58, ["hibc qr code"] = 104,
- ["extended code 39"] = 9, ["code 128-b"] = 60, ["hibc pdf417"] = 106,
- ["ean"] = 13, ["ap standard customer"] = 63, ["hibc micropdf417"] = 108,
- ["ean + check"] = 14, ["ap reply paid"] = 66, ["hibc codablock-f"] = 110,
- ["gs1-128"] = 16, ["ap routing"] = 67, ["hibc aztec code"] = 112,
- ["codabar"] = 18, ["ap redirection"] = 68, ["dotcode"] = 115,
- ["code 128"] = 20, ["isbn"] = 69, ["han xin code"] = 116,
- ["leitcode"] = 21, ["rm4scc"] = 70, ["rm mailmark"] = 121,
- ["identcode"] = 22, ["data matrix"] = 71, ["aztec runes"] = 128,
- ["code 16k"] = 23, ["ean-14"] = 72, ["code 32"] = 129,
- ["code 49"] = 24, ["vin (north america)"] = 73, ["comp ean"] = 130,
- ["code 93"] = 25, ["codablock-f"] = 74, ["comp gs1-128"] = 131,
- ["flattermarken"] = 28, ["nve-18"] = 75, ["comp databar omni"] = 132,
- ["gs1 databar omni"] = 29, ["japanese post"] = 76, ["comp databar ltd"] = 133,
- ["gs1 databar ltd"] = 30, ["korea post"] = 77, ["comp databar expom"] = 134,
- ["gs1 databar expom"] = 31, ["gs1 databar stack"] = 79, ["comp upc-a"] = 135,
- ["telepen alpha"] = 32, ["gs1 databar stack omni"] = 80, ["comp upc-e"] = 136,
- ["upc-a"] = 34, ["gs1 databar eso"] = 81, ["comp databar stack"] = 137,
- ["upc-a + check"] = 35, ["planet"] = 82, ["comp databar stack omni"] = 138,
- ["upc-e"] = 37, ["micropdf"] = 84, ["comp databar eso"] = 139,
- ["upc-e + check"] = 38, ["usps onecode"] = 85, ["channel code"] = 140,
- ["postnet"] = 40, ["uk plessey"] = 86, ["code one"] = 141,
- ["msi plessey"] = 47, ["telepen numeric"] = 87, ["grid matrix"] = 142,
- ["fim"] = 49, ["itf-14"] = 89, ["upnqr"] = 143,
- ["logmars"] = 50, ["kix code"] = 90, ["rmqr"] = 145,
-}
-
-table.setmetatableindex(mapping,function(t,k)
- local s = gsub(lower(k),"[^a-z0-9]","")
- local v = rawget(t,s) or false
- t[k] = v
- return v
-end)
-
-local report = logs.reporter("zint")
-local context = context
-local shown = false
-
------ f_rectangle = string.formatters["%sofill unitsquare xysized (%N,%N) shifted (%N,%N);"]
-
-local function execute(specification)
- if okay() then
- local code = specification.code
- local text = specification.text
- if code then
- local id = mapping[code]
- if id then
- specification.code = id
- local result = zintlib_execute(specification)
- if result then
- -- not that fast but if needed we can speed it up
- context.startMPcode()
- local rectangles = result.rectangles
- local hexagons = result.hexagons
- local circles = result.circles
- local strings = result.strings
- if rectangles then
- local n = #rectangles
- for i=1,n do
- local r = rectangles[i]
- context("%sofill unitsquare xysized (%N,%N) shifted (%N,%N);",
- i == n and "d" or "n",r[3],r[4],r[1],r[2])
- -- rectangles[i] = f_rectangle(i == n and "d" or "n",r[3],r[4],r[1],r[2])
- end
- -- context("% t",rectangles)
- end
- if hexagons then
- local n = #hexagons
- for i=1,#hexagons do
- context("%sofill (%N,%N)--(%N,%N)--(%N,%N)--(%N,%N)--(%N,%N)--(%N,%N)--cycle;",
- i == n and "d" or "n",unpack(hexagons[i]))
- end
- end
- if circles then
- local n = #circles
- for i=1,#circles do
- local c = circles[i]
- context("%sofill unitcircle scaled %N shifted (%N,%N);",
- i == n and "d" or "n",c[3],c[1],c[2])
- end
- end
- if strings then
- -- We set the font at the encapsulating level.
- for i=1,#strings do
- local s = strings[i]
- context('draw textext("%s") scaled (%N/10) shifted (%N,%N);',
- s[4],s[3],s[1],s[2])
- end
- end
- context.stopMPcode()
- end
- else
- report("unknown barcode alternative %a",code)
- if not shown then
- report("")
- report("valid barcode alternatives:")
- report("")
- local list = table.sortedkeys(mapping)
- for i=1,#list do
- report(" %s", list[i])
- end
- report("")
- shown = true
- end
- end
- end
- end
-end
-
-optional.loaded.zint = { execute = execute }
-
-interfaces.implement {
- name = "zint",
- actions = execute,
- arguments = {
- {
- { "code" },
- { "text" },
- }
- }
-}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/libs-imp-zint.mkxl b/Master/texmf-dist/tex/context/base/mkiv/libs-imp-zint.mkxl
deleted file mode 100644
index 72ce8157efe..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/libs-imp-zint.mkxl
+++ /dev/null
@@ -1,64 +0,0 @@
-%D \module
-%D [ file=m-zint,
-%D version=2010.12.07,
-%D title=\CONTEXT\ Extra Modules,
-%D subtitle=Zint Barcode Generator,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Using \type {zint} seems to be the easiest way to generate
-%D (PDF417) barcodes so therefore we now have this module. There
-%D are proper (also windows) binaries at:
-%D
-%D \starttyping
-%D http://www.zint.org.uk
-%D \stoptyping
-%D
-%D There is a bit more code than needed as we want to be able to
-%D feed names.
-
-\registerctxluafile{libs-imp-zint}{}
-
-\unprotect
-
-\definefont[usedzintfont][dejavusansmono at 10bp]
-
-\unexpanded\def\barcode[#1]% [alternative=,text=]
- {\bgroup
- \usedzintfont
- \getdummyparameters
- [\c!alternative=,\c!text=,#1]%
- \scale
- [#1]%
- {\clf_zint
- code {\dummyparameter\c!alternative}
- text {\dummyparameter\c!text}
- \relax}
- \egroup}
-
-\protect
-
-\continueifinputfile{libs-imp-zint.mkxl}
-
-\starttext
-
-% \dorecurse{1000}{
- \startTEXpage
- \barcode[alternative=PDF417,text={Hans Hagen}]%
- \blank
- \barcode[alternative=PDF417,text={Ton Otten}]%
- \blank
- \barcode[alternative=ISBN,text=9789490688011]%
- \blank
- \barcode[alternative=isbn,text=9789490688011,width=3cm]%
- \stopTEXpage
-% }
-
-\stoptext
-
-
diff --git a/Master/texmf-dist/tex/context/base/mkiv/libs-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/libs-ini.lua
index 2bac3201d28..5b8390df2a1 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/libs-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/libs-ini.lua
@@ -13,10 +13,10 @@ if not modules then modules = { } end modules ['libs-ini'] = {
-- is doing.
local type, unpack = type, unpack
+local find = string.find
-- here we implement the resolver
-local type = type
local nameonly = file.nameonly
local joinfile = file.join
@@ -30,8 +30,10 @@ local expandpaths = resolvers.expandedpathlistfromvariable
local report = logs.reporter("resolvers","libraries")
local trace = false
+local silent = false
-trackers.register("resolvers.lib", function(v) trace = v end)
+trackers.register("resolvers.lib", function(v) trace = v end)
+trackers.register("resolvers.lib.silent", function(v) silent = v end)
local function findlib(required) -- todo: cache
local suffix = os.libsuffix or "so"
@@ -143,10 +145,10 @@ function libraries.optionalloaded(name,libnames)
end
end
local initialized = thelib_initialize(unpack(libnames))
- if initialized then
- report("using library '% + t'",libnames)
- else
+ if not initialized then
report("unable to initialize library '% + t'",libnames)
+ elseif not silent then
+ report("using library '% + t'",libnames)
end
return initialized
end
@@ -154,6 +156,9 @@ function libraries.optionalloaded(name,libnames)
end
end
+-- For the moment the next blob is needed when we run \MTXRUN\ on top of \LUATEX\ and
+-- \LUAJITTEX\ but at some point we will {\em always} assume \LUAMETATEX\ as runner.
+
if FFISUPPORTED and ffi and ffi.load then
local ffiload = ffi.load
@@ -194,3 +199,19 @@ end
-- }
-- end
-- }
+
+local dofile = dofile
+local savedrequire = require
+
+function require(name,version)
+ if find(name,"%.lua$") or find(name,"%.lmt$") then
+ local m = dofile(findfile(name))
+ if m then
+ package.loaded[name] = m
+ return m
+ end
+ else
+ return savedrequire(name)
+ end
+end
+
diff --git a/Master/texmf-dist/tex/context/base/mkiv/libs-ini.mkxl b/Master/texmf-dist/tex/context/base/mkiv/libs-ini.mkxl
deleted file mode 100644
index 18163beed12..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/libs-ini.mkxl
+++ /dev/null
@@ -1,31 +0,0 @@
-%D \module
-%D [ file=libs-ini,
-%D version=2020.01.02,
-%D title=\CONTEXT\ Lua Macros,
-%D subtitle=Libraries,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\registerctxluafile{libs-ini}{}
-
-\registerctxluafile{libs-imp-curl}{}
-\registerctxluafile{libs-imp-ghostscript}{}
-\registerctxluafile{libs-imp-graphicsmagick}{}
-
-% These are loaded on demand:
-
-% \registerctxluafile{libs-imp-mysql}{}
-% \registerctxluafile{libs-imp-sqlite}{}
-% \registerctxluafile{libs-imp-postgress}{}
-
-\unprotect
-
-% \unexpanded\def\uselibrary[#1]%
-% {\clf_uselibrary{#1}}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lpdf-ano.lua b/Master/texmf-dist/tex/context/base/mkiv/lpdf-ano.lua
index c04ada15156..a120ff2f4ee 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lpdf-ano.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lpdf-ano.lua
@@ -712,7 +712,8 @@ function codeinjections.prerollreference(actions) -- share can become option
local bs, bc = pdfborder()
main = pdfdictionary {
Subtype = pdf_link,
- Border = bs,
+ -- Border = bs,
+ Border = pdfshareobjectreference(bs),
C = bc,
H = (not actions.highlight and pdf_n) or nil,
A = pdfshareobjectreference(main),
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lpdf-aux.lua b/Master/texmf-dist/tex/context/base/mkiv/lpdf-aux.lua
index 0d7cecbb853..91636ad04e0 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lpdf-aux.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lpdf-aux.lua
@@ -22,7 +22,8 @@ local cache = table.setmetatableindex(function(t,k) -- can be made weak
if v < 0x10000 then
v = format("%04x",v)
else
- v = format("%04x%04x",rshift(v,10),v%1024+0xDC00)
+ v = v - 0x10000
+ v = format("%04x%04x",rshift(v,10)+0xD800,v%1024+0xDC00)
end
t[k] = v
return v
@@ -71,7 +72,7 @@ local more = 0
local pattern = C(4) / function(s) -- needs checking !
local now = tonumber(s,16)
if more > 0 then
- now = (more-0xD800)*0x400 + (now-0xDC00) + 0x10000 -- the 0x10000 smells wrong
+ now = (more-0xD800)*0x400 + (now-0xDC00) + 0x10000
more = 0
return utfchar(now)
elseif now >= 0xD800 and now <= 0xDBFF then
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lpdf-col.lua b/Master/texmf-dist/tex/context/base/mkiv/lpdf-col.lua
index c586300e55b..d3b612593d5 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lpdf-col.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lpdf-col.lua
@@ -818,14 +818,20 @@ do
end
end
+ -- A problem is that we need to transfer back and this is kind of
+ -- messy so we force text mode .. i'll do a better job on that but
+ -- will experiment first (both engines). Virtual fonts will change
+ -- anyway.
+
backends.pdf.tables.vfspecials = allocate { -- todo: distinguish between glyph and rule color
startcolor = startcolor,
-- stopcolor = { "pdf", "page", "0 g 0 G Q" },
- stopcolor = { "pdf", "page", "Q" },
+ stopcolor = { "pdf", "text", "Q" },
startslant = startslant,
- stopslant = { "pdf", "origin", "Q" },
+ -- stopslant = { "pdf", "origin", "Q" },
+ stopslant = { "pdf", "text", "Q" },
}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lpdf-emb.lua b/Master/texmf-dist/tex/context/base/mkiv/lpdf-emb.lua
deleted file mode 100644
index 4ffcfd8a846..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/lpdf-emb.lua
+++ /dev/null
@@ -1,2224 +0,0 @@
-if not modules then modules = { } end modules ['lpdf-ini'] = {
- 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"
-}
-
--- vkgoeswild: Pink Floyd - Shine on You Crazy Diamond - piano cover (around that
--- time I redid the code, a reminder so to say)
-
--- At some point I wanted to have access to the shapes so that we could use them in
--- metapost. So, after looking at the cff and ttf specifications, I decided to write
--- parsers. At somepoint we needed a cff parser anyway in order to calculate the
--- dimensions. Then variable fonts came around and a option was added to recreate
--- streams of operators and a logical next step was to do all inclusion that way. It
--- was only then that I found out that some of the juggling also happens in the the
--- backend, but spread over places, so I could have saved myself some time
--- deciphering the specifications. Anyway, here we go.
---
--- Color fonts are a bit messy. Catching issues with older fonts will break new ones
--- so I don't think that it's wise to build in too many catches (like for fonts with
--- zero boundingboxes, weird dimensions, transformations that in a next version are
--- fixed, etc.). Better is then to wait till something gets fixed. If a spec doesn't
--- tell me how to deal with it ... I'll happily wait till it does. After all we're
--- not in a hurry as these fonts are mostly meant for the web or special purposes
--- with manual tweaking in desk top publishing applications. Keep in mind that Emoji
--- can have funny dimensions (e.g. to be consistent within a font, so no tight ones).
-
--- When we have moved to lmtx I will document a bit more. Till then it's experimental
--- and subjected to change.
-
-local next, type, unpack, rawget = next, type, unpack, rawget
-local char, byte, gsub, sub, match, rep, gmatch = string.char, string.byte, string.gsub, string.sub, string.match, string.rep, string.gmatch
-local formatters = string.formatters
-local format = string.format
-local concat, sortedhash, sort = table.concat, table.sortedhash, table.sort
-local utfchar = utf.char
-local random, round, max, abs, ceiling = math.random, math.round, math.max, math.abs, math.ceiling
-local extract, lshift, rshift, band, bor = bit32.extract, bit32.lshift, bit32.rshift, bit32.band, bit32.bor
-local idiv = number.idiv
-local setmetatableindex = table.setmetatableindex
-
-local pdfnull = lpdf.null
-local pdfdictionary = lpdf.dictionary
-local pdfarray = lpdf.array
-local pdfconstant = lpdf.constant
-local pdfstring = lpdf.string
-local pdfreference = lpdf.reference
-local pdfreserveobject = lpdf.reserveobject
-local pdfflushobject = lpdf.flushobject
-local pdfflushstreamobject = lpdf.flushstreamobject
-
-local report_fonts = logs.reporter("backend","fonts")
-
-local trace_fonts = false
-local trace_details = false
-
-local dimenfactors = number.dimenfactors
-local bpfactor = dimenfactors.bp
-local ptfactor = dimenfactors.pt
-
-trackers.register("backend.pdf.fonts",function(v) trace_fonts = v end)
-
-local readers = fonts.handlers.otf.readers
-local getinfo = readers.getinfo
-
-local setposition = utilities.files.setposition
-local readstring = utilities.files.readstring
-local openfile = utilities.files.open
-local closefile = utilities.files.close
-
-
--- needs checking: signed vs unsigned
-
-local tocardinal1 = char
-
-local function tocardinal2(n)
- return char(extract(n,8,8),extract(n,0,8))
-end
-
-local function tocardinal3(n)
- return char(extract(n,16,8),extract(n,8,8),extract(n,0,8))
-end
-
-local function tocardinal4(n)
- return char(extract(n,24,8),extract(n,16,8),extract(n,8,8),extract(n,0,8))
-end
-
-local function tointeger2(n)
- return char(extract(n,8,8),extract(n,0,8))
-end
-
-local function tointeger3(n)
- return char(extract(n,16,8),extract(n,8,8),extract(n,0,8))
-end
-
-local function tointeger4(n)
- return char(extract(n,24,8),extract(n,16,8),extract(n,8,8),extract(n,0,8))
-end
-
-local function tocardinal8(n)
- local l = idiv(n,0x100000000)
- local r = n % 0x100000000
- return char(extract(l,24,8),extract(l,16,8),extract(l,8,8),extract(l,0,8),
- extract(r,24,8),extract(r,16,8),extract(r,8,8),extract(r,0,8))
-end
-
--- A couple of shared helpers.
-
-local tounicodedictionary, widtharray, collectindices, subsetname, includecidset, forcecidset, tocidsetdictionary
-
-do
-
- -- Because we supply tounicodes ourselves we only use bfchar mappings (as in the
- -- backend). In fact, we can now no longer pass the tounicodes to the frontend but
- -- pick them up from the descriptions.
-
- local f_mapping_2 = formatters["<%02X> <%s>"]
- local f_mapping_4 = formatters["<%04X> <%s>"]
-
- local tounicode = fonts.mappings.tounicode
-
-local tounicode_template = [[
-%%!PS-Adobe-3.0 Resource-CMap
-%%%%DocumentNeededResources: ProcSet (CIDInit)
-%%%%IncludeResource: ProcSet (CIDInit)
-%%%%BeginResource: CMap (TeX-%s-0)
-%%%%Title: (TeX-%s-0 TeX %s 0)|
-%%%%Version: 1.000
-%%%%EndComments
-/CIDInit /ProcSet findresource begin
- 12 dict begin
- begincmap
- /CIDSystemInfo
- << /Registry (TeX) /Ordering (%s) /Supplement 0 >>
- def
- /CMapName
- /TeX-Identity-%s
- def
- /CMapType
- 2
- def
- 1 begincodespacerange
- <%s> <%s>
- endcodespacerange
- %i beginbfchar
-%s
- endbfchar
- endcmap
- CMapName currentdict /CMap defineresource pop
- end
-end
-%%%%EndResource
-%%%%EOF]]
-
- tounicodedictionary = function(details,indices,maxindex,name,wide)
- local mapping = { }
- local length = 0
- if maxindex > 0 then
- local f_mapping = wide and f_mapping_4 or f_mapping_2
- for index=1,maxindex do
- local data = indices[index]
- if data then
- length = length + 1
- local unicode = data.unicode
- if unicode then
- unicode = tounicode(unicode)
- else
- unicode = "FFFD"
- end
- mapping[length] = f_mapping(index,unicode)
- end
- end
- end
- local name = gsub(name,"%+","-") -- like luatex does
- local first = wide and "0000" or "00"
- local last = wide and "FFFF" or "FF"
- local blob = format(tounicode_template,name,name,name,name,name,first,last,length,concat(mapping,"\n"))
- return blob
- end
-
- widtharray = function(details,indices,maxindex,units)
- local widths = pdfarray()
- local length = 0
- local factor = 10000 / units
- if maxindex > 0 then
- local lastindex = -1
- local sublist = nil
- for index=1,maxindex do
- local data = indices[index]
- if data then
- local width = data.width -- hm, is inaccurate for cff, so take from elsewhere
- if width then
- -- width = round(width * 10000 / units) / 10
- width = round(width * factor) / 10
- else
- width = 0
- end
- if index == lastindex + 1 then
- sublist[#sublist+1] = width
- else
- if sublist then
- length = length + 1
- widths[length] = sublist
- end
- sublist = pdfarray { width }
- length = length + 1
- widths[length] = index
- end
- lastindex = index
- end
- end
- length = length + 1
- widths[length] = sublist
- end
- return widths
- end
-
- collectindices = function(descriptions,indices)
- local minindex = 0xFFFF
- local maxindex = 0
- local reverse = { }
- -- todo: already at definition time trigger copying streams
- -- and add extra indices ... first i need a good example of
- -- a clash
- -- for unicode, data in next, descriptions do
- -- local i = data.index or unicode
- -- if reverse[i] then
- -- print("CLASH")
- -- else
- -- reverse[i] = data
- -- end
- -- end
- for unicode, data in next, descriptions do
- reverse[data.index or unicode] = data
- end
- for index in next, indices do
- if index > maxindex then
- maxindex = index
- end
- if index < minindex then
- minindex = index
- end
- indices[index] = reverse[index]
- end
- if minindex > maxindex then
- minindex = maxindex
- end
- return indices, minindex, maxindex
- end
-
- includecidset = false
- forcecidset = false -- for private testing only
-
- directives.register("backend.pdf.forcecidset",function(v)
- forcecidset = v
- end)
-
- tocidsetdictionary = function(indices,min,max)
- if includecidset or forcecidset then
- local b = { }
- local m = idiv(max+7,8)
- for i=0,max do
- b[i] = 0
- end
- b[0] = bor(b[0],lshift(1,7)) -- force notdef into the file
- for i=min,max do
- if indices[i] then
- local bi = idiv(i,8)
- local ni = i % 8
- b[bi] = bor(b[bi],lshift(1,7-ni))
- end
- end
- b = char(unpack(b,0,#b))
- return pdfreference(pdfflushstreamobject(b))
- end
- end
-
- -- Actually we can use the same as we only embed once.
-
- -- subsetname = function(name)
- -- return "CONTEXT" .. name
- -- end
-
- local prefixes = { } -- todo: set fixed one
-
- subsetname = function(name)
- local prefix
- while true do
- prefix = utfchar(random(65,90),random(65,90),random(65,90),random(65,90),random(65,90),random(65,90))
- if not prefixes[prefix] then
- prefixes[prefix] = true
- break
- end
- end
- return prefix .. "+" .. name
- end
-
-end
-
--- Map file mess.
-
-local loadmapfile, loadmapline, getmapentry do
-
- -- We only need to pick up the filename and optionally the enc file
- -- as we only use them for old school virtual math fonts. We might as
- -- we drop this completely.
-
- local find, match, splitlines = string.find, string.match, string.splitlines
-
-
- local mappings = { }
-
- loadmapline = function(n)
- if trace_fonts then
- report_fonts("mapline: %s",n)
- end
- local name, fullname, encfile, pfbfile = match(n,"(%S+)%s+(%S+).-<(.-%.enc).-<(.-%.pfb)")
- if name then
- mappings[name] = { fullname, encfile, pfbfile }
- end
- end
-
- loadmapfile = function(n)
- local okay, data = resolvers.loadbinfile(n,"map")
- if okay and data then
- data = splitlines(data)
- for i=1,#data do
- local d = data[i]
- if d ~= "" and not find(d,"^[#%%]") then
- loadmapline(d)
- end
- end
- end
- end
-
- getmapentry = function(n)
- local n = file.nameonly(n)
- local m = mappings[n]
- if m then
- local encfile = m[2]
- local encoding = fonts.encodings.load(encfile)
- if not encoding then
- return
- end
- local pfbfile = resolvers.findfile(m[3],"pfb")
- if not pfbfile or pfbfile == "" then
- return
- end
- return encoding, pfbfile, encfile
- end
- end
-
- lpdf.getmapentry = getmapentry
-
-end
-
--- The three writers: opentype, truetype and type1.
-
-local mainwriters = { }
-
-do
-
- -- advh = os2.ascender - os2.descender
- -- tsb = default_advh - os2.ascender
-
- -- truetype has the following tables:
-
- -- head : mandate
- -- hhea : mandate
- -- vhea : mandate
- -- hmtx : mandate
- -- maxp : mandate
- -- glyf : mandate
- -- loca : mandate
- --
- -- cvt : if needed (but we flatten)
- -- fpgm : if needed (but we flatten)
- -- prep : if needed (but we flatten)
- -- PCLT : if needed (but we flatten)
- --
- -- name : not needed for T2: backend does that
- -- post : not needed for T2: backend does that
- -- OS/2 : not needed for T2: backend does that
- -- cmap : not needed for T2: backend does that
-
- local streams = utilities.streams
- local openstring = streams.openstring
- local readcardinal2 = streams.readcardinal2
- ----- readcardinal4 = streams.readcardinal4
-
- local otfreaders = fonts.handlers.otf.readers
-
- local function readcardinal4(f) -- this needs to be sorted out
- local a = readcardinal2(f)
- local b = readcardinal2(f)
- if a and b then
- return a * 0x10000 + b
- end
- end
-
- -- -- --
-
- local tablereaders = { }
- local tablewriters = { }
- local tablecreators = { }
- local tableloaders = { }
-
- local openfontfile, closefontfile, makefontfile, makemetadata do
-
- local details = {
- details = true,
- platformnames = true,
- platformextras = true,
- }
-
- -- .022 sec on luatex manual, neglectable:
-
- -- local function checksum(data)
- -- local s = openstring(data)
- -- local n = 0
- -- local d = #data
- -- while true do
- -- local c = readcardinal4(s)
- -- if c then
- -- n = (n + c) % 0x100000000
- -- else
- -- break
- -- end
- -- end
- -- return n
- -- end
-
- local function checksum(data)
- local s = openstring(data)
- local n = 0
- local d = #data
- while true do
- local a = readcardinal2(s)
- local b = readcardinal2(s)
- if b then
- n = (n + a * 0x10000 + b) % 0x100000000
- else
- break
- end
- end
- return n
- end
-
- openfontfile = function(details)
- return {
- offset = 0,
- order = { },
- used = { },
- details = details,
- streams = details.streams,
- }
- end
-
- closefontfile = function(fontfile)
- for k, v in next, fontfile do
- fontfile[k] = nil -- so it can be collected asap
- end
- end
-
- local metakeys = {
- "uniqueid", "version",
- "copyright", "license", "licenseurl",
- "manufacturer", "vendorurl",
- "family", "subfamily",
- "typographicfamily", "typographicsubfamily",
- "fullname", "postscriptname",
- }
-
- local template = [[
-<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
- <x:xmpmeta xmlns:x="adobe:ns:meta/">
- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
- <rdf:Description rdf:about="" xmlns:pdfx="http://ns.adobe.com/pdfx/1.3/">
-
-%s
-
- </rdf:Description>
- </rdf:RDF>
- </x:xmpmeta>
-<?xpacket end="w"?>]]
-
- makemetadata = function(fontfile)
- local names = fontfile.streams.names
- local list = { }
- local f_name = formatters["<pdfx:%s>%s</pdfx:%s>"]
- for i=1,#metakeys do
- local m = metakeys[i]
- local n = names[m]
- if n then
- list[#list+1] = f_name(m,n,m)
- end
- end
- return format(template,concat(list,"\n"))
- end
-
- makefontfile = function(fontfile)
- local order = fontfile.order
- local used = fontfile.used
- local count = 0
- for i=1,#order do
- local tag = order[i]
- local data = fontfile[tag]
- if data and #data > 0 then
- count = count + 1
- else
- fontfile[tag] = false
- end
- end
- local offset = 12 + (count * 16)
- local headof = 0
- local list = {
- "" -- placeholder
- }
- local i = 1
- local k = 0
- while i <= count do
- i = lshift(i,1)
- k = k + 1
- end
- local searchrange = lshift(i,3)
- local entryselector = k - 1
- local rangeshift = lshift(count,4) - lshift(i,3)
- local index = {
- tocardinal4(0x00010000), -- tables.version
- tocardinal2(count),
- tocardinal2(searchrange),
- tocardinal2(entryselector),
- tocardinal2(rangeshift),
- }
- --
- local ni = #index
- local nl = #list
- for i=1,#order do
- local tag = order[i]
- local data = fontfile[tag]
- if data then
- local csum = checksum(data)
- local dlength = #data
- local length = idiv(dlength+3,4) * 4
- local padding = length - dlength
- nl = nl + 1 ; list[nl] = data
- for i=1,padding do
- nl = nl + 1 ; list[nl] = "\0"
- end
- if #tag == 3 then
- tag = tag .. " "
- end
- ni = ni + 1 ; index[ni] = tag -- must be 4 chars
- ni = ni + 1 ; index[ni] = tocardinal4(csum)
- ni = ni + 1 ; index[ni] = tocardinal4(offset)
- ni = ni + 1 ; index[ni] = tocardinal4(dlength)
- used[i] = offset -- not used
- if tag == "head" then
- headof = offset
- end
- offset = offset + length
- end
- end
- list[1] = concat(index)
- local off = #list[1] + headof + 1 + 8
- list = concat(list)
- local csum = (0xB1B0AFBA - checksum(list)) % 0x100000000
- list = sub(list,1,off-1) .. tocardinal4(csum) .. sub(list,off+4,#list)
- return list
- end
-
- local function register(fontfile,name)
- local u = fontfile.used
- local o = fontfile.order
- if not u[name] then
- o[#o+1] = name
- u[name] = true
- end
- end
-
- local function create(fontfile,name)
- local t = { }
- fontfile[name] = t
- return t
- end
-
- local function write(fontfile,name)
- local t = fontfile[name]
- if not t then
- return
- end
- register(fontfile,name)
- if type(t) == "table" then
- if t[0] then
- fontfile[name] = concat(t,"",0,#t)
- elseif #t > 0 then
- fontfile[name] = concat(t)
- else
- fontfile[name] = false
- end
- end
- end
-
- tablewriters.head = function(fontfile)
- register(fontfile,"head")
- local t = fontfile.streams.fontheader
- fontfile.head = concat {
- tocardinal4(t.version),
- tocardinal4(t.fontversionnumber),
- tocardinal4(t.checksum),
- tocardinal4(t.magic),
- tocardinal2(t.flags),
- tocardinal2(t.units),
- tocardinal8(t.created),
- tocardinal8(t.modified),
- tocardinal2(t.xmin),
- tocardinal2(t.ymin),
- tocardinal2(t.xmax),
- tocardinal2(t.ymax),
- tocardinal2(t.macstyle),
- tocardinal2(t.smallpixels),
- tocardinal2(t.directionhint),
- tocardinal2(t.indextolocformat),
- tocardinal2(t.glyphformat),
- }
- end
-
- tablewriters.hhea = function(fontfile)
- register(fontfile,"hhea")
- local t = fontfile.streams.horizontalheader
- local n = t and fontfile.nofglyphs or 0
- fontfile.hhea = concat {
- tocardinal4(t.version),
- tocardinal2(t.ascender),
- tocardinal2(t.descender),
- tocardinal2(t.linegap),
- tocardinal2(t.maxadvancewidth),
- tocardinal2(t.minleftsidebearing),
- tocardinal2(t.minrightsidebearing),
- tocardinal2(t.maxextent),
- tocardinal2(t.caretsloperise),
- tocardinal2(t.caretsloperun),
- tocardinal2(t.caretoffset),
- tocardinal2(t.reserved_1),
- tocardinal2(t.reserved_2),
- tocardinal2(t.reserved_3),
- tocardinal2(t.reserved_4),
- tocardinal2(t.metricdataformat),
- tocardinal2(n) -- t.nofmetrics
- }
- end
-
- tablewriters.vhea = function(fontfile)
- local t = fontfile.streams.verticalheader
- local n = t and fontfile.nofglyphs or 0
- register(fontfile,"vhea")
- fontfile.vhea = concat {
- tocardinal4(t.version),
- tocardinal2(t.ascender),
- tocardinal2(t.descender),
- tocardinal2(t.linegap),
- tocardinal2(t.maxadvanceheight),
- tocardinal2(t.mintopsidebearing),
- tocardinal2(t.minbottomsidebearing),
- tocardinal2(t.maxextent),
- tocardinal2(t.caretsloperise),
- tocardinal2(t.caretsloperun),
- tocardinal2(t.caretoffset),
- tocardinal2(t.reserved_1),
- tocardinal2(t.reserved_2),
- tocardinal2(t.reserved_3),
- tocardinal2(t.reserved_4),
- tocardinal2(t.metricdataformat),
- tocardinal2(n) -- t.nofmetrics
- }
- end
-
- tablewriters.maxp = function(fontfile)
- register(fontfile,"maxp")
- local t = fontfile.streams.maximumprofile
- local n = fontfile.nofglyphs
- -- if fontfile.streams.cffinfo then
- -- error
- -- end
- fontfile.maxp = concat {
- tocardinal4(0x00010000),
- tocardinal2(n),
- tocardinal2(t.points),
- tocardinal2(t.contours),
- tocardinal2(t.compositepoints),
- tocardinal2(t.compositecontours),
- tocardinal2(t.zones),
- tocardinal2(t.twilightpoints),
- tocardinal2(t.storage),
- tocardinal2(t.functiondefs),
- tocardinal2(t.instructiondefs),
- tocardinal2(t.stackelements),
- tocardinal2(t.sizeofinstructions),
- tocardinal2(t.componentelements),
- tocardinal2(t.componentdepth),
- }
- end
-
- tablecreators.loca = function(fontfile) return create(fontfile,"loca") end
- tablewriters .loca = function(fontfile) return write (fontfile,"loca") end
-
- tablecreators.glyf = function(fontfile) return create(fontfile,"glyf") end
- tablewriters .glyf = function(fontfile) return write (fontfile,"glyf") end
-
- tablecreators.hmtx = function(fontfile) return create(fontfile,"hmtx") end
- tablewriters .hmtx = function(fontfile) return write (fontfile,"hmtx") end
-
- tablecreators.vmtx = function(fontfile) return create(fontfile,"vmtx") end
- tablewriters .vmtx = function(fontfile) return write (fontfile,"vmtx") end
-
- tableloaders .cmap = function(fontfile) return read (fontfile,"cmap") end
- tablewriters .cmap = function(fontfile) return write (fontfile,"cmap") end
-
- tableloaders .name = function(fontfile) return read (fontfile,"name") end
- tablewriters .name = function(fontfile) return write (fontfile,"name") end
-
- tableloaders .post = function(fontfile) return read (fontfile,"post") end
- tablewriters .post = function(fontfile) return write (fontfile,"post") end
-
- end
-
- mainwriters["truetype"] = function(details)
- --
- local fontfile = openfontfile(details)
- local basefontname = details.basefontname
- local streams = details.streams
- local blobs = streams.streams
- local fontheader = streams.fontheader
- local horizontalheader = streams.horizontalheader
- local verticalheader = streams.verticalheader
- local maximumprofile = streams.maximumprofile
- local names = streams.names
- local descriptions = details.rawdata.descriptions
- local metadata = details.rawdata.metadata
- local indices = details.indices
- local metabbox = { fontheader.xmin, fontheader.ymin, fontheader.xmax, fontheader.ymax }
- local indices,
- minindex,
- maxindex = collectindices(descriptions,indices)
- local glyphstreams = tablecreators.glyf(fontfile)
- local locations = tablecreators.loca(fontfile)
- local horizontals = tablecreators.hmtx(fontfile)
- local verticals = tablecreators.vmtx(fontfile)
- --
- local zero2 = tocardinal2(0)
- local zero4 = tocardinal4(0)
- --
- local horizontal = horizontalheader.nofmetrics > 0
- local vertical = verticalheader.nofmetrics > 0
- --
- local streamoffset = 0
- local lastoffset = zero4
- local g, h, v = 0, 0, 0
- --
- -- todo: locate notdef
- --
- if minindex > 0 then
- local blob = blobs[0]
- if blob and #blob > 0 then
- locations[0] = lastoffset
- g = g + 1 ; glyphstreams[g] = blob
- h = h + 1 ; horizontals [h] = zero4
- if vertical then
- v = v + 1 ; verticals[v] = zero4
- end
- streamoffset = streamoffset + #blob
- lastoffset = tocardinal4(streamoffset)
- else
- report_fonts("missing .notdef in font %a",basefontname)
- end
- -- todo: use a rep for h/v
- for index=1,minindex-1 do
- locations[index] = lastoffset
- h = h + 1 ; horizontals[h] = zero4
- if vertical then
- v = v + 1 ; verticals[v] = zero4
- end
- end
- end
- for index=minindex,maxindex do
- locations[index] = lastoffset
- local data = indices[index]
- if data then
- local blob = blobs[index] -- we assume padding
- if blob and #blob > 0 then
- g = g + 1 ; glyphstreams[g] = blob
- h = h + 1 ; horizontals [h] = tocardinal2(data.width or 0)
- h = h + 1 ; horizontals [h] = tocardinal2(data.boundingbox[1])
- if vertical then
- v = v + 1 ; verticals[v] = tocardinal2(data.height or 0)
- v = v + 1 ; verticals[v] = tocardinal2(data.boundingbox[3])
- end
- streamoffset = streamoffset + #blob
- lastoffset = tocardinal4(streamoffset)
- else
- h = h + 1 ; horizontals[h] = zero4
- if vertical then
- v = v + 1 ; verticals[v] = zero4
- end
- report_fonts("missing blob for index %i in font %a",index,basefontname)
- end
- else
- h = h + 1 ; horizontals[h] = zero4
- if vertical then
- v = v + 1 ; verticals[v] = zero4
- end
- end
- end
- locations[maxindex+1] = lastoffset -- cf spec
- --
- local nofglyphs = maxindex + 1 -- include zero
- --
- fontheader.checksum = 0
- fontheader.indextolocformat = 1
- maximumprofile.nofglyphs = nofglyphs
- --
- fontfile.format = "tff"
- fontfile.basefontname = basefontname
- fontfile.nofglyphs = nofglyphs
- --
- tablewriters.head(fontfile)
- tablewriters.hhea(fontfile)
- if vertical then
- tablewriters.vhea(fontfile)
- end
- tablewriters.maxp(fontfile)
-
- tablewriters.loca(fontfile)
- tablewriters.glyf(fontfile)
-
- tablewriters.hmtx(fontfile)
- if vertical then
- tablewriters.vmtx(fontfile)
- end
- --
- local fontdata = makefontfile(fontfile)
- local fontmeta = makemetadata(fontfile)
- --
- fontfile = closefontfile(fontfile)
- --
- local units = metadata.units
- local basefont = pdfconstant(basefontname)
- local widths = widtharray(details,indices,maxindex,units)
- local object = details.objectnumber
- local tounicode = tounicodedictionary(details,indices,maxindex,basefontname,true)
- local tocidset = tocidsetdictionary(indices,minindex,maxindex)
- local metabbox = metadata.boundingbox or { 0, 0, 0, 0 }
- local fontbbox = pdfarray { unpack(metabbox) }
- local ascender = metadata.ascender
- local descender = metadata.descender
- local capheight = metadata.capheight or fontbbox[4]
- local stemv = metadata.weightclass
- local italicangle = metadata.italicangle
- local xheight = metadata.xheight or fontbbox[4]
- --
- if stemv then
- stemv = (stemv/65)^2 + 50
- end
- --
- local function scale(n)
- if n then
- return round((n) * 10000 / units) / 10
- else
- return 0
- end
- end
- --
- local reserved = pdfreserveobject()
- local child = pdfdictionary {
- Type = pdfconstant("Font"),
- Subtype = pdfconstant("CIDFontType2"),
- BaseFont = basefont,
- FontDescriptor = pdfreference(reserved),
- W = pdfreference(pdfflushobject(widths)),
- CIDToGIDMap = pdfconstant("Identity"),
- CIDSystemInfo = pdfdictionary {
- Registry = pdfstring("Adobe"),
- Ordering = pdfstring("Identity"),
- Supplement = 0,
- }
- }
- local descendants = pdfarray {
- pdfreference(pdfflushobject(child)),
- }
- local descriptor = pdfdictionary {
- Type = pdfconstant("FontDescriptor"),
- FontName = basefont,
- Flags = 4,
- FontBBox = fontbbox,
- Ascent = scale(ascender),
- Descent = scale(descender),
- ItalicAngle = round(italicangle or 0),
- CapHeight = scale(capheight),
- StemV = scale(stemv),
- XHeight = scale(xheight),
- FontFile2 = pdfreference(pdfflushstreamobject(fontdata)),
- CIDSet = tocidset,
- Metadata = fontmeta and pdfreference(pdfflushstreamobject(fontmeta)) or nil,
- }
- local parent = pdfdictionary {
- Type = pdfconstant("Font"),
- Subtype = pdfconstant("Type0"),
- Encoding = pdfconstant(details.properties.writingmode == "vertical" and "Identity-V" or "Identity-H"),
- BaseFont = basefont,
- DescendantFonts = descendants,
- ToUnicode = pdfreference(pdfflushstreamobject(tounicode)),
- }
- pdfflushobject(reserved,descriptor)
- pdfflushobject(object,parent)
- --
- -- if trace_details then
- -- local name = "temp.ttf"
- -- report_fonts("saving %a",name)
- -- io.savedata(name,fontdata)
- -- inspect(fonts.handlers.otf.readers.loadfont(name))
- -- end
- --
- end
-
- do
- -- todo : cff2
-
- local details = {
- details = true,
- platformnames = true,
- platformextras = true,
- }
-
- tablecreators.cff = function(fontfile)
- fontfile.charstrings = { }
- fontfile.charmappings = { }
- fontfile.cffstrings = { }
- fontfile.cffhash = { }
- return fontfile.charstrings , fontfile.charmappings
- end
-
- local todictnumber, todictreal, todictinteger, todictoffset do
-
- local maxnum = 0x7FFFFFFF
- local minnum = - 0x7FFFFFFF - 1
- local epsilon = 1.0e-5
-
- local int2tag = "\28"
- local int4tag = "\29"
- local realtag = "\30"
-
- todictinteger = function(n)
- if not n then
- return char(band(139,0xFF))
- elseif n >= -107 and n <= 107 then
- return char(band(n + 139,0xFF))
- elseif n >= 108 and n <= 1131 then
- n = 0xF700 + n - 108
- return char(band(rshift(n,8),0xFF),band(n,0xFF))
- elseif n >= -1131 and n <= -108 then
- n = 0xFB00 - n - 108
- return char(band(rshift(n,8),0xFF),band(n,0xFF))
- elseif n >= -32768 and n <= 32767 then
- -- return int2tag .. tointeger2(n)
- return char(28,extract(n,8,8),extract(n,0,8))
- else
- -- return int4tag .. tointeger4(n)
- return char(29,extract(n,24,8),extract(n,16,8),extract(n,8,8),extract(n,0,8))
- end
- end
-
- -- -- not called that often
- --
- -- local encoder = readers.cffencoder
- --
- -- todictinteger = function(n)
- -- if not n then
- -- return encoder[0]
- -- elseif n >= -1131 and n <= 1131 then
- -- return encoder[n]
- -- elseif n >= -32768 and n <= 32767 then
- -- -- return int2tag .. tointeger2(n)
- -- return char(28,extract(n,8,8),extract(n,0,8))
- -- else
- -- -- return int4tag .. tointeger4(n)
- -- return char(29,extract(n,24,8),extract(n,16,8),extract(n,8,8),extract(n,0,8))
- -- end
- -- end
-
- todictoffset = function(n)
- return int4tag .. tointeger4(n)
- end
-
- local e = false
- local z = byte("0")
- local dp = 10
- local ep = 11
- local em = 12
- local mn = 14
- local es = 15
-
- local fg = formatters["%g"]
-
- todictreal = function(v)
- local s = fg(v)
- local t = { [0] = realtag }
- local n = 0
- for s in gmatch(s,".") do
- if s == "e" or s == "E" then
- e = true
- elseif s == "+" then
- -- skip
- elseif s == "-" then
- n = n + 1
- if e then
- t[n] = em
- e = false
- else
- t[n] = mn
- end
- else
- if e then
- n = n + 1
- t[n] = ep
- e = false
- end
- n = n + 1
- if s == "." then
- t[n] = dp
- else
- t[n] = byte(s) - z
- end
- end
- end
- n = n + 1
- t[n] = es
- if (n % 2) ~= 0 then
- n = n + 1
- t[n] = es
- end
- local j = 0
- for i=1,n,2 do
- j = j + 1
- t[j] = char(t[i]*0x10+t[i+1])
- end
- t = concat(t,"",0,j)
- return t
- end
-
- todictnumber = function(n)
- if not n or n == 0 then
- return todictinteger(0)
- elseif (n > maxnum or n < minnum or (abs(n - round(n)) > epsilon)) then
- return todictreal(n)
- else
- return todictinteger(n)
- end
- end
-
- end
-
- local todictkey = char
-
- local function todictstring(fontfile,value)
- if not value then
- value = ""
- end
- local s = fontfile.cffstrings
- local h = fontfile.cffhash
- local n = h[value]
- if not n then
- n = #s + 1
- s[n] = value
- h[value] = n
- end
- return todictinteger(390+n)
- end
-
- local function todictboolean(b)
- return todictinteger(b and 1 or 0)
- end
-
- local function todictdeltas(t)
- local r = { }
- for i=1,#t do
- r[i] = todictnumber(t[i]-(t[i-1] or 0))
- end
- return concat(r)
- end
-
- local function todictarray(t)
- local r = { }
- for i=1,#t do
- r[i] = todictnumber(t[i])
- end
- return concat(r)
- end
-
- local function writestring(target,source,offset,what)
- target[#target+1] = source
- -- report_fonts("string : %-11s %06i # %05i",what,offset,#source)
- return offset + #source
- end
-
- local function writetable(target,source,offset,what)
- source = concat(source)
- target[#target+1] = source
- -- report_fonts("table : %-11s %06i # %05i",what,offset,#source)
- return offset + #source
- end
-
- local function writeindex(target,source,offset,what)
- local n = #source
- local t = #target
- t = t + 1 ; target[t] = tocardinal2(n)
- if n > 0 then
- local data = concat(source)
- local size = #data -- assume the worst
- local offsetsize, tocardinal
- if size < 0xFF then
- offsetsize, tocardinal = 1, tocardinal1
- elseif size < 0xFFFF then
- offsetsize, tocardinal = 2, tocardinal2
- elseif size < 0xFFFFFF then
- offsetsize, tocardinal = 3, tocardinal3
- elseif size < 0xFFFFFFFF then
- offsetsize, tocardinal = 4, tocardinal4
- end
- -- report_fonts("index : %-11s %06i # %05i (%i entries with offset size %i)",what,offset,#data,n,offsetsize)
- offset = offset + 2 + 1 + (n + 1) * offsetsize + size
- -- bytes per offset
- t = t + 1 ; target[t] = tocardinal1(offsetsize)
- -- list of offsets (one larger for length calculation)
- local offset = 1 -- mandate
- t = t + 1 ; target[t] = tocardinal(offset)
- for i=1,n do
- offset = offset + #source[i]
- t = t + 1 ; target[t] = tocardinal(offset)
- end
- t = t + 1 ; target[t] = data
- else
- -- report_fonts("index : %-11s %06i # %05i (no entries)",what,offset,0)
- offset = offset + 2
- end
- -- print("offset",offset,#concat(target))
- return offset
- end
-
- tablewriters.cff = function(fontfile)
- --
- local streams = fontfile.streams
- local cffinfo = streams.cffinfo or { }
- local names = streams.names or { }
- local fontheader = streams.fontheader or { }
- local basefontname = fontfile.basefontname
- --
- local offset = 0
- local dictof = 0
- local target = { }
- --
- local charstrings = fontfile.charstrings
- local nofglyphs = #charstrings + 1
- local fontmatrix = { 0.001, 0, 0, 0.001, 0, 0 } -- todo
- local fontbbox = fontfile.fontbbox
- local defaultwidth = cffinfo.defaultwidth or 0
- local nominalwidth = cffinfo.nominalwidth or 0
- local bluevalues = cffinfo.bluevalues
- local otherblues = cffinfo.otherblues
- local familyblues = cffinfo.familyblues
- local familyotherblues = cffinfo.familyotherblues
- local bluescale = cffinfo.bluescale
- local blueshift = cffinfo.blueshift
- local bluefuzz = cffinfo.bluefuzz
- local stdhw = cffinfo.stdhw
- local stdvw = cffinfo.stdvw
- --
- if defaultwidth == 0 then defaultwidth = nil end
- if nomimalwidth == 0 then nominalwidth = nil end
- if bluevalues then bluevalues = todictarray(bluevalues) end
- if otherblues then otherblues = todictarray(otherblues) end
- if familyblues then familyblues = todictarray(familyblues) end
- if familyotherblues then familyotherblues = todictarray(familyotherblues) end
- if bluescale then bluescale = todictnumber(bluescale) end
- if blueshift then blueshift = todictnumber(blueshift) end
- if bluefuzz then bluefuzz = todictnumber(bluefuzz) end
- if stdhw then stdhw = todictdeltas(stdhw) end
- if stdvw then stdvw = todictdeltas(stdvw) end
- --
- local fontversion = todictstring(fontfile,fontheader.fontversion or "uknown version")
- local familyname = todictstring(fontfile,cffinfo.familyname or names.family or basefontname)
- local fullname = todictstring(fontfile,cffinfo.fullname or basefontname)
- local weight = todictstring(fontfile,cffinfo.weight or "Normal")
- local fontbbox = todictarray(fontbbox)
- local strokewidth = todictnumber(cffinfo.strokewidth)
- local monospaced = todictboolean(cffinfo.monospaced)
- local italicangle = todictnumber(cffinfo.italicangle)
- local underlineposition = todictnumber(cffinfo.underlineposition)
- local underlinethickness = todictnumber(cffinfo.underlinethickness)
- local charstringtype = todictnumber(2)
- local fontmatrix = todictarray(fontmatrix)
- local ros = todictstring(fontfile,"Adobe") -- registry
- .. todictstring(fontfile,"Identity") -- identity
- .. todictnumber(0) -- supplement
- local cidcount = todictnumber(fontfile.nofglyphs)
- local fontname = todictstring(fontfile,basefontname)
- local fdarrayoffset = todictoffset(0)
- local fdselectoffset = todictoffset(0)
- local charstringoffset = todictoffset(0)
- local charsetoffset = todictoffset(0)
- local privateoffset = todictoffset(0)
- --
- local defaultwidthx = todictnumber(defaultwidth)
- local nominalwidthx = todictnumber(nominalwidth)
- local private = ""
- .. (defaultwidthx and (defaultwidthx .. todictkey(20)) or "")
- .. (nominalwidthx and (nominalwidthx .. todictkey(21)) or "")
- .. (bluevalues and (bluevalues .. todictkey(6)) or "")
- .. (otherblues and (otherblues .. todictkey(7)) or "")
- .. (familyblues and (familyblues .. todictkey(8)) or "")
- .. (familyotherblues and (familyotherblues .. todictkey(9)) or "")
- .. (bluescale and (bluescale .. todictkey(12,9)) or "")
- .. (blueshift and (blueshift .. todictkey(12,10)) or "")
- .. (bluefuzz and (bluefuzz .. todictkey(12,11)) or "")
- .. (stdhw and (stdhw .. todictkey(12,12)) or "")
- .. (stdvw and (stdvw .. todictkey(12,13)) or "")
- local privatesize = todictnumber(#private)
- local privatespec = privatesize .. privateoffset
- --
- -- header (fixed @ 1)
- --
- local header =
- tocardinal1(1) -- major
- .. tocardinal1(0) -- minor
- .. tocardinal1(4) -- header size
- .. tocardinal1(4) -- offset size
- --
- offset = writestring(target,header,offset,"header")
- --
- -- name index (fixed @ 2) (has to be sorted)
- --
- local names = {
- basefontname,
- }
- --
- offset = writeindex(target,names,offset,"names")
- --
- -- topdict index (fixed @ 3)
- --
- local topvars =
- charstringoffset .. todictkey(17)
- .. charsetoffset .. todictkey(15)
- .. fdarrayoffset .. todictkey(12,36)
- .. fdselectoffset .. todictkey(12,37)
- .. privatespec .. todictkey(18)
- --
- local topdict = {
- ros .. todictkey(12,30) -- first
- .. cidcount .. todictkey(12,34)
- .. familyname .. todictkey( 3)
- .. fullname .. todictkey( 2)
- .. weight .. todictkey( 4)
- .. fontbbox .. todictkey( 5)
- .. monospaced .. todictkey(12, 1)
- .. italicangle .. todictkey(12, 2)
- .. underlineposition .. todictkey(12, 3)
- .. underlinethickness .. todictkey(12, 4)
- .. charstringtype .. todictkey(12, 6)
- .. fontmatrix .. todictkey(12, 7)
- .. strokewidth .. todictkey(12, 8)
- .. topvars
- }
- --
- offset = writeindex(target,topdict,offset,"topdict")
- dictof = #target
- --
- -- string index (fixed @ 4)
- --
- offset = writeindex(target,fontfile.cffstrings,offset,"strings")
- --
- -- global subroutine index (fixed @ 5)
- --
- offset = writeindex(target,{},offset,"globals")
- --
- -- Encoding (cff1)
- --
- -- offset = writeindex(target,{},offset,"encoding")
- --
- -- Charsets
- --
- charsetoffset = todictoffset(offset)
- offset = writetable(target,fontfile.charmappings,offset,"charsets")
- --
- -- fdselect
- --
- local fdselect =
- tocardinal1(3) -- format
- .. tocardinal2(1) -- n of ranges
- -- entry 1
- .. tocardinal2(0) -- first gid
- .. tocardinal1(0) -- fd index
- -- entry 2
--- .. tocardinal2(fontfile.sparsemax-1) -- sentinel
- .. tocardinal2(fontfile.sparsemax) -- sentinel
- --
- fdselectoffset = todictoffset(offset)
- offset = writestring(target,fdselect,offset,"fdselect")
- --
- -- charstrings
- --
- charstringoffset = todictoffset(offset)
- offset = writeindex(target,charstrings,offset,"charstrings")
- --
- -- font dict
- --
- -- offset = writeindex(target,{},offset,"fontdict")
- --
- -- private
- --
- privateoffset = todictoffset(offset)
- privatespec = privatesize .. privateoffset
- offset = writestring(target,private,offset,"private")
- --
- local fdarray = {
- fontname .. todictkey(12,38)
- .. privatespec .. todictkey(18)
- }
- fdarrayoffset = todictoffset(offset)
- offset = writeindex(target,fdarray,offset,"fdarray")
- --
- topdict = target[dictof]
- topdict = sub(topdict,1,#topdict-#topvars)
- topvars =
- charstringoffset .. todictkey(17)
- .. charsetoffset .. todictkey(15)
- .. fdarrayoffset .. todictkey(12,36)
- .. fdselectoffset .. todictkey(12,37)
- .. privatespec .. todictkey(18)
- target[dictof] = topdict .. topvars
- --
- target = concat(target)
- -- if trace_details then
- -- local name = "temp.cff"
- -- report_fonts("saving %a",name)
- -- io.savedata(name,target)
- -- inspect(fonts.handlers.otf.readers.cffcheck(name))
- -- end
- return target
- end
-
- end
-
- -- todo: check widths (missing a decimal)
-
- mainwriters["opentype"] = function(details)
- --
- local fontfile = openfontfile(details)
- local basefontname = details.basefontname
- local streams = details.streams
- local blobs = streams.streams
- local fontheader = streams.fontheader
- local maximumprofile = streams.maximumprofile
- local names = streams.names
- local descriptions = details.rawdata.descriptions
- local metadata = details.rawdata.metadata
- local indices = details.indices
- local metabbox = { fontheader.xmin, fontheader.ymin, fontheader.xmax, fontheader.ymax }
- local correction = 1
-
- -- (*) We share code with type1 and when we have old school tfm with
- -- pfb but without descriptions we're kind of toast.
-
- if not descriptions or not next(descriptions) then
- -- This is good enough, we only need indices and widths.
- descriptions = details.fontdata.characters
- -- This is a hack, we have no basepoints.
- correction = details.fontdata.parameters.size / 1000
- -- And this needs checking.
- correction = correction * bpfactor / ptfactor
- metadata = { }
- end
-
- --
-
- local indices,
- minindex,
- maxindex = collectindices(descriptions,indices)
- local streamoffset = 0
- local glyphstreams,
- charmappings = tablecreators.cff(fontfile)
- --
- local zero2 = tocardinal2(0)
- local zero4 = tocardinal4(0)
- --
- -- we need to locate notdef (or store its unicode someplace)
- --
- local blob = blobs[0] or "\14"
- local sparsemax = 1
- local lastoffset = zero4
- glyphstreams[sparsemax] = blob
- charmappings[sparsemax] = tocardinal1(0) -- format 0
- streamoffset = streamoffset + #blob
- lastoffset = tocardinal4(streamoffset)
- if minindex == 0 then
- minindex = 1
- end
- for index=minindex,maxindex do
- if indices[index] then
- local blob = blobs[index] or "\14"
- sparsemax = sparsemax + 1
- glyphstreams[sparsemax] = blob
- charmappings[sparsemax] = tocardinal2(index)
- streamoffset = streamoffset + #blob
- lastoffset = tocardinal4(streamoffset)
- end
- end
- --
- fontfile.nofglyphs = maxindex + 1
- fontfile.sparsemax = sparsemax
- fontfile.format = "cff"
- fontfile.basefontname = basefontname
- fontfile.fontbbox = metabbox
- --
- local fontdata = tablewriters.cff(fontfile)
- local fontmeta = makemetadata(fontfile)
- --
- fontfile = closefontfile(fontfile)
- --
- local units = fontheader.units or metadata.units
-
- local basefont = pdfconstant(basefontname)
- local widths = widtharray(details,indices,maxindex,units * correction)
- local object = details.objectnumber
- local tounicode = tounicodedictionary(details,indices,maxindex,basefontname,true)
- local tocidset = tocidsetdictionary(indices,minindex,maxindex)
- local fontbbox = pdfarray { unpack(metabbox) }
- local ascender = metadata.ascender or 0
- local descender = metadata.descender or 0
- local capheight = metadata.capheight or fontbbox[4]
- local stemv = metadata.weightclass
- local italicangle = metadata.italicangle
- local xheight = metadata.xheight or fontbbox[4]
- if stemv then
- stemv = (stemv/65)^2 + 50
- else
--- stemv = 2
- end
- --
- local function scale(n)
- if n then
- return round((n) * 10000 / units) / 10
- else
- return 0
- end
- end
- --
- local reserved = pdfreserveobject()
- local child = pdfdictionary {
- Type = pdfconstant("Font"),
- Subtype = pdfconstant("CIDFontType0"),
- BaseFont = basefont,
- FontDescriptor = pdfreference(reserved),
- W = pdfreference(pdfflushobject(widths)),
- CIDSystemInfo = pdfdictionary {
- Registry = pdfstring("Adobe"),
- Ordering = pdfstring("Identity"),
- Supplement = 0,
- }
- }
- local descendants = pdfarray {
- pdfreference(pdfflushobject(child)),
- }
- local fontstream = pdfdictionary {
- Subtype = pdfconstant("CIDFontType0C"),
- }
- local descriptor = pdfdictionary {
- Type = pdfconstant("FontDescriptor"),
- FontName = basefont,
- Flags = 4,
- FontBBox = fontbbox,
- Ascent = scale(ascender),
- Descent = scale(descender),
- ItalicAngle = round(italicangle or 0),
- CapHeight = scale(capheight),
- StemV = scale(stemv),
- XHeight = scale(xheight),
- CIDSet = tocidset,
- FontFile3 = pdfreference(pdfflushstreamobject(fontdata,fontstream())),
- Metadata = fontmeta and pdfreference(pdfflushstreamobject(fontmeta)) or nil,
- }
- local parent = pdfdictionary {
- Type = pdfconstant("Font"),
- Subtype = pdfconstant("Type0"),
- Encoding = pdfconstant(details.properties.writingmode == "vertical" and "Identity-V" or "Identity-H"),
- BaseFont = basefont,
- DescendantFonts = descendants,
- ToUnicode = pdfreference(pdfflushstreamobject(tounicode)),
- }
- pdfflushobject(reserved,descriptor)
- pdfflushobject(object,parent)
- end
-
- mainwriters["type1"] = function(details)
- -- We abuse the cff includer which is ok but for special cases like
- -- tfm -> pfb we don't have the right descriptions and scale so this
- -- is why we cheat elsewhere. Maybe I should just drop that kind of
- -- support and assume afm files to be present. See (*) above.
- local s = details.streams
- local m = details.rawdata.metadata
- if m then
- local h = s.horizontalheader
- local c = s.cffinfo
- local n = s.names
- h.ascender = m.ascender or h.ascender
- h.descender = m.descender or h.descender
- n.copyright = m.copyright or n.copyright
- n.family = m.familyname or n.familyname
- n.fullname = m.fullname or n.fullname
- n.fontname = m.fontname or n.fontname
- n.subfamily = m.subfamilyname or n.subfamilyname
- n.version = m.version or n.version
- setmetatableindex(h,m)
- setmetatableindex(c,m)
- setmetatableindex(n,m)
- end
- mainwriters["opentype"](details)
- end
-
- do
-
- -- The methods might become plugins.
-
- local methods = { }
-
- local pdfimage = lpdf.epdf.image
- local openpdf = pdfimage.open
- local closepdf = pdfimage.close
- local copypage = pdfimage.copy
-
- local embedimage = images.embed
-
- local f_glyph = formatters["G%d"]
- local f_char = formatters["BT /V%d 1 Tf [<%04X>] TJ ET"]
- local f_width = formatters["%.6N 0 d0"]
- local f_index = formatters["I%d"]
- local f_image_xy = formatters["%.6N 0 d0 1 0 0 1 %.6N %.6N cm /%s Do"]
- local f_image_c = formatters["/%s Do"]
- local f_image_c_xy = formatters["%.6N 0 0 %.6N %.6N %.6N cm /%s Do"]
- local f_image_w = formatters["%.6N 0 d0 %s"]
- local f_image_d = formatters["%.6N 0 d0 1 0 0 1 0 %.6N cm /%s Do"]
- local f_stream = formatters["%.6N 0 d0 %s"]
- local f_stream_c = formatters["%.6N 0 0 0 0 0 d1 %s"]
- local f_stream_d = formatters["%.6N 0 d0 1 0 0 1 0 %.6N cm %s"]
-
- -- A type 3 font has at most 256 characters and Acrobat also wants a zero slot
- -- to be filled. We can share a mandate zero slot character. We also need to
- -- make sure that we use bytes as index in the page stream as well as in the
- -- tounicode vector.
-
- local c_notdef = nil
- local r_notdef = nil
- local w_notdef = nil
- local fontbbox = nil
-
- -- pk inclusion (not really tested but not really used either)
-
- function methods.pk(filename)
- local pkfullname = resolvers.findpk(basedfontname,resolution)
- if not pkfullname or pkfullname == "" then
- return
- end
- local readers = fonts.handlers.tfm.readers
- local result = readers.loadpk(pkfullname)
- local convert = readers.pktopdf
- if not result or result.error then
- return
- end
- local resolution = 600
- local widthfactor = resolution / 72
- local scalefactor = 72 / resolution / 10
- local factor = widthfactor / 65536
- local function pktopdf(glyph,data)
- return convert(glyph,data,factor) -- return pdfcode, width
- end
- return result.glyphs, scalefactor, pktopdf, false, false
- end
-
- -- pdf inclusion
-
- local used = setmetatableindex("table")
-
- function methods.pdf(filename,details)
- local properties = details.properties
- local pdfshapes = properties.indexdata[1]
- local pdfdoc = openpdf(pdfshapes.filename)
- local xforms = pdfdictionary()
- local nofglyphs = 0
- if pdfdoc then
- local scale = 10 * details.parameters.size/details.parameters.designsize
- local units = details.parameters.units
- local factor = units * bpfactor / scale
- local fixdepth = pdfshapes.fixdepth
- local useddoc = used[pdfdoc]
- local function pdftopdf(glyph,data)
- local width = (data.width or 0) * factor
- local image = useddoc[glyph]
- local reference = nil
- if not image then
- image = embedimage(copypage(pdfdoc,glyph))
- nofglyphs = nofglyphs + 1
- local name = f_glyph(nofglyphs)
- local stream = nil
- if fixdepth then
- local depth = data.depth or 0
- local height = data.height or 0
- if depth ~= 0 or height ~= 0 then
- local d = data.dropin.descriptions[data.index]
- local b = d.boundingbox
- local l = b[1]
- local r = b[3]
- local w = r - l
- local scale = w / d.width
- local x = l
- local y = - b[4] - b[2] - d.depth
- local scale = w / (image.width * bpfactor)
- stream = f_image_c_xy(scale,scale,x,y,name)
- else
- stream = f_image_c(name)
- end
- else
- stream = f_image_c(name)
- end
- useddoc[glyph] = image
- image.embedded_name = name
- image.embedded_stream = stream
- image.embedded_reference = pdfreference(image.objnum)
- end
- xforms[image.embedded_name] = image.embedded_reference
- return f_image_w(width,image.embedded_stream), width
- end
- local function closepdf()
- -- closepdf(pdfdoc)
- end
- local function getresources()
- return pdfdictionary { XObject = xforms }
- end
- return pdfshapes, 1/units, pdftopdf, closepdf, getresources
- end
- end
-
- -- mps inclusion
-
- local decompress = gzip.decompress
- local metapost = metapost
- local simplemprun = metapost.simple
- local setparameterset = metapost.setparameterset
-
- function methods.mps(filename,details)
- local properties = details.properties
- local parameters = details.parameters
- local mpshapes = properties.indexdata[1] -- indexdata will change
- if mpshapes then
- local scale = 10 * parameters.size/parameters.designsize
- local units = mpshapes.units or parameters.units
- local factor = units * bpfactor / scale
- local fixdepth = mpshapes.fixdepth
- local usecolor = mpshapes.usecolor
- local specification = mpshapes.specification
- local shapedefinitions = mpshapes.shapes
- local instance = mpshapes.instance
- --
- simplemprun(instance,"begingroup;",true,true)
- setparameterset("mpsfont",specification)
- if shapedefinitions then
- local preamble = shapedefinitions.parameters.preamble
- if preamble then
- simplemprun(instance,preamble,true,true)
- end
- end
- --
- local function mpstopdf(mp,data)
- local width = data.width
- if decompress then
- mp = decompress(mp)
- end
- local pdf = simplemprun(instance,mp,true) -- can be sped up, minifun
- local width = width * factor
- if usecolor then
- return f_stream_c(width,pdf), width
- elseif fixdepth then
- local depth = data.depth or 0
- local height = data.height or 0
- if depth ~= 0 or height ~= 0 then
- return f_stream_d(width,(-height-depth)*factor,pdf), width
- end
- end
- return f_stream(width,pdf), width
- end
- --
- local function resetmps()
- setparameterset("mpsfont")
- simplemprun(instance,"endgroup;",true,true)
- end
- --
- local function getresources()
- return lpdf.collectedresources {
- serialize = false,
- }
- end
- --
- return mpshapes, 1/units, mpstopdf, resetmps, getresources
- end
- end
-
- -- png inclusion
-
- -- With d1 the image mask is used when given and obeys color. So it is needed for pure bw
- -- bitmap fonts, so here we really need d0.
- --
- -- Acrobat X pro only seems to see the image mask but other viewers are doing it ok. Acrobat
- -- reader crashes. We really need to add a notdef!
-
- local files = utilities.files
- local openfile = files.open
- local closefile = files.close
- local setposition = files.setposition
- local readstring = files.readstring
-
- function methods.png(filename,details)
- local properties = details.properties
- local pngshapes = properties.indexdata[1]
- if pngshapes then
- local parameters = details.parameters
- local png = properties.png
- local hash = png.hash
- local xforms = pdfdictionary()
- local nofglyphs = 0
- local scale = 10 * parameters.size/parameters.designsize
- local factor = bpfactor / scale
- -- local units = parameters.units -- / 1000
- local units = 1000
- local filehandle = openfile(details.filename,true)
- local function pngtopdf(glyph,data)
- -- local info = graphics.identifiers.png(glyph.data,"string")
- local offset = glyph.o
- local size = glyph.s
- local pdfdata = nil
- if offset and size then
- setposition(filehandle,offset)
- local blob = readstring(filehandle,size)
- local info = graphics.identifiers.png(blob,"string")
- info.enforcecmyk = pngshapes.enforcecmyk
- local image = lpdf.injectors.png(info,"string")
- local width = (data.width or 0) * factor
- if image then
- embedimage(image)
- nofglyphs = nofglyphs + 1
- local xoffset = (glyph.x or 0) / units
- local yoffset = (glyph.y or 0) / units
- local name = f_glyph(nofglyphs)
- xforms[name] = pdfreference(image.objnum)
- pdfdata = f_image_xy(width,xoffset,yoffset,name)
- end
- end
- return pdfdata or f_stream(width), width
- end
- local function closepng()
- if filehandle then
- closefile(filehandle)
- end
- pngshapes = nil
- end
- local function getresources()
- return pdfdictionary { XObject = xforms }
- end
- return pngshapes, 1, pngtopdf, closepng, getresources
- end
- end
-
- function methods.color(filename,details)
- local colrshapes = details.properties.indexdata[1]
- local colrvalues = details.properties.indexdata[2]
- local usedfonts = { }
- local function colrtopdf(description,data)
- -- descriptions by index
- local colorlist = description.colors
- if colorlist then
- local dropdata = data.dropin
- local dropid = dropdata.properties.id
- local dropunits = dropdata.parameters.units -- shared
- local descriptions = dropdata.descriptions
- usedfonts[dropid] = dropid
- local w = description.width or 0
- local s = #colorlist
- local l = nil
- local t = { f_width(w) }
- local n = 1
- local d = colrvalues[#colrvalues]
- for i=1,s do
- local entry = colorlist[i]
- local v = colrvalues[entry.class] or d
- if v and l ~= v then
- n = n + 1 ; t[n] = v
- l = v
- end
- local e = descriptions[entry.slot]
- if e then
- n = n + 1 ; t[n] = f_char(dropid,e.index)
- end
- end
- return concat(t," "), w / dropunits
- end
- end
- local function getresources()
- return lpdf.collectedresources {
- serialize = false,
- fonts = usedfonts,
- fontprefix = "V",
- }
- end
- return colrshapes, 1, colrtopdf, false, getresources
- end
-
- mainwriters["type3"] = function(details)
- local properties = details.properties
- local basefontname = details.basefontname or properties.name
- local askedmethod = properties.method or "pk"
- local method = methods[askedmethod] or methods.pk
- if not method then
- return
- end
- local glyphs, scalefactor, glyphtopdf, reset, getresources = method(basedfontname,details)
- if not glyphs then
- return
- end
- local parameters = details.parameters
- local object = details.objectnumber
- local factor = parameters.factor -- normally 1
- local fontmatrix = pdfarray { scalefactor, 0, 0, scalefactor, 0, 0 }
- local indices,
- minindex,
- maxindex = collectindices(details.fontdata.characters,details.indices)
- local widths = pdfarray()
- local differences = pdfarray()
- local charprocs = pdfdictionary()
- local basefont = pdfconstant(basefontname)
- local d = 0
- local w = 0
- local forcenotdef = minindex > 0
- local lastindex = -0xFF
- if forcenotdef then
- widths[0] = 0
- minindex = 0
- lastindex = 0
- d = 2
- if not c_notdef then
- w_notdef = 0
- c_notdef = pdfconstant(".notdef")
- r_notdef = pdfreference(pdfflushstreamobject("0 0 d0"))
- end
- differences[1] = w_notdef
- differences[2] = c_notdef
- charprocs[".notdef"] = r_notdef
- end
-
- for i=1,maxindex-minindex+1 do
- widths[i] = 0
- end
-
- for index, data in sortedhash(indices) do
- local name = f_index(index)
- local glyph = glyphs[index]
- if glyph then
- local stream, width = glyphtopdf(glyph,data)
- if stream then
- if index - 1 ~= lastindex then
- d = d + 1 differences[d] = index
- end
- lastindex = index
- d = d + 1 differences[d] = pdfconstant(name)
- charprocs[name] = pdfreference(pdfflushstreamobject(stream))
- widths[index-minindex+1] = width
- end
- else
- report_fonts("missing glyph %i in type3 font %a",index,basefontname)
- end
- end
- if not fontbbox then
- -- The specification permits zero values and these are actually also more
- -- robust as then there are no assumptions and no accuracy is needed.
- fontbbox = pdfarray { 0, 0, 0, 0 }
- end
- local encoding = pdfdictionary {
- Type = pdfconstant("Encoding"),
- Differences = differences,
- }
- local tounicode = tounicodedictionary(details,indices,maxindex,basefontname,false)
- local resources = getresources and getresources()
- if not resources or not next(resources) then
- -- resources = lpdf.procset(true)
- resources = nil
- end
- local descriptor = pdfdictionary {
- -- most is optional in type3
- Type = pdfconstant("FontDescriptor"),
- FontName = basefont,
- Flags = 4,
- ItalicAngle = 0,
- }
- local parent = pdfdictionary {
- Type = pdfconstant("Font"),
- Subtype = pdfconstant("Type3"),
- Name = basefont,
- FontBBox = fontbbox,
- FontMatrix = fontmatrix,
- CharProcs = pdfreference(pdfflushobject(charprocs)),
- Encoding = pdfreference(pdfflushobject(encoding)),
- FirstChar = minindex,
- LastChar = maxindex,
- Widths = pdfreference(pdfflushobject(widths)),
- FontDescriptor = pdfreference(pdfflushobject(descriptor)),
- Resources = resources,
- ToUnicode = tounicode and pdfreference(pdfflushstreamobject(tounicode)),
- }
- pdfflushobject(object,parent)
- if reset then
- reset()
- end
- end
-
- end
-
-end
-
--- writingmode
-
-local usedfonts = fonts.hashes.identifiers -- for now
-local noffonts = 0
-
--- The main injector.
-
--- here we need to test for sharing otherwise we reserve too many
--- objects
-
-local getstreamhash = fonts.handlers.otf.getstreamhash
-local loadstreamdata = fonts.handlers.otf.loadstreamdata
-
--- we can actually now number upwards (so not use fontid in /F)
-
-local objects = setmetatableindex(function(t,k)
- local v
- if type(k) == "number" then
- local h = getstreamhash(k)
- v = rawget(t,h)
- if not v then
- v = pdfreserveobject()
- t[h] = v
- end
- if trace_fonts then
- report_fonts("font id %i bound to hash %s and object %i",k,h,v)
- end
- else
- -- no problem as it can be svg only
- -- report_fonts("fatal error, hash %s asked but not used",k,h,v)
- v = pdfreserveobject()
- t[k] = v
- end
- return v
-end)
-
-local n = 0
-
-local names = setmetatableindex(function(t,k)
- local v
- if type(k) == "number" then
- local h = getstreamhash(k)
- v = rawget(t,h)
- if not v then
- n = n + 1
- v = n
- t[h] = v
- end
- if trace_fonts then
- report_fonts("font id %i bound to hash %s and name %i",k,h,n)
- end
- end
- t[k] = v
- return v
-end)
-
-function lpdf.flushfonts()
-
- local mainfonts = { }
-
- statistics.starttiming(objects)
-
- for fontid, used in sortedhash(lpdf.usedcharacters) do
-
- -- for a bitmap we need a different hash unless we stick to a fixed high
- -- resolution which makes much sense
-
- local hash = getstreamhash(fontid)
- if hash then
- local parent = mainfonts[hash]
- if not parent then
- local fontdata = usedfonts[fontid]
- local rawdata = fontdata.shared and fontdata.shared.rawdata
- local resources = fontdata.resources
- local properties = fontdata.properties -- writingmode and type3
- local parameters = fontdata.parameters -- used in type3
- if not rawdata then
- -- we have a virtual font that loaded directly ... at some point i will
- -- sort this out (in readanddefine we need to do a bit more) .. the problem
- -- is that we have a hybrid font then
- for xfontid, xfontdata in next, fonts.hashes.identifiers do
- if fontid ~= xfontid then
- local xhash = getstreamhash(xfontid)
- if hash == xhash then
- rawdata = xfontdata.shared and xfontdata.shared.rawdata
- if rawdata then
- resources = xfontdata.resources
- properties = xfontdata.properties
- parameters = xfontdata.parameters
- break
- end
- end
- end
- end
- end
- if rawdata then
- parent = {
- hash = hash,
- fontdata = fontdata,
- filename = resources.filename or properties.filename or "unset",
- indices = { },
- rawdata = rawdata,
- properties = properties, -- we assume consistency
- parameters = parameters, -- we assume consistency
- streams = { },
- objectnumber = objects[hash],
- basefontname = subsetname(properties.psname or properties.name or "unset"),
- name = names[hash],
- }
- mainfonts[hash] = parent
- noffonts = noffonts + 1
- end
- end
- if parent then
- local indices = parent.indices
- for k in next, used do
- indices[k] = true
- end
- end
- end
- end
-
- -- this is no not yet ok for tfm / type 1 .. we need to move the nested blobs ourside the loop
-
- for hash, details in sortedhash(mainfonts) do
- local filename = details.filename
- if next(details.indices) then
- if trace_fonts then
- report_fonts("embedding %a hashed as %a",filename,hash)
- end
- local properties = details.properties
- local bitmap = properties.usedbitmap
- local method = properties.method -- will be pk | pdf | svg | ...
- if bitmap or method then
- local format = "type3"
- local writer = mainwriters[format]
- if writer then
- if trace_fonts then
- report_fonts("using main writer %a",format)
- end
- writer(details)
- end
- else
- local format = properties.format
- local writer = mainwriters[format]
- if not writer then
- -- This will move to the tpk module where we will also deal
- -- with bitmaps then.
- local encoding, pfbfile, encfile = getmapentry(filename)
- if trace_fonts then
- report_fonts("file %a resolved to encoding %a and file %a",filename,encoding,pfbfile)
- end
- if encoding and pfbfile then
- filename = pfbfile
- format = "type1"
- --
- -- another (temp) hack
- local size = details.fontdata.parameters.size
- local factor = details.fontdata.parameters.factor
- local descriptions = { }
- local characters = details.fontdata.characters
- --
- local names, _, _, metadata = fonts.constructors.handlers.pfb.loadvector(pfbfile)
- local reverse = table.swapped(names)
- local vector = encoding.vector
- local indices = details.indices
- local remapped = { }
- local factor = bpfactor * size / 65536
- for k, v in next, indices do
- local name = vector[k]
- local index = reverse[name] or 0
- local width = factor * (characters[k].width or 0)
- descriptions[k] = {
- width = width,
- index = index,
- name = name,
- }
- remapped[index] = true
- end
- details.indices = remapped
- --
- details.rawdata.descriptions = descriptions
- details.filename = filename
- details.rawdata.metadata = { }
- --
- properties.filename = filename
- properties.format = format
- writer = mainwriters[format]
- end
- end
- if not writer then
- local pfbfile = file.replacesuffix(filename,"pfb")
- if encoding and pfbfile then
- filename = pfbfile
- format = "type1"
- --
- -- another (temp) hack
- local size = details.fontdata.parameters.size
- local factor = details.fontdata.parameters.factor
- local descriptions = { }
- local characters = details.fontdata.characters
- --
- local names, _, _, metadata = fonts.constructors.handlers.pfb.loadvector(pfbfile)
- local reverse = table.swapped(names)
- local vector = encoding.vector
- local indices = details.indices
- local remapped = { }
- local factor = bpfactor * size / 65536
- for k, v in next, indices do
- local name = vector[k]
- local index = reverse[name] or 0
- local width = factor * (characters[k].width or 0)
- descriptions[k] = {
- width = width,
- index = index,
- name = name,
- }
- remapped[index] = true
- end
- details.indices = remapped
- --
- details.rawdata.descriptions = descriptions
- details.filename = filename
- details.rawdata.metadata = { }
- --
- properties.filename = filename
- properties.format = format
- writer = mainwriters[format]
- end
- end
- if writer then
- if trace_fonts then
- report_fonts("using main writer %a",format)
- end
- -- better move this test to the writers .. cleaner
- local streams = loadstreamdata(details.fontdata)
- if streams and streams.fontheader and streams.names then
- details.streams = streams
- writer(details)
- details.streams = { }
- elseif trace_fonts then
- -- can be ok for e.g. emoji
- report_fonts("no streams in %a",filename)
- end
- -- free some memory
- else -- if trace_fonts then
- report_fonts("no %a writer for %a",format,filename)
- end
- end
- else -- not problem for svg ...
- -- report_fonts("no indices for %a",filename)
- end
- if trace_fonts then
- report_fonts("embedded indices: % t",table.sortedkeys(details.indices))
- end
- mainfonts[details.hash] = false -- done
- end
-
- statistics.stoptiming(objects)
-
-end
-
-statistics.register("font embedding time",function()
- if noffonts > 0 then
- return format("%s seconds, %s fonts", statistics.elapsedtime(objects),noffonts)
- end
-end)
-
--- this is temporary
-
-local done = false
-
-updaters.register("backend.update.pdf",function()
- if not done then
- function pdf.getfontobjnum (k) return objects[k] end
- function pdf.getfontname (k) return names [k] end
- function pdf.includechar () end -- maybe, when we need it
- function pdf.includefont () end -- maybe, when we need it
- function pdf.includecharlist () end -- maybe, when we need it
- function pdf.setomitcidset (v) includecidset = not toboolean(v) end
- function pdf.setomitcharset () end -- we don't need that in lmtx
- function pdf.setsuppressoptionalinfo() end -- we don't need that in lmtx
- function pdf.mapfile (n) loadmapfile(n) end
- function pdf.mapline (n) loadmapline(n) end
- -- this will change
- lpdf.registerdocumentfinalizer(lpdf.flushfonts,1,"wrapping up fonts")
- done = true
- end
-end)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lpdf-eng.lua b/Master/texmf-dist/tex/context/base/mkiv/lpdf-eng.lua
index 21c7e66e999..26a63e9a0ef 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lpdf-eng.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lpdf-eng.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['lpdf-eng'] = {
version = 1.001,
+ optimize = true,
comment = "companion to lpdf-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lpdf-epa.lua b/Master/texmf-dist/tex/context/base/mkiv/lpdf-epa.lua
index 45000aebc75..0ff764e1d72 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lpdf-epa.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lpdf-epa.lua
@@ -510,7 +510,7 @@ local validstamps = {
ForPublicRelease = true,
}
--- todo: we can use runtoks instead of steps
+-- todo: we can use runlocal instead of steps
local function validStamp(v)
local name = "Stamped" -- fallback
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lpdf-fld.lua b/Master/texmf-dist/tex/context/base/mkiv/lpdf-fld.lua
index e5a95fdab7c..e14968eb8ad 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lpdf-fld.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lpdf-fld.lua
@@ -1003,17 +1003,17 @@ function nodeinjections.typesetfield(name,specification)
end
end
-local function save_parent(field,specification,d,hasopt)
+local function save_parent(field,specification,d)
local kidsnum = pdfreserveobject()
d.Kids = pdfreference(kidsnum)
field.kidsnum = kidsnum
field.kids = pdfarray()
- if hasopt then
- local optnum = pdfreserveobject()
- d.Opt = pdfreference(optnum)
- field.optnum = optnum
- field.opt = pdfarray()
- end
+-- if d.Opt then
+-- local optnum = pdfreserveobject()
+-- d.Opt = pdfreference(optnum)
+-- field.optnum = optnum
+-- field.opt = pdfarray()
+-- end
local pnum = pdfflushobject(d)
field.pobj = pnum
collected[#collected+1] = pdfreference(pnum)
@@ -1022,12 +1022,12 @@ end
local function save_kid(field,specification,d,optname)
local kn = pdfreserveobject()
field.kids[#field.kids+1] = pdfreference(kn)
- if optname then
- local opt = field.opt
- if opt then
- opt[#opt+1] = optname
- end
- end
+-- if optname then
+-- local opt = field.opt
+-- if opt then
+-- opt[#opt+1] = optname
+-- end
+-- end
local width = specification.width or 0
local height = specification.height or 0
local depth = specification.depth or 0
@@ -1243,7 +1243,7 @@ local function makecheckparent(field,specification)
FT = pdf_btn,
V = fielddefault(field,default),
}
- save_parent(field,specification,d,true)
+ save_parent(field,specification,d)
end
local function makecheckchild(name,specification)
@@ -1371,7 +1371,7 @@ local function makeradioparent(field,specification)
-- H = pdf_n,
V = fielddefault(field),
}
- save_parent(field,specification,d,true)
+ save_parent(field,specification,d)
end
-- local function makeradiochild(name,specification)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lpdf-fmt.lua b/Master/texmf-dist/tex/context/base/mkiv/lpdf-fmt.lua
index 388db0be3d9..c6a3f25ff5e 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lpdf-fmt.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lpdf-fmt.lua
@@ -885,8 +885,8 @@ function codeinjections.setformat(s)
end
local pdf_version = spec.pdf_version * 10
local inject_metadata = spec.inject_metadata
- local majorversion = math.div(pdf_version,10)
- local minorversion = math.mod(pdf_version,10)
+ local majorversion = math.floor(math.div(pdf_version,10))
+ local minorversion = math.floor(math.mod(pdf_version,10))
local objectcompression = spec.object_compression and pdf_version >= 15
local compresslevel = level or lpdf.compresslevel() -- keep default
local objectcompresslevel = (objectcompression and (level or lpdf.objectcompresslevel())) or 0
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lpdf-grp.lua b/Master/texmf-dist/tex/context/base/mkiv/lpdf-grp.lua
index e827419a6ce..963b1dde319 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lpdf-grp.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lpdf-grp.lua
@@ -293,3 +293,5 @@ end
function lpdf.patternstream(n,width,height)
return f_pattern("Pt" .. n,width*basepoints,height*basepoints)
end
+
+backends.pdf.codeinjections.registerpattern = lpdf.registerpattern
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lpdf-img.lua b/Master/texmf-dist/tex/context/base/mkiv/lpdf-img.lua
deleted file mode 100644
index 17305a1cfa6..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/lpdf-img.lua
+++ /dev/null
@@ -1,1340 +0,0 @@
-if not modules then modules = { } end modules ['lpdf-img'] = {
- 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"
-}
-
--- This started as an experiment but has potential for some (cached) optimizations.
--- At some point we can also use it for fonts. For small images performance is ok
--- with pure lua but for bigger images we can use some helpers. Normally in a
--- typesetting workflow non-interlaced images are used. One should convert
--- interlaced images to more efficient non-interlaced ones (ok, we can cache
--- them if needed).
---
--- The \LUA\ code is slightly optimized so we could have done with less lines if
--- we wanted but best gain a little. The idea is that we collect striped (in stages)
--- so that we can play with substitutions.
-
-local type = type
-local concat, move = table.concat, table.move
-local ceil, min = math.ceil, math.min
-local char, byte, find, gmatch = string.char, string.byte, string.find, string.gmatch
-local idiv = number.idiv
-local band, rshift = bit32.band, bit32.rshift
-
-local loaddata = io.loaddata
-local setmetatableindex = table.setmetatableindex
-local formatters = string.formatters
-
-local streams = utilities.streams
-local openstring = streams.openstring
-local readstring = streams.readstring
-local readbytetable = streams.readbytetable
-
-local newreader = io.newreader
-
-local tobytetable = string.bytetable
-
-local lpdf = lpdf or { }
-local pdfdictionary = lpdf.dictionary
-local pdfarray = lpdf.array
-local pdfconstant = lpdf.constant
-local pdfstring = lpdf.string
-local pdfflushstreamobject = lpdf.flushstreamobject
-local pdfreference = lpdf.reference
-local pdfverbose = lpdf.verbose
-
-local pdfmajorversion = lpdf.majorversion
-local pdfminorversion = lpdf.minorversion
-
-local createimage = images.create
-
-local zlibcompress = (xzip or zlib).compress
-local zlibdecompress = (xzip or zlib).decompress
-
-local trace = false
-
-local report_jpg = logs.reporter("graphics","jpg")
-local report_jp2 = logs.reporter("graphics","jp2")
-local report_png = logs.reporter("graphics","png")
-
-trackers.register("graphics.backend", function(v) trace = v end)
-
-local injectors = { }
-lpdf.injectors = injectors
-
--- todo: load from a virtual file
-
-local function loadcontent(filename,method)
- return method == "string" and filename or loaddata(filename)
-end
-
-local function newcontent(filename,method)
- return newreader(filename,method)
-end
-
---
-
-local chars = setmetatableindex(function(t,k) -- share this one
- local v = (k <= 0 and "\000") or (k >= 255 and "\255") or char(k)
- t[k] = v
- return v
-end)
-
-do
-
- function injectors.jpg(specification,method)
- if specification.error then
- return
- end
- local filename = specification.filename
- if not filename then
- return
- end
- local colorspace = specification.colorspace or jpg_gray
- local decodearray = nil
- ----- procset = colorspace == 0 and "image b" or "image c"
- if colorspace == 1 then
- colorspace = "DeviceGray"
- elseif colorspace == 2 then
- colorspace = "DeviceRGB"
- elseif colorspace == 3 then
- colorspace = "DeviceCMYK"
- decodearray = pdfarray { 1, 0, 1, 0, 1, 0, 1, 0 }
- end
- -- todo: set filename
- local xsize = specification.xsize
- local ysize = specification.ysize
- local colordepth = specification.colordepth
- local content = loadcontent(filename,method)
- local xobject = pdfdictionary {
- Type = pdfconstant("XObject"),
- Subtype = pdfconstant("Image"),
- -- BBox = pdfarray { 0, 0, xsize, ysize },
- Width = xsize,
- Height = ysize,
- BitsPerComponent = colordepth,
- Filter = pdfconstant("DCTDecode"),
- ColorSpace = pdfconstant(colorspace),
- Decode = decodearray,
- Length = #content, -- specification.length
- } + specification.attr
- if trace then
- report_jpg("%s: width %i, height %i, colordepth %i, size %i",filename,xsize,ysize,colordepth,#content)
- end
- return createimage {
- bbox = { 0, 0, specification.width/xsize, specification.height/ysize }, -- mandate
- transform = specification.transform,
- nolength = true,
- nobbox = true,
- notype = true,
- stream = content,
- attr = xobject(),
- }
- end
-
-end
-
-do
-
- function injectors.jp2(specification,method)
- if specification.error then
- return
- end
- local filename = specification.filename
- if not filename then
- return
- end
- -- todo: set filename
- local xsize = specification.xsize
- local ysize = specification.ysize
- local content = loadcontent(filename,method)
- local xobject = pdfdictionary {
- Type = pdfconstant("XObject"),
- Subtype = pdfconstant("Image"),
- BBox = pdfarray { 0, 0, xsize, ysize },
- Width = xsize,
- Height = ysize,
- Filter = pdfconstant("JPXDecode"),
- Length = #content, -- specification.length
- } + specification.attr
- if trace then
- report_jp2("%s: width %i, height %i, size %i",filename,xsize,ysize,#content)
- end
- return createimage {
- bbox = { 0, 0, specification.width/xsize, specification.height/ysize }, -- mandate
- transform = specification.transform,
- nolength = true,
- nobbox = true,
- notype = true,
- stream = content,
- attr = xobject(),
- }
- end
-
-end
-
-do
-
- -- We don't like interlaced files. You can deinterlace them beforehand because otherwise
- -- each run you add runtime. Actually, even masked images can best be converted to PDF
- -- beforehand.
-
- -- The amount of code is larger that I like and looks somewhat redundant but we sort of
- -- optimize a few combinations that happen often.
-
- local pngapplyfilter = pngdecode.applyfilter
- local pngsplitmask = pngdecode.splitmask
- local pnginterlace = pngdecode.interlace
- local pngexpand = pngdecode.expand
- local pngtocmyk = pngdecode.tocmyk
-
- local filtermask, decodemask, decodestrip, transpose, expand, tocmyk
-
- local newindex = lua.newindex
- local newtable = lua.newtable
-
- local function newoutput(size)
- if newindex then
- return newindex(size,0)
- end
- local t = newtable and newtable(size,0) or { }
- for i=1,size do
- t[i] = 0
- end
- return t
- end
-
- local function convert(t)
- if type(t) == "table" then
- for i=1,#t do
- local ti = t[i]
- if ti ~= "" then -- soon gone
- t[i] = chars[ti]
- end
- end
- return concat(t)
- else
- return t
- end
- end
-
- local function zero(t,k)
- return 0
- end
-
- local function applyfilter(t,xsize,ysize,bpp)
- local len = xsize * bpp + 1
- local n = 1
- local m = len - 1
- for i=1,ysize do
- local filter = t[n]
- t[n] = ""
- if filter == 0 then
- elseif filter == 1 then
- for j=n+bpp+1,n+m do
- t[j] = (t[j] + t[j-bpp]) % 256
- end
- elseif filter == 2 then
- for j=n+1,n+m do
- t[j] = (t[j] + t[j-len]) % 256
- end
- elseif filter == 3 then
- for j=n+1,n+bpp do
- t[j] = (t[j] + idiv(t[j-len],2)) % 256
- end
- for j=n+bpp+1,n+m do
- t[j] = (t[j] + idiv(t[j-bpp] + t[j-len],2)) % 256
- end
- elseif filter == 4 then
- for j=n+1,n+bpp do
- local p = j - len
- local b = t[p]
- if b > 0 then
- t[j] = (t[j] + b) % 256
- end
- end
- for j=n+bpp+1,n+m do
- local p = j - len
- local a = t[j-bpp]
- local b = t[p]
- local c = t[p-bpp]
- local pa = b - c
- local pb = a - c
- local pc = pa + pb
- if pa < 0 then pa = - pa end
- if pb < 0 then pb = - pb end
- if pc < 0 then pc = - pc end
- t[j] = (t[j] + ((pa <= pb and pa <= pc and a) or (pb <= pc and b) or c)) % 256
- end
- end
- n = n + len
- end
- return t
- end
-
- local filtermask_l = function (content,xsize,ysize,colordepth,colorspace,hasfilter)
- local mask = { }
- local bytes = colordepth == 16 and 2 or 1
- local bpp = colorspace == "DeviceRGB" and 3 or 1
- local length = #content
- local size = ysize * xsize * ((bpp+1)*bytes + (hasfilter and 1 or 0))
- local n = 1
- local l = 1
- if bytes == 2 then
- if bpp == 1 then
- for i=1,ysize do
- if hasfilter then
- content[n] = "" ; n = n + 1
- end
- for j=1,xsize do
- content[n] = chars[content[n]] ; n = n + 1
- content[n] = chars[content[n]] ; n = n + 1
- mask[l] = chars[content[n]] ; l = l + 1
- content[n] = "" ; n = n + 1
- mask[l] = chars[content[n]] ; l = l + 1
- content[n] = "" ; n = n + 1
- end
- end
- elseif bpp == 3 then
- for i=1,ysize do
- if hasfilter then
- content[n] = "" ; n = n + 1
- end
- for j=1,xsize do
- content[n] = chars[content[n]] ; n = n + 1
- content[n] = chars[content[n]] ; n = n + 1
- content[n] = chars[content[n]] ; n = n + 1
- content[n] = chars[content[n]] ; n = n + 1
- content[n] = chars[content[n]] ; n = n + 1
- content[n] = chars[content[n]] ; n = n + 1
- mask[l] = chars[content[n]] ; l = l + 1
- content[n] = "" ; n = n + 1
- mask[l] = chars[content[n]] ; l = l + 1
- content[n] = "" ; n = n + 1
- end
- end
- else
- return "", ""
- end
- else
- if bpp == 1 then
- for i=1,ysize do
- if hasfilter then
- content[n] = "" ; n = n + 1
- end
- for j=1,xsize do
- content[n] = chars[content[n]] ; n = n + 1
- mask[l] = chars[content[n]] ; l = l + 1
- content[n] = "" ; n = n + 1
- end
- end
- elseif bpp == 3 then
- for i=1,ysize do
- if hasfilter then
- content[n] = "" ; n = n + 1
- end
- for j=1,xsize do
- content[n] = chars[content[n]] ; n = n + 1
- content[n] = chars[content[n]] ; n = n + 1
- content[n] = chars[content[n]] ; n = n + 1
- mask[l] = chars[content[n]] ; l = l + 1
- content[n] = "" ; n = n + 1
- end
- end
- else
- return "", ""
- end
- end
- return concat(content), concat(mask)
- end
-
- local decodemask_l = function(content,xsize,ysize,colordepth,colorspace)
- local bytes = colordepth == 16 and 2 or 1
- local bpp = colorspace == "DeviceRGB" and 3 or 1
- local slice = bytes*(bpp+1)
- local length = #content
- local size = ysize * xsize * ((bpp+1)*bytes + 1) -- assume filter
- content = openstring(content)
- content = readbytetable(content,length)
- setmetatableindex(content,zero)
- applyfilter(content,xsize,ysize,slice)
- content, mask = filtermask(content,xsize,ysize,colordepth,colorspace,true)
- return content, mask
- end
-
- local filtermask_c = function(content,xsize,ysize,colordepth,colorspace)
- local bytes = colordepth == 16 and 2 or 1
- local bpp = colorspace == "DeviceRGB" and 3 or 1
- return pngsplitmask(content,xsize,ysize,bpp,bytes)
- end
-
- local decodemask_c = function(content,xsize,ysize,colordepth,colorspace)
- local mask = true
- local filter = false
- local bytes = colordepth == 16 and 2 or 1
- local bpp = colorspace == "DeviceRGB" and 3 or 1
- local slice = bytes * (bpp + 1) -- always a mask
- content = pngapplyfilter(content,xsize,ysize,slice)
- return pngsplitmask(content,xsize,ysize,bpp,bytes,mask,filter)
- end
-
- local function decodestrip_l(s,nx,ny,slice)
- local input = readbytetable(s,ny*(nx*slice+1))
- setmetatableindex(input,zero)
- applyfilter(input,nx,ny,slice)
- return input, true
- end
-
- local function decodestrip_c(s,nx,ny,slice)
- local input = readstring(s,ny*(nx*slice+1))
- input = pngapplyfilter(input,nx,ny,slice)
- return input, false
- end
-
- local xstart = { 0, 4, 0, 2, 0, 1, 0 }
- local ystart = { 0, 0, 4, 0, 2, 0, 1 }
- local xstep = { 8, 8, 4, 4, 2, 2, 1 }
- local ystep = { 8, 8, 8, 4, 4, 2, 2 }
-
- local xblock = { 8, 4, 4, 2, 2, 1, 1 }
- local yblock = { 8, 8, 4, 4, 2, 2, 1 }
-
- local function transpose_l(xsize,ysize,slice,pass,input,output,filter)
- local xstart = xstart[pass]
- local xstep = xstep[pass]
- local ystart = ystart[pass]
- local ystep = ystep[pass]
- local nx = idiv(xsize + xstep - xstart - 1,xstep)
- local ny = idiv(ysize + ystep - ystart - 1,ystep)
- local offset = filter and 1 or 0
- local xstep = xstep * slice
- local xstart = xstart * slice
- local xsize = xsize * slice
- local target = ystart * xsize + xstart + 1
- local ystep = ystep * xsize
- local start = 1
- local plus = nx * xstep
- local step = plus - xstep
- if not output then
- output = newoutput(xsize*(parts or slice)*ysize)
- end
- if slice == 1 then
- for j=0,ny-1 do
- start = start + offset
- local target = target + j * ystep
- for target=target,target+step,xstep do
- output[target] = input[start]
- start = start + slice
- end
- end
- elseif slice == 2 then
- for j=0,ny-1 do
- start = start + offset
- local target = target + j * ystep
- for target=target,target+step,xstep do
- output[target] = input[start]
- output[target+1] = input[start+1]
- start = start + slice
- end
- end
- elseif slice == 3 then
- for j=0,ny-1 do
- start = start + offset
- local target = target + j * ystep
- for target=target,target+step,xstep do
- output[target] = input[start]
- output[target+1] = input[start+1]
- output[target+2] = input[start+2]
- start = start + slice
- end
- end
- elseif slice == 4 then
- for j=0,ny-1 do
- start = start + offset
- local target = target + j * ystep
- for target=target,target+step,xstep do
- output[target] = input[start]
- output[target+1] = input[start+1]
- output[target+2] = input[start+2]
- output[target+3] = input[start+3]
- start = start + slice
- end
- end
- else
- local delta = slice - 1
- for j=0,ny-1 do
- start = start + offset
- local target = target + j * ystep
- for target=target,target+step,xstep do
- move(input,start,start+delta,target,output)
- start = start + slice
- end
- end
- end
- return output;
- end
-
- local transpose_c = pnginterlace
-
- -- print(band(rshift(v,4),0x03),extract(v,4,2))
- -- print(band(rshift(v,6),0x03),extract(v,6,2))
-
- local function expand_l(t,xsize,ysize,parts,run,factor,filter)
- local size = ysize * xsize + 1 -- a bit of overshoot, needs testing, probably a few bytes us ok
- local xline = filter and (run+1) or run
- local f = filter and 1 or 0
- local l = xline - 1
- local n = 1
- local o = newoutput(size)
- local k = 0
- if factor then
- if parts == 4 then
- for i=1,ysize do
- for j=n+f,n+l do
- local v = t[j]
- if v == 0 then
- k = k + 2
- else
- k = k + 1 ; o[k] = extract4(v,4) * 0x11
- k = k + 1 ; o[k] = extract4(v,0) * 0x11
- end
- end
- k = i * xsize
- n = n + xline
- end
- elseif parts == 2 then
- for i=1,ysize do
- for j=n+f,n+l do
- local v = t[j]
- if v == 0 then
- k = k + 4
- else
- k = k + 1 ; o[k] = extract2(v,6) * 0x55
- k = k + 1 ; o[k] = extract2(v,4) * 0x55
- k = k + 1 ; o[k] = extract2(v,2) * 0x55
- k = k + 1 ; o[k] = extract2(v,0) * 0x55
- end
- end
- k = i * xsize
- n = n + xline
- end
- else
- for i=1,ysize do
- for j=n+f,n+l do
- local v = t[j]
- if v == 0 then
- k = k + 8
- else
- k = k + 1 ; if band(v,0x80) ~= 0 then o[k] = 0xFF end -- o[k] = extract1(v,7) * 0xFF
- k = k + 1 ; if band(v,0x40) ~= 0 then o[k] = 0xFF end -- o[k] = extract1(v,6) * 0xFF
- k = k + 1 ; if band(v,0x20) ~= 0 then o[k] = 0xFF end -- o[k] = extract1(v,5) * 0xFF
- k = k + 1 ; if band(v,0x10) ~= 0 then o[k] = 0xFF end -- o[k] = extract1(v,4) * 0xFF
- k = k + 1 ; if band(v,0x08) ~= 0 then o[k] = 0xFF end -- o[k] = extract1(v,3) * 0xFF
- k = k + 1 ; if band(v,0x04) ~= 0 then o[k] = 0xFF end -- o[k] = extract1(v,2) * 0xFF
- k = k + 1 ; if band(v,0x02) ~= 0 then o[k] = 0xFF end -- o[k] = extract1(v,1) * 0xFF
- k = k + 1 ; if band(v,0x01) ~= 0 then o[k] = 0xFF end -- o[k] = extract1(v,0) * 0xFF
- end
- end
- k = i * xsize
- n = n + xline
- end
- end
- else
- if parts == 4 then
- for i=1,ysize do
- for j=n+f,n+l do
- local v = t[j]
- if v == 0 then
- k = k + 2
- else
- k = k + 1 ; o[k] = extract4(v,4)
- k = k + 1 ; o[k] = extract4(v,0)
- end
- end
- k = i * xsize
- n = n + xline
- end
- elseif parts == 2 then
- for i=1,ysize do
- for j=n+f,n+l do
- local v = t[j]
- if v == 0 then
- k = k + 4
- else
- k = k + 1 ; o[k] = extract2(v,6)
- k = k + 1 ; o[k] = extract2(v,4)
- k = k + 1 ; o[k] = extract2(v,2)
- k = k + 1 ; o[k] = extract2(v,0)
- end
- end
- k = i * xsize
- n = n + xline
- end
- else
- for i=1,ysize do
- for j=n+f,n+l do
- local v = t[j]
- if v == 0 then
- k = k + 8
- else
- k = k + 1 ; if band(v,0x80) ~= 0 then o[k] = 1 end -- o[k] = extract1(v,7)
- k = k + 1 ; if band(v,0x40) ~= 0 then o[k] = 1 end -- o[k] = extract1(v,6)
- k = k + 1 ; if band(v,0x20) ~= 0 then o[k] = 1 end -- o[k] = extract1(v,5)
- k = k + 1 ; if band(v,0x10) ~= 0 then o[k] = 1 end -- o[k] = extract1(v,4)
- k = k + 1 ; if band(v,0x08) ~= 0 then o[k] = 1 end -- o[k] = extract1(v,3)
- k = k + 1 ; if band(v,0x04) ~= 0 then o[k] = 1 end -- o[k] = extract1(v,2)
- k = k + 1 ; if band(v,0x02) ~= 0 then o[k] = 1 end -- o[k] = extract1(v,1)
- k = k + 1 ; if band(v,0x01) ~= 0 then o[k] = 1 end -- o[k] = extract1(v,0)
- end
- end
- k = i * xsize
- n = n + xline
- end
- end
- end
- for i=size,xsize * ysize +1,-1 do
- o[i] = nil
- end
- return o, false
- end
-
- local expand_c = pngexpand
-
- local function analyze(colordepth,colorspace,palette,mask)
- -- return bytes, parts, factor
- if palette then
- if colordepth == 16 then
- return 2, false, false
- elseif colordepth == 8 then
- return 1, false, false
- elseif colordepth == 4 then
- return 1, 4, false
- elseif colordepth == 2 then
- return 1, 2, false
- elseif colordepth == 1 then
- return 1, 1, false
- end
- elseif colorspace == "DeviceGray" then
- if colordepth == 16 then
- return mask and 4 or 2, false, false
- elseif colordepth == 8 then
- return mask and 2 or 1, false, false
- elseif colordepth == 4 then
- return 1, 4, true
- elseif colordepth == 2 then
- return 1, 2, true
- elseif colordepth == 1 then
- return 1, 1, true
- end
- else
- if colordepth == 16 then
- return mask and 8 or 6, false, false
- elseif colordepth == 8 then
- return mask and 4 or 3, false, false
- elseif colordepth == 4 then
- return 3, 4, true
- elseif colordepth == 2 then
- return 3, 2, true
- elseif colordepth == 1 then
- return 3, 1, true
- end
- end
- return false, false, false
- end
-
- -- 1 6 4 6 2 6 4 6
- -- 7 7 7 7 7 7 7 7
- -- 5 6 5 6 5 6 5 6
- -- 7 7 7 7 7 7 7 7
- -- 3 6 4 6 3 6 4 6
- -- 7 7 7 7 7 7 7 7
- -- 5 6 5 6 5 6 5 6
- -- 7 7 7 7 7 7 7 7
-
- local function deinterlace(content,xsize,ysize,colordepth,colorspace,palette,mask)
- local slice, parts, factor = analyze(colordepth,colorspace,palette,mask)
- if slice then
- content = openstring(zlibdecompress(content))
- local filter = false
- local output = false
- for pass=1,7 do
- local xstart = xstart[pass]
- local xstep = xstep[pass]
- local ystart = ystart[pass]
- local ystep = ystep[pass]
- local nx = idiv(xsize + xstep - xstart - 1,xstep)
- local ny = idiv(ysize + ystep - ystart - 1,ystep)
- if nx > 0 and ny > 0 then
- local input, filter
- if parts then
- local nxx = ceil(nx*parts/8)
- input, filter = decodestrip(content,nxx,ny,slice)
- input, filter = expand(input,nx,ny,parts,nxx,factor,filter)
- else
- input, filter = decodestrip(content,nx,ny,slice)
- end
- output = transpose(xsize,ysize,slice,pass,input,output,filter)
- end
- -- if pass == 3 then
- -- break -- still looks ok, could be nice for a preroll
- -- end
- end
- return output, parts and 8 or false
- end
- end
-
- -- 1 (palette used), 2 (color used), and 4 (alpha channel used)
-
- -- paeth:
- --
- -- p = a + b - c
- -- pa = abs(p - a) => a + b - c - a => b - c
- -- pb = abs(p - b) => a + b - c - b => a - c
- -- pc = abs(p - c) => a + b - c - c => a + b - c - c => a - c + b - c => pa + pb
-
- local function full(t,k) local v = "\xFF" t[k] = v return v end
-
- local function expandvector(transparent)
- local s = openstring(transparent)
- local n = #transparent
- local r = { }
- for i=0,n-1 do
- r[i] = readstring(s,1) -- readchar
- end
- setmetatableindex(r,full)
- return r
- end
-
- local function createmask_l(content,palette,transparent,xsize,ysize,colordepth,colorspace)
- if palette then
- local r = expandvector(transparent)
- local size = xsize*ysize
- local len = ceil(xsize*colordepth/8) + 1
- local o = newoutput(xsize*ysize)
- local u = setmetatableindex(zero)
- content = zlibdecompress(content)
- content = openstring(content)
- for i=0,ysize-1 do
- local t = readbytetable(content,len)
- local k = i * xsize
- local filter = t[1]
- if filter == 0 then
- elseif filter == 1 then
- for j=3,len do
- t[j] = (t[j] + t[j-1]) % 256
- end
- elseif filter == 2 then
- for j=2,len do
- t[j] = (t[j] + u[j]) % 256
- end
- elseif filter == 3 then
- local j = 2
- t[j] = (t[j] + idiv(u[j],2)) % 256
- for j=3,len do
- t[j] = (t[j] + idiv(t[j-1] + u[j],2)) % 256
- end
- elseif filter == 4 then
- local j = 2
- local p = j - len
- local b = t[p]
- if b < 0 then
- b = - b
- end
- if b > 0 then
- t[j] = (t[j] + b) % 256
- end
- for j=3,len do
- local p = j - len
- local a = t[j-1]
- local b = t[p]
- local c = t[p-1]
- local pa = b - c
- local pb = a - c
- local pc = pa + pb
- if pa < 0 then pa = - pa end
- if pb < 0 then pb = - pb end
- if pc < 0 then pc = - pc end
- t[j] = (t[j] + ((pa <= pb and pa <= pc and a) or (pb <= pc and b) or c)) % 256
- end
- end
- if colordepth == 8 then
- for j=2,len do
- local v = t[j]
- k = k + 1 ; o[k] = r[v]
- end
- elseif colordepth == 4 then
- for j=2,len do
- local v = t[j]
- k = k + 1 ; o[k] = r[extract4(v,4)]
- k = k + 1 ; o[k] = r[extract4(v,0)]
- end
- elseif colordepth == 2 then
- for j=2,len do
- local v = t[j]
- k = k + 1 ; o[k] = r[extract2(v,6)]
- k = k + 1 ; o[k] = r[extract2(v,4)]
- k = k + 1 ; o[k] = r[extract2(v,2)]
- k = k + 1 ; o[k] = r[extract2(v,0)]
- end
- else
- for j=2,len do
- local v = t[j]
- k = k + 1 ; o[k] = r[extract1(v,7)]
- k = k + 1 ; o[k] = r[extract1(v,6)]
- k = k + 1 ; o[k] = r[extract1(v,5)]
- k = k + 1 ; o[k] = r[extract1(v,4)]
- k = k + 1 ; o[k] = r[extract1(v,3)]
- k = k + 1 ; o[k] = r[extract1(v,2)]
- k = k + 1 ; o[k] = r[extract1(v,1)]
- k = k + 1 ; o[k] = r[extract1(v,0)]
- end
- end
- u = t
- end
- return concat(o,"",1,size)
- end
- end
-
- local function createmask_c(content,palette,transparent,xsize,ysize,colordepth,colorspace)
- if palette then
- local r = expandvector(transparent)
- local size = xsize*ysize
- local len = ceil(xsize*colordepth/8)
- local o = newoutput(size)
- content = zlibdecompress(content)
- content = pngapplyfilter(content,len,ysize,1) -- nostrip (saves copy)
- content = openstring(content)
- for i=0,ysize-1 do
- local t = readbytetable(content,len)
- local k = i * xsize
- if colordepth == 8 then
- for j=1,len do
- local v = t[j]
- k = k + 1 ; o[k] = r[v]
- end
- elseif colordepth == 4 then
- for j=1,len do
- local v = t[j]
- k = k + 1 ; o[k] = r[extract4(v,4)]
- k = k + 1 ; o[k] = r[extract4(v,0)]
- end
- elseif colordepth == 2 then
- for j=1,len do
- local v = t[j]
- k = k + 1 ; o[k] = r[extract2(v,6)]
- k = k + 1 ; o[k] = r[extract2(v,4)]
- k = k + 1 ; o[k] = r[extract2(v,2)]
- k = k + 1 ; o[k] = r[extract2(v,0)]
- end
- else
- for j=1,len do
- local v = t[j]
- k = k + 1 ; o[k] = r[extract1(v,7)]
- k = k + 1 ; o[k] = r[extract1(v,6)]
- k = k + 1 ; o[k] = r[extract1(v,5)]
- k = k + 1 ; o[k] = r[extract1(v,4)]
- k = k + 1 ; o[k] = r[extract1(v,3)]
- k = k + 1 ; o[k] = r[extract1(v,2)]
- k = k + 1 ; o[k] = r[extract1(v,1)]
- k = k + 1 ; o[k] = r[extract1(v,0)]
- end
- end
- end
- return concat(o,"",1,size)
- end
- end
-
- local function tocmyk_l(content,colordepth)
- local l = #content
- local t = { }
- local n = 0
- if colordepth == 8 then
- for i=1,l,3 do
- local r, g, b = byte(content,i,i+2)
- n = n + 1 ; t[n] = char(255-r,255-g,255-b,0) -- a tad faster than chars[...]
- end
- else
- for i=1,l,6 do
- local r1, r2, g1, g2, b1, b2 = byte(content,i,i+5)
- n = n + 1 ; t[n] = char(255-r1,255-r2,255-g1,255-g2,255-b1,255-b2,0,0)
- end
- end
- return concat(t)
- end
-
- local tocmyk_c = pngtocmyk or tocmyk_l
-
- local function converttocmyk(content,colorspace,colordepth)
- if colorspace == "DeviceRGB" and colordepth == 8 or colordepth == 16 then
- local done = tocmyk(content,colordepth)
- if done then
- content = done
- colorspace = "DeviceCMYK"
- end
- end
- return content, colorspace
- end
-
- local function switch(v)
- if v then
- filtermask = filtermask_l
- decodemask = decodemask_l
- decodestrip = decodestrip_l
- transpose = transpose_l
- expand = expand_l
- createmask = createmask_l
- tocmyk = tocmyk_l
- else
- filtermask = filtermask_c
- decodemask = decodemask_c
- decodestrip = decodestrip_c
- transpose = transpose_c
- expand = expand_c
- createmask = createmask_c
- tocmyk = tocmyk_c
- end
- end
-
- if pngapplyfilter then
- switch(false)
- directives.register("graphics.png.purelua",switch)
- else
- switch(true)
- end
-
- local alwaysdecode = false -- trucky with palettes
- local compresslevel = 3
-
- directives.register("graphics.png.recompress", function(v)
- alwaysdecode = v
- end)
-
- directives.register("graphics.png.compresslevel", function(v)
- v = tonumber(v)
- if compresslevel >= 0 or compresslevel <= 9 then
- compresslevel = v
- end
- end)
-
- function injectors.png(specification,method) -- todo: method in specification
- if specification.error then
- return
- end
- local filename = specification.filename
- if not filename then
- return
- end
- local colorspace = specification.colorspace
- if not colorspace then
- return
- end
- local interlace = specification.interlace or 0
- if interlace == 1 then
- interlace = true
- elseif interlace == 0 then
- interlace = false
- else
- report_png("unknown interlacing %i",interlace)
- return
- end
- local tables = specification.tables
- if not tables then
- return
- end
- local idat = tables.idat
- if not idat then
- return
- end
- local pngfile = newcontent(filename,method)
- if not pngfile then
- return
- end
- local content = idat(pngfile,true)
- tables.idat = false
- --
- -- if tables.gama then
- -- report_png("ignoring gamma correction")
- -- end
- --
- local xsize = specification.xsize
- local ysize = specification.ysize
- local colordepth = specification.colordepth or 8
- local mask = false
- local transparent = false
- local palette = false
- local enforcecmyk = specification.enforcecmyk
- local colors = 1
- if colorspace == 0 then -- gray | image b
- colorspace = "DeviceGray"
- transparent = true
- elseif colorspace == 2 then -- rgb | image c
- colorspace = "DeviceRGB"
- colors = 3
- transparent = true
- elseif colorspace == 3 then -- palette | image c+i
- colorspace = "DeviceRGB"
- palette = true
- transparent = true
- elseif colorspace == 4 then -- gray | alpha | image b
- colorspace = "DeviceGray"
- mask = true
- elseif colorspace == 6 then -- rgb | alpha | image c
- colorspace = "DeviceRGB"
- colors = 3
- mask = true
- else
- report_png("unknown colorspace %i",colorspace)
- return
- end
- --
- if transparent then
- local trns = tables.trns
- if trns then
- transparent = trns(pngfile,true)
- if transparent == "" then
- transparent = false
- end
- tables.trns = false
- else
- transparent = false
- end
- end
- --
- local decode = alwaysdecode -- tricky, might go away
- local filter = pdfconstant("FlateDecode")
- local major = pdfmajorversion()
- local minor = pdfminorversion()
- if major > 1 then
- -- we're okay
- elseif minor < 5 and colordepth == 16 then
- report_png("16 bit colordepth not supported in pdf < 1.5")
- return
- elseif minor < 4 and (mask or transparent) then
- report_png("alpha channels not supported in pdf < 1.4")
- return
- elseif minor < 2 then
- report_png("you'd better use a version > 1.2")
- return
- -- decode = true
- end
- --
- -- todo: compresslevel (or delegate)
- --
- if palette then
- local plte = tables.plte
- if plte then
- palette = plte(pngfile,true)
- if palette == "" then
- palette = false
- end
- tables.plte = false
- else
- palette = false
- end
- end
- --
- if interlace then
- local r, p = deinterlace(content,xsize,ysize,colordepth,colorspace,palette,mask)
- if not r then
- return
- end
- if p then
- colordepth = p
- end
- if mask then
- if not (colordepth == 8 or colordepth == 16) then
- report_png("mask can't be split from the image")
- return
- end -- get rid of bpp:
- content, mask = filtermask(r,xsize,ysize,colordepth,colorspace,false)
- else
- content = convert(r) -- can be in deinterlace if needed
- end
- if enforcecmyk then
- content, colorspace = converttocmyk(content,colorspace,colordepth)
- end
- if compresslevel > 0 then
- content = zlibcompress(content,compresslevel)
- else
- filter = nil
- end
- decode = true
- elseif mask then
- if not (colordepth == 8 or colordepth == 16) then
- report_png("mask can't be split from the image")
- return
- end
- content = zlibdecompress(content)
- content, mask = decodemask(content,xsize,ysize,colordepth,colorspace)
- if enforcecmyk and not palette then
- content, colorspace = converttocmyk(content,colorspace,colordepth)
- end
- if compresslevel > 0 then
- content = zlibcompress(content,compresslevel)
- else
- filter = nil
- end
- decode = true -- we don't copy the filter byte
- elseif transparent then
- -- in test suite
- -- how about decode/recompress here
- if palette then
- mask = createmask(content,palette,transparent,xsize,ysize,colordepth,colorspace)
- else
- pallette = false
- end
- elseif decode or (enforcecmyk and not palette) then
- -- this one needs checking
- local bytes = analyze(colordepth,colorspace)
- if bytes then
- content = zlibdecompress(content)
- content = decodestrip(openstring(content),xsize,ysize,bytes)
- if enforcecmyk and not palette then
- content, colorspace = converttocmyk(content,colorspace,colordepth)
- end
- if compresslevel > 0 then
- content = zlibcompress(content,compresslevel)
- else
- filter = nil
- end
- else
- return
- end
- decode = true -- due to enforcecmyk
- else
- -- print("PASS ON")
- end
- if palette then
- local colorspace = "DeviceRGB"
- local nofbytes = 3
- if enforcecmyk then
- palette = converttocmyk(palette,colorspace,8)
- colorspace = "DeviceCMYK"
- nofbytes = 4
- end
- palette = pdfarray {
- pdfconstant("Indexed"),
- pdfconstant(colorspace),
- idiv(#palette,nofbytes),
- pdfreference(pdfflushstreamobject(palette)),
- }
- end
- pngfile:close()
- local xobject = pdfdictionary {
- Type = pdfconstant("XObject"),
- Subtype = pdfconstant("Image"),
- -- BBox = pdfarray { 0, 0, xsize, ysize },
- Width = xsize,
- Height = ysize,
- BitsPerComponent = colordepth,
- Filter = filter,
- ColorSpace = palette or pdfconstant(colorspace),
- Length = #content,
- } + specification.attr
- if mask then
- local d = pdfdictionary {
- Type = pdfconstant("XObject"),
- Subtype = pdfconstant("Image"),
- Width = xsize,
- Height = ysize,
- BitsPerComponent = palette and 8 or colordepth,
- ColorSpace = pdfconstant("DeviceGray"),
- }
- xobject.SMask = pdfreference(pdfflushstreamobject(mask,d()))
- end
- if not decode then
- xobject.DecodeParms = pdfdictionary {
- Colors = colors,
- Columns = xsize,
- BitsPerComponent = colordepth,
- Predictor = 15,
- }
- end
- if trace then
- report_png("%s: width %i, height %i, colordepth %i, size %i, palette %l, mask %l, transparent %l, decode %l",filename,xsize,ysize,colordepth,#content,palette,mask,transparent,decode)
- end
- if specification.colorref then
- xobject.ColorSpace = pdfreference(specification.colorref)
- end
- local width = specification.width or xsize * 65536
- local height = specification.height or ysize * 65536
- return createimage {
- bbox = { 0, 0, width/xsize, height/ysize }, -- mandate
- transform = specification.transform,
- nolength = true,
- nobbox = true,
- notype = true,
- stream = content,
- attr = xobject(),
- }
- end
-
-end
-
-do
-
- local function pack(specification,what)
- local t = { }
- local n = 0
- local s = specification.colorspace
- local d = specification.data
- local x = specification.xsize
- local y = specification.ysize
- if what == "mask" then
- d = specification.mask
- s = 1
- elseif what == "indexed" then
- s = 1
- elseif what == "index" then
- d = specification.index
- s = - s
- end
- if s > 0 then
- if s == 1 then
- for i=1,y do
- local r = d[i]
- for j=1,x do
- n = n + 1 ; t[n] = chars[r[j]]
- end
- end
- elseif s == 2 then
- for i=1,y do
- local r = d[i]
- for j=1,x do
- local c = r[j]
- n = n + 1 ; t[n] = chars[c[1]]
- n = n + 1 ; t[n] = chars[c[2]]
- n = n + 1 ; t[n] = chars[c[3]]
- -- n = n + 1 ; t[n] = char(c[1],c[2],c[3]) -- test this
- end
- end
- elseif s == 3 then
- for i=1,y do
- local r = d[i]
- for j=1,x do
- local c = r[j]
- n = n + 1 ; t[n] = chars[c[1]]
- n = n + 1 ; t[n] = chars[c[2]]
- n = n + 1 ; t[n] = chars[c[3]]
- n = n + 1 ; t[n] = chars[c[4]]
- -- n = n + 1 ; t[n] = char(c[1],c[2],c[3],c[4]) -- test this
- end
- end
- end
- return concat(t)
- else
- local z = d[0] and 0 or 1
- if s == -1 then
- local f = formatters["%02X"]
- for i=z,#d do
- n = n + 1 ; t[n] = f(d[i])
- end
- elseif s == -2 then
- local f = formatters["%02X%02X%02X"]
- for i=z,#d do
- local c = d[i]
- n = n + 1 ; t[n] = f(c[1],c[2],c[3])
- end
- elseif s == -3 then
- local f = formatters["%02X%02X%02X%02X"]
- for i=z,#d do
- local c = d[i]
- n = n + 1 ; t[n] = f(c[1],c[2],c[3],c[4])
- end
- end
- return "<" .. concat(t," ") .. ">"
- end
- return ""
- end
-
- function injectors.bitmap(specification)
- local data = specification.data
- if not data then
- return
- end
- local xsize = specification.xsize or 0
- local ysize = specification.ysize or 0
- if xsize == 0 or ysize == 0 then
- return
- end
- local colorspace = specification.colorspace or 1
- if colorspace == 1 then
- colorspace = "DeviceGray"
- elseif colorspace == 2 then
- colorspace = "DeviceRGB"
- elseif colorspace == 3 then
- colorspace = "DeviceCMYK"
- end
- local colordepth = (specification.colordepth or 2) == 16 or 8
- local index = specification.index
- local content = pack(specification,index and "indexed" or "data")
- local mask = specification.mask
- local colorspace = pdfconstant(colorspace)
- if index then
- colorspace = pdfarray {
- pdfconstant("Indexed"),
- colorspace,
- #index + (index[0] and 0 or -1), -- upper index
- pdfverbose(pack(specification,"index"))
- }
- end
- local xobject = pdfdictionary {
- Type = pdfconstant("XObject"),
- Subtype = pdfconstant("Image"),
- BBox = pdfarray { 0, 0, xsize, ysize },
- Width = xsize,
- Height = ysize,
- BitsPerComponent = colordepth,
- ColorSpace = colorspace,
- Length = #content, -- specification.length
- }
- if mask then
- local d = pdfdictionary {
- Type = pdfconstant("XObject"),
- Subtype = pdfconstant("Image"),
- Width = xsize,
- Height = ysize,
- BitsPerComponent = colordepth,
- ColorSpace = pdfconstant("DeviceGray"),
- }
- xobject.SMask = pdfreference(pdfflushstreamobject(pack(specification,"mask"),d()))
- end
- return createimage {
- bbox = { 0, 0, specification.width/xsize, specification.height/ysize }, -- mandate
- -- nolength = true,
- nobbox = true,
- notype = true,
- stream = content,
- attr = xobject(),
- }
- end
-
- backends.pdf.codeinjections.bitmap = injectors.bitmap
-
-end
-
--- local function validcompression(data)
--- local d = utilities.streams.openstring(data)
--- local b1 = utilities.streams.readbyte(d)
--- local b2 = utilities.streams.readbyte(d)
--- print(b1,b2)
--- if (b1 * 256 + b2) % 31 ~= 0 then
--- return false, "no zlib compressed file"
--- end
--- local method = band(b1,15)
--- if method ~= 8 then
--- return false, "method 8 expected"
--- end
--- local detail = band(rshift(b1,4),15)
--- if detail > 7 then
--- return false, "window 32 expected"
--- end
--- local preset = band(rshift(b2,5),1)
--- if preset ~= 0 then
--- return false, "unexpected preset dictionary"
--- end
--- return true
--- end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lpdf-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/lpdf-ini.lua
index 2163e874852..1098ef8fa38 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lpdf-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lpdf-ini.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['lpdf-ini'] = {
version = 1.001,
+ optimize = true,
comment = "companion to lpdf-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
@@ -7,6 +8,9 @@ if not modules then modules = { } end modules ['lpdf-ini'] = {
}
-- beware of "too many locals" here
+--
+-- The lua files are still hybrid ones but we keep that as a reference for the
+-- lmt variants that started out as copies.
local setmetatable, getmetatable, type, next, tostring, tonumber, rawset = setmetatable, getmetatable, type, next, tostring, tonumber, rawset
local char, byte, format, gsub, concat, match, sub, gmatch = string.char, string.byte, string.format, string.gsub, table.concat, string.match, string.sub, string.gmatch
@@ -25,7 +29,6 @@ local report_finalizing = logs.reporter("backend","finalizing")
local report_blocked = logs.reporter("backend","blocked")
local implement = interfaces.implement
-local two_strings = interfaces.strings[2]
local context = context
@@ -295,7 +298,9 @@ do
if v < 0x10000 then
v = format("%04x",v)
else
- v = format("%04x%04x",rshift(v,10),v%1024+0xDC00)
+ v = v - 0x10000
+ v = format("%04x%04x",rshift(v,10)+0xD800,v%1024+0xDC00)
+ -- v = format("%04x%04x",rshift(v-0x10000,10)+0xD800,v%1024+0xDC00)
end
t[k] = v
return v
@@ -316,7 +321,7 @@ do
local pattern = C(4) / function(s) -- needs checking !
local now = tonumber(s,16)
if more > 0 then
- now = (more-0xD800)*0x400 + (now-0xDC00) + 0x10000 -- the 0x10000 smells wrong
+ now = (more-0xD800)*0x400 + (now-0xDC00) + 0x10000
more = 0
return utfchar(now)
elseif now >= 0xD800 and now <= 0xDBFF then
@@ -445,10 +450,14 @@ do
local f_key_null = formatters["/%s null"]
local f_key_value = formatters["/%s %s"]
- local f_key_dictionary = formatters["/%s << % t >>"]
- local f_dictionary = formatters["<< % t >>"]
- local f_key_array = formatters["/%s [ % t ]"]
- local f_array = formatters["[ % t ]"]
+ -- local f_key_dictionary = formatters["/%s << % t >>"]
+ -- local f_dictionary = formatters["<< % t >>"]
+ local f_key_dictionary = formatters["/%s << %s >>"]
+ local f_dictionary = formatters["<< %s >>"]
+ -- local f_key_array = formatters["/%s [ % t ]"]
+ -- local f_array = formatters["[ % t ]"]
+ local f_key_array = formatters["/%s [ %s ]"]
+ local f_array = formatters["[ %s ]"]
local f_key_number = formatters["/%s %N"] -- always with max 9 digits and integer is possible
local f_tonumber = formatters["%N"] -- always with max 9 digits and integer is possible
@@ -501,8 +510,9 @@ do
if e then
r[n+1] = e
end
+ r = concat(r," ")
if contentonly then
- return concat(r," ")
+ return r
elseif key then
return f_key_dictionary(key,r)
else
@@ -550,8 +560,9 @@ do
if e then
r[tn+1] = e
end
+ r = concat(r," ")
if contentonly then
- return concat(r, " ")
+ return r
elseif key then
return f_key_array(key,r)
else
@@ -1553,16 +1564,16 @@ end
-- interface
implement { name = "lpdf_collectedresources", actions = { lpdf.collectedresources, context } }
-implement { name = "lpdf_addtocatalog", arguments = two_strings, actions = lpdf.addtocatalog }
-implement { name = "lpdf_addtoinfo", arguments = two_strings, actions = function(a,b,c) lpdf.addtoinfo(a,b,c) end } -- gets adapted
-implement { name = "lpdf_addtonames", arguments = two_strings, actions = lpdf.addtonames }
-implement { name = "lpdf_addtopageattributes", arguments = two_strings, actions = lpdf.addtopageattributes }
-implement { name = "lpdf_addtopagesattributes", arguments = two_strings, actions = lpdf.addtopagesattributes }
-implement { name = "lpdf_addtopageresources", arguments = two_strings, actions = lpdf.addtopageresources }
-implement { name = "lpdf_adddocumentextgstate", arguments = two_strings, actions = function(a,b) lpdf.adddocumentextgstate (a,pdfverbose(b)) end }
-implement { name = "lpdf_adddocumentcolorspace", arguments = two_strings, actions = function(a,b) lpdf.adddocumentcolorspace(a,pdfverbose(b)) end }
-implement { name = "lpdf_adddocumentpattern", arguments = two_strings, actions = function(a,b) lpdf.adddocumentpattern (a,pdfverbose(b)) end }
-implement { name = "lpdf_adddocumentshade", arguments = two_strings, actions = function(a,b) lpdf.adddocumentshade (a,pdfverbose(b)) end }
+implement { name = "lpdf_addtocatalog", arguments = "2 strings", actions = lpdf.addtocatalog }
+implement { name = "lpdf_addtoinfo", arguments = "2 strings", actions = function(a,b,c) lpdf.addtoinfo(a,b,c) end } -- gets adapted
+implement { name = "lpdf_addtonames", arguments = "2 strings", actions = lpdf.addtonames }
+implement { name = "lpdf_addtopageattributes", arguments = "2 strings", actions = lpdf.addtopageattributes }
+implement { name = "lpdf_addtopagesattributes", arguments = "2 strings", actions = lpdf.addtopagesattributes }
+implement { name = "lpdf_addtopageresources", arguments = "2 strings", actions = lpdf.addtopageresources }
+implement { name = "lpdf_adddocumentextgstate", arguments = "2 strings", actions = function(a,b) lpdf.adddocumentextgstate (a,pdfverbose(b)) end }
+implement { name = "lpdf_adddocumentcolorspace", arguments = "2 strings", actions = function(a,b) lpdf.adddocumentcolorspace(a,pdfverbose(b)) end }
+implement { name = "lpdf_adddocumentpattern", arguments = "2 strings", actions = function(a,b) lpdf.adddocumentpattern (a,pdfverbose(b)) end }
+implement { name = "lpdf_adddocumentshade", arguments = "2 strings", actions = function(a,b) lpdf.adddocumentshade (a,pdfverbose(b)) end }
-- more helpers: copy from lepd to lpdf
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lpdf-lmt.lua b/Master/texmf-dist/tex/context/base/mkiv/lpdf-lmt.lua
deleted file mode 100644
index 3966143b4cd..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/lpdf-lmt.lua
+++ /dev/null
@@ -1,2765 +0,0 @@
-if not modules then modules = { } end modules ['lpdf-lmt'] = {
- 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 code below was originally in back-lpd.lua but it makes more sense in
--- this namespace. I will rename variables.
---
--- There is no way that a lua based backend can compete with the original one
--- for relative simple text runs. And we're talking seconds here on say 500
--- pages with paragraphs alternativng between three fonts and colors. But such
--- documents are rare so in practice we are quite okay, especially because in
--- ConTeXt we can gain quite a bit elsewhere. So, when we loose 30% on such
--- simple documents, we break even on for instance the manual, and gain 30% on
--- Thomas's turture test (also for other reasons). But .. who knows what magic
--- I can cook up in due time.
-
--- If you consider this complex, watch:
---
--- https://www.youtube.com/watch?v=6H-cAzfB2qo
---
--- or in distractionmode:
---
--- https://www.youtube.com/watch?v=TYuTE_1jvvE
--- https://www.youtube.com/watch?v=nnicGKX3lvM
---
--- For the moment we have to support the built in backend as well as the alternative. So
--- the next interface is suboptimal and will change at some time. At that moment I will
--- also optimize and extend.
-
-local type, next, unpack, tonumber = type, next, unpack, tonumber
-local char, rep, find = string.char, string.rep, string.find
-local formatters, splitupstring = string.formatters, string.splitup
-local band, extract = bit32.band, bit32.extract
-local concat, sortedhash = table.concat, table.sortedhash
-local setmetatableindex = table.setmetatableindex
-local loaddata = io.loaddata
-
-local bpfactor <const> = number.dimenfactors.bp
-
-local md5HEX = md5.HEX
-local osuuid = os.uuid
-local zlibcompress = (xzip or zlib).compress
-
-local nuts = nodes.nuts
-local tonut = nodes.tonut
-
-local getdata = nuts.getdata
-local getsubtype = nuts.getsubtype
-local getwhd = nuts.getwhd
-local flushlist = nuts.flush_list
-
-local pdfincludeimage = lpdf.includeimage
-local pdfgetfontname = lpdf.getfontname
-local pdfgetfontobjnumber = lpdf.getfontobjnumber
-
-local pdfreserveobject = lpdf.reserveobject
-local pdfpagereference = lpdf.pagereference
-local pdfflushobject = lpdf.flushobject
-local pdfreference = lpdf.reference
-local pdfdictionary = lpdf.dictionary
-local pdfarray = lpdf.array
-local pdfconstant = lpdf.constant
-local pdfflushstreamobject = lpdf.flushstreamobject
-local pdfliteral = lpdf.literal -- not to be confused with a whatsit!
-
-local pdf_pages = pdfconstant("Pages")
-local pdf_page = pdfconstant("Page")
-local pdf_xobject = pdfconstant("XObject")
-local pdf_form = pdfconstant("Form")
-
-local fonthashes = fonts.hashes
-local characters = fonthashes.characters
-local descriptions = fonthashes.descriptions
-local parameters = fonthashes.parameters
-local properties = fonthashes.properties
-
-local report = logs.reporter("backend")
-
--- used variables
-
-local pdf_h, pdf_v
-local need_tm, need_tf, cur_tmrx, cur_factor, cur_f, cur_e
-local need_width, need_mode, done_width, done_mode
-local mode
-local f_pdf_cur, f_pdf, fs_cur, fs, f_cur
-local tj_delta, cw
-local usedfonts, usedxforms, usedximages, usedxgroups
-local getxformname, getximagename
-local boundingbox, shippingmode, objectnumber
-local tmrx, tmry, tmsx, tmsy, tmtx, tmty
-local cmrx, cmry, cmsx, cmsy, cmtx, cmty
-
-local function usefont(t,k) -- a bit redundant hash
- local v = pdfgetfontname(k)
- t[k] = v
- return v
-end
-
-local function reset_variables(specification)
- pdf_h, pdf_v = 0, 0
- cmrx, cmry = 1.0, 1.0
- cmsx, cmsy = 0.0, 0.0
- cmtx, cmty = 0.0, 0.0
- tmrx, tmry = 1.0, 1.0
- tmsx, tmsy = 0.0, 0.0
- tmtx, tmty = 0.0, 0.0
- need_tm = false
- need_tf = false
- need_width = 0
- need_mode = 0
- done_width = false
- done_mode = false
- mode = "page"
- shippingmode = specification.shippingmode
- objectnumber = specification.objectnumber
- cur_tmrx = 0.0
- f_cur = 0
- f_pdf_cur = 0 -- nullfont
- f_pdf = 0 -- nullfont
- fs_cur = 0
- fs = 0
- cur_factor = 0
- cur_f = false
- cur_e = false
- tj_delta = 0.0
- cw = 0.0
- usedfonts = setmetatableindex(usefont)
- usedxforms = { }
- usedximages = { }
- -- usedxgroups = { }
- boundingbox = specification.boundingbox
-end
-
--- buffer
-
-local buffer = lua.newtable(1024,0) -- { }
-local b = 0
-
-local function reset_buffer()
- b = 0
-end
-
--- fonts
-
-local fontcharacters
-local fontdescriptions
-local fontparameters
-local fontproperties
-local usedcharacters = setmetatableindex("table")
-local pdfcharacters
-
-local horizontalmode = true
------ widefontmode = true
-local scalefactor = 1
-local threshold = 655360
-local tjfactor <const> = 100 / 65536
-
-lpdf.usedcharacters = usedcharacters
-
-local function updatefontstate(font)
- fontcharacters = characters[font]
- fontdescriptions = descriptions[font]
- fontparameters = parameters[font]
- fontproperties = properties[font]
- local size = fontparameters.size -- or bad news
- local designsize = fontparameters.designsize or size
- pdfcharacters = usedcharacters[font]
- horizontalmode = fontparameters.writingmode ~= "vertical"
- -- widefontmode = fontproperties.encodingbytes == 2
- scalefactor = (designsize/size) * tjfactor
- local fthreshold = fontproperties.threshold
- threshold = (fthreshold and (size * fthreshold / 100)) or 655360
-end
-
--- helpers
-
-local f_cm = formatters["%.6N %.6N %.6N %.6N %.6N %.6N cm"]
-local f_tm = formatters["%.6N %.6N %.6N %.6N %.6N %.6N Tm"]
-
-local saved_text_pos_v = 0
-local saved_text_pos_h = 0
-
-local function begin_text()
- saved_text_pos_h = pdf_h
- saved_text_pos_v = pdf_v
- b = b + 1 ; buffer[b] = "BT"
- need_tf = true
- need_width = 0
- need_mode = 0
- mode = "text"
-end
-
-local function end_text()
- if done_width then
- b = b + 1 ; buffer[b] = "0 w"
- done_width = false
- end
- if done_mode then
- b = b + 1 ; buffer[b] = "0 Tr"
- done_mode = false
- end
- b = b + 1 ; buffer[b] = "ET"
- pdf_h = saved_text_pos_h
- pdf_v = saved_text_pos_v
- mode = "page"
-end
-
-local saved_chararray_pos_h
-local saved_chararray_pos_v
-
-local saved_b = 0
-
-local function begin_chararray()
- saved_chararray_pos_h = pdf_h
- saved_chararray_pos_v = pdf_v
- cw = horizontalmode and saved_chararray_pos_h or - saved_chararray_pos_v
- tj_delta = 0
- saved_b = b
- b = b + 1 ; buffer[b] = " ["
- mode = "chararray"
-end
-
-local function end_chararray()
- b = b + 1 ; buffer[b] = "] TJ"
- buffer[saved_b] = concat(buffer,"",saved_b,b)
- b = saved_b
- pdf_h = saved_chararray_pos_h
- pdf_v = saved_chararray_pos_v
- mode = "text"
-end
-
-local function begin_charmode()
- b = b + 1 ; buffer[b] = "<"
- mode = "char"
-end
-
-local function end_charmode()
- b = b + 1 ; buffer[b] = ">"
- mode = "chararray"
-end
-
-local function calc_pdfpos(h,v)
- -- mostly char
- if mode == "page" then
- cmtx = h - pdf_h
- cmty = v - pdf_v
- return h ~= pdf_h or v ~= pdf_v
- elseif mode == "text" then
- tmtx = h - saved_text_pos_h
- tmty = v - saved_text_pos_v
- return h ~= pdf_h or v ~= pdf_v
- elseif horizontalmode then
- tmty = v - saved_text_pos_v
- tj_delta = cw - h
- return tj_delta ~= 0 or v ~= pdf_v
- else
- tmtx = h - saved_text_pos_h
- tj_delta = cw + v
- return tj_delta ~= 0 or h ~= pdf_h
- end
-end
-
-local function pdf_set_pos(h,v)
- local move = calc_pdfpos(h,v)
- if move then
- b = b + 1 ; buffer[b] = f_cm(cmrx, cmsx, cmsy, cmry, cmtx*bpfactor, cmty*bpfactor)
- pdf_h = pdf_h + cmtx
- pdf_v = pdf_v + cmty
- end
-end
-
-local function pdf_reset_pos()
- if mode == "page" then
- cmtx = - pdf_h
- cmty = - pdf_v
- if pdf_h == 0 and pdf_v == 0 then
- return
- end
- elseif mode == "text" then
- tmtx = - saved_text_pos_h
- tmty = - saved_text_pos_v
- if pdf_h == 0 and pdf_v == 0 then
- return
- end
- elseif horizontalmode then
- tmty = - saved_text_pos_v
- tj_delta = cw
- if tj_delta == 0 and pdf_v == 0 then
- return
- end
- else
- tmtx = - saved_text_pos_h
- tj_delta = cw
- if tj_delta == 0 and pdf_h == 0 then
- return
- end
- end
- b = b + 1 ; buffer[b] = f_cm(cmrx, cmsx, cmsy, cmry, cmtx*bpfactor, cmty*bpfactor)
- pdf_h = pdf_h + cmtx
- pdf_v = pdf_v + cmty
-end
-
-local function pdf_set_pos_temp(h,v)
- local move = calc_pdfpos(h,v)
- if move then
- b = b + 1 ; buffer[b] = f_cm(cmrx, cmsx, cmsy, cmry, cmtx*bpfactor, cmty*bpfactor)
- end
-end
-
--- these dummy returns makes using them a bit faster
-
-local function pdf_end_string_nl()
- if mode == "char" then
- end_charmode()
- return end_chararray()
- elseif mode == "chararray" then
- return end_chararray()
- end
-end
-
-local function pdf_goto_textmode()
- if mode == "page" then
- pdf_reset_pos()
- return begin_text()
- elseif mode ~= "text" then
- if mode == "char" then
- end_charmode()
- return end_chararray()
- else -- if mode == "chararray" then
- return end_chararray()
- end
- end
-end
-
-local function pdf_goto_pagemode()
- if mode ~= "page" then
- if mode == "char" then
- end_charmode()
- end_chararray()
- return end_text()
- elseif mode == "chararray" then
- end_chararray()
- return end_text()
- elseif mode == "text" then
- return end_text()
- end
- end
-end
-
-local function pdf_goto_fontmode()
- if mode == "char" then
- end_charmode()
- end_chararray()
- end_text()
- elseif mode == "chararray" then
- end_chararray()
- end_text()
- elseif mode == "text" then
- end_text()
- end
- pdf_reset_pos()
- mode = "page"
-end
-
--- characters
-
-local flushcharacter do
-
- local round = math.round
-
- -- across pages ... todo: clean up because we don't need to pass the font
- -- as fontparameters already has checked / set it we can also have a variable
- -- for it so
-
- local naturalwidth = nil
-
- local naturalwidths = setmetatableindex(function(t,font)
- local d = descriptions[font]
- local c = characters[font]
- local f = parameters[font].hfactor
- local v = setmetatableindex(function(t,char)
- local e = d and d[char]
- local w
- if e then
- w = e.width
- if w then
- w = w * f
- end
- end
- if not w then
- e = c[char]
- if e then
- w = e.width or 0
- end
- end
- if not w then
- w = 0
- end
- t[char] = w
- return w
- end)
- t[font] = v
- return v
- end)
-
- local function setup_fontparameters(font,factor,f,e)
- local slant = fontparameters.slantfactor or 0
- local extend = fontparameters.extendfactor or 1
- local squeeze = fontparameters.squeezefactor or 1
- local expand = 1 + factor / 1000000
- local format = fontproperties.format
- if e then
- extend = extend * e
- end
- tmrx = expand * extend
- tmsy = slant
- tmry = squeeze
- need_width = fontparameters.width or 0
- need_mode = fontparameters.mode or 0
- f_cur = font
- f_pdf = usedfonts[font] -- cache
- cur_factor = factor
- cur_f = f
- cur_e = e
- tj_delta = 0
- fs = fontparameters.size * bpfactor
- if f then
- fs = fs * f
- end
- -- kind of special:
- if format == "opentype" or format == "type1" then
- fs = fs * 1000 / fontparameters.units -- can we avoid this ?
- end
- --
- naturalwidth = naturalwidths[font]
- end
-
- -- This only saves a little on hz because there we switch a lot of
- -- instances.
-
- -- local lastslant, lastextend, lastsqueeze, lastformat, lastsize, lastwidth, lastmode, lastused, lastfont
-
- -- local function setup_fontparameters(font,factor,f,e)
- -- if font ~= lastfont then
- -- lastslant = fontparameters.slantfactor or 0
- -- lastextend = fontparameters.extendfactor or 1
- -- lastsqueeze = fontparameters.squeezefactor or 1
- -- lastformat = fontproperties.format
- -- lastsize = fontparameters.size * bpfactor
- -- if format == "opentype" or format == "type1" then
- -- lastsize = lastsize * 1000 / fontparameters.units -- can we avoid this ?
- -- end
- -- lastwidth = fontparameters.width
- -- lastmode = fontparameters.mode
- -- lastused = usedfonts[font] -- cache
- -- lastfont = font
- -- end
- -- local expand = 1 + factor / 1000000
- -- if e then
- -- tmrx = expand * lastextend * e
- -- else
- -- tmrx = expand * lastextend
- -- end
- -- tmsy = lastslant
- -- tmry = lastsqueeze
- -- need_width = lastwidth
- -- need_mode = lastmode
- -- f_cur = lastfont
- -- f_pdf = lastused
- -- cur_factor = factor
- -- cur_f = f
- -- cur_e = e
- -- tj_delta = 0
- -- if f then
- -- fs = lastsize * f
- -- else
- -- fs = lastsize
- -- end
- -- end
-
- local f_width = formatters["%.6N w"]
- local f_mode = formatters["%i Tr"] -- can be hash
- local f_font = formatters["/F%i %.6N Tf"] -- can be hash
-
- local s_width <const> = "0 w"
- local s_mode <const> = "0 Tr"
-
- local function set_font()
- -- if need_width and need_width ~= 0 then
- if need_width ~= 0 then
- b = b + 1 ; buffer[b] = f_width(bpfactor * need_width / 1000)
- done_width = true
- elseif done_width then
- b = b + 1 ; buffer[b] = s_width
- done_width = false
- end
- -- if need_mode and need_mode ~= 0 then
- if need_mode ~= 0 then
- b = b + 1 ; buffer[b] = f_mode(need_mode)
- done_mode = true
- elseif done_mode then
- b = b + 1 ; buffer[b] = s_mode
- done_mode = false
- end
- b = b + 1 ; buffer[b] = f_font(f_pdf,fs)
- f_pdf_cur = f_pdf
- fs_cur = fs
- need_tf = false
- need_tm = true
- end
-
- local function set_textmatrix(h,v)
- local move = calc_pdfpos(h,v)
- if need_tm or move then
- b = b + 1 ; buffer[b] = f_tm(tmrx, tmsx, tmsy, tmry, tmtx*bpfactor, tmty*bpfactor)
- pdf_h = saved_text_pos_h + tmtx
- pdf_v = saved_text_pos_v + tmty
- need_tm = false
- end
- cur_tmrx = tmrx
- end
-
- local f_hex_4 = formatters["%04X"]
- local f_hex_2 = formatters["%02X"]
-
- local h_hex_4 = setmetatableindex(function(t,k) -- we already have this somewhere
- if k < 256 then -- maybe 512
- -- not sparse in this range
- for i=0,255 do
- t[i] = f_hex_4(i)
- end
- return t[k]
- else
- local v = f_hex_4(k)
- t[k] = v
- return v
- end
- end)
- local h_hex_2 = setmetatableindex(function(t,k) -- we already have this somewhere
- local v = k < 256 and f_hex_2(k) or "00"
- t[k] = v
- return v
- end)
-
- local trace_threshold = false trackers.register("backends.pdf.threshold", function(v) trace_threshold = v end)
-
- flushcharacter = function(current,pos_h,pos_v,pos_r,font,char,data,f,e,factor) -- ,naturalwidth,width)
- if need_tf or font ~= f_cur or f_pdf ~= f_pdf_cur or fs ~= fs_cur or mode == "page" then
- pdf_goto_textmode()
- setup_fontparameters(font,factor,f,e)
- set_font()
- elseif cur_tmrx ~= tmrx or cur_factor ~= factor or cur_f ~= f or cur_e ~= e then
- setup_fontparameters(font,factor,f,e)
- need_tm = true
- end
- local move = calc_pdfpos(pos_h,pos_v)
-
- -- if trace_threshold then
- -- report(
- -- "font %i, char %C, factor %i, naturalwidth %p, move %l, tm %l, hpos %p, delta %p, threshold %p, cw %p",
- -- font,char,factor,naturalwidth[char],move,need_tm,pos_h,tj_delta,threshold,cw
- -- )
- -- end
-
- if move or need_tm then
- if not need_tm then
- if horizontalmode then
- if (saved_text_pos_v + tmty) ~= pdf_v then
- need_tm = true
- elseif tj_delta >= threshold or tj_delta <= -threshold then
- need_tm = true
- end
- else
- if (saved_text_pos_h + tmtx) ~= pdf_h then
- need_tm = true
- elseif tj_delta >= threshold or tj_delta <= -threshold then
- need_tm = true
- end
- end
- end
- if need_tm then
- pdf_goto_textmode()
- set_textmatrix(pos_h,pos_v)
- begin_chararray()
- move = calc_pdfpos(pos_h,pos_v)
- end
- if move then
- local d = tj_delta * scalefactor
- if d <= -0.5 or d >= 0.5 then
- if mode == "char" then
- end_charmode()
- end
- b = b + 1 ; buffer[b] = round(d) -- or f_skip(d)
- end
- cw = cw - tj_delta
- end
- end
-
- if mode == "chararray" then
- begin_charmode()
- end
-
- cw = cw + naturalwidth[char] * tmrx
-
- local index = data.index or char
-
- b = b + 1 ; buffer[b] = font > 0 and h_hex_4[index] or h_hex_2[index]
-
- if not pdfcharacters[index] then
- pdfcharacters[index] = true
- end
-
- end
-
- flushfontchar = function(font,char,data)
- local dummy = usedfonts[font]
- local index = data.index or char
- if not pdfcharacters[index] then
- pdfcharacters[index] = true
- end
- return dummy
- end
-
-end
-
--- literals
-
-local flushliteral do
-
- local nodeproperties <const> = nodes.properties.data
- local literalvalues <const> = nodes.literalvalues
-
- local originliteral_code <const> = literalvalues.origin
- local pageliteral_code <const> = literalvalues.page
- local alwaysliteral_code <const> = literalvalues.always
- local rawliteral_code <const> = literalvalues.raw
- local textliteral_code <const> = literalvalues.text
- local fontliteral_code <const> = literalvalues.font
-
- flushliteral = function(current,pos_h,pos_v,mode,str)
- if mode then
- if not str then
- mode, str = originliteral_code, mode
- elseif mode == "mode" then
- mode = literalvalues[str]
- if mode == originliteral_code then
- pdf_goto_pagemode()
- pdf_set_pos(pos_h,pos_v)
- elseif mode == pageliteral_code then
- pdf_goto_pagemode()
- elseif mode == textliteral_code then
- pdf_goto_textmode()
- elseif mode == fontliteral_code then
- pdf_goto_fontmode()
- elseif mode == alwaysliteral_code then
- pdf_end_string_nl()
- need_tm = true
- elseif mode == rawliteral_code then
- pdf_end_string_nl()
- end
- return
- else
- mode = literalvalues[mode]
- end
- else
- local p = nodeproperties[current]
- if p then
- str = p.data
- mode = p.mode
- else
- str, mode = getdata(current)
- end
- end
- if str and str ~= "" then
- if mode == originliteral_code then
- pdf_goto_pagemode()
- pdf_set_pos(pos_h,pos_v)
- elseif mode == pageliteral_code then
- pdf_goto_pagemode()
- elseif mode == textliteral_code then
- pdf_goto_textmode()
- elseif mode == fontliteral_code then
- pdf_goto_fontmode()
- elseif mode == alwaysliteral_code then
- pdf_end_string_nl()
- need_tm = true
- elseif mode == rawliteral_code then
- pdf_end_string_nl()
- else
- report("check literal")
- pdf_goto_pagemode()
- pdf_set_pos(pos_h,pos_v)
- end
- b = b + 1 ; buffer[b] = str
- end
- end
-
- updaters.register("backend.update.pdf",function()
- function pdf.print(mode,str)
- if str then
- mode = literalvalues[mode]
- else
- mode, str = originliteral_code, mode
- end
- if str and str ~= "" then
- if mode == originliteral_code then
- pdf_goto_pagemode()
- -- pdf_set_pos(pdf_h,pdf_v)
- elseif mode == pageliteral_code then
- pdf_goto_pagemode()
- elseif mode == textliteral_code then
- pdf_goto_textmode()
- elseif mode == fontliteral_code then
- pdf_goto_fontmode()
- elseif mode == alwaysliteral_code then
- pdf_end_string_nl()
- need_tm = true
- elseif mode == rawliteral_code then
- pdf_end_string_nl()
- else
- pdf_goto_pagemode()
- -- pdf_set_pos(pdf_h,pdf_v)
- end
- b = b + 1 ; buffer[b] = str
- end
- end
- end)
-
-end
-
--- grouping & orientation
-
-local flushsave, flushrestore, flushsetmatrix do
-
- local matrices = { }
- local positions = { }
- local nofpositions = 0
- local nofmatrices = 0
-
- local f_matrix = formatters["%s 0 0 cm"]
-
- flushsave = function(current,pos_h,pos_v)
- nofpositions = nofpositions + 1
- positions[nofpositions] = { pos_h, pos_v, nofmatrices }
- pdf_goto_pagemode()
- pdf_set_pos(pos_h,pos_v)
- b = b + 1 ; buffer[b] = "q"
- end
-
- flushrestore = function(current,pos_h,pos_v)
- if nofpositions < 1 then
- return
- end
- local t = positions[nofpositions]
- -- local h = pos_h - t[1]
- -- local v = pos_v - t[2]
- if shippingmode == "page" then
- nofmatrices = t[3]
- end
- pdf_goto_pagemode()
- pdf_set_pos(pos_h,pos_v)
- b = b + 1 ; buffer[b] = "Q"
- nofpositions = nofpositions - 1
- end
-
- local function pdf_set_matrix(str,pos_h,pos_v)
- if shippingmode == "page" then
- local rx, sx, sy, ry = splitupstring(str," ")
- if rx and ry and sx and ry then
- rx, sx, sy, ry = tonumber(rx), tonumber(sx), tonumber(sy), tonumber(ry)
- local tx = pos_h * (1 - rx) - pos_v * sy
- local ty = pos_v * (1 - ry) - pos_h * sx
- if nofmatrices > 1 then
- local t = matrices[nofmatrices]
- local r_x, s_x, s_y, r_y, te, tf = t[1], t[2], t[3], t[4], t[5], t[6]
- rx, sx = rx * r_x + sx * s_y, rx * s_x + sx * r_y
- sy, ry = sy * r_x + ry * s_y, sy * s_x + ry * r_y
- tx, ty = tx * r_x + ty * s_y, tx * s_x + ty * r_y
- end
- nofmatrices = nofmatrices + 1
- matrices[nofmatrices] = { rx, sx, sy, ry, tx, ty }
- end
- end
- end
-
- local nodeproperties = nodes.properties.data
-
- flushsetmatrix = function(current,pos_h,pos_v)
- local str
- if type(current) == "string" then
- str = current
- else
- local p = nodeproperties[current]
- if p then
- str = p.matrix
- else
- str = getdata(current) -- for the moment
- end
- end
- if str and str ~= "" then
- pdf_set_matrix(str,pos_h,pos_v)
- pdf_goto_pagemode()
- pdf_set_pos(pos_h,pos_v)
- b = b + 1 ; buffer[b] = f_matrix(str)
- end
- end
-
- do
-
- local function hasmatrix()
- return nofmatrices > 0
- end
-
- local function getmatrix()
- if nofmatrices > 0 then
- return unpack(matrices[nofmatrices])
- else
- return 1, 0, 0, 1, 0, 0
- end
- end
-
- updaters.register("backend.update.pdf",function()
- pdf.hasmatrix = hasmatrix
- pdf.getmatrix = getmatrix
- end)
-
- end
-
- pushorientation = function(orientation,pos_h,pos_v,pos_r)
- pdf_goto_pagemode()
- pdf_set_pos(pos_h,pos_v)
- b = b + 1 ; buffer[b] = "q"
- if orientation == 1 then
- b = b + 1 ; buffer[b] = "0 -1 1 0 0 0 cm" -- 90
- elseif orientation == 2 then
- b = b + 1 ; buffer[b] = "-1 0 0 -1 0 0 cm" -- 180
- elseif orientation == 3 then
- b = b + 1 ; buffer[b] = "0 1 -1 0 0 0 cm" -- 270
- end
- end
-
- poporientation = function(orientation,pos_h,pos_v,pos_r)
- pdf_goto_pagemode()
- pdf_set_pos(pos_h,pos_v)
- b = b + 1 ; buffer[b] = "Q"
- end
-
- -- pushorientation = function(orientation,pos_h,pos_v,pos_r)
- -- flushsave(false,pos_h,pos_v)
- -- if orientation == 1 then
- -- flushsetmatrix("0 -1 1 0",pos_h,pos_v)
- -- elseif orientation == 2 then
- -- flushsetmatrix("-1 0 0 -1",pos_h,pos_v)
- -- elseif orientation == 3 then
- -- flushsetmatrix("0 1 -1 0",pos_h,pos_v)
- -- end
- -- end
-
- -- poporientation = function(orientation,pos_h,pos_v,pos_r)
- -- flushrestore(false,pos_h,pos_v)
- -- end
-
-end
-
--- rules
-
-local flushedxforms = { } -- actually box resources but can also be direct
-local localconverter = nil -- will be set
-
-local flushrule, flushsimplerule, flushimage, flushgroup do
-
- local rulecodes = nodes.rulecodes
- local newrule = nodes.pool.rule
-
- local setprop = nuts.setprop
- local getprop = nuts.getprop
-
- local normalrule_code <const> = rulecodes.normal
- local boxrule_code <const> = rulecodes.box
- local imagerule_code <const> = rulecodes.image
- local emptyrule_code <const> = rulecodes.empty
- local userrule_code <const> = rulecodes.user
- local overrule_code <const> = rulecodes.over
- local underrule_code <const> = rulecodes.under
- local fractionrule_code <const> = rulecodes.fraction
- local radicalrule_code <const> = rulecodes.radical
- local outlinerule_code <const> = rulecodes.outline
-
- local rule_callback = callbacks.functions.process_rule
-
- local f_fm = formatters["/Fm%d Do"]
- local f_im = formatters["/Im%d Do"]
- local f_gr = formatters["/Gp%d Do"]
-
- local s_b <const> = "q"
- local s_e <const> = "Q"
-
- local f_v = formatters["[] 0 d 0 J %.6N w 0 0 m %.6N 0 l S"]
- local f_h = formatters["[] 0 d 0 J %.6N w 0 0 m 0 %.6N l S"]
-
- local f_f = formatters["0 0 %.6N %.6N re f"]
- local f_o = formatters["[] 0 d 0 J 0 0 %.6N %.6N re S"]
- local f_w = formatters["[] 0 d 0 J %.6N w 0 0 %.6N %.6N re S"]
-
- -- Historically the index is an object which is kind of bad.
-
- local boxresources, n = { }, 0
-
- getxformname = function(index)
- local l = boxresources[index]
- if l then
- return l.name
- else
- report("no box resource %S",index)
- end
- end
-
- updaters.register("backend.update.pdf",function()
- pdf.getxformname = getxformname
- end)
-
- local function saveboxresource(box,attributes,resources,immediate,kind,margin)
- n = n + 1
- local immediate = true
- local margin = margin or 0 -- or dimension
- local objnum = pdfreserveobject()
- local list = tonut(type(box) == "number" and tex.takebox(box) or box)
- --
- local width, height, depth = getwhd(list)
- --
- local l = {
- width = width,
- height = height,
- depth = depth,
- margin = margin,
- attributes = attributes,
- resources = resources,
- list = nil,
- type = kind,
- name = n,
- index = objnum,
- objnum = objnum,
- }
- boxresources[objnum] = l
- if immediate then
- localconverter(list,"xform",objnum,l)
- flushedxforms[objnum] = { true , objnum }
- flushlist(list)
- else
- l.list = list
- end
- return objnum
- end
-
- local function useboxresource(index,wd,ht,dp)
- local l = boxresources[index]
- if l then
- if wd or ht or dp then
- wd, ht, dp = wd or 0, ht or 0, dp or 0
- else
- wd, ht, dp = l.width, l.height, l.depth
- end
- local rule = newrule(wd,ht,dp) -- newboxrule
- rule.subtype = boxrule_code
- setprop(tonut(rule),"index",index)
- return rule, wd, ht, dp
- else
- report("no box resource %S",index)
- end
- end
-
- local function getboxresourcedimensions(index)
- local l = boxresources[index]
- if l then
- return l.width, l.height, l.depth, l.margin
- else
- report("no box resource %S",index)
- end
- end
-
- local function getboxresourcebox(index)
- local l = boxresources[index]
- if l then
- return l.list
- end
- end
-
- updaters.register("backend.update.tex",function()
- tex.saveboxresource = saveboxresource
- tex.useboxresource = useboxresource
- tex.getboxresourcedimensions = getboxresourcedimensions
- tex.getboxresourcebox = getboxresourcebox
- end)
-
- -- a bit of a mess: index is now objnum but that has to change to a proper index
- -- ... an engine inheritance
-
- local function flushpdfxform(current,pos_h,pos_v,pos_r,size_h,size_v)
- -- object properties
- local objnum = getprop(current,"index")
- local name = getxformname(objnum)
- local info = flushedxforms[objnum]
- local r = boxresources[objnum]
- if not info then
- info = { false , objnum }
- flushedxforms[objnum] = info
- end
- local wd, ht, dp = getboxresourcedimensions(objnum)
- -- or: wd, ht, dp = r.width, r.height, r.depth
- -- sanity check
- local htdp = ht + dp
- if wd == 0 or size_h == 0 or htdp == 0 or size_v == 0 then
- return
- end
- -- calculate scale
- local rx, ry = 1, 1
- if wd ~= size_h or htdp ~= size_v then
- rx = size_h / wd
- ry = size_v / htdp
- end
- -- flush the reference
- usedxforms[objnum] = true
- pdf_goto_pagemode()
- calc_pdfpos(pos_h,pos_v)
- tx = cmtx * bpfactor
- ty = cmty * bpfactor
- b = b + 1 ; buffer[b] = s_b
- b = b + 1 ; buffer[b] = f_cm(rx,0,0,ry,tx,ty)
- b = b + 1 ; buffer[b] = f_fm(name)
- b = b + 1 ; buffer[b] = s_e
- end
-
- -- place image also used in vf but we can use a different one if we need it
-
- local imagetypes = images.types -- pdf png jpg jp2 jbig2 stream memstream
- local img_none = imagetypes.none
- local img_pdf = imagetypes.pdf
- local img_stream = imagetypes.stream
- local img_memstream = imagetypes.memstream
-
- local one_bp <const> = 65536 * bpfactor
-
- local imageresources, n = { }, 0
-
- getximagename = function(index)
- local l = imageresources[index]
- if l then
- return l.name
- else
- report("no image resource %S",index)
- end
- end
-
- updaters.register("backend.update.pdf",function()
- pdf.getximagename = getximagename
- end)
-
- -- Groups are flushed immediately but we can decide to make them into a
- -- specific whatsit ... but not now. We could hash them if needed when
- -- we use lot sof them in mp ... but not now.
-
- usedxgroups = { }
- local groups = 0
- local group = nil
-
- flushgroup = function(content,bbox)
- if not group then
- group = pdfdictionary {
- Type = pdfconstant("Group"),
- S = pdfconstant("Transparency"),
- }
- end
- local wrapper = pdfdictionary {
- Type = pdf_xobject,
- Subtype = pdf_form,
- FormType = 1,
- Group = group,
- BBox = pdfarray(bbox),
- Resources = lpdf.collectedresources { serialize = false },
- }
- local objnum = pdfflushstreamobject(content,wrapper,false)
- groups = groups + 1
- usedxgroups[groups] = objnum
- return f_gr(groups)
- end
-
- lpdf.flushgroup = flushgroup -- todo: access via driver in mlib-pps
-
- -- end of experiment
-
- local function flushpdfximage(current,pos_h,pos_v,pos_r,size_h,size_v)
-
- local width,
- height,
- depth = getwhd(current)
- local total = height + depth
- local transform = getprop(current,"transform") or 0 -- we never set it ... so just use rotation then
- local index = getprop(current,"index") or 0
- local kind,
- xorigin,
- yorigin,
- xsize,
- ysize,
- rotation, -- transform / orientation / rotation : it's a mess (i need to redo this)
- objnum,
- groupref = pdfincludeimage(index) -- needs to be sorted out, bad name (no longer mixed anyway)
-
- if not kind then
- report("invalid image %S",index)
- return
- end
-
- local rx, sx, sy, ry, tx, ty = 1, 0, 0, 1, 0, 0
-
- -- tricky: xsize and ysize swapped
-
- if kind == img_pdf or kind == img_stream or kind == img_memstream then
- rx, ry, tx, ty = 1/xsize, 1/ysize, xorigin/xsize, yorigin/ysize
- else
- -- if kind == img_png then
- -- -- if groupref > 0 and img_page_group_val == 0 then
- -- -- img_page_group_val = groupref
- -- -- end
- -- end
- rx, ry = bpfactor, bpfactor
- end
-
- if band(transform,7) > 3 then
- -- mirror
- rx, tx = -rx, -tx
- end
- local t = band(transform + rotation,3)
- if t == 0 then
- -- nothing
- elseif t == 1 then
- -- rotation over 90 degrees (counterclockwise)
- rx, sx, sy, ry, tx, ty = 0, rx, -ry, 0, -ty, tx
- elseif t == 2 then
- -- rotation over 180 degrees (counterclockwise)
- rx, ry, tx, ty = -rx, -ry, -tx, -ty
- elseif t == 3 then
- -- rotation over 270 degrees (counterclockwise)
- rx, sx, sy, ry, tx, ty = 0, -rx, ry, 0, ty, -tx
- end
-
- rx = rx * width
- sx = sx * total
- sy = sy * width
- ry = ry * total
- tx = pos_h - tx * width
- ty = pos_v - ty * total
-
- local t = transform + rotation
-
- if band(transform,7) > 3 then
- t = t + 1
- end
-
- t = band(t,3)
-
- if t == 0 then
- -- no transform
- elseif t == 1 then
- -- rotation over 90 degrees (counterclockwise)
- tx = tx + width
- elseif t == 2 then
- -- rotation over 180 degrees (counterclockwise)
- tx = tx + width
- ty = ty + total
- elseif t == 3 then
- -- rotation over 270 degrees (counterclockwise)
- ty = ty + total
- end
-
- -- a flaw in original, can go:
- --
- -- if img_page_group_val == 0 then
- -- img_page_group_val = group_ref
- -- end
-
- usedximages[index] = objnum -- hm
-
- pdf_goto_pagemode()
-
- calc_pdfpos(tx,ty)
-
- tx = cmtx * bpfactor
- ty = cmty * bpfactor
-
- b = b + 1 ; buffer[b] = s_b
- b = b + 1 ; buffer[b] = f_cm(rx,sx,sy,ry,tx,ty)
- b = b + 1 ; buffer[b] = f_im(index)
- b = b + 1 ; buffer[b] = s_e
- end
-
- flushimage = function(index,width,height,depth,pos_h,pos_v)
-
- -- used in vf characters
-
- local total = height + depth
- local kind,
- xorigin, yorigin,
- xsize, ysize,
- rotation,
- objnum,
- groupref = pdfincludeimage(index)
-
- local rx = width / xsize
- local sx = 0
- local sy = 0
- local ry = total / ysize
- local tx = pos_h
- -- to be sorted out
- -- local ty = pos_v - depth
- local ty = pos_v -- we assume that depth is dealt with in the caller (for now)
-
- usedximages[index] = objnum
-
- pdf_goto_pagemode()
-
- calc_pdfpos(tx,ty)
-
- tx = cmtx * bpfactor
- ty = cmty * bpfactor
-
- b = b + 1 ; buffer[b] = s_b
- b = b + 1 ; buffer[b] = f_cm(rx,sx,sy,ry,tx,ty)
- b = b + 1 ; buffer[b] = f_im(index)
- b = b + 1 ; buffer[b] = s_e
- end
-
- -- For the moment we need this hack because the engine checks the 'image'
- -- command in virtual fonts (so we use lua instead).
-
- flushrule = function(current,pos_h,pos_v,pos_r,size_h,size_v,subtype)
-
- if subtype == emptyrule_code then
- return
- elseif subtype == boxrule_code then
- return flushpdfxform(current,pos_h,pos_v,pos_r,size_h,size_v)
- elseif subtype == imagerule_code then
- return flushpdfximage(current,pos_h,pos_v,pos_r,size_h,size_v)
- end
- if subtype == userrule_code or subtype >= overrule_code and subtype <= radicalrule_code then
- pdf_goto_pagemode()
- b = b + 1 ; buffer[b] = s_b
- pdf_set_pos_temp(pos_h,pos_v)
- rule_callback(current,size_h,size_v,pos_r) -- so we pass direction
- b = b + 1 ; buffer[b] = s_e
- return
- end
-
- pdf_goto_pagemode()
-
- -- local saved_b = b
-
- b = b + 1 ; buffer[b] = s_b
-
- local dim_h = size_h * bpfactor
- local dim_v = size_v * bpfactor
- local rule
-
- if dim_v <= one_bp then
- pdf_set_pos_temp(pos_h,pos_v + 0.5 * size_v)
- rule = f_v(dim_v,dim_h)
- elseif dim_h <= one_bp then
- pdf_set_pos_temp(pos_h + 0.5 * size_h,pos_v)
- rule = f_h(dim_h,dim_v)
- else
- pdf_set_pos_temp(pos_h,pos_v)
- if subtype == outlinerule_code then
- local linewidth = getdata(current)
- if linewidth > 0 then
- rule = f_w(linewidth * bpfactor,dim_h,dim_v)
- else
- rule = f_o(dim_h,dim_v)
- end
- else
- rule = f_f(dim_h,dim_v)
- end
- end
-
- b = b + 1 ; buffer[b] = rule
- b = b + 1 ; buffer[b] = s_e
-
- -- buffer[saved_b] = concat(buffer," ",saved_b,b)
- -- b = saved_b
-
- end
-
- flushsimplerule = function(pos_h,pos_v,pos_r,size_h,size_v)
- pdf_goto_pagemode()
-
- b = b + 1 ; buffer[b] = s_b
-
- local dim_h = size_h * bpfactor
- local dim_v = size_v * bpfactor
- local rule
-
- if dim_v <= one_bp then
- pdf_set_pos_temp(pos_h,pos_v + 0.5 * size_v)
- rule = f_v(dim_v,dim_h)
- elseif dim_h <= one_bp then
- pdf_set_pos_temp(pos_h + 0.5 * size_h,pos_v)
- rule = f_h(dim_h,dim_v)
- else
- pdf_set_pos_temp(pos_h,pos_v)
- rule = f_f(dim_h,dim_v)
- end
-
- b = b + 1 ; buffer[b] = rule
- b = b + 1 ; buffer[b] = s_e
- end
-
-end
-
---- basics
-
-local wrapup, registerpage do
-
- local pages = { }
- local maxkids = 10
- local nofpages = 0
- local pagetag = "unset"
-
- registerpage = function(object)
- nofpages = nofpages + 1
- local objnum = pdfpagereference(nofpages)
- pages[nofpages] = {
- page = nofpages, -- original number, only for diagnostics
- objnum = objnum,
- object = object,
- tag = pagetag,
- }
- end
-
- function lpdf.setpagetag(tag)
- pagetag = tag or "unset"
- end
-
- function lpdf.getnofpages()
- return nofpages
- end
-
- function lpdf.getpagetags()
- local list = { }
- for i=1,nofpages do
- list[i] = pages[i].tag
- end
- return list
- end
-
- function lpdf.setpageorder(mapping)
- -- mapping can be a hash so:
- local list = table.sortedkeys(mapping)
- local n = #list
- if n == nofpages then
- local done = { }
- local hash = { }
- for i=1,n do
- local order = mapping[list[i]]
- if hash[order] then
- report("invalid page order, duplicate entry %i",order)
- return
- elseif order < 1 or order > nofpages then
- report("invalid page order, no page %i",order)
- return
- else
- done[i] = pages[order]
- hash[order] = true
- end
- end
- pages = done
- else
- report("invalid page order, %i entries expected",nofpages)
- end
- end
-
- -- We can have this, but then via codeinjections etc. Later.
-
- -- function structures.pages.swapthem()
- -- local n = lpdf.getnofpages()
- -- local t = { }
- -- for i=1,n do
- -- t[i] = i
- -- end
- -- for i=2,math.odd(n) and n or (n-1),2 do
- -- t[i] = i+1
- -- t[i+1] = i
- -- end
- -- lpdf.setpageorder(t)
- -- end
-
- wrapup = function(driver)
-
- -- hook (to reshuffle pages)
- local pagetree = { }
- local parent = nil
- local minimum = 0
- local maximum = 0
- local current = 0
- if #pages > 1.5 * maxkids then
- repeat
- local plist, pnode
- if current == 0 then
- plist, minimum = pages, 1
- elseif current == 1 then
- plist, minimum = pagetree, 1
- else
- plist, minimum = pagetree, maximum + 1
- end
- maximum = #plist
- if maximum > minimum then
- local kids
- for i=minimum,maximum do
- local p = plist[i]
- if not pnode or #kids == maxkids then
- kids = pdfarray()
- parent = pdfreserveobject()
- pnode = pdfdictionary {
- objnum = parent,
- Type = pdf_pages,
- Kids = kids,
- Count = 0,
- }
- pagetree[#pagetree+1] = pnode
- end
- kids[#kids+1] = pdfreference(p.objnum)
- pnode.Count = pnode.Count + (p.Count or 1)
- p.Parent = pdfreference(parent)
- end
- end
- current = current + 1
- until maximum == minimum
- -- flush page tree
- for i=1,#pagetree do
- local entry = pagetree[i]
- local objnum = entry.objnum
- entry.objnum = nil
- pdfflushobject(objnum,entry)
- end
- else
- -- ugly
- local kids = pdfarray()
- local list = pdfdictionary {
- Type = pdf_pages,
- Kids = kids,
- Count = nofpages,
- }
- parent = pdfreserveobject()
- for i=1,nofpages do
- local page = pages[i]
- kids[#kids+1] = pdfreference(page.objnum)
- page.Parent = pdfreference(parent)
- end
- pdfflushobject(parent,list)
- end
- for i=1,nofpages do
- local page = pages[i]
- local object = page.object
- object.Parent = page.Parent
- pdfflushobject(page.objnum,object)
- end
- lpdf.addtocatalog("Pages",pdfreference(parent))
-
- end
-
-end
-
-pdf_h, pdf_v = 0, 0
-
-local function initialize(driver,details)
- reset_variables(details)
- reset_buffer()
-end
-
--- This will all move and be merged and become less messy.
-
--- todo: more clever resource management: a bit tricky as we can inject
--- stuff in the page stream
-
-local compact = false
-
-do
-
- -- This is more a convenience feature and it might even be not entirely robust.
- -- It removes redundant color directives which makes the page stream look a bit
- -- nicer (also when figuring out issues). I might add more here but there is
- -- some additional overhead involved so runtime can be impacted.
-
- local P, R, S, Cs, lpegmatch = lpeg.P, lpeg.R, lpeg.S, lpeg.Cs, lpeg.match
-
- local p_ds = (R("09") + S(" ."))^1
- ----- p_nl = S("\n\r")^1
- local p_nl = S("\n")^1
- local p_eg = P("Q")
-
- local p_cl = p_ds * (P("rg") + P("g") + P("k")) * p_ds * (P("RG") + P("G") + P("K"))
- ----- p_cl = (p_ds * (P("rg") + P("g") + P("k") + P("RG") + P("G") + P("K")))^1
- local p_tr = P("/Tr") * p_ds * P("gs")
-
- local p_no_cl = (p_cl * p_nl) / ""
- local p_no_tr = (p_tr * p_nl) / ""
- local p_no_nl = 1 - p_nl
-
- local p_do_cl = p_cl * p_nl
- local p_do_tr = p_tr * p_nl
-
- local p_do_eg = p_eg * p_nl
-
- local pattern = Cs( (
- (p_no_cl + p_no_tr)^0 * p_do_eg -- transparencies and colors before Q
- + p_no_tr * p_no_cl * p_do_tr * p_do_cl -- transparencies and colors before others
- + p_no_cl * p_do_cl -- successive colors
- + p_no_tr * p_do_tr -- successive transparencies
- + p_no_nl^1
- + 1
- )^1 )
-
- local oldsize = 0
- local newsize = 0
-
- directives.register("pdf.compact", function(v)
- compact = v and function(s)
- oldsize = oldsize + #s
- s = lpegmatch(pattern,s) or s
- newsize = newsize + #s
- return s
- end
- end)
-
- statistics.register("pdf pagestream",function()
- if oldsize ~= newsize then
- return string.format("old size: %i, new size %i",oldsize,newsize)
- end
- end)
-
-
-end
-
-local flushdeferred -- defined later
-
-local level = 0
-
-local finalize do
-
- local f_font = formatters["F%d"]
-
- local f_form = formatters["Fm%d"]
- local f_group = formatters["Gp%d"]
- local f_image = formatters["Im%d"]
-
- finalize = function(driver,details)
-
- level = level + 1
-
- pdf_goto_pagemode() -- for now
-
- local objnum = details.objnum
- local specification = details.specification
-
- local content = concat(buffer,"\n",1,b)
-
- if compact then
- content = compact(content)
- end
-
- local fonts = nil
- local xforms = nil
-
- if next(usedfonts) then
- fonts = pdfdictionary { }
- for k, v in next, usedfonts do
- fonts[f_font(v)] = pdfreference(pdfgetfontobjnumber(k)) -- we can overload for testing
- end
- end
-
- -- messy: use real indexes for both ... so we need to change some in the
- -- full luatex part
-
- if next(usedxforms) or next(usedximages) or next(usedxgroups) then
- xforms = pdfdictionary { }
- for k in sortedhash(usedxforms) do
- -- xforms[f_form(k)] = pdfreference(k)
- xforms[f_form(getxformname(k))] = pdfreference(k)
- end
- for k, v in sortedhash(usedximages) do
- xforms[f_image(k)] = pdfreference(v)
- end
- for k, v in sortedhash(usedxgroups) do
- xforms[f_group(k)] = pdfreference(v)
- end
- end
-
- reset_buffer()
-
- -- finish_pdfpage_callback(shippingmode == "page")
-
- if shippingmode == "page" then
-
- local pageproperties = lpdf.getpageproperties()
-
- local pageresources = pageproperties.pageresources
- local pageattributes = pageproperties.pageattributes
- local pagesattributes = pageproperties.pagesattributes
-
- pageresources.Font = fonts
- pageresources.XObject = xforms
- pageresources.ProcSet = lpdf.procset()
-
- local xorigin, yorigin, relocated = backends.codeinjections.getpageorigin() -- for now here
-
- local bbox = pdfarray {
- (boundingbox[1] + xorigin) * bpfactor,
- (boundingbox[2] + yorigin) * bpfactor,
- (boundingbox[3] + xorigin) * bpfactor,
- (boundingbox[4] + yorigin) * bpfactor,
- }
-
- if relocated then
- content = formatters["1 0 0 1 %.6N %.6N cm\n%s"](bbox[1],bbox[2],content)
- end
-
- local contentsobj = pdfflushstreamobject(content,false,false)
-
- pageattributes.Type = pdf_page
- pageattributes.Contents = pdfreference(contentsobj)
- pageattributes.Resources = pageresources
- -- pageattributes.Resources = pdfreference(pdfflushobject(pageresources))
- pageattributes.MediaBox = bbox
- pageattributes.Parent = nil -- precalculate
- pageattributes.Group = nil -- todo
-
- -- resources can be indirect
-
- registerpage(pageattributes)
-
- lpdf.finalizepage(true)
-
- if relocated then
- if pageattributes.TrimBox then pageattributes.TrimBox = box end
- if pageattributes.CropBox then pageattributes.CropBox = box end
- if pageattributes.BleedBox then pageattributes.BleedBox = box end
- end
-
- else
-
- local xformtype = specification.type or 0
- local margin = specification.margin or 0
- local attributes = specification.attributes or ""
- local resources = specification.resources or ""
-
- local wrapper = nil
-
- if xformtype == 0 then
- wrapper = pdfdictionary {
- Type = pdf_xobject,
- Subtype = pdf_form,
- FormType = 1,
- BBox = nil,
- Matrix = nil,
- Resources = nil,
- }
- else
- wrapper = pdfdictionary {
- BBox = nil,
- Matrix = nil,
- Resources = nil,
- }
- end
- if xformtype == 0 or xformtype == 1 or xformtype == 3 then
- wrapper.BBox = pdfarray {
- -margin * bpfactor,
- -margin * bpfactor,
- (boundingbox[3] + margin) * bpfactor,
- (boundingbox[4] + margin) * bpfactor,
- }
- end
- if xformtype == 0 or xformtype == 2 or xformtype == 3 then
- wrapper.Matrix = pdfarray { 1, 0, 0, 1, 0, 0 }
- end
-
- -- todo: additional = resources
-
- local boxresources = lpdf.collectedresources { serialize = false }
- boxresources.Font = fonts
- boxresources.XObject = xforms
-
- -- todo: maybe share them
- -- wrapper.Resources = pdfreference(pdfflushobject(boxresources))
-
- if resources ~= "" then
- boxresources = boxresources + resources
- end
- if attributes ~= "" then
- wrapper = wrapper + attributes
- end
-
- wrapper.Resources = next(boxresources) and boxresources or nil
- wrapper.ProcSet = lpdf.procset()
-
- -- pdfflushstreamobject(content,wrapper,false,objectnumber)
- pdfflushstreamobject(content,wrapper,false,specification.objnum)
-
- end
-
- for objnum in sortedhash(usedxforms) do
- local f = flushedxforms[objnum]
- if f[1] == false then
- f[1] = true
- local objnum = f[2] -- specification.objnum
- local specification = boxresources[objnum]
- local list = specification.list
- localconverter(list,"xform",f[2],specification)
- end
- end
-
- pdf_h, pdf_v = 0, 0
-
- if level == 1 then
- flushdeferred()
- end
- level = level - 1
-
- end
-
-end
-
-updaters.register("backend.update.pdf",function()
- job.positions.registerhandlers {
- getpos = drivers.getpos,
- getrpos = drivers.getrpos,
- gethpos = drivers.gethpos,
- getvpos = drivers.getvpos,
- }
-end)
-
-updaters.register("backend.update",function()
- local saveboxresource = tex.boxresources.save
- --
- -- also in lpdf-res .. brrr .. needs fixing
- --
- backends.codeinjections.registerboxresource = function(n,offset)
- local r = saveboxresource(n,nil,nil,false,0,offset or 0)
- return r
- end
-end)
-
--- now comes the pdf file handling
-
-local objects = { }
-local streams = { } -- maybe just parallel to objects (no holes)
-local nofobjects = 0
-local offset = 0
-local f = false
-local flush = false
-local threshold = 40 -- also #("/Filter /FlateDecode") (compression threshold)
-local objectstream = true
-local compress = true
-local cache = false
-local info = ""
-local catalog = ""
-local lastdeferred = false
-local majorversion = 1
-local minorversion = 7
-local trailerid = true
-
-directives.register("backend.pdf.threshold",function(v)
- if v then
- threshold = tonumber(v) or 40
- else
- threshold = -1000
- end
-end)
-
-local f_object = formatters["%i 0 obj\010%s\010endobj\010"]
-local f_stream_n_u = formatters["%i 0 obj\010<< /Length %i >>\010stream\010%s\010endstream\010endobj\010"]
-local f_stream_n_c = formatters["%i 0 obj\010<< /Filter /FlateDecode /Length %i >>\010stream\010%s\010endstream\010endobj\010"]
-local f_stream_d_u = formatters["%i 0 obj\010<< %s /Length %i >>\010stream\010%s\010endstream\010endobj\010"]
-local f_stream_d_c = formatters["%i 0 obj\010<< %s /Filter /FlateDecode /Length %i >>\010stream\010%s\010endstream\010endobj\010"]
-local f_stream_d_r = formatters["%i 0 obj\010<< %s >>\010stream\010%s\010endstream\010endobj\010"]
-
------ f_object_b = formatters["%i 0 obj\010"]
-local f_stream_b_n_u = formatters["%i 0 obj\010<< /Length %i >>\010stream\010"]
-local f_stream_b_n_c = formatters["%i 0 obj\010<< /Filter /FlateDecode /Length %i >>\010stream\010"]
-local f_stream_b_d_u = formatters["%i 0 obj\010<< %s /Length %i >>\010stream\010"]
-local f_stream_b_d_c = formatters["%i 0 obj\010<< %s /Filter /FlateDecode /Length %i >>\010stream\010"]
-local f_stream_b_d_r = formatters["%i 0 obj\010<< %s >>\010stream\010"]
-
------ s_object_e <const> = "\010endobj\010"
-local s_stream_e <const> = "\010endstream\010endobj\010"
-
-do
-
- local function setinfo() end -- we get it
- local function setcatalog() end -- we get it
-
- local function settrailerid(v)
- trailerid = v or false
- end
-
- local function setmajorversion(v) majorversion = tonumber(v) or majorversion end
- local function setminorversion(v) minorversion = tonumber(v) or minorversion end
-
- local function getmajorversion(v) return majorversion end
- local function getminorversion(v) return minorversion end
-
- local function setcompresslevel (v) compress = v and v ~= 0 and true or false end
- local function setobjcompresslevel(v) objectstream = v and v ~= 0 and true or false end
-
- local function getcompresslevel (v) return compress and 3 or 0 end
- local function getobjcompresslevel(v) return objectstream and 1 or 0 end
-
- local function setpageresources () end -- needs to be sorted out
- local function setpageattributes () end
- local function setpagesattributes() end
-
- updaters.register("backend.update.pdf",function()
- pdf.setinfo = setinfo
- pdf.setcatalog = setcatalog
- pdf.settrailerid = settrailerid
- pdf.setmajorversion = setmajorversion
- pdf.setminorversion = setminorversion
- pdf.getmajorversion = getmajorversion
- pdf.getminorversion = getminorversion
- pdf.setcompresslevel = setcompresslevel
- pdf.setobjcompresslevel = setobjcompresslevel
- pdf.getcompresslevel = getcompresslevel
- pdf.getobjcompresslevel = getobjcompresslevel
- pdf.setpageresources = setpageresources
- pdf.setpageattributes = setpageattributes
- pdf.setpagesattributes = setpagesattributes
- end)
-
-end
-
-local addtocache, flushcache, cache do
-
- local data, d = { }, 0
- local list, l = { }, 0
- local coffset = 0
- local indices = { }
-
- local maxsize <const> = 32 * 1024 -- uncompressed
- local maxcount <const> = 0xFF
-
- addtocache = function(n,str)
- local size = #str
- if size == 0 then
- -- todo: message
- return
- end
- if coffset + size > maxsize or d == maxcount then
- flushcache()
- end
- if d == 0 then
- nofobjects = nofobjects + 1
- objects[nofobjects] = false
- streams[nofobjects] = indices
- cache = nofobjects
- end
- objects[n] = - cache
- indices[n] = d
- d = d + 1
- -- can have a comment n 0 obj as in luatex
- data[d] = str
- l = l + 1 ; list[l] = n
- l = l + 1 ; list[l] = coffset
- coffset = coffset + size + 1
- end
-
- local p_ObjStm = pdfconstant("ObjStm")
-
- flushcache = function() -- references cannot be stored
- if l > 0 then
- list = concat(list," ")
- data[0] = list
- data = concat(data,"\010",0,d)
- local strobj = pdfdictionary {
- Type = p_ObjStm,
- N = d,
- First = #list + 1,
- }
- objects[cache] = offset
- local b = nil
- local e = s_stream_e
- if compress then
- local comp = zlibcompress(data,3)
- if comp and #comp < #data then
- data = comp
- b = f_stream_b_d_c(cache,strobj(),#data)
- else
- b = f_stream_b_d_u(cache,strobj(),#data)
- end
- else
- b = f_stream_b_d_u(cache,strobj(),#data)
- end
- flush(f,b)
- flush(f,data)
- flush(f,e)
- offset = offset + #b + #data + #e
- data, d = { }, 0
- list, l = { }, 0
- coffset = 0
- indices = { }
- end
- end
-
-end
-
-local function pdfreserveobj()
- nofobjects = nofobjects + 1
- objects[nofobjects] = false
- return nofobjects
-end
-
-local pages = table.setmetatableindex(function(t,k)
- local v = pdfreserveobj()
- t[k] = v
- return v
-end)
-
-local function getpageref(n)
- return pages[n]
-end
-
-local function refobj()
- -- not needed, as we have auto-delay
-end
-
-local function flushnormalobj(data,n)
- if not n then
- nofobjects = nofobjects + 1
- n = nofobjects
- end
- data = f_object(n,data)
- if level == 0 then
- objects[n] = offset
- offset = offset + #data
- flush(f,data)
- else
- if not lastdeferred then
- lastdeferred = n
- elseif n < lastdeferred then
- lastdeferred = n
- end
- objects[n] = data
- end
- return n
-end
-
-local function flushstreamobj(data,n,dict,comp,nolength)
- if not data then
- report("no data for %S",dict)
- return
- end
- if not n then
- nofobjects = nofobjects + 1
- n = nofobjects
- end
- local size = #data
- if level == 0 then
- local b = nil
- local e = s_stream_e
- if nolength then
- b = f_stream_b_d_r(n,dict)
- elseif comp ~= false and compress and size > threshold then
- local compdata = zlibcompress(data,3)
- if compdata then
- local compsize = #compdata
- if compsize > size - threshold then
- b = dict and f_stream_b_d_u(n,dict,size) or f_stream_b_n_u(n,size)
- else
- data = compdata
- b = dict and f_stream_b_d_c(n,dict,compsize) or f_stream_b_n_c(n,compsize)
- end
- else
- b = dict and f_stream_b_d_u(n,dict,size) or f_stream_b_n_u(n,size)
- end
- else
- b = dict and f_stream_b_d_u(n,dict,size) or f_stream_b_n_u(n,size)
- end
- flush(f,b)
- flush(f,data)
- flush(f,e)
- objects[n] = offset
- offset = offset + #b + #data + #e
- else
- if nolength then
- data = f_stream_d_r(n,dict,data)
- elseif comp ~= false and compress and size > threshold then
- local compdata = zlibcompress(data,3)
- if compdata then
- local compsize = #compdata
- if compsize > size - threshold then
- data = dict and f_stream_d_u(n,dict,size,data) or f_stream_n_u(n,size,data)
- else
- data = dict and f_stream_d_c(n,dict,compsize,compdata) or f_stream_n_c(n,compsize,compdata)
- end
- else
- data = dict and f_stream_d_u(n,dict,size,data) or f_stream_n_u(n,size,data)
- end
- else
- data = dict and f_stream_d_u(n,dict,size,data) or f_stream_n_u(n,size,data)
- end
- if not lastdeferred then
- lastdeferred = n
- elseif n < lastdeferred then
- lastdeferred = n
- end
- objects[n] = data
- end
- return n
-end
-
-flushdeferred = function() -- was forward defined
- if lastdeferred then
- for n=lastdeferred,nofobjects do
- local o = objects[n]
- if type(o) == "string" then
- objects[n] = offset
- offset = offset + #o
- flush(f,o)
- end
- end
- lastdeferred = false
- end
-end
-
--- n = pdf.obj([n,] objtext)
--- n = pdf.obj([n,] "file", filename)
--- n = pdf.obj([n,] "stream", streamtext [, attrtext])
--- n = pdf.obj([n,] "streamfile", filename [, attrtext])
---
--- n = pdf.obj {
--- type = <string>, -- raw|stream
--- immediate = <boolean>,
--- objnum = <number>,
--- attr = <string>,
--- compresslevel = <number>,
--- objcompression = <boolean>,
--- file = <string>,
--- string = <string>,
--- nolength = <boolean>,
--- }
-
-local function obj(a,b,c,d)
- local kind --, immediate
- local objnum, data, attr, filename
- local compresslevel, objcompression, nolength
- local argtype = type(a)
- if argtype == "table" then
- kind = a.type -- raw | stream
- -- immediate = a.immediate
- objnum = a.objnum
- attr = a.attr
- compresslevel = a.compresslevel
- objcompression = a.objcompression
- filename = a.file
- data = a.string or a.stream or ""
- nolength = a.nolength
- if kind == "stream" then
- if filename then
- data = loaddata(filename) or ""
- end
- elseif kind == "raw"then
- if filename then
- data = loaddata(filename) or ""
- end
- elseif kind == "file"then
- kind = "raw"
- data = filename and loaddata(filename) or ""
- elseif kind == "streamfile" then
- kind = "stream"
- data = filename and loaddata(filename) or ""
- end
- else
- if argtype == "number" then
- objnum = a
- a, b, c = b, c, d
- else
- nofobjects = nofobjects + 1
- objnum = nofobjects
- end
- if b then
- if a == "stream" then
- kind = "stream"
- data = b
- elseif a == "file" then
- -- kind = "raw"
- data = loaddata(b)
- elseif a == "streamfile" then
- kind = "stream"
- data = loaddata(b)
- else
- data = "" -- invalid object
- end
- attr = c
- else
- -- kind = "raw"
- data = a
- end
- end
- if not objnum then
- nofobjects = nofobjects + 1
- objnum = nofobjects
- end
- -- todo: immediate
- if kind == "stream" then
- flushstreamobj(data,objnum,attr,compresslevel and compresslevel > 0 or nil,nolength)
- elseif objectstream and objcompression ~= false then
- addtocache(objnum,data)
- else
- flushnormalobj(data,objnum)
- end
- return objnum
-end
-
-updaters.register("backend.update.pdf",function()
- pdf.reserveobj = pdfreserveobj
- pdf.getpageref = getpageref
- pdf.refobj = refobj
- pdf.flushstreamobj = flushstreamobj
- pdf.flushnormalobj = flushnormalobj
- pdf.obj = obj
- pdf.immediateobj = obj
-end)
-
--- In lua 5.4 the methods are now moved one metalevel deeper so we need to get them
--- from mt.__index instead. (I did get that at first.) It makes for a slightly (imo)
--- nicer interface but no real gain in speed as we don't flush that often.
-
-local openfile, closefile do
-
- -- I used to do <space><lf> but then figured out that when I open and save a file in a mode
- -- that removes trailing spaces, the xref becomes invalid. The problem was then that a
- -- reconstruction of the file by a viewer gives weird effects probably because percent symbols
- -- gets interpreted then. Thanks to Ross Moore for noticing this side effect!
-
- local f_used = formatters["%010i 00000 n\013\010"]
- local f_link = formatters["%010i 00000 f\013\010"]
- local f_first = formatters["%010i 65535 f\013\010"]
-
- local f_pdf = formatters["%%PDF-%i.%i\010"]
- local f_xref = formatters["xref\0100 %i\010"]
- local f_trailer_id = formatters["trailer\010<< %s /ID [ <%s> <%s> ] >>\010startxref\010%i\010%%%%EOF"]
- local f_trailer_no = formatters["trailer\010<< %s >>\010startxref\010%i\010%%%%EOF"]
- local f_startxref = formatters["startxref\010%i\010%%%%EOF"]
-
- local inmemory = false
- local close = false
-
- openfile = function(filename)
- if inmemory then
- local n = 0
- f = { }
- flush = function(f,s)
- n = n + 1 f[n] = s
- end
- close = function(f)
- f = concat(f)
- io.savedata(filename,f)
- f = false
- end
- -- local n = 0
- -- f = {
- -- write = function(self,s)
- -- n = n + 1 f[n] = s
- -- end,
- -- close = function(self)
- -- f = concat(f)
- -- io.savedata(filename,f)
- -- f = false
- -- end,
- -- }
- else
- f = io.open(filename,"wb")
- if not f then
- -- message
- os.exit()
- end
- -- f:setvbuf("full",64*1024)
- local m = getmetatable(f)
- flush = m.write or m.__index.write
- close = m.close or m.__index.close
- end
- local v = f_pdf(majorversion,minorversion)
- -- local b = "%\xCC\xD5\xC1\xD4\xC5\xD8\xD0\xC4\xC6\010" -- LUATEXPDF (+128)
- local b = "%\xC3\xCF\xCE\xD4\xC5\xD8\xD4\xD0\xC4\xC6\010" -- CONTEXTPDF (+128)
- flush(f,v)
- flush(f,b)
- offset = #v + #b
- end
-
- closefile = function(abort)
- if abort then
- f:close()
- f = io.open(abort,"wb")
- if f then
- local name = resolvers.findfile("context-lmtx-error.pdf")
- if name then
- local data = io.loaddata(name)
- if data then
- f:write(data)
- f:close()
- return
- end
- end
- f:close()
- removefile(abort)
- end
- else
- local xrefoffset = offset
- local lastfree = 0
- local noffree = 0
- local catalog = lpdf.getcatalog()
- local info = lpdf.getinfo()
- if trailerid == true then
- trailerid = md5HEX(osuuid())
- elseif trailerid and #trailerid > 32 then
- trailerid = md5HEX(trailerid)
- else
- trailerid = false
- end
- if objectstream then
- flushdeferred()
- flushcache()
- --
- xrefoffset = offset
- --
- nofobjects = nofobjects + 1
- objects[nofobjects] = offset -- + 1
- --
- -- combine these three in one doesn't really give less code so
- -- we go for the efficient ones
- --
- local nofbytes = 4
- local c1, c2, c3, c4
- if offset <= 0xFFFF then
- nofbytes = 2
- for i=1,nofobjects do
- local o = objects[i]
- if not o then
- noffree = noffree + 1
- else
- local strm = o < 0
- if strm then
- o = -o
- end
- c1 = extract(o,8,8)
- c2 = extract(o,0,8)
- if strm then
- objects[i] = char(2,c1,c2,streams[o][i])
- else
- objects[i] = char(1,c1,c2,0)
- end
- end
- end
- if noffree > 0 then
- for i=nofobjects,1,-1 do
- local o = objects[i]
- if not o then
- local f1 = extract(lastfree,8,8)
- local f2 = extract(lastfree,0,8)
- objects[i] = char(0,f1,f2,0)
- lastfree = i
- end
- end
- end
- elseif offset <= 0xFFFFFF then
- nofbytes = 3
- for i=1,nofobjects do
- local o = objects[i]
- if not o then
- noffree = noffree + 1
- else
- local strm = o < 0
- if strm then
- o = -o
- end
- c1 = extract(o,16,8)
- c2 = extract(o, 8,8)
- c3 = extract(o, 0,8)
- if strm then
- objects[i] = char(2,c1,c2,c3,streams[o][i])
- else
- objects[i] = char(1,c1,c2,c3,0)
- end
- end
- end
- if noffree > 0 then
- for i=nofobjects,1,-1 do
- local o = objects[i]
- if not o then
- local f1 = extract(lastfree,16,8)
- local f2 = extract(lastfree, 8,8)
- local f3 = extract(lastfree, 0,8)
- objects[i] = char(0,f1,f2,f3,0)
- lastfree = i
- end
- end
- end
- else
- nofbytes = 4
- for i=1,nofobjects do
- local o = objects[i]
- if not o then
- noffree = noffree + 1
- else
- local strm = o < 0
- if strm then
- o = -o
- end
- c1 = extract(o,24,8)
- c2 = extract(o,16,8)
- c3 = extract(o, 8,8)
- c4 = extract(o, 0,8)
- if strm then
- objects[i] = char(2,c1,c2,c3,c4,streams[o][i])
- else
- objects[i] = char(1,c1,c2,c3,c4,0)
- end
- end
- end
- if noffree > 0 then
- for i=nofobjects,1,-1 do
- local o = objects[i]
- if not o then
- local f1 = extract(lastfree,24,8)
- local f2 = extract(lastfree,16,8)
- local f3 = extract(lastfree, 8,8)
- local f4 = extract(lastfree, 0,8)
- objects[i] = char(0,f1,f2,f3,f4,0)
- lastfree = i
- end
- end
- end
- end
- objects[0] = rep("\0",1+nofbytes+1)
- local data = concat(objects,"",0,nofobjects)
- local xref = pdfdictionary {
- Type = pdfconstant("XRef"),
- Size = nofobjects + 1,
- W = pdfarray { 1, nofbytes, 1 },
- Root = catalog,
- Info = info,
- ID = trailerid and pdfarray { pdfliteral(trailerid,true), pdfliteral(trailerid,true) } or nil,
- }
- if compress then
- local comp = zlibcompress(data,3)
- if comp then
- data = comp
- flush(f,f_stream_b_d_c(nofobjects,xref(),#data))
- else
- flush(f,f_stream_b_d_u(nofobjects,xref(),#data))
- end
- else
- flush(f,f_stream_b_d_u(nofobjects,xref(),#data))
- end
- flush(f,data)
- flush(f,s_stream_e)
- flush(f,f_startxref(xrefoffset))
- else
- flushdeferred()
- xrefoffset = offset
- flush(f,f_xref(nofobjects+1))
- local trailer = pdfdictionary {
- Size = nofobjects+1,
- Root = catalog,
- Info = info,
- }
- for i=1,nofobjects do
- local o = objects[i]
- if o then
- objects[i] = f_used(o)
- end
- end
- for i=nofobjects,1,-1 do
- local o = objects[i]
- if not o then
- objects[i] = f_link(lastfree)
- lastfree = i
- end
- end
- objects[0] = f_first(lastfree)
- flush(f,concat(objects,"",0,nofobjects))
- trailer.Size = nofobjects + 1
- if trailerid then
- flush(f,f_trailer_id(trailer(),trailerid,trailerid,xrefoffset))
- else
- flush(f,f_trailer_no(trailer(),xrefoffset))
- end
- end
- f:close()
- end
- io.flush()
- closefile = function() end
- end
-
-end
-
--- For the moment we overload it here, although back-fil.lua eventually will
--- be merged with back-pdf as it's pdf specific, or maybe back-imp-pdf or so.
-
-updaters.register("backend.update.pdf",function()
-
- -- We overload img but at some point it will even go away, so we just
- -- reimplement what we need in context. This will change completely i.e.
- -- we will drop the low level interface!
-
- local codeinjections = backends.pdf.codeinjections
-
- local imagetypes = images.types -- pdf png jpg jp2 jbig2 stream memstream
- local img_none = imagetypes.none
-
- local rulecodes = nodes.rulecodes
-
- local setprop = nodes.nuts.setprop
-
- local report_images = logs.reporter("backend","images")
-
- local lastindex = 0
- local indices = { }
-
- local bpfactor <const> = number.dimenfactors.bp
- local imagerule_code <const> = rulecodes.image
-
- function codeinjections.newimage(specification)
- return specification
- end
-
- function codeinjections.copyimage(original)
- return setmetatableindex(original)
- end
-
- function codeinjections.scanimgage(specification)
- return specification
- end
-
- local function embedimage(specification)
- if specification then
- lastindex = lastindex + 1
- index = lastindex
- specification.index = index
- local xobject = pdfdictionary { }
- if not specification.notype then
- xobject.Type = pdf_xobject
- xobject.Subtype = pdf_form
- xobject.FormType = 1
- end
- local bbox = specification.bbox
- if bbox and not specification.nobbox then
- xobject.BBox = pdfarray {
- bbox[1] * bpfactor,
- bbox[2] * bpfactor,
- bbox[3] * bpfactor,
- bbox[4] * bpfactor,
- }
- end
- xobject = xobject + specification.attr
- if bbox and not specification.width then
- specification.width = bbox[3]
- end
- if bbox and not specification.height then
- specification.height = bbox[4]
- end
- local dict = xobject()
- --
- nofobjects = nofobjects + 1
- local objnum = nofobjects
- local nolength = specification.nolength
- local stream = specification.stream or specification.string
- --
- -- We cannot set type in native img so we need this hack or
- -- otherwise we need to patch too much. Better that i write
- -- a wrapper then. Anyway, it has to be done better: a key that
- -- tells either or not to scale by xsize/ysize when flushing.
- --
- if not specification.type then
- local kind = specification.kind
- if kind then
- -- take that one
- elseif attr and find(attr,"BBox") then
- kind = img_stream
- else
- -- hack: a bitmap
- kind = img_none
- end
- specification.type = kind
- specification.kind = kind
- end
- local compress = compresslevel and compresslevel > 0 or nil
- flushstreamobj(stream,objnum,dict,compress,nolength)
- specification.objnum = objnum
- specification.rotation = specification.rotation or 0
- specification.orientation = specification.orientation or 0
- specification.transform = specification.transform or 0
- specification.stream = nil
- specification.attr = nil
- specification.type = specification.kind or specification.type or img_none
- indices[index] = specification -- better create a real specification
- return specification
- end
- end
-
- codeinjections.embedimage = embedimage
-
- function codeinjections.wrapimage(specification)
- --
- local index = specification.index
- if not index then
- embedimage(specification)
- end
- --
- local width = specification.width or 0
- local height = specification.height or 0
- local depth = specification.depth or 0
- -- newimagerule
- local n = nodes.pool.rule(width,height,depth)
- n.subtype = imagerule_code
- setprop(tonut(n),"index",specification.index)
- return n
- end
-
- function pdf.includeimage(index)
- local specification = indices[index]
- if specification then
- local bbox = specification.bbox
- local xorigin = bbox[1]
- local yorigin = bbox[2]
- local xsize = bbox[3] - xorigin -- we need the original ones, not the 'rotated' ones
- local ysize = bbox[4] - yorigin -- we need the original ones, not the 'rotated' ones
- local transform = specification.transform or 0
- local objnum = specification.objnum or pdfreserveobj()
- local groupref = nil
- local kind = specification.kind or specification.type or img_none -- determines scaling type
- return
- kind,
- xorigin, yorigin,
- xsize, ysize,
- transform,
- objnum,
- groupref
- end
- end
-
-end)
-
-updaters.register("backend.update.lpdf",function()
-
- -- todo: an md5 or sha2 hash can save space
- -- todo: make a type 3 font instead
- -- todo: move to lpdf namespace
-
- local pdfimage = lpdf.epdf.image
- local newpdf = pdfimage.new
- local openpdf = pdfimage.open
- local closepdf = pdfimage.close
- local copypage = pdfimage.copy
-
- local embedimage = images.embed
-
- local nofstreams = 0
- local topdf = { }
- local toidx = { }
-
- local function storedata_s(pdf)
- local idx = toidx[pdf]
- if not idx then
- nofstreams = nofstreams + 1
- idx = nofstreams
- toidx[pdf] = nofstreams
- topdf[idx] = pdf
- end
- return idx
- end
-
- local function vfimage_s(id,wd,ht,dp,pos_h,pos_v)
- local index = topdf[id]
- if type(index) == "string" then
- local pdfdoc = newpdf(index,#index)
- local image = copypage(pdfdoc)
- local bbox = image.bbox
- image.width = bbox[3] - bbox[1]
- image.height = bbox[4] - bbox[2]
- embedimage(image)
- index = image.index
- topdf[id] = index
- end
- -- pdf.print or pdf.literal
- flushimage(index,wd,ht,dp,pos_h,pos_v)
- end
-
- local function storedata_n(name,page)
- local idx = toidx[pdf]
- if not idx then
- nofstreams = nofstreams + 1
- idx = nofstreams
- toidx[pdf] = nofstreams
- topdf[idx] = pdf
- end
- return idx
- end
-
- -- We need to have a way to close such a pdf ... esp for fonts.
-
- local pdfdocs = { }
-
- local function vfimage_n(name,page,wd,ht,dp,pos_h,pos_v)
- local d = pdfdocs[name]
- if not d then
- d = { doc = openpdf(name), pages = { } }
- pdfdocs[name] = d
- end
- local index = d.pages[page]
- if not index then
- local image = copypage(d.doc,page)
- local bbox = image.bbox
- image.width = bbox[3] - bbox[1]
- image.height = bbox[4] - bbox[2]
- embedimage(image)
- index = image.index
- d.pages[page] = index
- end
- flushimage(index,wd,ht,dp,pos_h,pos_v)
- end
-
- local function pdfvfimage(wd,ht,dp,data,name)
- if type(data) == "number" then
- return { "lua", function(font,char,pos_h,pos_v)
- vfimage_n(name,data,wd,ht,dp,pos_h,pos_v)
- end }
- else
- return { "lua", function(font,char,pos_h,pos_v)
- local id = storedata_s(data)
- vfimage_s(id,wd,ht,dp,pos_h,pos_v)
- end }
- end
- end
-
- lpdf.vfimage = pdfvfimage
-
-end)
-
--- The driver.
-
-do
-
- local isfile = lfs.isfile
- local removefile = os.remove
- local renamefile = os.rename
- -- local copyfile = file.copy
- -- local addsuffix = file.addsuffix
- local texgetbox = tex.getbox
-
- local pdfname = nil
- local converter = nil
- local useddriver = nil -- a bit of a hack
-
- local function outputfilename(driver)
- return pdfname
- end
-
- -- todo: prevent twice
-
- local function prepare(driver)
- if not environment.initex then
- -- install new functions in pdf namespace
- updaters.apply("backend.update.pdf")
- -- install new functions in lpdf namespace
- updaters.apply("backend.update.lpdf")
- -- adapt existing shortcuts to lpdf namespace
- updaters.apply("backend.update.tex")
- -- adapt existing shortcuts to tex namespace
- updaters.apply("backend.update")
- --
- -- if rawget(pdf,"setforcefile") then
- -- pdf.setforcefile(false) -- default anyway
- -- end
- --
- pdfname = file.addsuffix(tex.jobname,"pdf")
- openfile(pdfname)
- --
- luatex.registerstopactions(1,function()
- if pdfname then
- lpdf.finalizedocument()
- closefile()
- end
- end)
- --
- luatex.registerpageactions(1,function()
- if pdfname then
- lpdf.finalizepage(true)
- end
- end)
- -- --
- lpdf.registerdocumentfinalizer(wrapup,nil,"wrapping up")
- --
- end
- --
- environment.lmtxmode = CONTEXTLMTXMODE
- --
- converter = drivers.converters.lmtx
- useddriver = driver
- end
-
- local function wrapup(driver)
- if pdfname then
- closefile()
- pdfname = nil
- end
- end
-
- local function cleanup(driver)
- if pdfname then
- closefile(pdfname)
- pdfname = nil
- end
- end
-
- local function convert(driver,boxnumber)
- converter(driver,texgetbox(boxnumber),"page")
- end
-
- localconverter = function(...)
- converter(useddriver,...)
- end
-
- drivers.install {
- name = "pdf",
- flushers = {
- character = flushcharacter,
- fontchar = flushfontchar,
- rule = flushrule,
- simplerule = flushsimplerule,
- pushorientation = pushorientation,
- poporientation = poporientation,
- --
- literal = flushliteral,
- setmatrix = flushsetmatrix,
- save = flushsave,
- restore = flushrestore,
- image = flushimage,
- group = flushgroup,
- --
- updatefontstate = updatefontstate,
- },
- actions = {
- prepare = prepare,
- wrapup = wrapup,
- cleanup = cleanup,
- --
- initialize = initialize,
- convert = convert,
- finalize = finalize,
- --
- outputfilename = outputfilename,
- },
- }
-
-end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lpdf-mis.lua b/Master/texmf-dist/tex/context/base/mkiv/lpdf-mis.lua
index 7227f9dba8a..94e9fc2714f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lpdf-mis.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lpdf-mis.lua
@@ -17,7 +17,8 @@ if not modules then modules = { } end modules ['lpdf-mis'] = {
local next, tostring, type = next, tostring, type
local format, gsub, formatters = string.format, string.gsub, string.formatters
-local flattened = table.flattened
+local concat, flattened = table.concat, table.flattened
+local settings_to_array = utilities.parsers.settings_to_array
local backends, lpdf, nodes = backends, lpdf, nodes
@@ -236,19 +237,13 @@ local function setupidentity()
end
local keywords = identity.keywords or ""
if keywords ~= "" then
- keywords = gsub(keywords, "[%s,]+", " ")
- addtoinfo("Keywords",pdfunicode(keywords), keywords)
+ keywords = concat(settings_to_array(keywords), " ")
+ addtoinfo("Keywords", pdfunicode(keywords), keywords)
end
local id = lpdf.id()
addtoinfo("ID", pdfstring(id), id) -- needed for pdf/x
--
addtoinfo("ConTeXt.Version",version)
- --
- local lmtx = codeinjections.lmtxmode()
- if lmtx then
- addtoinfo("ConTeXt.LMTX",formatters["%0.2f"](lmtx))
- end
- --
addtoinfo("ConTeXt.Time",os.date("%Y-%m-%d %H:%M"))
addtoinfo("ConTeXt.Jobname",jobname)
addtoinfo("ConTeXt.Url","www.pragma-ade.com")
@@ -451,7 +446,7 @@ local function documentspecification()
if not pagespec or pagespec == "" then
pagespec = v_default
end
- local settings = utilities.parsers.settings_to_array(pagespec)
+ local settings = settings_to_array(pagespec)
-- so the first one detemines the defaults
local first = settings[1]
local defaults = pagespecs[first]
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lpdf-pde.lua b/Master/texmf-dist/tex/context/base/mkiv/lpdf-pde.lua
index ec1064a0dfd..1c80eb5b274 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lpdf-pde.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lpdf-pde.lua
@@ -48,6 +48,7 @@ local abs = math.abs
local concat, swapped, sortedhash, sortedkeys = table.concat, table.swapped, table.sortedhash, table.sortedkeys
local utfchar = string.char
local setmetatableindex = table.setmetatableindex
+local ioopen = io.open
local lpegmatch, lpegpatterns = lpeg.match, lpeg.patterns
local P, C, S, R, Ct, Cc, V, Carg, Cs, Cf, Cg = lpeg.P, lpeg.C, lpeg.S, lpeg.R, lpeg.Ct, lpeg.Cc, lpeg.V, lpeg.Carg, lpeg.Cs, lpeg.Cf, lpeg.Cg
@@ -67,6 +68,7 @@ local lpdf_epdf = { }
lpdf.epdf = lpdf_epdf
local pdfopen = pdfe.open
+local pdfopenfile = pdfe.openfile
local pdfnew = pdfe.new
local pdfclose = pdfe.close
@@ -440,8 +442,11 @@ function lpdf_epdf.load(filename,userpassword,ownerpassword,fromstring)
if not document then
statistics.starttiming(lpdf_epdf)
local __data__
+ local __file__
if fromstring then
__data__ = pdfnew(filename,#filename)
+ elseif pdfopenfile then
+ __data__ = pdfopenfile(ioopen(filename,"rb"))
else
__data__ = pdfopen(filename)
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lpdf-vfc.lua b/Master/texmf-dist/tex/context/base/mkiv/lpdf-vfc.lua
new file mode 100644
index 00000000000..5c1937ab9a6
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkiv/lpdf-vfc.lua
@@ -0,0 +1,50 @@
+if not modules then modules = { } end modules ['lpdf-vfc'] = {
+ version = 1.001,
+ comment = "companion to lpdf-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local setmetatableindex = table.setmetatableindex
+local formatters = string.formatters
+
+local bp = number.dimenfactors.bp
+local r = 16384 * bp
+local f_1 = formatters["%.6F w 0 %.6F %.6F %.6F re f"]
+local f_2 = formatters["[] 0 d 0 J %.6F w %.6F %.6F %.6F %.6F re S"]
+
+local vfspecials = backends.pdf.tables.vfspecials
+
+vfspecials.backgrounds = setmetatableindex(function(t,h)
+ local h = h * bp
+ local v = setmetatableindex(function(t,d)
+ local d = d * bp
+ local v = setmetatableindex(function(t,w)
+ local v = { "pdf", "origin", f_1(r,-d,w*bp,h+d) }
+ t[w] = v
+ return v
+ end)
+ t[d] = v
+ return v
+ end)
+ t[h] = v
+ return v
+end)
+
+vfspecials.outlines = setmetatableindex(function(t,h)
+ local h = h * bp
+ local v = setmetatableindex(function(t,d)
+ local d = d * bp
+ local v = setmetatableindex(function(t,w)
+ -- the frame goes through the boundingbox
+ local v = { "pdf", "origin", f_2(r,r/2,-d+r/2,w*bp-r,h+d-r) }
+ t[w] = v
+ return v
+ end)
+ t[d] = v
+ return v
+ end)
+ t[h] = v
+ return v
+end)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/luat-cbk.lua b/Master/texmf-dist/tex/context/base/mkiv/luat-cbk.lua
index d3184e1af77..9fd55f3ecc0 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/luat-cbk.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/luat-cbk.lua
@@ -333,7 +333,7 @@ nodes (in this case 121049).</p>
<p>The following code is kind of experimental. In the documents
that describe the development of <l n='luatex'/> we report
-on speed tests. One observation is thta it sometimes helps to
+on speed tests. One observation is that it sometimes helps to
restart the collector. Okay, experimental code has been removed,
because messing aroudn with the gc is too unpredictable.</p>
--ldx]]--
@@ -347,6 +347,8 @@ local garbagecollector = utilities.garbagecollector
garbagecollector.enabled = false -- could become a directive
garbagecollector.criterium = 4*1024*1024
+-- garbagecollector.enabled = true
+
-- Lua allocates up to 12 times the amount of memory needed for
-- handling a string, and for large binary chunks (like chinese otf
-- files) we get a prominent memory consumption. Even when a variable
diff --git a/Master/texmf-dist/tex/context/base/mkiv/luat-cnf.lua b/Master/texmf-dist/tex/context/base/mkiv/luat-cnf.lua
index 4939b05c39c..f1690832125 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/luat-cnf.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/luat-cnf.lua
@@ -19,20 +19,79 @@ texconfig.shell_escape = 't'
luatex = luatex or { }
local luatex = luatex
-texconfig.error_line = 79 -- frozen / large values can crash
-texconfig.expand_depth = 10000
-texconfig.half_error_line = 50 -- frozen
-texconfig.hash_extra = 100000
-texconfig.max_in_open = 1000 -- frozen
-texconfig.max_print_line = 100000 -- frozen
-texconfig.max_strings = 500000
-texconfig.nest_size = 1000
-texconfig.param_size = 25000
-texconfig.save_size = 100000
-texconfig.stack_size = 10000
-texconfig.function_size = 32768
-texconfig.properties_size = 10000
-texconfig.fix_mem_init = 750000
+texconfig.error_line = 250
+texconfig.expand_depth = 10000
+texconfig.half_error_line = 125
+texconfig.max_print_line = 100000
+texconfig.max_strings = 500000
+texconfig.hash_extra = 200000
+texconfig.function_size = 32768
+texconfig.properties_size = 10000
+texconfig.level_max = 500
+texconfig.level_chr = 46 -- period
+
+if CONTEXTLMTXMODE > 0 then
+
+texconfig.max_in_open = 2000
+texconfig.nest_size = 10000
+texconfig.param_size = 100000
+texconfig.save_size = 500000
+texconfig.stack_size = 100000
+texconfig.buffer_size = 10000000
+texconfig.token_size = 10000000
+texconfig.node_size = 50000000
+texconfig.max_pool = 10000000
+
+else
+
+texconfig.max_in_open = 1000
+texconfig.nest_size = 1000
+texconfig.param_size = 25000
+texconfig.save_size = 100000
+texconfig.stack_size = 10000
+texconfig.buf_size = 10000000
+texconfig.fix_mem_init = 1000000
+
+end
+
+local variablenames = CONTEXTLMTXMODE > 0 and {
+ error_line = false,
+ half_error_line = false,
+ max_print_line = false,
+ max_in_open = false,
+ expand_depth = true,
+ hash_extra = true,
+ nest_size = true,
+ max_strings = true,
+ max_pool = true,
+ param_size = true,
+ save_size = true,
+ stack_size = true,
+ function_size = true,
+ properties_size = true,
+ token_size = true,
+ node_size = true,
+ buffer_size = true,
+ level_max = true,
+ level_chr = true,
+} or {
+ error_line = false,
+ half_error_line = false,
+ max_print_line = false,
+ max_in_open = false,
+ expand_depth = true,
+ hash_extra = true,
+ nest_size = true,
+ max_strings = true,
+ param_size = true,
+ save_size = true,
+ stack_size = true,
+ function_size = true,
+ properties_size = true,
+ fix_mem_init = true,
+ level_max = true,
+ level_chr = true,
+}
local stub = [[
@@ -68,15 +127,17 @@ function texconfig.init()
},
basictex = {
-- always
- "callback", "font", "lang", "lua", "node", "status", "tex", "texconfig", "texio", "token",
- -- not in luametatex
- "img", "pdf",
+ "callback", "font", "lua", "node", "status", "tex", "texconfig", "texio", "token",
+ -- not in luametatex
+ "img", "pdf", "lang",
+ -- in luametatex
+ "language",
},
extralua = {
-- not in luametatex
"unicode", "utf", "gzip", "zip", "zlib",
-- in luametatex
- "xzip", "xmath", "xcomplex", "basexx",
+ "xzip", "xmath", "xcomplex", "xdecimal", "basexx",
-- maybe some day in luametatex
"lz4", "lzo",
-- always (mime can go)
@@ -201,22 +262,6 @@ end)
-- done, from now on input and callbacks are internal
]]
-local variablenames = {
- error_line = false,
- half_error_line = false,
- max_print_line = false,
- max_in_open = false,
- expand_depth = true,
- hash_extra = true,
- nest_size = true,
- max_strings = true,
- param_size = true,
- save_size = true,
- stack_size = true,
- function_size = true,
- properties_size = true,
-}
-
local function makestub()
name = name or (environment.jobname .. ".lui")
report("creating stub file %a using directives:",name)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/luat-cod.lua b/Master/texmf-dist/tex/context/base/mkiv/luat-cod.lua
index 8d5d65a452a..b3abecbbab4 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/luat-cod.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/luat-cod.lua
@@ -20,19 +20,21 @@ local texconfig, lua = texconfig, lua
texconfig.kpse_init = false
texconfig.shell_escape = 't'
-texconfig.error_line = 79 -- frozen / large values can crash
-texconfig.expand_depth = 10000
-texconfig.half_error_line = 50 -- frozen
-texconfig.max_in_open = 1000
-texconfig.max_print_line = 100000
-texconfig.max_strings = 500000
-texconfig.nest_size = 1000
-texconfig.param_size = 25000
-texconfig.save_size = 100000
-texconfig.stack_size = 10000
-texconfig.function_size = 32768
-texconfig.properties_size = 10000
-texconfig.fix_mem_init = 750000
+texconfig.error_line = 250
+texconfig.expand_depth = 10000
+texconfig.half_error_line = 125
+texconfig.max_in_open = 1000
+texconfig.max_print_line = 100000
+texconfig.max_strings = 500000
+texconfig.nest_size = 1000
+texconfig.param_size = 25000
+texconfig.save_size = 100000
+texconfig.stack_size = 10000
+texconfig.function_size = 32768
+texconfig.properties_size = 10000
+texconfig.fix_mem_init = 1000000
+texconfig.level_max = 500
+texconfig.level_chr = 46 -- period
-- registering bytecode chunks
@@ -59,9 +61,6 @@ local strip = false if arg then for i=-1,#arg do if arg[i] == "--c:strip" then s
function lua.registercode(filename,options)
local barename = gsub(filename,"%.[%a%d]+$","")
- if barename == filename then
- filename = filename .. ".lua"
- end
local basename = match(barename,"^.+[/\\](.-)$") or barename
if not bytedone[basename] then
local opts = { }
@@ -70,10 +69,13 @@ function lua.registercode(filename,options)
opts[s] = true
end
end
+ if barename == filename then
+ filename = filename .. ".lua"
+ end
local code = environment.luafilechunk(filename,false,opts.optimize)
if code then
bytedone[basename] = true
- if environment.initex then
+ if environment.initex and not opts.initexonly then
local n = lua.lastbytecode + 1
bytedata[n] = { name = barename, options = opts }
if strip or opts.strip then
@@ -142,7 +144,7 @@ if LUATEXVERSION == nil then
end
if CONTEXTLMTXMODE == nil then
- CONTEXTLMTXMODE = LUATEXENGINE == "luametatex" and 1 or 0
+ CONTEXTLMTXMODE = 0
end
if LUATEXFUNCTIONALITY == nil then
diff --git a/Master/texmf-dist/tex/context/base/mkiv/luat-cod.mkiv b/Master/texmf-dist/tex/context/base/mkiv/luat-cod.mkiv
index 823b918c3bd..e7d58e8abe7 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/luat-cod.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/luat-cod.mkiv
@@ -15,8 +15,8 @@
\unprotect
-%D We cannot use the following due to the fact that existing usage
-%D demanded duplicating hashes.
+%D We cannot use the following due to the fact that existing usage demanded
+%D duplicating hashes.
%D
%D \starttyping
%D \def\expanded#1{\normalexpanded{\noexpand#1}} % ## mess
@@ -24,10 +24,9 @@
\newif\ifproductionrun
-%D Originally we compiled the \LUA\ files externally and loaded
-%D then at runtime, but when the amount grew, we realized that
-%D we needed away to store them in the format, which is what
-%D bytecode arrays do. And so the following is obsolete:
+%D Originally we compiled the \LUA\ files externally and loaded then at runtime, but
+%D when the amount grew, we realized that we needed away to store them in the
+%D format, which is what bytecode arrays do. And so the following is obsolete:
%D
%D \starttyping
%D \setnewconstant\ctxluaembeddingmode \plusone
@@ -36,16 +35,15 @@
%D 1 = runtime compilation and embedding
%D \stoptyping
%D
-%D Allocation of \LUA\ engines has changed too. The original idea
-%D was to have multiple \LUA\ instances and it worked that way for
-%D several years. Hoewver in practice we used only one engine because
-%D scripts need to share data anyway. So eventually \LUATEX\ got only
-%D one instance. Because each call is reentrant there is not much
-%D danger for crashes.
+%D Allocation of \LUA\ engines has changed too. The original idea was to have
+%D multiple \LUA\ instances and it worked that way for several years. Hoewver in
+%D practice we used only one engine because scripts need to share data anyway. So
+%D eventually \LUATEX\ got only one instance. Because each call is reentrant there
+%D is not much danger for crashes.
%D
-%D Most code here has changed after version 0.60 as part of adaption to
-%D new functionality. We no longer support the hooks for initializing
-%D code as this can be done at the \LUA\ end.
+%D Most code here has changed after version 0.60 as part of adaption to new
+%D functionality. We no longer support the hooks for initializing code as this can
+%D be done at the \LUA\ end.
% we can drop the \zerocount as it's default
diff --git a/Master/texmf-dist/tex/context/base/mkiv/luat-env.lua b/Master/texmf-dist/tex/context/base/mkiv/luat-env.lua
index 1620a26e521..edf127765a8 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/luat-env.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/luat-env.lua
@@ -38,14 +38,6 @@ local mt = {
else
return "unknown"
end
- elseif k == "kind" then
- local kind = texgettoks and texgettoks("contextkindtoks")
- if kind and kind ~= "" then
- rawset(environment,"kind",kind)
- return kind
- else
- return "unknown"
- end
elseif k == "jobname" or k == "formatname" then
local name = tex and tex[k]
if name or name== "" then
diff --git a/Master/texmf-dist/tex/context/base/mkiv/luat-fio.lua b/Master/texmf-dist/tex/context/base/mkiv/luat-fio.lua
index 26db46a88ab..2418eec1b59 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/luat-fio.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/luat-fio.lua
@@ -8,7 +8,6 @@ if not modules then modules = { } end modules ['luat-fio'] = {
local format = string.format
local concat = table.concat
-local sequenced = table.sequenced
texconfig.kpse_init = false
texconfig.shell_escape = 't'
diff --git a/Master/texmf-dist/tex/context/base/mkiv/luat-fmt.lua b/Master/texmf-dist/tex/context/base/mkiv/luat-fmt.lua
index 538556ed282..fe97cf604b9 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/luat-fmt.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/luat-fmt.lua
@@ -6,6 +6,15 @@ if not modules then modules = { } end modules ['luat-fmt'] = {
license = "see context related readme files"
}
+-- The original idea was to have a generic format builder and as a result the code
+-- here (and some elsewhere) is bit more extensive that we really need for context.
+-- For instance, in the real beginning we had runtime loading because we had no
+-- bytecode registers yet. We also had multiple files as stubs and the context.lus
+-- file specified these. More than a decade only the third method was used, just
+-- loading luat-cod, so in the end we could get rid of the lus file. In due time
+-- I'll strip the code here because something generic will never take of and we
+-- moved on to luametatex anyway.
+
local format = string.format
local concat = table.concat
local quoted = string.quoted
@@ -13,9 +22,6 @@ local luasuffixes = utilities.lua.suffixes
local report_format = logs.reporter("resolvers","formats")
--- this is a bit messy: we also handle flags in mtx-context so best we
--- can combine this some day (all here)
-
local function primaryflags(arguments)
local flags = { }
if arguments.silent then
@@ -58,7 +64,7 @@ end
-- The silent option is for Taco. It's a bit of a hack because we cannot yet mess
-- with directives. In fact, I could probably clean up the maker a bit by now.
-local template = [[--ini %primaryflags% --lua=%luafile% %texfile% %secondaryflags% %dump% %redirect%]]
+local template = [[--ini %primaryflags% --lua=%luafile% %texfile% %secondaryflags% %redirect%]]
local checkers = {
primaryflags = "verbose", -- "flags"
@@ -66,21 +72,20 @@ local checkers = {
luafile = "readable", -- "cache"
texfile = "readable", -- "cache"
redirect = "string",
- dump = "string",
binarypath = "string",
}
local runners = {
- luatex = sandbox.registerrunner {
- name = "make luatex format",
- program = "luatex",
+ luametatex = sandbox.registerrunner {
+ name = "make luametatex format",
+ program = "luametatex",
template = template,
checkers = checkers,
reporter = report_format,
},
- luametatex = sandbox.registerrunner {
- name = "make luametatex format",
- program = "luametatex",
+ luatex = sandbox.registerrunner {
+ name = "make luatex format",
+ program = "luatex",
template = template,
checkers = checkers,
reporter = report_format,
@@ -94,6 +99,18 @@ local runners = {
},
}
+local stubfiles = {
+ luametatex = "luat-cod.lmt",
+ luatex = "luat-cod.lua",
+ luajittex = "luat-cod.lua",
+}
+
+local suffixes = {
+ luametatex = "mkxl",
+ luatex = "mkiv",
+ luajittex = "mkiv",
+}
+
local function validbinarypath()
-- if environment.arguments.addbinarypath then
if not environment.arguments.nobinarypath then
@@ -107,137 +124,75 @@ local function validbinarypath()
end
end
+local function fatalerror(startupdir,...)
+ report_format(...)
+ lfs.chdir(startupdir)
+end
+
function environment.make_format(formatname)
- -- first we set up the engine and normally that information is provided
- -- by the engine ... when we move to luametatex we could decide to simplfy
- -- all the following
- local arguments = environment.arguments
- local engine = environment.ownmain or "luatex"
- local silent = arguments.silent
- local errors = arguments.errors
+ local arguments = environment.arguments
+ local engine = environment.ownmain or "luatex"
+ local silent = arguments.silent
+ local errors = arguments.errors
+ local runner = runners[engine]
+ local startupdir = dir.current()
+ if not runner then
+ return fatalerror(startupdir,"the format %a cannot be generated, no runner available for engine %a",name,engine)
+ end
-- now we locate the to be used source files ... there are some variants that we
-- need to take care
- local texsourcename = ""
- local texsourcepath = ""
- local fulltexsourcename = ""
- if engine == "luametatex" then
- texsourcename = file.addsuffix(formatname,"mkxl")
- fulltexsourcename = resolvers.findfile(texsourcename,"tex") or ""
- end
- if fulltexsourcename == "" then
- texsourcename = file.addsuffix(formatname,"mkiv")
- fulltexsourcename = resolvers.findfile(texsourcename,"tex") or ""
+ local luasourcename = stubfiles[engine]
+ if not luasourcename then
+ return fatalerror(startupdir,"no lua stub file specified for %a",engine)
end
+ local texsourcename = file.addsuffix(formatname,suffixes[engine])
+ local fulltexsourcename = resolvers.findfile(texsourcename,"tex") or ""
if fulltexsourcename == "" then
- texsourcename = file.addsuffix(formatname,"tex")
- fulltexsourcename = resolvers.findfile(texsourcename,"tex") or ""
+ return fatalerror(startupdir,"no tex source file with name %a (mkiv or tex)",formatname)
end
- if fulltexsourcename == "" then
- report_format("no tex source file with name %a (mkiv or tex)",formatname)
- return
- end
- report_format("using tex source file %a",fulltexsourcename)
-- this is tricky: we normally have an expanded path but when we don't have one,
-- the current path gets appended
- fulltexsourcename = dir.expandname(fulltexsourcename)
- texsourcepath = file.dirname(fulltexsourcename)
- if not lfs.isfile(fulltexsourcename) then
- report_format("no accessible tex source file with name %a",fulltexsourcename)
- return
+ local fulltexsourcename = dir.expandname(fulltexsourcename)
+ local texsourcepath = file.dirname(fulltexsourcename)
+ if lfs.isfile(fulltexsourcename) then
+ report_format("using tex source file %a",fulltexsourcename)
+ else
+ return fatalerror(startupdir,"no accessible tex source file with name %a",fulltexsourcename)
end
-- we're getting there, that is: we have a file that specifies the context format;
-- in addition to that file we need a stub for setting up lua as we start rather
- -- minimalistic
- local specificationname = "context.lus"
- local specificationpath = ""
- local fullspecificationname = resolvers.findfile(specificationname) or ""
- if fullspecificationname == "" then
- report_format("unable to locate specification file %a",specificationname)
- return
- end
- report_format("using specification file %a",fullspecificationname)
- -- let's expand the found name and so an extra check
- fullspecificationname = dir.expandname(fullspecificationname)
- specificationpath = file.dirname(fullspecificationname)
- if texsourcepath ~= specificationpath then
- report_format("tex source file and specification file are on different paths")
- return
- end
- -- let's do an additional check here, if only because we then have a bit better
- -- feedback on what goes wrong
- if not lfs.isfile(fulltexsourcename) then
- report_format("no accessible tex source file with name %a",fulltexsourcename)
- return
- end
- if not lfs.isfile(fullspecificationname) then
- report_format("no accessible specification file with name %a",fulltexsourcename)
- return
+ -- minimalistic ..
+ local fullluasourcename = dir.expandname(file.join(texsourcepath,luasourcename) or "")
+ if lfs.isfile(fullluasourcename) then
+ report_format("using lua stub file %a",fullluasourcename)
+ else
+ return fatalerror(startupdir,"no accessible lua stub file with name %a",fulltexsourcename)
end
- -- we're still going strong
- report_format("using tex source path %a",texsourcepath)
-- we will change tot the format path because some local files will be created
-- in the process and we don't want clutter
local validformatpath = caches.getwritablepath("formats",engine) or ""
- local startupdir = dir.current()
if validformatpath == "" then
- report_format("invalid format path, insufficient write access")
- return
+ return fatalerror(startupdir,"invalid format path, insufficient write access")
end
-- in case we have a qualified path, we need to do this before we change
-- because we can have half qualified paths (in lxc)
local binarypath = validbinarypath()
report_format("changing to format path %a",validformatpath)
- lfs.chdir(validformatpath)
- if dir.current() ~= validformatpath then
- report_format("unable to change to format path %a",validformatpath)
- return
- end
- -- we're now ready for making the format which we do on the first found
- -- writable path
- local usedluastub = nil
- local usedlualibs = dofile(fullspecificationname)
- if type(usedlualibs) == "string" then
- usedluastub = file.join(specificationpath,usedlualibs)
- elseif type(usedlualibs) == "table" then
- report_format("using stub specification %a",fullspecificationname)
- local texbasename = file.basename(name)
- local luastubname = file.addsuffix(texbasename,luasuffixes.lua)
- local lucstubname = file.addsuffix(texbasename,luasuffixes.luc)
- -- pack libraries in stub
- report_format("creating initialization file %a",luastubname)
- utilities.merger.selfcreate(usedlualibs,specificationpath,luastubname)
- -- compile stub file (does not save that much as we don't use this stub at startup any more)
- if utilities.lua.compile(luastubname,lucstubname) and lfs.isfile(lucstubname) then
- report_format("using compiled initialization file %a",lucstubname)
- usedluastub = lucstubname
- else
- report_format("using uncompiled initialization file %a",luastubname)
- usedluastub = luastubname
- end
- else
- report_format("invalid stub specification %a",fullspecificationname)
- lfs.chdir(startupdir)
- return
- end
- -- we're ready to go now but first we check if we actually do have a runner
- -- for this engine ... we'd better have one
- local runner = runners[engine]
- if not runner then
- report_format("the format %a cannot be generated, no runner available for engine %a",name,engine)
- lfs.chdir(startupdir)
- return
+ -- lfs.chdir(validformatpath)
+ -- if dir.current() ~= validformatpath then
+ if not lfs.chdir(validformatpath) then
+ return fatalerror(startupdir,"unable to change to format path %a",validformatpath)
end
-- now we can generate the format, where we use a couple of flags,
-- split into two categories
local primaryflags = primaryflags(arguments)
local secondaryflags = secondaryflags(arguments)
- local specification = {
+ local specification = {
binarypath = binarypath,
primaryflags = primaryflags,
secondaryflags = secondaryflags,
- luafile = quoted(usedluastub),
+ luafile = quoted(fullluasourcename),
texfile = quoted(fulltexsourcename),
- dump = os.platform == "unix" and "\\\\dump" or "\\dump",
}
if silent then
specification.redirect = "> temp.log"
@@ -255,7 +210,7 @@ function environment.make_format(formatname)
end
report_format("format path : %s",validformatpath)
report_format("luatex engine : %s",engine)
- report_format("lua startup file : %s",usedluastub)
+ report_format("lua startup file : %s",fullluasourcename)
if primaryflags ~= "" then
report_format("primary flags : %s",primaryflags)
end
@@ -342,9 +297,9 @@ function environment.run_format(formatname,scriptname,filename,primaryflags,seco
luafile = quoted(scriptname),
texfile = filename ~= "" and quoted(filename) or "",
}
- statistics.starttiming()
+ statistics.starttiming("make format")
local result = runner(specification)
- local runtime = statistics.stoptiming()
+ statistics.stoptiming("make format")
if verbose then
report_format()
if binarypath and binarypath ~= "" then
@@ -362,7 +317,7 @@ function environment.run_format(formatname,scriptname,filename,primaryflags,seco
if secondaryflags ~= "" then
report_format("secondary flags : %s",secondaryflags)
end
- report_format("run time : %.3f seconds",runtime)
+ report_format("run time : %0.3f seconds",statistics.elapsed("make format"))
report_format("return value : %s",result == 0 and "okay" or "error")
report_format()
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/luat-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/luat-ini.lua
index cec0161e7b0..dcca8cec7a8 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/luat-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/luat-ini.lua
@@ -25,21 +25,15 @@ if not global then
global = _G
end
-LUATEXVERSION = status.luatex_version/100
- + tonumber(status.luatex_revision)/10000
-
-LUATEXENGINE = status.luatex_engine and string.lower(status.luatex_engine)
- or (string.find(status.banner,"LuajitTeX",1,true) and "luajittex" or "luatex")
-
+LUATEXVERSION = status.luatex_version/100 + tonumber(status.luatex_revision)/10000
+LUATEXENGINE = status.luatex_engine and string.lower(status.luatex_engine) or "luametatex"
LUATEXFUNCTIONALITY = status.development_id or 6346
-
LUATEXFORMATID = status.format_id or 0
+JITSUPPORTED = false
+INITEXMODE = status.run_state == 0 -- initializing updating production
+CONTEXTLMTXMODE = 0
-JITSUPPORTED = LUATEXENGINE == "luajittex" or jit
-
-INITEXMODE = status.ini_version
-
-CONTEXTLMTXMODE = CONTEXTLMTXMODE or (LUATEXENGINE == "luametatex" and 1) or 0
+status.ini_version = INITEXMODE -- for a while
function os.setlocale()
-- no need for a message
diff --git a/Master/texmf-dist/tex/context/base/mkiv/luat-ini.mkiv b/Master/texmf-dist/tex/context/base/mkiv/luat-ini.mkiv
index d1d829be978..09014ad86cd 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/luat-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/luat-ini.mkiv
@@ -34,7 +34,7 @@
% the \type {\normalexpanded} around \type {\directlua}. Something to discuss
% in the team.
-\normalprotected\def\startlua % \stoplua
+\protected\def\startlua % \stoplua
{\begingroup
\obeylualines
\luat_start_lua_indeed}
@@ -42,7 +42,7 @@
\def\luat_start_lua_indeed#1\stoplua
{\normalexpanded{\endgroup\noexpand\directlua{#1}}} % \zerocount is default
-\normalprotected\def\startluacode % \stopluacode
+\protected\def\startluacode % \stopluacode
{\begingroup
\obeylualines
\obeyluatokens
@@ -77,24 +77,28 @@
\edef\lua_letter_seven {\string\7} \edef\lua_letter_eight {\string\8}
\edef\lua_letter_nine {\string\9} \edef\lua_letter_zero {\string\0}
+\pushoverloadmode
+ \let\-\explicitdiscretionary
+\popoverloadmode
+
\everyluacode {% \appendtoks
- \let\\\lua_letter_backslash
- \let\|\lua_letter_bar \let\-\lua_letter_dash
- \let\(\lua_letter_lparent \let\)\lua_letter_rparent
- \let\{\lua_letter_lbrace \let\}\lua_letter_rbrace
- \let\'\lua_letter_squote \let\"\lua_letter_dquote
- \let\n\lua_letter_n \let\r\lua_letter_r
- \let\f\lua_letter_f \let\t\lua_letter_t
- \let\a\lua_letter_a \let\b\lua_letter_b
- \let\v\lua_letter_v \let\s\lua_letter_s
- \let\1\lua_letter_one \let\2\lua_letter_two
- \let\3\lua_letter_three \let\4\lua_letter_four
- \let\5\lua_letter_five \let\6\lua_letter_six
- \let\7\lua_letter_seven \let\8\lua_letter_eight
- \let\9\lua_letter_nine \let\0\lua_letter_zero
+ \enforced\let\\\lua_letter_backslash
+ \enforced\let\|\lua_letter_bar \enforced\let\-\lua_letter_dash
+ \enforced\let\(\lua_letter_lparent \enforced\let\)\lua_letter_rparent
+ \enforced\let\{\lua_letter_lbrace \enforced\let\}\lua_letter_rbrace
+ \enforced\let\'\lua_letter_squote \enforced\let\"\lua_letter_dquote
+ \enforced\let\n\lua_letter_n \enforced\let\r\lua_letter_r
+ \enforced\let\f\lua_letter_f \enforced\let\t\lua_letter_t
+ \enforced\let\a\lua_letter_a \enforced\let\b\lua_letter_b
+ \enforced\let\v\lua_letter_v \enforced\let\s\lua_letter_s
+ \enforced\let\1\lua_letter_one \enforced\let\2\lua_letter_two
+ \enforced\let\3\lua_letter_three \enforced\let\4\lua_letter_four
+ \enforced\let\5\lua_letter_five \enforced\let\6\lua_letter_six
+ \enforced\let\7\lua_letter_seven \enforced\let\8\lua_letter_eight
+ \enforced\let\9\lua_letter_nine \enforced\let\0\lua_letter_zero
} % \to \everyluacode
-\normalprotected\def\obeyluatokens
+\protected\def\obeyluatokens
{\setcatcodetable\luacatcodes
\the\everyluacode}
@@ -121,13 +125,12 @@
%D \edef\luaescapestring#1{\!!bs#1\!!es}
%D \stoptyping
-\def\setdocumentfilename #1#2{\clf_setdocumentfilename\numexpr#1\relax{#2}}
-\def\setdocumentargument #1#2{\clf_setdocumentargument{#1}{#2}}
-\def\setdocumentargumentdefault#1#2{\clf_setdocumentdefaultargument{#1}{#2}}
-\def\getdocumentfilename #1{\clf_getdocumentfilename\numexpr#1\relax}
-\def\getdocumentargument #1{\clf_getdocumentargument{#1}{}}
-\def\setdocumentargument #1#2{\clf_setdocumentargument{#1}{#2}}
-\def\getdocumentargumentdefault#1#2{\clf_getdocumentargument{#1}{#2}}
+\protected\def\setdocumentfilename #1#2{\clf_setdocumentfilename\numexpr#1\relax{#2}}
+\protected\def\setdocumentargument #1#2{\clf_setdocumentargument{#1}{#2}}
+\protected\def\setdocumentargumentdefault#1#2{\clf_setdocumentdefaultargument{#1}{#2}}
+ \def\getdocumentfilename #1{\clf_getdocumentfilename\numexpr#1\relax}
+ \def\getdocumentargument #1{\clf_getdocumentargument{#1}{}}
+ \def\getdocumentargumentdefault#1#2{\clf_getdocumentargument{#1}{#2}}
% seldom used so no need for speedy variants:
@@ -147,7 +150,7 @@
%D Experimental:
-\normalprotected\def\startluaparameterset[#1]%
+\protected\def\startluaparameterset[#1]%
{\begingroup
\obeylualines
\obeyluatokens
@@ -186,7 +189,7 @@
%D \ctxluacode{context("%0.5f",1/3)}
%D \stoptyping
-\normalprotected\def\ctxluacode
+\protected\def\ctxluacode
{\begingroup
\obeylualines
\obeyluatokens
@@ -217,7 +220,7 @@
\installsystemnamespace{ctxfunction}
-\normalprotected\def\startctxfunctiondefinition #1 %
+\protected\def\startctxfunctiondefinition #1 %
{\begingroup \obeylualines \obeyluatokens \luat_start_lua_function_definition_indeed{#1}}
\installsystemnamespace{luafunction}
@@ -227,13 +230,13 @@
\expandafter\chardef\csname\??luafunction#1\endcsname\ctxcommand{ctxfunction(\!!bs#2\!!es)}\relax
\expandafter\edef\csname#1\endcsname{\noexpand\luafunction\csname\??luafunction#1\endcsname}}
-\normalprotected\def\setctxluafunction#1#2% experiment
+\protected\def\setctxluafunction#1#2% experiment
{\expandafter\chardef\csname\??luafunction#1\endcsname#2\relax
\expandafter\edef\csname#1\endcsname{\noexpand\luafunction\csname\??luafunction#1\endcsname}}
\let\stopctxfunctiondefinition\relax
-\normalprotected\def\startctxfunction #1 %
+\protected\def\startctxfunction #1 %
{\begingroup \obeylualines \obeyluatokens \luat_start_lua_function_indeed{#1}}
\def\luat_start_lua_function_indeed#1#2\stopctxfunction
@@ -267,23 +270,23 @@
% \ifdefined\normalluadef
- \normalprotected\def\installctxfunction#1#2% expandable
+ \protected\def\installctxfunction#1#2% expandable
{\edef\m_syst_name{\csstring#1}%
\global\expandafter\normalluadef\csname\m_syst_name\endcsname\ctxcommand{ctxfunction(\!!bs#2\!!es,true)}\relax}
- \normalprotected\def\installctxscanner#1#2% expandable
+ \protected\def\installctxscanner#1#2% expandable
{\edef\m_syst_name{\csstring#1}%
\global\expandafter\normalluadef\csname\m_syst_name\endcsname\ctxcommand{ctxscanner("\m_syst_name",\!!bs#2\!!es,true)}\relax}
- \normalprotected\def\installprotectedctxfunction#1#2% protected
+ \protected\def\installprotectedctxfunction#1#2% protected
{\edef\m_syst_name{\csstring#1}%
- \global\normalprotected\expandafter\normalluadef\csname\m_syst_name\endcsname\ctxcommand{ctxfunction(\!!bs#2\!!es,true)}\relax}
+ \global\protected\expandafter\normalluadef\csname\m_syst_name\endcsname\ctxcommand{ctxfunction(\!!bs#2\!!es,true)}\relax}
- \normalprotected\def\installprotectedctxscanner#1#2% protected
+ \protected\def\installprotectedctxscanner#1#2% protected
{\edef\m_syst_name{\csstring#1}%
- \global\normalprotected\expandafter\normalluadef\csname\m_syst_name\endcsname\ctxcommand{ctxscanner("\m_syst_name",\!!bs#2\!!es,true)}\relax}
+ \global\protected\expandafter\normalluadef\csname\m_syst_name\endcsname\ctxcommand{ctxscanner("\m_syst_name",\!!bs#2\!!es,true)}\relax}
- \normalprotected\def\resetctxscanner#1%
+ \protected\def\resetctxscanner#1%
{\edef\m_syst_name{\csstring#1}%
\expandafter\glet\csname\m_syst_name\endcsname\relax}
@@ -295,53 +298,53 @@
% \else
%
% \ifdefined\luafunctioncall \else
-% \normalprotected\def\luafunctioncall{\luafunction}
+% \protected\def\luafunctioncall{\luafunction}
% \fi
%
-% \normalprotected\def\installctxfunction#1#2% expandable
+% \protected\def\installctxfunction#1#2% expandable
% {\edef\m_syst_name{\csstring#1}%
% \global\expandafter\chardef\csname\??luafunction\m_syst_name\endcsname\ctxcommand{ctxfunction("#2",true)}\relax
% \expandafter\xdef\csname\m_syst_name\endcsname{\noexpand\luafunction\csname\??luafunction\m_syst_name\endcsname}}
%
-% \normalprotected\def\installctxscanner#1#2% expandable
+% \protected\def\installctxscanner#1#2% expandable
% {\edef\m_syst_name{\csstring#1}%
% \global\expandafter\chardef\csname\??luafunction\m_syst_name\endcsname\ctxcommand{ctxscanner("\m_syst_name","#2",true)}\relax
% \expandafter\xdef\csname\m_syst_name\endcsname{\noexpand\luafunction\csname\??luafunction\m_syst_name\endcsname}}
%
-% \normalprotected\def\installprotectedctxfunction#1#2% protected
+% \protected\def\installprotectedctxfunction#1#2% protected
% {\edef\m_syst_name{\csstring#1}%
% \global\expandafter\chardef\csname\??luafunction\m_syst_name\endcsname\ctxcommand{ctxfunction("#2",true)}\relax
% \expandafter\xdef\csname\m_syst_name\endcsname{\noexpand\luafunctioncall\csname\??luafunction\m_syst_name\endcsname}}
%
-% \normalprotected\def\installprotectedctxscanner#1#2% protected
+% \protected\def\installprotectedctxscanner#1#2% protected
% {\edef\m_syst_name{\csstring#1}%
% \global\expandafter\chardef\csname\??luafunction\m_syst_name\endcsname\ctxcommand{ctxscanner("\m_syst_name","#2",true)}\relax
% \expandafter\xdef\csname\m_syst_name\endcsname{\noexpand\luafunctioncall\csname\??luafunction\m_syst_name\endcsname}}
%
-% \normalprotected\def\resetctxscanner#1%
+% \protected\def\resetctxscanner#1%
% {\edef\m_syst_name{\csstring#1}%
% \global\expandafter\chardef\csname\??luafunction\m_syst_name\endcsname\zerocount
% \expandafter\glet\csname\m_syst_name\endcsname\relax}
%
-% % \normalprotected\def\installctxfunctioncall#1#2%
+% % \protected\def\installctxfunctioncall#1#2%
% % {\edef\m_syst_name{\csstring#1}%
% % \global\expandafter\chardef\csname\??luafunction\m_syst_name\endcsname\ctxcommand{ctxfunction("#2",true)}\relax
% % \expandafter\xdef\csname\m_syst_name\endcsname{\luafunctioncall\csname\??luafunction\m_syst_name\endcsname}}
% %
-% % \normalprotected\def\installctxscannercall#1#2%
+% % \protected\def\installctxscannercall#1#2%
% % {\edef\m_syst_name{\csstring#1}%
% % \global\expandafter\chardef\csname\??luafunction\m_syst_name\endcsname\ctxcommand{ctxscanner("\m_syst_name","#2",true)}\relax
% % \expandafter\xdef\csname\m_syst_name\endcsname{\luafunctioncall\csname\??luafunction\m_syst_name\endcsname}}
% %
-% % \normalprotected\def\installprotectedctxfunctioncall#1#2%
+% % \protected\def\installprotectedctxfunctioncall#1#2%
% % {\edef\m_syst_name{\csstring#1}%
% % \global\expandafter\chardef\csname\??luafunction\m_syst_name\endcsname\ctxcommand{ctxfunction("#2",true)}\relax
-% % \normalprotected\expandafter\xdef\csname\m_syst_name\endcsname{\luafunctioncall\csname\??luafunction\m_syst_name\endcsname}}
+% % \protected\expandafter\xdef\csname\m_syst_name\endcsname{\luafunctioncall\csname\??luafunction\m_syst_name\endcsname}}
% %
-% % \normalprotected\def\installprotectedctxscannercall#1#2%
+% % \protected\def\installprotectedctxscannercall#1#2%
% % {\edef\m_syst_name{\csstring#1}%
% % \global\expandafter\chardef\csname\??luafunction\m_syst_name\endcsname\ctxcommand{ctxscanner("\m_syst_name","#2",true)}\relax
-% % \normalprotected\expandafter\xdef\csname\m_syst_name\endcsname{\luafunctioncall\csname\??luafunction\m_syst_name\endcsname}}
+% % \protected\expandafter\xdef\csname\m_syst_name\endcsname{\luafunctioncall\csname\??luafunction\m_syst_name\endcsname}}
%
% \fi
diff --git a/Master/texmf-dist/tex/context/base/mkiv/luat-lib.mkiv b/Master/texmf-dist/tex/context/base/mkiv/luat-lib.mkiv
index 0ffd1dd4076..6dbcdaf54a3 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/luat-lib.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/luat-lib.mkiv
@@ -24,8 +24,8 @@
\registerctxluafile{util-dim}{}
\registerctxluafile{trac-set}{}
-\registerctxluafile{trac-log}{}
-\registerctxluafile{trac-inf}{}
+\registerctxluafile{luat-log}{autosuffix}
+\registerctxluafile{trac-inf}{autosuffix}
\registerctxluafile{util-lua}{}
\registerctxluafile{util-deb}{} % could also be done in trac-deb.mkiv
@@ -45,10 +45,6 @@
\registerctxluafile{util-soc-imp-http} {}
\registerctxluafile{util-soc-imp-tp} {}
-\ifcase\contextlmtxmode\else
- \registerctxluafile{util-zip}{}
-\fi
-
\registerctxluafile{data-ini}{}
\registerctxluafile{data-exp}{}
\registerctxluafile{data-env}{}
@@ -73,13 +69,9 @@
\registerctxluafile{data-use}{}
\registerctxluafile{data-aux}{}
-% \ifcase\contextlmtxmode
-% \registerctxluafile{util-lib}{}
-% \fi
-
\registerctxluafile{luat-cbk}{}
\registerctxluafile{luat-run}{}
-\registerctxluafile{luat-fio}{}
+\registerctxluafile{luat-fio}{autosuffix}
\registerctxluafile{luat-cnf}{}
\registerctxluafile{luat-lua}{}
\registerctxluafile{luat-sto}{}
@@ -99,8 +91,8 @@
\registerctxluafile{lxml-aux}{}
\registerctxluafile{lxml-mis}{}
-\normalprotected\def\writestatus#1#2{\ctxlua{logs.status([==[#1]==],[==[#2]==])}}
-\normalprotected\def\writestring #1{\ctxlua{logs.writer([==[#1]==],"\string\n")}}
-\normalprotected\def\writeline {\ctxlua{logs.newline()}}
+\protected\def\writestatus#1#2{\ctxlua{logs.status([==[#1]==],[==[#2]==])}}
+\protected\def\writestring #1{\ctxlua{logs.writer([==[#1]==],"\string\n")}}
+\protected\def\writeline {\ctxlua{logs.newline()}}
\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/luat-log.lua b/Master/texmf-dist/tex/context/base/mkiv/luat-log.lua
new file mode 100644
index 00000000000..8bfec8d218e
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkiv/luat-log.lua
@@ -0,0 +1,795 @@
+if not modules then modules = { } end modules ['luat-log'] = {
+ version = 1.001,
+ 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"
+}
+
+-- In fact all writes could go through lua and we could write the console and
+-- terminal handler in lua then. Ok, maybe it's slower then, so a no-go.
+
+-- This used to be combined in trac-log but as we also split between mkiv and lmtx
+-- we now have dedicated files. A side effect is a smaller format and a smaller
+-- mtxrun.
+
+local next, type, select, print = next, type, select, print
+local format, gmatch, find = string.format, string.gmatch, string.find
+local concat, insert, remove = table.concat, table.insert, table.remove
+local topattern = string.topattern
+local utfchar = utf.char
+local datetime = os.date
+local openfile = io.open
+
+local write_nl = texio and texio.write_nl
+local write = texio and texio.write
+
+local setmetatableindex = table.setmetatableindex
+local formatters = string.formatters
+local settings_to_hash = utilities.parsers.settings_to_hash
+local sortedkeys = table.sortedkeys
+
+-- variant is set now
+
+local variant = "default"
+----- variant = "ansi"
+
+logs = logs or { }
+local logs = logs
+
+-- we extend the formatters:
+
+formatters.add (
+ formatters, "unichr",
+ [["U+" .. format("%%05X",%s) .. " (" .. utfchar(%s) .. ")"]]
+)
+
+formatters.add (
+ formatters, "chruni",
+ [[utfchar(%s) .. " (U+" .. format("%%05X",%s) .. ")"]]
+)
+
+-- basic loggers
+
+local function ignore() end
+
+setmetatableindex(logs, function(t,k) t[k] = ignore ; return ignore end)
+
+local report, subreport, status, settarget, setformats, settranslations
+
+local direct, subdirect, writer, pushtarget, poptarget, setlogfile, settimedlog, setprocessor, setformatters, newline
+
+-- we use formatters but best check for % then because for simple messages but
+-- we don't want this overhead for single messages (not that there are that
+-- many; we could have a special weak table)
+
+local function ansisupported(specification)
+ if specification ~= "ansi" and specification ~= "ansilog" then
+ return false
+ elseif os and os.enableansi then
+ return os.enableansi()
+ else
+ return false
+ end
+end
+
+do
+
+ if texio.setescape then
+ texio.setescape(0) -- or (false)
+ end
+
+ if arg and ansisupported then
+ -- we're don't have environment.arguments yet
+ for k, v in next, arg do -- k can be negative !
+ if v == "--ansi" or v == "--c:ansi" then
+ if ansisupported("ansi") then
+ variant = "ansi"
+ end
+ break
+ elseif v == "--ansilog" or v == "--c:ansilog" then
+ if ansisupported("ansilog") then
+ variant = "ansilog"
+ end
+ break
+ end
+ end
+ end
+
+ local function useluawrites()
+
+ -- quick hack, awaiting speedup in engine (8 -> 6.4 sec for --make with console2)
+ -- still needed for luajittex .. luatex should not have that ^^ mess
+
+ local texio_write_nl = texio.write_nl
+ local texio_write = texio.write
+ local io_write = io.write
+
+ write_nl = function(target,...)
+ if not io_write then
+ io_write = io.write
+ end
+ if target == "term and log" then
+ texio_write_nl("log",...)
+ texio_write_nl("term","")
+ io_write(...)
+ elseif target == "log" then
+ texio_write_nl("log",...)
+ elseif target == "term" then
+ texio_write_nl("term","")
+ io_write(...)
+ elseif type(target) == "number" then
+ texio_write_nl(target,...) -- a tex output channel
+ elseif target ~= "none" then
+ texio_write_nl("log",target,...)
+ texio_write_nl("term","")
+ io_write(target,...)
+ end
+ end
+
+ write = function(target,...)
+ if not io_write then
+ io_write = io.write
+ end
+ if target == "term and log" then
+ texio_write("log",...)
+ io_write(...)
+ elseif target == "log" then
+ texio_write("log",...)
+ elseif target == "term" then
+ io_write(...)
+ elseif type(target) == "number" then
+ texio_write(target,...) -- a tex output channel
+ elseif target ~= "none" then
+ texio_write("log",target,...)
+ io_write(target,...)
+ end
+ end
+
+ texio.write = write
+ texio.write_nl = write_nl
+
+ useluawrites = ignore
+
+ end
+
+ -- local format = string.formatter
+
+ local whereto = "both"
+ local target = nil
+ local targets = nil
+
+ local formats = table.setmetatableindex("self")
+ local translations = table.setmetatableindex("self")
+
+ local report_yes, subreport_yes, direct_yes, subdirect_yes, status_yes
+ local report_nop, subreport_nop, direct_nop, subdirect_nop, status_nop
+
+ local variants = {
+ default = {
+ formats = {
+ report_yes = formatters["%-15s > %s\n"],
+ report_nop = formatters["%-15s >\n"],
+ direct_yes = formatters["%-15s > %s"],
+ direct_nop = formatters["%-15s >"],
+ subreport_yes = formatters["%-15s > %s > %s\n"],
+ subreport_nop = formatters["%-15s > %s >\n"],
+ subdirect_yes = formatters["%-15s > %s > %s"],
+ subdirect_nop = formatters["%-15s > %s >"],
+ status_yes = formatters["%-15s : %s\n"],
+ status_nop = formatters["%-15s :\n"],
+ },
+ targets = {
+ logfile = "log",
+ log = "log",
+ file = "log",
+ console = "term",
+ terminal = "term",
+ both = "term and log",
+ },
+ },
+ ansi = {
+ formats = {
+ report_yes = formatters["%-15s > %s\n"],
+ report_nop = formatters["%-15s >\n"],
+ direct_yes = formatters["%-15s > %s"],
+ direct_nop = formatters["%-15s >"],
+ subreport_yes = formatters["%-15s > %s > %s\n"],
+ subreport_nop = formatters["%-15s > %s >\n"],
+ subdirect_yes = formatters["%-15s > %s > %s"],
+ subdirect_nop = formatters["%-15s > %s >"],
+ status_yes = formatters["%-15s : %s\n"],
+ status_nop = formatters["%-15s :\n"],
+ },
+ targets = {
+ logfile = "none",
+ log = "none",
+ file = "none",
+ console = "term",
+ terminal = "term",
+ both = "term",
+ },
+ }
+ }
+
+ variants.ansilog = {
+ formats = variants.ansi.formats,
+ targets = variants.default.targets,
+ }
+
+ logs.flush = io.flush
+
+ writer = function(...)
+ write_nl(target,...)
+ end
+
+ newline = function()
+ write_nl(target,"\n")
+ end
+
+ report = function(a,b,c,...)
+ if c ~= nil then
+ write_nl(target,report_yes(translations[a],formatters[formats[b]](c,...)))
+ elseif b then
+ write_nl(target,report_yes(translations[a],formats[b]))
+ elseif a then
+ write_nl(target,report_nop(translations[a]))
+ else
+ write_nl(target,"\n")
+ end
+ end
+
+ direct = function(a,b,c,...)
+ if c ~= nil then
+ return direct_yes(translations[a],formatters[formats[b]](c,...))
+ elseif b then
+ return direct_yes(translations[a],formats[b])
+ elseif a then
+ return direct_nop(translations[a])
+ else
+ return ""
+ end
+ end
+
+ subreport = function(a,s,b,c,...)
+ if c ~= nil then
+ write_nl(target,subreport_yes(translations[a],translations[s],formatters[formats[b]](c,...)))
+ elseif b then
+ write_nl(target,subreport_yes(translations[a],translations[s],formats[b]))
+ elseif a then
+ write_nl(target,subreport_nop(translations[a],translations[s]))
+ else
+ write_nl(target,"\n")
+ end
+ end
+
+ subdirect = function(a,s,b,c,...)
+ if c ~= nil then
+ return subdirect_yes(translations[a],translations[s],formatters[formats[b]](c,...))
+ elseif b then
+ return subdirect_yes(translations[a],translations[s],formats[b])
+ elseif a then
+ return subdirect_nop(translations[a],translations[s])
+ else
+ return ""
+ end
+ end
+
+ status = function(a,b,c,...)
+ if c ~= nil then
+ write_nl(target,status_yes(translations[a],formatters[formats[b]](c,...)))
+ elseif b then
+ write_nl(target,status_yes(translations[a],formats[b]))
+ elseif a then
+ write_nl(target,status_nop(translations[a]))
+ else
+ write_nl(target,"\n")
+ end
+ end
+
+ settarget = function(askedwhereto)
+ whereto = askedwhereto or whereto or "both"
+ target = targets[whereto]
+ if not target then
+ whereto = "both"
+ target = targets[whereto]
+ end
+ if target == "term" or target == "term and log" then
+ logs.flush = io.flush
+ else
+ logs.flush = ignore
+ end
+ end
+
+ local stack = { }
+
+ pushtarget = function(newtarget)
+ insert(stack,target)
+ settarget(newtarget)
+ end
+
+ poptarget = function()
+ if #stack > 0 then
+ settarget(remove(stack))
+ end
+ end
+
+ setformats = function(f)
+ formats = f
+ end
+
+ settranslations = function(t)
+ translations = t
+ end
+
+ setprocessor = function(f)
+ local writeline = write_nl
+ write_nl = function(target,...)
+ writeline(target,f(...))
+ end
+ end
+
+ setformatters = function(specification)
+ local t = nil
+ local f = nil
+ local d = variants.default
+ if not specification then
+ --
+ elseif type(specification) == "table" then
+ t = specification.targets
+ f = specification.formats or specification
+ else
+ if not ansisupported(specification) then
+ specification = "default"
+ end
+ local v = variants[specification]
+ if v then
+ t = v.targets
+ f = v.formats
+ variant = specification
+ end
+ end
+ targets = t or d.targets
+ target = targets[whereto] or target
+ if f then
+ d = d.formats
+ else
+ f = d.formats
+ d = f
+ end
+ setmetatableindex(f,d)
+ report_yes = f.report_yes
+ report_nop = f.report_nop
+ subreport_yes = f.subreport_yes
+ subreport_nop = f.subreport_nop
+ direct_yes = f.direct_yes
+ direct_nop = f.direct_nop
+ subdirect_yes = f.subdirect_yes
+ subdirect_nop = f.subdirect_nop
+ status_yes = f.status_yes
+ status_nop = f.status_nop
+ if variant == "ansi" or variant == "ansilog" then
+ useluawrites() -- because tex escapes ^^, not needed in lmtx
+ end
+ settarget(whereto)
+ end
+
+ setformatters(variant)
+
+ setlogfile = ignore
+ settimedlog = ignore
+
+ -- settimedlog = function()
+ -- local localtime = os.localtime
+ -- local writeline = write_nl
+ -- write_nl = function(f,...)
+ -- writeline(f,localtime() .. " | " .. concat { ... })
+ -- end
+ -- settimedlog = ignore
+ -- end
+
+end
+
+logs.report = report
+logs.subreport = subreport
+logs.status = status
+logs.settarget = settarget
+logs.pushtarget = pushtarget
+logs.poptarget = poptarget
+logs.setformats = setformats
+logs.settranslations = settranslations
+
+logs.setlogfile = setlogfile
+logs.settimedlog = settimedlog
+logs.setprocessor = setprocessor
+logs.setformatters = setformatters
+
+logs.direct = direct
+logs.subdirect = subdirect
+logs.writer = writer
+logs.newline = newline
+
+local data = { }
+local states = nil
+local force = false
+
+function logs.reporter(category,subcategory)
+ local logger = data[category]
+ if not logger then
+ local state = states == true
+ if not state and type(states) == "table" then
+ for c, _ in next, states do
+ if find(category,c) then
+ state = true
+ break
+ end
+ end
+ end
+ logger = {
+ reporters = { },
+ state = state,
+ }
+ data[category] = logger
+ end
+ local reporter = logger.reporters[subcategory or "default"]
+ if not reporter then
+ if subcategory then
+ reporter = function(...)
+ if force or not logger.state then
+ subreport(category,subcategory,...)
+ end
+ end
+ logger.reporters[subcategory] = reporter
+ else
+ local tag = category
+ reporter = function(...)
+ if force or not logger.state then
+ report(category,...)
+ end
+ end
+ logger.reporters.default = reporter
+ end
+ end
+ return reporter
+end
+
+logs.new = logs.reporter -- for old times sake
+
+-- context specicific: this ends up in the macro stream
+
+local ctxreport = logs.writer
+
+function logs.setmessenger(m)
+ ctxreport = m
+end
+
+function logs.messenger(category,subcategory)
+ -- we need to avoid catcode mess (todo: fast context)
+ if subcategory then
+ return function(...)
+ ctxreport(subdirect(category,subcategory,...))
+ end
+ else
+ return function(...)
+ ctxreport(direct(category,...))
+ end
+ end
+end
+
+-- so far
+
+local function setblocked(category,value) -- v.state == value == true : disable
+ if category == true or category == "all" then
+ -- lock all
+ category, value = "*", true
+ elseif category == false then
+ -- unlock all
+ category, value = "*", false
+ elseif value == nil then
+ -- lock selective
+ value = true
+ end
+ if category == "*" then
+ states = value
+ for k, v in next, data do
+ v.state = value
+ end
+ else
+ alllocked = false
+ states = settings_to_hash(category,type(states)=="table" and states or nil)
+ for c in next, states do
+ local v = data[c]
+ if v then
+ v.state = value
+ else
+ c = topattern(c,true,true)
+ for k, v in next, data do
+ if find(k,c) then
+ v.state = value
+ end
+ end
+ end
+ end
+ end
+end
+
+function logs.disable(category,value)
+ setblocked(category,value == nil and true or value)
+end
+
+function logs.enable(category)
+ setblocked(category,false)
+end
+
+function logs.categories()
+ return sortedkeys(data)
+end
+
+function logs.show()
+ local n, c, s, max = 0, 0, 0, 0
+ for category, v in table.sortedpairs(data) do
+ n = n + 1
+ local state = v.state
+ local reporters = v.reporters
+ local nc = #category
+ if nc > c then
+ c = nc
+ end
+ for subcategory, _ in next, reporters do
+ local ns = #subcategory
+ if ns > c then
+ s = ns
+ end
+ local m = nc + ns
+ if m > max then
+ max = m
+ end
+ end
+ local subcategories = concat(sortedkeys(reporters),", ")
+ if state == true then
+ state = "disabled"
+ elseif state == false then
+ state = "enabled"
+ else
+ state = "unknown"
+ end
+ -- no new here
+ report("logging","category %a, subcategories %a, state %a",category,subcategories,state)
+ end
+ report("logging","categories: %s, max category: %s, max subcategory: %s, max combined: %s",n,c,s,max)
+end
+
+local delayed_reporters = { }
+
+setmetatableindex(delayed_reporters,function(t,k)
+ local v = logs.reporter(k.name)
+ t[k] = v
+ return v
+end)
+
+function utilities.setters.report(setter,...)
+ delayed_reporters[setter](...)
+end
+
+directives.register("logs.blocked", function(v)
+ setblocked(v,true)
+end)
+
+directives.register("logs.target", function(v)
+ settarget(v)
+end)
+
+do
+
+ local report = logs.reporter("pages") -- not needed but saves checking when we grep for it
+ local texgetcount = tex and tex.getcount
+
+ local real, user, sub = 0, 0, 0
+
+ function logs.start_page_number()
+ real = texgetcount("realpageno")
+ user = texgetcount("userpageno")
+ sub = texgetcount("subpageno")
+ end
+
+ local timing = false
+ local usage = false
+ local lasttime = nil
+
+ logs.private = {
+ enablepagetiming = function()
+ usage = true
+ end,
+ getpagetiming = function()
+ return type(usage) == "table" and usage
+ end,
+ }
+
+ trackers.register("pages.timing", function() timing = "" end)
+
+ function logs.stop_page_number() -- the first page can includes the initialization so we omit this in average
+ if timing or usage then
+ local elapsed = statistics.currenttime(statistics)
+ local average, page
+ if not lasttime or real < 2 then
+ average = elapsed
+ page = elapsed
+ else
+ average = elapsed / (real - 1)
+ page = elapsed - lasttime
+ end
+ lasttime = elapsed
+ if timing then
+ timing = formatters[", total %0.03f, page %0.03f, average %0.03f"](elapsed,page,average)
+ end
+ if usage then
+ usage = {
+ page = {
+ real = real,
+ user = user,
+ sub = sub,
+ },
+ time = {
+ elapsed = elapsed,
+ page = page,
+ average = average,
+ }
+ }
+ end
+ end
+ if real <= 0 then
+ report("flushing page%s",timing)
+ elseif user <= 0 then
+ report("flushing realpage %s%s",real,timing)
+ elseif sub <= 0 then
+ report("flushing realpage %s, userpage %s%s",real,user,timing)
+ else
+ report("flushing realpage %s, userpage %s, subpage %s%s",real,user,sub,timing)
+ end
+ logs.flush()
+ end
+
+end
+
+-- we don't have show_open and show_close callbacks yet
+
+do
+ local texerror = tex and tex.error or print
+ local formatters = string.formatters
+
+ function logs.texerrormessage(fmt,first,...) -- for the moment we put this function here
+ texerror(first and formatters[fmt](first,...) or fmt)
+ end
+
+end
+
+-- this is somewhat slower but prevents out-of-order messages when print is mixed
+-- with texio.write
+
+-- io.stdout:setvbuf('no')
+-- io.stderr:setvbuf('no')
+
+-- windows: > nul 2>&1
+-- unix : > null 2>&1
+
+if package.helpers.report then
+ package.helpers.report = logs.reporter("package loader") -- when used outside mtxrun
+end
+
+do
+
+ local finalactions = { }
+ local fatalerrors = { }
+ local possiblefatal = { }
+ local loggingerrors = false
+
+ function logs.loggingerrors()
+ return loggingerrors
+ end
+
+ directives.register("logs.errors",function(v)
+ loggingerrors = v
+ if type(v) == "string" then
+ fatalerrors = settings_to_hash(v)
+ else
+ fatalerrors = { }
+ end
+ end)
+
+ function logs.registerfinalactions(...)
+ insert(finalactions,...) -- so we can force an order if needed
+ end
+
+ local what = nil
+ local report = nil
+ local state = nil
+ local target = nil
+
+ local function startlogging(t,r,w,s)
+ target = t
+ state = force
+ force = true
+ report = type(r) == "function" and r or logs.reporter(r)
+ what = w
+ pushtarget(target)
+ newline()
+ if s then
+ report("start %s: %s",what,s)
+ else
+ report("start %s",what or "")
+ end
+ if target == "logfile" then
+ newline()
+ end
+ return report
+ end
+
+ local function stoplogging()
+ if target == "logfile" then
+ newline()
+ end
+ report("stop %s",what or "")
+ if target == "logfile" then
+ newline()
+ end
+ poptarget()
+ state = oldstate
+ end
+
+ function logs.startfilelogging(...)
+ return startlogging("logfile", ...)
+ end
+
+ logs.stopfilelogging = stoplogging
+
+ local done = false
+
+ function logs.starterrorlogging(r,w,...)
+ if not done then
+ pushtarget("terminal")
+ newline()
+ logs.report("error logging","start possible issues")
+ poptarget()
+ done = true
+ end
+ if fatalerrors[w] then
+ possiblefatal[w] = true
+ end
+ return startlogging("terminal",r,w,...)
+ end
+
+ logs.stoperrorlogging = stoplogging
+
+ function logs.finalactions()
+ if #finalactions > 0 then
+ for i=1,#finalactions do
+ finalactions[i]()
+ end
+ if done then
+ pushtarget("terminal")
+ newline()
+ logs.report("error logging","stop possible issues")
+ poptarget()
+ end
+ return next(possiblefatal) and sortedkeys(possiblefatal) or false
+ end
+ end
+
+end
+
+-- just in case we load from context
+
+local dummy = function() end
+
+function logs.application(t)
+ return {
+ name = t.name or tex.jobname,
+ banner = t.banner,
+ report = logs.reporter(t.name),
+ moreinfo = dummy,
+ export = dummy,
+ help = dummy,
+ identify = dummy,
+ version = dummy,
+ }
+end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/luat-mac.lua b/Master/texmf-dist/tex/context/base/mkiv/luat-mac.lua
index e6789a2338a..3c50a41f89c 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/luat-mac.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/luat-mac.lua
@@ -30,36 +30,125 @@ local report_macros = logs.reporter("interface","macros")
local stack, top, n, hashes = { }, nil, 0, { }
-local function set(s)
- if top then
- n = n + 1
- if n > 9 then
- report_macros("number of arguments > 9, ignoring %s",s)
- else
+-- local function set(s)
+-- if top then
+-- n = n + 1
+-- if n > 9 then
+-- report_macros("number of arguments > 9, ignoring %s",s)
+-- else
+-- local ns = #stack
+-- local h = hashes[ns]
+-- if not h then
+-- h = rep("#",2^(ns-1))
+-- hashes[ns] = h
+-- end
+-- if s == "ignore" then
+-- top[s] = ""
+-- return h .. "0"
+-- else
+-- local m = h .. n
+-- top[s] = m
+-- return m
+-- end
+-- end
+-- end
+-- end
+
+-- local function get(s)
+-- if s == "ignore" then
+-- return ""
+-- else
+-- if not top then
+-- report_macros("keeping #%s, no stack",s)
+-- return "#" .. s -- can be lua
+-- end
+-- local m = top[s]
+-- if m then
+-- return m
+-- else
+-- report_macros("keeping #%s, not on stack",s)
+-- return "#" .. s -- quite likely an error
+-- end
+-- end
+-- end
+
+local set = CONTEXTLMTXMODE > 0 and
+ function(s)
+ if top then
local ns = #stack
local h = hashes[ns]
if not h then
h = rep("#",2^(ns-1))
hashes[ns] = h
end
- local m = h .. n
- top[s] = m
- return m
+ if s == "ignore" then
+ return h .. "-"
+ elseif s == "spacer" then
+ return h .. "*"
+ elseif s == "pickup" then
+ return h .. ":"
+ else
+ n = n + 1
+ if n > 9 then
+ report_macros("number of arguments > 9, ignoring %s",s)
+ elseif s == "discard" then
+ top[s] = ""
+ return h .. "0"
+ elseif s == "keepbraces" then
+ top[s] = ""
+ return h .. "+"
+ elseif s == "mandate" then
+ top[s] = ""
+ return h .. "="
+ elseif s == "keepmandate" then
+ top[s] = ""
+ return h .. "_"
+ elseif s == "prunespacing" then
+ top[s] = ""
+ return h .. "/"
+ else
+ local m = h .. n
+ top[s] = m
+ return m
+ end
+ end
+ end
+ end
+or
+ function(s)
+ if top then
+ local ns = #stack
+ local h = hashes[ns]
+ if not h then
+ h = rep("#",2^(ns-1))
+ hashes[ns] = h
+ end
+ n = n + 1
+ if n > 9 then
+ report_macros("number of arguments > 9, ignoring %s",s)
+ else
+ local m = h .. n
+ top[s] = m
+ return m
+ end
end
end
-end
local function get(s)
- if not top then
- report_macros("keeping #%s, no stack",s)
- return "#" .. s -- can be lua
- end
- local m = top[s]
- if m then
- return m
+ if s == "ignore" or s == "discard" then
+ return ""
else
- report_macros("keeping #%s, not on stack",s)
- return "#" .. s -- quite likely an error
+ if not top then
+ report_macros("keeping #%s, no stack",s)
+ return "#" .. s -- can be lua
+ end
+ local m = top[s]
+ if m then
+ return m
+ else
+ report_macros("keeping #%s, not on stack",s)
+ return "#" .. s -- quite likely an error
+ end
end
end
@@ -209,7 +298,7 @@ end
function macros.convertfile(oldname,newname) -- beware, no testing on oldname == newname
local data = loadtexfile(oldname)
- data = interfaces.preprocessed(data) or "" -- interfaces not yet defined
+ data = macros.preprocessed(data) or "" -- interfaces not yet defined
savedata(newname,data)
end
@@ -336,6 +425,8 @@ end
-- ]]))
-- print(macros.preprocessed([[\checked \def \bla #bla{bla#{bla}}]]))
+-- print(macros.preprocessed([[\checked \def \bla #bla#discard#foo{bla#{bla}+#ignore+bla#foo}]]))
+-- print(macros.preprocessed([[\checked \def \bla #bla#ignore#foo{bla#{bla}+#ignore+bla#foo}]]))
-- print(macros.preprocessed([[\def\bla#bla{#{bla}bla}]]))
-- print(macros.preprocessed([[\def\blä#{blá}{blà:#{blá}}]]))
-- print(macros.preprocessed([[\def\blä#bla{blà:#bla}]]))
diff --git a/Master/texmf-dist/tex/context/base/mkiv/luat-run.lua b/Master/texmf-dist/tex/context/base/mkiv/luat-run.lua
index d29a463b88c..874287ee1a0 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/luat-run.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/luat-run.lua
@@ -45,6 +45,7 @@ local function start_run()
if logs.start_run then
logs.start_run()
end
+ -- logs.report("engine","%s version %s, format id %s",LUATEXENGINE,LUATEXVERSION,LUATEXFORMATID)
for i=1,#startactions do
startactions[i]()
end
@@ -61,7 +62,9 @@ local function stop_run()
if trace_tex_status then
logs.newline()
for k, v in table.sortedhash(status.list()) do
- report_tex("%S=%S",k,v)
+ if type(v) ~= "table" then
+ report_tex("%S=%S",k,v)
+ end
end
end
if quit then
@@ -99,18 +102,11 @@ end
local function report_output_log()
end
--- local function show_open()
--- end
-
--- local function show_close()
--- end
-
local function pre_dump_actions()
for i=1,#dumpactions do
dumpactions[i]()
end
lua.finalize(trace_lua_dump and report_lua or nil)
- -- statistics.savefmtstatus("\jobname","\contextversion","context.tex")
end
local function wrapup_synctex()
@@ -131,10 +127,10 @@ appendgroup(wrapupactions,"user")
appendgroup(cleanupactions,"system")
appendgroup(cleanupactions,"user")
-local function wrapup_run()
+local function wrapup_run(someerror)
local runner = wrapupactions.runner
if runner then
- runner()
+ runner(someerror) -- we could use the error flag in lmtx
end
end
@@ -297,3 +293,36 @@ end)
-- end
-- end)
+local report = logs.reporter("csname overload")
+local reported = { }
+
+callback.register("handle_overload", function(fatal,overload,csname,flags)
+ if not reported[csname] then
+ logs.newline()
+ local readstate = status.readstate
+ local filename = readstate.filename
+ local linenumber = readstate.linenumber
+ local flags = tokens.flags and tokens.flags(csname) or { }
+ if filename and linenumber then
+ report("%s, protection level %i, control sequence %a, properties '% t', file %a, line %i",
+ fatal and "fatal error" or "warning",overload,csname,flags,filename,linenumber)
+ else
+ report("%s, protection level %i, control sequence %a, properties '% t'",
+ fatal and "fatal error" or "warning",overload,csname,flags)
+ end
+ reported[csname] = true
+ logs.newline()
+ if fatal then
+ cleanup_run()
+ osexit(1)
+ end
+ end
+end)
+
+-- bonus
+
+if environment.initex then
+
+ luatex.registerdumpactions(statistics.showmemory)
+
+end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/luat-sto.lua b/Master/texmf-dist/tex/context/base/mkiv/luat-sto.lua
index 620de9a15b4..feb5464009b 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/luat-sto.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/luat-sto.lua
@@ -94,27 +94,12 @@ if environment.initex then
end
--- to be tested with otf caching:
-
-function lua.collectgarbage(threshold)
- local current = collectgarbage("count")
- local threshold = threshold or 256 * 1024
- while true do
- collectgarbage("collect")
- local previous = collectgarbage("count")
- if current - previous < threshold then
- break
- else
- current = previous
- end
- end
-end
-
statistics.register("stored bytecode data", function()
- local nofmodules = (storage.nofmodules > 0 and storage.nofmodules) or (status.luabytecodes - lua.firstbytecode - 1)
- local nofdumps = (storage.noftables > 0 and storage.noftables ) or storage.max-storage.min + 1
- local tofmodules = storage.tofmodules or 0
- local tofdumps = storage.toftables or 0
+ local nofbytecodes = CONTEXTLMTXMODE > 0 and status.luastate.bytecodes or status.luabytecodes
+ local nofmodules = (storage.nofmodules > 0 and storage.nofmodules) or (nofbytecodes - lua.firstbytecode - 1)
+ local nofdumps = (storage.noftables > 0 and storage.noftables ) or storage.max-storage.min + 1
+ local tofmodules = storage.tofmodules or 0
+ local tofdumps = storage.toftables or 0
if environment.initex then
local luautilities = utilities.lua
return format("%s modules, %s tables, %s chunks, %s chunks stripped (%s bytes)",
diff --git a/Master/texmf-dist/tex/context/base/mkiv/luat-usr.lua b/Master/texmf-dist/tex/context/base/mkiv/luat-usr.lua
index b49379bbf05..1756bb19842 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/luat-usr.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/luat-usr.lua
@@ -102,23 +102,6 @@ interfaces.implement {
arguments = "2 strings",
}
--- local scanners = interfaces.scanners
---
--- local function ctxscanner(name)
--- local scanner = scanners[name]
--- if scanner then
--- scanner()
--- else
--- report("unknown scanner: %s",name)
--- end
--- end
---
--- interfaces.implement {
--- name = "clfscanner",
--- actions = ctxscanner,
--- arguments = "string",
--- }
-
local function registername(name,message)
if not name or name == "" then
report_instance("no valid name given")
diff --git a/Master/texmf-dist/tex/context/base/mkiv/luat-usr.mkiv b/Master/texmf-dist/tex/context/base/mkiv/luat-usr.mkiv
index f3868ccf4bc..ebd96e031c4 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/luat-usr.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/luat-usr.mkiv
@@ -38,13 +38,14 @@
%D \macros
%D {definenamedlua}
%D
-%D We provide an interface for defining instances:
+%D We provide an interface for defining instances. We don't have the definers yet
+%D so we do itlow level:
\def\s!lua {lua}
\def\s!code {code}
\def\s!data {data}
-%def\s!start{start}
-%def\s!stop {stop}
+\def\s!start{start}
+\def\s!stop {stop}
%D Beware: because \type {\expanded} is een convert command, the error
%D message will show \type{<inserted text>} as part of the message.
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lxml-aux.lua b/Master/texmf-dist/tex/context/base/mkiv/lxml-aux.lua
index ed0f03fd8c7..126df4d82de 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lxml-aux.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lxml-aux.lua
@@ -22,7 +22,7 @@ local xmlapplylpath = xml.applylpath
local type, next, setmetatable, getmetatable = type, next, setmetatable, getmetatable
local insert, remove, fastcopy, concat = table.insert, table.remove, table.fastcopy, table.concat
-local gmatch, gsub, format, find, strip = string.gmatch, string.gsub, string.format, string.find, string.strip
+local gmatch, gsub, format, find, strip, match = string.gmatch, string.gsub, string.format, string.find, string.strip, string.match
local utfbyte = utf.byte
local lpegmatch, lpegpatterns = lpeg.match, lpeg.patterns
local striplinepatterns = utilities.strings.striplinepatterns
@@ -176,7 +176,7 @@ local function xmltoelement(whatever,root)
end
local element
if type(whatever) == "string" then
- element = xmlinheritedconvert(whatever,root) -- beware, not really a root
+ element = xmlinheritedconvert(whatever,root,true) -- beware, not really a root
else
element = whatever -- we assume a table
end
@@ -195,16 +195,29 @@ end
xml.toelement = xmltoelement
+-- local function copiedelement(element,newparent)
+-- if type(element) ~= "string" then
+-- element = xmlcopy(element).dt
+-- if newparent and type(element) == "table" then
+-- element.__p__ = newparent
+-- end
+-- end
+-- return element
+-- end
+
local function copiedelement(element,newparent)
- if type(element) == "string" then
- return element
- else
+ if type(element) ~= "string" then
element = xmlcopy(element).dt
if newparent and type(element) == "table" then
- element.__p__ = newparent
+ for i=1,#element do
+ local e = element[i]
+ if type(e) == "table" then
+ e.__p__ = newparent
+ end
+ end
end
- return element
end
+ return element
end
function xml.delete(root,pattern)
@@ -247,6 +260,33 @@ function xml.delete(root,pattern)
end
end
+function xml.wipe(root,pattern) -- not yet in manual
+ local collected = xmlapplylpath(root,pattern)
+ if collected then
+ for c=1,#collected do
+ local e = collected[c]
+ local p = e.__p__
+ if p then
+ local d = p.dt
+ local ni = e.ni
+ if ni <= #d then
+ local dt = e.dt
+ if #dt == 1 then
+ local d1 = dt[1]
+ if type(d1) == "string" and match(d1,"^%s*$") then
+ if trace_manipulations then
+ report('wiping',pattern,c,e)
+ end
+ remove(d,ni)
+ redo_ni(d) -- can be made faster and inlined
+ end
+ end
+ end
+ end
+ end
+ end
+end
+
function xml.replace(root,pattern,whatever)
local element = root and xmltoelement(whatever,root)
local collected = element and xmlapplylpath(root,pattern)
@@ -430,10 +470,10 @@ local function include(xmldata,pattern,attribute,recursive,loaddata,level)
-- for the moment hard coded
epdt[ek.ni] = xml.escaped(data) -- d[k] = xml.escaped(data)
else
-local settings = xmldata.settings
-local savedresource = settings.currentresource
-settings.currentresource = name
- local xi = xmlinheritedconvert(data,xmldata)
+ local settings = xmldata.settings
+ local savedresource = settings.currentresource
+ settings.currentresource = name
+ local xi = xmlinheritedconvert(data,xmldata,true)
if not xi then
epdt[ek.ni] = "" -- xml.empty(d,k)
else
@@ -443,7 +483,7 @@ settings.currentresource = name
local child = xml.body(xi) -- xml.assign(d,k,xi)
child.__p__ = ekrt
child.__f__ = name -- handy for tracing
-child.cf = name
+ child.cf = name
epdt[ek.ni] = child
local settings = xmldata.settings
local inclusions = settings and settings.inclusions
@@ -517,30 +557,49 @@ end
local b_collapser = lpegpatterns.b_collapser
local m_collapser = lpegpatterns.m_collapser
local e_collapser = lpegpatterns.e_collapser
+local x_collapser = lpegpatterns.x_collapser
local b_stripper = lpegpatterns.b_stripper
local m_stripper = lpegpatterns.m_stripper
local e_stripper = lpegpatterns.e_stripper
+local x_stripper = lpegpatterns.x_stripper
-local function stripelement(e,nolines,anywhere)
+local function stripelement(e,nolines,anywhere,everything)
local edt = e.dt
if edt then
local n = #edt
if n == 0 then
return e -- convenient
+ elseif everything then
+ local t = { }
+ local m = 0
+ for i=1,n do
+ local str = edt[i]
+ if type(str) ~= "string" then
+ m = m + 1
+ t[m] = str
+ elseif str ~= "" then
+ str = lpegmatch(x_collapser,str)
+ if str ~= "" then
+ m = m + 1
+ t[m] = str
+ end
+ end
+ end
+ e.dt = t
elseif anywhere then
local t = { }
local m = 0
- for e=1,n do
- local str = edt[e]
+ for i=1,n do
+ local str = edt[i]
if type(str) ~= "string" then
m = m + 1
t[m] = str
elseif str ~= "" then
if nolines then
- str = lpegmatch((n == 1 and b_collapser) or (n == m and e_collapser) or m_collapser,str)
+ str = lpegmatch((i == 1 and b_collapser) or (i == m and e_collapser) or m_collapser,str)
else
- str = lpegmatch((n == 1 and b_stripper) or (n == m and e_stripper) or m_stripper,str)
+ str = lpegmatch((i == 1 and b_stripper) or (i == m and e_stripper) or m_stripper,str)
end
if str ~= "" then
m = m + 1
@@ -584,15 +643,51 @@ end
xml.stripelement = stripelement
-function xml.strip(root,pattern,nolines,anywhere) -- strips all leading and trailing spacing
+function xml.strip(root,pattern,nolines,anywhere,everything) -- strips all leading and trailing spacing
local collected = xmlapplylpath(root,pattern) -- beware, indices no longer are valid now
if collected then
for i=1,#collected do
- stripelement(collected[i],nolines,anywhere)
+ stripelement(collected[i],nolines,anywhere,everything)
end
end
+-- return root
end
+-- local function compactelement(e)
+-- local edt = e.dt
+-- if edt then
+-- local t = { }
+-- local m = 0
+-- for e=1,#edt do
+-- local str = edt[e]
+-- if type(str) ~= "string" then
+-- m = m + 1
+-- t[m] = str
+-- elseif str ~= "" and find(str,"%S") then
+-- m = m + 1
+-- t[m] = str
+-- end
+-- end
+-- e.dt = t
+-- end
+-- return e -- convenient
+-- end
+
+local function compactelement(e)
+ local edt = e.dt
+ if edt then
+ for e=1,#edt do
+ local str = edt[e]
+ if type(str) == "string" and not find(str,"%S") then
+ edt[e] = ""
+ end
+ end
+ end
+ return e -- convenient
+end
+
+xml.compactelement = compactelement
+
local function renamespace(root, oldspace, newspace) -- fast variant
local ndt = #root.dt
for i=1,ndt or 0 do
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lxml-css.lua b/Master/texmf-dist/tex/context/base/mkiv/lxml-css.lua
index 96dc626f7db..76cc4891e1d 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lxml-css.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lxml-css.lua
@@ -17,6 +17,8 @@ local setmetatableindex = table.setmetatableindex
xml.css = xml.css or { }
local css = xml.css
+local report_css = logs and logs.reporter("xml","css") or function(...) print(string.format(...)) end
+
local getid = lxml.getid
if not number.dimenfactors then
@@ -787,7 +789,7 @@ local p_not = P(":not") * Cc(true) * skipspace * P("(") * skipspace
local p_yes = Cc(false) * skipspace * p_step
local p_stepper = Ct((skipspace * (p_not+p_yes))^1)
-local p_steps = Ct((p_stepper * p_separator^0)^1) * skipspace * (P(-1) + function() print("error") end)
+local p_steps = Ct((p_stepper * p_separator^0)^1) * skipspace * (P(-1) + function() report_css("recovering from error") end)
local cache = setmetatableindex(function(t,k)
local v = lpegmatch(p_steps,k) or false
@@ -1063,13 +1065,15 @@ end
-- -- faster interface (1.02):
interfaces.implement {
- name = "xmlstylevalue",
+ name = "xmlcssstylevalue",
+ public = true,
actions = css.stylevalue,
arguments = "2 strings",
}
interfaces.implement {
- name = "xmlmappedstylevalue",
+ name = "xmlcssmappedstylevalue",
+ public = true,
actions = css.mappedstylevalue,
arguments = "3 strings",
}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lxml-css.mkiv b/Master/texmf-dist/tex/context/base/mkiv/lxml-css.mkiv
index 04000a6caba..271afdb7dc7 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lxml-css.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/lxml-css.mkiv
@@ -69,8 +69,8 @@
% \xmlregistersetup{html:settings}
% \xmlprocessbuffer{main}{temp}{}
-\let\xmlcssstylevalue \clf_xmlstylevalue
-\let\xmlcssmappedstylevalue\clf_xmlmappedstylevalue
+% \xmlcssstylevalue % defined at lua end
+% \xmlcssmappedstylevalue % defined at lua end
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lxml-ctx.mkiv b/Master/texmf-dist/tex/context/base/mkiv/lxml-ctx.mkiv
index e0beb22bf68..7d44d61bea1 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lxml-ctx.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/lxml-ctx.mkiv
@@ -11,8 +11,8 @@
%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.
+%D Experimental. This might change! Also, it might become a module instead if
+%D core code.
\writestatus{loading}{ConTeXt XML Support / Goodies}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lxml-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/lxml-ini.lua
index 348ecbbe45c..43643f71a18 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lxml-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lxml-ini.lua
@@ -21,120 +21,124 @@ local implement = interfaces.implement
-- lxml.id
-implement { name = "lxmlid", actions = lxml.getid, arguments = "string" }
-
-implement { name = "xmldoif", actions = lxml.doif, arguments = "2 strings" }
-implement { name = "xmldoifnot", actions = lxml.doifnot, arguments = "2 strings" }
-implement { name = "xmldoifelse", actions = lxml.doifelse, arguments = "2 strings" }
-implement { name = "xmldoiftext", actions = lxml.doiftext, arguments = "2 strings" }
-implement { name = "xmldoifnottext", actions = lxml.doifnottext, arguments = "2 strings" }
-implement { name = "xmldoifelsetext", actions = lxml.doifelsetext, arguments = "2 strings" }
-
-implement { name = "xmldoifempty", actions = lxml.doifempty, arguments = "2 strings" }
-implement { name = "xmldoifnotempty", actions = lxml.doifnotempty, arguments = "2 strings" }
-implement { name = "xmldoifelseempty", actions = lxml.doifelseempty, arguments = "2 strings" }
-implement { name = "xmldoifselfempty", actions = lxml.doifempty, arguments = "string" } -- second arg is not passed (used)
-implement { name = "xmldoifnotselfempty", actions = lxml.doifnotempty, arguments = "string" } -- second arg is not passed (used)
-implement { name = "xmldoifelseselfempty", actions = lxml.doifelseempty, arguments = "string" } -- second arg is not passed (used)
-
---------- { name = "xmlcontent", actions = lxml.content, arguments = "string" }
---------- { name = "xmlflushstripped", actions = lxml.strip, arguments = { "string", true } }
-
-implement { name = "xmlall", actions = lxml.all, arguments = "2 strings" }
-implement { name = "xmlatt", actions = lxml.att, arguments = "2 strings" }
-implement { name = "xmlattdef", actions = lxml.att, arguments = "3 strings" }
-implement { name = "xmlattribute", actions = lxml.attribute, arguments = "3 strings" }
-implement { name = "xmlattributedef", actions = lxml.attribute, arguments = "4 strings" }
-implement { name = "xmlbadinclusions", actions = lxml.badinclusions, arguments = "string" }
-implement { name = "xmlchainatt", actions = lxml.chainattribute, arguments = { "string", "'/'", "string" } }
-implement { name = "xmlchainattdef", actions = lxml.chainattribute, arguments = { "string", "'/'", "string", "string" } }
-implement { name = "xmlchecknamespace", actions = xml.checknamespace, arguments = { "lxmlid", "string", "string" } }
-implement { name = "xmlcommand", actions = lxml.command, arguments = "3 strings" }
-implement { name = "xmlconcat", actions = lxml.concat, arguments = "3 strings" } -- \detokenize{#3}
-implement { name = "xmlconcatrange", actions = lxml.concatrange, arguments = { "string", "string", "string", "string", "string" } } -- \detokenize{#5}
-implement { name = "xmlcontext", actions = lxml.context, arguments = "2 strings" }
-implement { name = "xmlcount", actions = lxml.count, arguments = "2 strings" }
-implement { name = "xmldelete", actions = lxml.delete, arguments = "2 strings" }
-implement { name = "xmldirect", actions = lxml.direct, arguments = "string" }
-implement { name = "xmldirectives", actions = lxml.directives.setup, arguments = "string" }
-implement { name = "xmldirectivesafter", actions = lxml.directives.after, arguments = "string" }
-implement { name = "xmldirectivesbefore", actions = lxml.directives.before, arguments = "string" }
-implement { name = "xmldisplayverbatim", actions = lxml.displayverbatim, arguments = "string" }
-implement { name = "xmlelement", actions = lxml.element, arguments = "2 strings" } -- could be integer but now we can alias
-implement { name = "xmlfilter", actions = lxml.filter, arguments = "2 strings" }
-implement { name = "xmlfilterlist", actions = lxml.filterlist, arguments = "2 strings" }
-implement { name = "xmlfirst", actions = lxml.first, arguments = "2 strings" }
-implement { name = "xmlflush", actions = lxml.flush, arguments = "string" }
-implement { name = "xmlflushcontext", actions = lxml.context, arguments = "string" }
-implement { name = "xmlflushlinewise", actions = lxml.flushlinewise, arguments = "string" }
-implement { name = "xmlflushpure", actions = lxml.pure, arguments = "string" }
-implement { name = "xmlflushspacewise", actions = lxml.flushspacewise, arguments = "string" }
-implement { name = "xmlflushtext", actions = lxml.text, arguments = "string" }
-implement { name = "xmlfunction", actions = lxml.applyfunction, arguments = "2 strings" }
-implement { name = "xmlinclude", actions = lxml.include, arguments = { "string", "string", "string", true } }
-implement { name = "xmlincludeoptions", actions = lxml.include, arguments = "4 strings" }
-implement { name = "xmlinclusion", actions = lxml.inclusion, arguments = "string" }
-implement { name = "xmlinclusionbase", actions = lxml.inclusion, arguments = { "string", false, true } }
-implement { name = "xmlinclusions", actions = lxml.inclusions, arguments = "string" }
-implement { name = "xmlindex", actions = lxml.index, arguments = "3 strings" } -- can be integer but now we can alias
-implement { name = "xmlinlineverbatim", actions = lxml.inlineverbatim, arguments = "string" }
-implement { name = "xmllast", actions = lxml.last, arguments = "2 strings" }
-implement { name = "xmllastatt", actions = lxml.lastatt }
-implement { name = "xmllastmatch", actions = lxml.lastmatch }
-implement { name = "xmllastpar", actions = lxml.lastpar }
-implement { name = "xmlloadfile", actions = lxml.load, arguments = "3 strings" }
-implement { name = "xmlloadbuffer", actions = lxml.loadbuffer, arguments = "3 strings" }
-implement { name = "xmlloaddata", actions = lxml.loaddata, arguments = "3 strings" }
-implement { name = "xmlloaddirectives", actions = lxml.directives.load, arguments = "string" }
-implement { name = "xmlmain", actions = lxml.main, arguments = "string" }
-implement { name = "xmlmatch", actions = lxml.match, arguments = "string" }
-implement { name = "xmlname", actions = lxml.name, arguments = "string" }
-implement { name = "xmlnamespace", actions = lxml.namespace, arguments = "string" }
-implement { name = "xmlnonspace", actions = lxml.nonspace, arguments = "2 strings" }
-implement { name = "xmlpar", actions = lxml.par, arguments = "2 strings" }
-implement { name = "xmlparam", actions = lxml.param, arguments = "3 strings" }
-implement { name = "xmlpath", actions = lxml.path, arguments = { "string", "'/'" } }
-implement { name = "xmlpopmatch", actions = lxml.popmatch }
-implement { name = "xmlpos", actions = lxml.pos, arguments = "string" }
-implement { name = "xmlpure", actions = lxml.pure, arguments = "2 strings" }
-implement { name = "xmlpushmatch", actions = lxml.pushmatch }
-implement { name = "xmlraw", actions = lxml.raw, arguments = "2 strings" }
-implement { name = "xmlrawtex", actions = lxml.rawtex, arguments = "2 strings" }
-implement { name = "xmlrefatt", actions = lxml.refatt, arguments = "2 strings" }
-implement { name = "xmlregisterns", actions = xml.registerns, arguments = "2 strings" }
-implement { name = "xmlremapname", actions = xml.remapname, arguments = { "lxmlid", "string","string","string" } }
-implement { name = "xmlremapnamespace", actions = xml.renamespace, arguments = { "lxmlid", "string", "string" } }
-implement { name = "xmlsave", actions = lxml.save, arguments = "2 strings" }
-implement { name = "xmlsetatt", actions = lxml.setatt, arguments = "3 strings" }
-implement { name = "xmlsetattribute", actions = lxml.setattribute, arguments = "4 strings" }
-implement { name = "xmlsetpar", actions = lxml.setpar, arguments = "3 strings" }
-implement { name = "xmlsetparam", actions = lxml.setparam, arguments = "4 strings" }
-implement { name = "xmlsetsetup", actions = lxml.setsetup, arguments = "3 strings" }
-implement { name = "xmlsnippet", actions = lxml.snippet, arguments = "2 strings" }
-implement { name = "xmlstrip", actions = lxml.strip, arguments = "2 strings" }
-implement { name = "xmlstripanywhere", actions = lxml.strip, arguments = { "string", "string", true, true } }
-implement { name = "xmlstripnolines", actions = lxml.strip, arguments = { "string", "string", true } }
-implement { name = "xmlstripped", actions = lxml.stripped, arguments = "2 strings" }
-implement { name = "xmlstrippednolines", actions = lxml.stripped, arguments = { "string", "string", true } }
-implement { name = "xmltag", actions = lxml.tag, arguments = "string" }
-implement { name = "xmltext", actions = lxml.text, arguments = "2 strings" }
-implement { name = "xmltobuffer", actions = lxml.tobuffer, arguments = "3 strings" }
-implement { name = "xmltobuffertextonly", actions = lxml.tobuffer, arguments = { "string", "string", "string", false } }
-implement { name = "xmltobufferverbose", actions = lxml.tobuffer, arguments = { "string", "string", "string", true, true } }
-implement { name = "xmltofile", actions = lxml.tofile, arguments = "3 strings" }
-implement { name = "xmltoparameters", actions = lxml.toparameters, arguments = "string" }
-implement { name = "xmlverbatim", actions = lxml.verbatim, arguments = "string" }
-
-implement { name = "xmlstartraw", actions = lxml.startraw }
-implement { name = "xmlstopraw", actions = lxml.stopraw }
-
-implement { name = "xmlprependsetup", actions = lxml.installsetup, arguments = { 1, "string", "string" } } -- 2:*
-implement { name = "xmlappendsetup", actions = lxml.installsetup, arguments = { 2, "string", "string" } } -- 2:*
-implement { name = "xmlbeforesetup", actions = lxml.installsetup, arguments = { 3, "string", "string", "string" } } -- 2:*
-implement { name = "xmlaftersetup", actions = lxml.installsetup, arguments = { 4, "string", "string", "string" } } -- 2:*
-implement { name = "xmlremovesetup", actions = lxml.removesetup, arguments = "2 strings" } -- 1:*
-implement { name = "xmlflushsetups", actions = lxml.flushsetups, arguments = "3 strings" } -- 2:*
-implement { name = "xmlresetsetups", actions = lxml.resetsetups, arguments = "string" }
+implement { name = "lxmlid", public = true, actions = lxml.getid, arguments = "string" }
+
+implement { name = "xmldoif", public = true, actions = lxml.doif, arguments = "2 strings" }
+implement { name = "xmldoifnot", public = true, actions = lxml.doifnot, arguments = "2 strings" }
+implement { name = "xmldoifelse", public = true, actions = lxml.doifelse, arguments = "2 strings" }
+implement { name = "xmldoiftext", public = true, actions = lxml.doiftext, arguments = "2 strings" }
+implement { name = "xmldoifnottext", public = true, actions = lxml.doifnottext, arguments = "2 strings" }
+implement { name = "xmldoifelsetext", public = true, actions = lxml.doifelsetext, arguments = "2 strings" }
+
+implement { name = "xmldoifempty", public = true, actions = lxml.doifempty, arguments = "2 strings" }
+implement { name = "xmldoifnotempty", public = true, actions = lxml.doifnotempty, arguments = "2 strings" }
+implement { name = "xmldoifelseempty", public = true, actions = lxml.doifelseempty, arguments = "2 strings" }
+implement { name = "xmldoifselfempty", public = true, actions = lxml.doifempty, arguments = "string" } -- second arg is not passed (used)
+implement { name = "xmldoifnotselfempty", public = true, actions = lxml.doifnotempty, arguments = "string" } -- second arg is not passed (used)
+implement { name = "xmldoifelseselfempty", public = true, actions = lxml.doifelseempty, arguments = "string" } -- second arg is not passed (used)
+
+--------- { name = "xmlcontent", actions = lxml.content, arguments = "string" }
+--------- { name = "xmlflushstripped", actions = lxml.strip, arguments = { "string", true } }
+
+implement { name = "xmlall", public = true, actions = lxml.all, arguments = "2 strings" }
+implement { name = "xmlatt", public = true, actions = lxml.att, arguments = "2 strings" }
+implement { name = "xmlattdef", public = true, actions = lxml.att, arguments = "3 strings" }
+implement { name = "xmlattribute", public = true, actions = lxml.attribute, arguments = "3 strings" }
+implement { name = "xmlattributedef", public = true, actions = lxml.attribute, arguments = "4 strings" }
+implement { name = "xmlbadinclusions", public = true, actions = lxml.badinclusions, arguments = "string" }
+implement { name = "xmlchainatt", public = true, actions = lxml.chainattribute, arguments = { "string", "'/'", "string" } }
+implement { name = "xmlchainattdef", public = true, actions = lxml.chainattribute, arguments = { "string", "'/'", "string", "string" } }
+implement { name = "xmlchecknamespace", public = true, actions = xml.checknamespace, arguments = { "lxmlid", "string", "string" } }
+implement { name = "xmlcommand", public = true, actions = lxml.command, arguments = "3 strings" }
+implement { name = "xmlconcat", actions = lxml.concat, arguments = "3 strings" } -- \detokenize{#3}
+implement { name = "xmlconcatrange", actions = lxml.concatrange, arguments = "5 strings" } -- \detokenize{#5}
+--------- { name = "xmlconcat", actions = lxml.concat, arguments = { "string", "string", "verbatim" } }
+--------- { name = "xmlconcatrange", actions = lxml.concatrange, arguments = { "string", "string", "string", "string", "verbatim" } }
+implement { name = "xmlcontext", public = true, actions = lxml.context, arguments = "2 strings" }
+implement { name = "xmlcount", public = true, actions = lxml.count, arguments = "2 strings" }
+implement { name = "xmldepth", public = true, actions = lxml.depth, arguments = "string" }
+implement { name = "xmldelete", public = true, actions = lxml.delete, arguments = "2 strings" }
+implement { name = "xmldirect", public = true, actions = lxml.direct, arguments = "string" }
+implement { name = "xmldirectives", public = true, actions = lxml.directives.setup, arguments = "string" }
+implement { name = "xmldirectivesafter", public = true, actions = lxml.directives.after, arguments = "string" }
+implement { name = "xmldirectivesbefore", public = true, actions = lxml.directives.before, arguments = "string" }
+implement { name = "xmldisplayverbatim", public = true, actions = lxml.displayverbatim, arguments = "string" }
+implement { name = "xmlelement", public = true, actions = lxml.element, arguments = "2 strings" } -- could be integer but now we can alias
+implement { name = "xmlfilter", public = true, actions = lxml.filter, arguments = "2 strings" }
+implement { name = "xmlfilterlist", public = true, actions = lxml.filterlist, arguments = "2 strings" }
+implement { name = "xmlfirst", public = true, actions = lxml.first, arguments = "2 strings" }
+implement { name = "xmlflush", public = true, actions = lxml.flush, arguments = "string" }
+implement { name = "xmlflushcontext", public = true, actions = lxml.context, arguments = "string" }
+implement { name = "xmlflushlinewise", public = true, actions = lxml.flushlinewise, arguments = "string" }
+implement { name = "xmlflushpure", public = true, actions = lxml.pure, arguments = "string" }
+implement { name = "xmlflushspacewise", public = true, actions = lxml.flushspacewise, arguments = "string" }
+implement { name = "xmlflushtext", public = true, actions = lxml.text, arguments = "string" }
+implement { name = "xmlfunction", public = true, actions = lxml.applyfunction, arguments = "2 strings" }
+implement { name = "xmlinclude", public = true, actions = lxml.include, arguments = { "string", "string", "string", true } }
+implement { name = "xmlincludeoptions", public = true, actions = lxml.include, arguments = "4 strings" }
+implement { name = "xmlinclusion", public = true, actions = lxml.inclusion, arguments = "string" }
+implement { name = "xmlinclusionbase", public = true, actions = lxml.inclusion, arguments = { "string", false, true } }
+implement { name = "xmlinclusions", public = true, actions = lxml.inclusions, arguments = "string" }
+implement { name = "xmlindex", public = true, actions = lxml.index, arguments = "3 strings" } -- can be integer but now we can alias
+implement { name = "xmlinlineverbatim", public = true, actions = lxml.inlineverbatim, arguments = "string" }
+implement { name = "xmllast", public = true, actions = lxml.last, arguments = "2 strings" }
+implement { name = "xmllastatt", public = true, actions = lxml.lastatt }
+implement { name = "xmllastmatch", public = true, actions = lxml.lastmatch }
+implement { name = "xmllastpar", public = true, actions = lxml.lastpar }
+implement { name = "xmlloadfile", actions = lxml.load, arguments = "3 strings" }
+implement { name = "xmlloadbuffer", actions = lxml.loadbuffer, arguments = "3 strings" }
+implement { name = "xmlloaddata", actions = lxml.loaddata, arguments = "3 strings" }
+implement { name = "xmlloaddirectives", public = true, actions = lxml.directives.load, arguments = "string" }
+implement { name = "xmlmain", public = true, actions = lxml.main, arguments = "string" }
+implement { name = "xmlmatch", public = true, actions = lxml.match, arguments = "string" }
+implement { name = "xmlname", public = true, actions = lxml.name, arguments = "string" }
+implement { name = "xmlnamespace", public = true, actions = lxml.namespace, arguments = "string" }
+implement { name = "xmlnonspace", public = true, actions = lxml.nonspace, arguments = "2 strings" }
+implement { name = "xmlpar", public = true, actions = lxml.par, arguments = "2 strings" }
+implement { name = "xmlparam", public = true, actions = lxml.param, arguments = "3 strings" }
+implement { name = "xmlpath", public = true, actions = lxml.path, arguments = { "string", "'/'" } }
+implement { name = "xmlpopmatch", public = true, actions = lxml.popmatch }
+implement { name = "xmlpos", public = true, actions = lxml.pos, arguments = "string" }
+implement { name = "xmlpure", public = true, actions = lxml.pure, arguments = "2 strings" }
+implement { name = "xmlpushmatch", public = true, actions = lxml.pushmatch }
+implement { name = "xmlraw", public = true, actions = lxml.raw, arguments = "2 strings" }
+implement { name = "xmlrawtex", actions = lxml.rawtex, arguments = "2 strings" }
+implement { name = "xmlrefatt", public = true, actions = lxml.refatt, arguments = "2 strings" }
+implement { name = "xmlregisterns", public = true, actions = xml.registerns, arguments = "2 strings" }
+implement { name = "xmlremapname", public = true, actions = xml.remapname, arguments = { "lxmlid", "string","string","string" } }
+implement { name = "xmlremapnamespace", public = true, actions = xml.renamespace, arguments = { "lxmlid", "string", "string" } }
+implement { name = "xmlsave", public = true, actions = lxml.save, arguments = "2 strings" }
+implement { name = "xmlsetatt", public = true, actions = lxml.setatt, arguments = "3 strings" }
+implement { name = "xmlsetattribute", public = true, actions = lxml.setattribute, arguments = "4 strings" }
+implement { name = "xmlsetpar", public = true, actions = lxml.setpar, arguments = "3 strings" }
+implement { name = "xmlsetparam", public = true, actions = lxml.setparam, arguments = "4 strings" }
+implement { name = "xmlsetsetup", public = true, actions = lxml.setsetup, arguments = "3 strings" }
+implement { name = "xmlsnippet", public = true, actions = lxml.snippet, arguments = "2 strings" }
+implement { name = "xmlstrip", public = true, actions = lxml.strip, arguments = "2 strings" }
+implement { name = "xmlstripanywhere", public = true, actions = lxml.strip, arguments = { "string", "string", true, true } }
+implement { name = "xmlstripeverything", public = true, actions = lxml.strip, arguments = { "string", "string", true, true, true } }
+implement { name = "xmlstripnolines", public = true, actions = lxml.strip, arguments = { "string", "string", true } }
+implement { name = "xmlstripped", public = true, actions = lxml.stripped, arguments = "2 strings" }
+implement { name = "xmlstrippednolines", public = true, actions = lxml.stripped, arguments = { "string", "string", true } }
+implement { name = "xmltag", public = true, actions = lxml.tag, arguments = "string" }
+implement { name = "xmltext", public = true, actions = lxml.text, arguments = "2 strings" }
+implement { name = "xmltobuffer", public = true, actions = lxml.tobuffer, arguments = "3 strings" }
+implement { name = "xmltobuffertextonly", public = true, actions = lxml.tobuffer, arguments = { "string", "string", "string", false } }
+implement { name = "xmltobufferverbose", public = true, actions = lxml.tobuffer, arguments = { "string", "string", "string", true, true } }
+implement { name = "xmltofile", public = true, actions = lxml.tofile, arguments = "3 strings" }
+implement { name = "xmltoparameters", public = true, actions = lxml.toparameters, arguments = "string" }
+implement { name = "xmlverbatim", public = true, actions = lxml.verbatim, arguments = "string" }
+
+implement { name = "xmlstartraw", actions = lxml.startraw }
+implement { name = "xmlstopraw", actions = lxml.stopraw }
+
+implement { name = "xmlprependsetup", actions = lxml.installsetup, arguments = { 1, "string", "string" } } -- 2:*
+implement { name = "xmlappendsetup", actions = lxml.installsetup, arguments = { 2, "string", "string" } } -- 2:*
+implement { name = "xmlbeforesetup", actions = lxml.installsetup, arguments = { 3, "string", "string", "string" } } -- 2:*
+implement { name = "xmlaftersetup", actions = lxml.installsetup, arguments = { 4, "string", "string", "string" } } -- 2:*
+implement { name = "xmlremovesetup", actions = lxml.removesetup, arguments = "2 strings" } -- 1:*
+implement { name = "xmlflushsetups", actions = lxml.flushsetups, arguments = "3 strings" } -- 2:*
+implement { name = "xmlresetsetups", actions = lxml.resetsetups, arguments = "string" }
implement { name = "xmlgetindex", actions = lxml.getindex, arguments = "2 strings" }
implement { name = "xmlwithindex", actions = lxml.withindex, arguments = "3 strings" }
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lxml-ini.mkiv b/Master/texmf-dist/tex/context/base/mkiv/lxml-ini.mkiv
index 09358e11cba..52514519a96 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lxml-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/lxml-ini.mkiv
@@ -34,7 +34,7 @@
\def\ctxlxml #1{\ctxlua{lxml.#1}}
-% for now indirect
+% for now indirect .. this will change when we have updated luatex (scan_argument)
\def\xmlconcat #1#2#3{\clf_xmlconcat {#1}{#2}{\detokenize{#3}}}
\def\xmlconcatrange #1#2#3#4#5{\clf_xmlconcatrange{#1}{#2}{#3}{#4}{\detokenize{#5}}}
@@ -49,93 +49,94 @@
% aliased
-\let\xmlall \clf_xmlall
-\let\xmlatt \clf_xmlatt
-\let\xmlattdef \clf_xmlattdef
-\let\xmlattribute \clf_xmlattribute
-\let\xmlattributedef \clf_xmlattributedef
-\let\xmlbadinclusions \clf_xmlbadinclusions
-\let\xmlchainatt \clf_xmlchainatt
-\let\xmlchainattdef \clf_xmlchainattdef
-\let\xmlchecknamespace \clf_xmlchecknamespace
-\let\xmlcommand \clf_xmlcommand
-\let\xmlcontext \clf_xmlcontext
-\let\xmlcount \clf_xmlcount
-\let\xmldelete \clf_xmldelete
-\let\xmldirect \clf_xmldirect % in loops, not dt but root
-\let\xmldirectives \clf_xmldirectives
-\let\xmldirectivesafter \clf_xmldirectivesafter
-\let\xmldirectivesbefore \clf_xmldirectivesbefore
-\let\xmldisplayverbatim \clf_xmldisplayverbatim
-\let\xmlelement \clf_xmlelement
-\let\xmlfilter \clf_xmlfilter
-\let\xmlfilterlist \clf_xmlfilterlist
-\let\xmlfirst \clf_xmlfirst
-\let\xmlflush \clf_xmlflush
-\let\xmlflushcontext \clf_xmlflushcontext
-\let\xmlflushlinewise \clf_xmlflushlinewise
-\let\xmlflushpure \clf_xmlflushpure
-\let\xmlflushspacewise \clf_xmlflushspacewise
-\let\xmlflushtext \clf_xmlflushtext
-\let\xmlfunction \clf_xmlfunction
-\let\xmlinclude \clf_xmlinclude
-\let\xmlincludeoptions \clf_xmlincludeoptions
-\let\xmlinclusion \clf_xmlinclusion
-\let\xmlinclusionbase \clf_xmlinclusionbase
-\let\xmlinclusions \clf_xmlinclusions
-\let\xmlindex \clf_xmlindex
-\let\xmlinlineverbatim \clf_xmlinlineverbatim
-\let\xmllast \clf_xmllast
-\let\xmllastatt \clf_xmllastatt
-\let\xmllastmatch \clf_xmllastmatch
-\let\xmllastpar \clf_xmllastpar
-\let\xmlloaddirectives \clf_xmlloaddirectives
-\let\xmlmain \clf_xmlmain
-\let\xmlmatch \clf_xmlmatch
-\let\xmlname \clf_xmlname
-\let\xmlnamespace \clf_xmlnamespace
-\let\xmlnonspace \clf_xmlnonspace
-\let\xmlpar \clf_xmlpar
-\let\xmlparam \clf_xmlparam
-\let\xmlpath \clf_xmlpath
-\let\xmlpopmatch \clf_xmlpopmatch
-\let\xmlpos \clf_xmlpos
-\let\xmlposition \clf_xmlindex
-\let\xmlpure \clf_xmlpure
-\let\xmlpushmatch \clf_xmlpushmatch
-\let\xmlraw \clf_xmlraw
-\let\xmlrefatt \clf_xmlrefatt
-\let\xmlregisterns \clf_xmlregisterns % document
-\let\xmlremapname \clf_xmlremapname % element
-\let\xmlremapnamespace \clf_xmlremapnamespace % document
-\let\xmlsave \clf_xmlsave
-\let\xmlsetatt \clf_xmlsetatt
-\let\xmlsetattribute \clf_xmlsetattribute
-\let\xmlsetpar \clf_xmlsetpar
-\let\xmlsetparam \clf_xmlsetparam
-\let\xmlsetsetup \clf_xmlsetsetup
-\let\xmlsnippet \clf_xmlsnippet
-\let\xmlstrip \clf_xmlstrip
-\let\xmlstripanywhere \clf_xmlstripanywhere
-\let\xmlstripnolines \clf_xmlstripnolines
-\let\xmlstripped \clf_xmlstripped
-\let\xmlstrippednolines \clf_xmlstrippednolines
-\let\xmltag \clf_xmltag
-\let\xmltext \clf_xmltext
-\let\xmltobuffer \clf_xmltobuffer % id pattern name
-\let\xmltobuffertextonly \clf_xmltobuffertextonly % id pattern name
-\let\xmltobufferverbose \clf_xmltobufferverbose % id pattern name
-\let\xmltofile \clf_xmltofile % id pattern filename
-\let\xmltoparameters \clf_xmltoparameters
-\let\xmlverbatim \clf_xmlverbatim
-
-\unexpanded\def\xmlinfo#1{\hbox{\ttxx[\clf_xmlname{#1}]}}
+%let\xmlall \clf_xmlall
+%let\xmlatt \clf_xmlatt
+%let\xmlattdef \clf_xmlattdef
+%let\xmlattribute \clf_xmlattribute
+%let\xmlattributedef \clf_xmlattributedef
+%let\xmlbadinclusions \clf_xmlbadinclusions
+%let\xmlchainatt \clf_xmlchainatt
+%let\xmlchainattdef \clf_xmlchainattdef
+%let\xmlchecknamespace \clf_xmlchecknamespace
+%let\xmlcommand \clf_xmlcommand
+%let\xmlcontext \clf_xmlcontext
+%let\xmlcount \clf_xmlcount
+%let\xmldelete \clf_xmldelete
+%let\xmldirect \clf_xmldirect % in loops, not dt but root
+%let\xmldirectives \clf_xmldirectives
+%let\xmldirectivesafter \clf_xmldirectivesafter
+%let\xmldirectivesbefore \clf_xmldirectivesbefore
+%let\xmldisplayverbatim \clf_xmldisplayverbatim
+%let\xmlelement \clf_xmlelement
+%let\xmlfilter \clf_xmlfilter
+%let\xmlfilterlist \clf_xmlfilterlist
+%let\xmlfirst \clf_xmlfirst
+%let\xmlflush \clf_xmlflush
+%let\xmlflushcontext \clf_xmlflushcontext
+%let\xmlflushlinewise \clf_xmlflushlinewise
+%let\xmlflushpure \clf_xmlflushpure
+%let\xmlflushspacewise \clf_xmlflushspacewise
+%let\xmlflushtext \clf_xmlflushtext
+%let\xmlfunction \clf_xmlfunction
+%let\xmlinclude \clf_xmlinclude
+%let\xmlincludeoptions \clf_xmlincludeoptions
+%let\xmlinclusion \clf_xmlinclusion
+%let\xmlinclusionbase \clf_xmlinclusionbase
+%let\xmlinclusions \clf_xmlinclusions
+%let\xmlindex \clf_xmlindex
+%let\xmlinlineverbatim \clf_xmlinlineverbatim
+%let\xmllast \clf_xmllast
+%let\xmllastatt \clf_xmllastatt
+%let\xmllastmatch \clf_xmllastmatch
+%let\xmllastpar \clf_xmllastpar
+%let\xmlloaddirectives \clf_xmlloaddirectives
+%let\xmlmain \clf_xmlmain
+%let\xmlmatch \clf_xmlmatch
+%let\xmlname \clf_xmlname
+%let\xmlnamespace \clf_xmlnamespace
+%let\xmlnonspace \clf_xmlnonspace
+%let\xmlpar \clf_xmlpar
+%let\xmlparam \clf_xmlparam
+%let\xmlpath \clf_xmlpath
+%let\xmlpopmatch \clf_xmlpopmatch
+%let\xmlpos \clf_xmlpos
+%let\xmlpure \clf_xmlpure
+%let\xmlpushmatch \clf_xmlpushmatch
+%let\xmlraw \clf_xmlraw
+%let\xmlrefatt \clf_xmlrefatt
+%let\xmlregisterns \clf_xmlregisterns % document
+%let\xmlremapname \clf_xmlremapname % element
+%let\xmlremapnamespace \clf_xmlremapnamespace % document
+%let\xmlsave \clf_xmlsave
+%let\xmlsetatt \clf_xmlsetatt
+%let\xmlsetattribute \clf_xmlsetattribute
+%let\xmlsetpar \clf_xmlsetpar
+%let\xmlsetparam \clf_xmlsetparam
+%let\xmlsetsetup \clf_xmlsetsetup
+%let\xmlsnippet \clf_xmlsnippet
+%let\xmlstrip \clf_xmlstrip
+%let\xmlstripanywhere \clf_xmlstripanywhere
+%let\xmlstripnolines \clf_xmlstripnolines
+%let\xmlstripped \clf_xmlstripped
+%let\xmlstrippednolines \clf_xmlstrippednolines
+%let\xmltag \clf_xmltag
+%let\xmltext \clf_xmltext
+%let\xmltobuffer \clf_xmltobuffer % id pattern name
+%let\xmltobuffertextonly \clf_xmltobuffertextonly % id pattern name
+%let\xmltobufferverbose \clf_xmltobufferverbose % id pattern name
+%let\xmltofile \clf_xmltofile % id pattern filename
+%let\xmltoparameters \clf_xmltoparameters
+%let\xmlverbatim \clf_xmlverbatim
+
+\let\xmlposition \xmlindex
+
+\unexpanded\def\xmlinfo#1{\hbox{\ttxx[\xmlname{#1}]}}
\unexpanded\def\xmlshow#1{\startpacked\ttx\xmlverbatim{#1}\stoppacked}
% the next one is handy for mode runs because it enforces a consistent
% #1 indexing (needed when using \xmltext{main:123}{...} like calls
-\let\xmladdindex \clf_xmladdindex
+%let\xmladdindex \clf_xmladdindex
% we need to pass the last argument as function, so
@@ -185,23 +186,23 @@
% these are expandable! todo: \xmldoifelseattribute
-\let\xmldoif \clf_xmldoif
-\let\xmldoifnot \clf_xmldoifnot
-\let\xmldoifelse \clf_xmldoifelse
-\let\xmldoiftext \clf_xmldoiftext
-\let\xmldoifnottext \clf_xmldoifnottext
-\let\xmldoifelsetext \clf_xmldoifelsetext
-
-\let\xmldoifatt \clf_xmldoifatt
-\let\xmldoifnotatt \clf_xmldoifnotatt
-\let\xmldoifelseatt \clf_xmldoifelseatt
-
-\let\xmldoifempty \clf_xmldoifempty
-\let\xmldoifnotempty \clf_xmldoifnotempty
-\let\xmldoifelseempty \clf_xmldoifelseempty
-\let\xmldoifselfempty \clf_xmldoifselfempty
-\let\xmldoifnotselfempty \clf_xmldoifnotselfempty
-\let\xmldoifelseselfempty \clf_xmldoifelseselfempty
+%let\xmldoif \clf_xmldoif
+%let\xmldoifnot \clf_xmldoifnot
+%let\xmldoifelse \clf_xmldoifelse
+%let\xmldoiftext \clf_xmldoiftext
+%let\xmldoifnottext \clf_xmldoifnottext
+%let\xmldoifelsetext \clf_xmldoifelsetext
+
+%let\xmldoifatt \clf_xmldoifatt
+%let\xmldoifnotatt \clf_xmldoifnotatt
+%let\xmldoifelseatt \clf_xmldoifelseatt
+
+%let\xmldoifempty \clf_xmldoifempty
+%let\xmldoifnotempty \clf_xmldoifnotempty
+%let\xmldoifelseempty \clf_xmldoifelseempty
+%let\xmldoifselfempty \clf_xmldoifselfempty
+%let\xmldoifnotselfempty \clf_xmldoifnotselfempty
+%let\xmldoifelseselfempty \clf_xmldoifelseselfempty
\let\xmldoiftextelse \xmldoifelsetext
\let\xmldoifemptyelse \xmldoifelseempty
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lxml-lpt.lua b/Master/texmf-dist/tex/context/base/mkiv/lxml-lpt.lua
index 5bcdfbabcb0..9e4b475fb09 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lxml-lpt.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lxml-lpt.lua
@@ -648,7 +648,7 @@ local lp_attribute = (P("@") + P("attribute::")) / "" * Cc("(ll.at and ll.at['")
----- lp_fastpos_n = (P("-") * R("09")^1 * P(-1)) / function(s) return "(" .. s .. "<0 and (#list+".. s .. "==l))" end
local lp_fastpos_p = P("+")^0 * R("09")^1 * P(-1) / "l==%0"
-local lp_fastpos_n = P("-") * R("09")^1 * P(-1) / "(%0<0 and (#list+%0==l))"
+local lp_fastpos_n = P("-") * R("09")^1 * P(-1) / "(%0<0 and (#list+%0+1==l))" -- +1 added
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")
@@ -1317,6 +1317,8 @@ end
-- return false
-- end
+-- could be a hashed hash
+
expressions.oneof = function(s,...)
for i=1,select("#",...) do
if s == select(i,...) then
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lxml-tab.lua b/Master/texmf-dist/tex/context/base/mkiv/lxml-tab.lua
index 8f6379f2f8b..3af4974d300 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lxml-tab.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lxml-tab.lua
@@ -1292,13 +1292,26 @@ end
xml.convert = xmlconvert
-function xml.inheritedconvert(data,xmldata) -- xmldata is parent
+function xml.inheritedconvert(data,xmldata,cleanup) -- xmldata is parent
local settings = xmldata.settings
if settings then
settings.parent_root = xmldata -- to be tested
end
-- settings.no_root = true
local xc = xmlconvert(data,settings) -- hm, we might need to locate settings
+ if cleanup then
+ local x = xc.dt
+ if x then
+ x = x[1]
+ if x and x.tg == "@pi@" then
+ local dt = x.dt
+ local pi = dt and dt[1]
+ if type(pi) == "string" and find(pi,"^xml") then
+ remove(dt,1)
+ end
+ end
+ end
+ end
-- xc.settings = nil
-- xc.entities = nil
-- xc.special = nil
@@ -1414,9 +1427,17 @@ local function copy(old,p)
new[k] = t
elseif k == "dt" then
v.__p__ = nil
- v = copy(v,new)
- new[k] = v
- v.__p__ = p
+ local t = { }
+ for i=1,#v do
+ local vi = v[i]
+ if type(vi) == "table" then
+ t[i] = copy(vi,new)
+ else
+ t[i] = vi
+ end
+ end
+ new[k] = t
+ t.__p__ = p
else
new[k] = v -- so we also share entities, etc in root
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lxml-tex.lua b/Master/texmf-dist/tex/context/base/mkiv/lxml-tex.lua
index 9ab8cafc60a..7a79ee15f4d 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lxml-tex.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lxml-tex.lua
@@ -14,7 +14,7 @@ local concat, insert, remove, sortedkeys, reversed = table.concat, table.insert,
local format, sub, gsub, find, gmatch, match = string.format, string.sub, string.gsub, string.find, string.gmatch, string.match
local type, next, tonumber, tostring, select = type, next, tonumber, tostring, select
local lpegmatch = lpeg.match
-local P, S, C, Cc, Cs = lpeg.P, lpeg.S, lpeg.C, lpeg.Cc, lpeg.Cs
+local P, S, C = lpeg.P, lpeg.S, lpeg.C
local patterns = lpeg.patterns
local setmetatableindex = table.setmetatableindex
local formatters, strip = string.formatters, string.strip
@@ -472,6 +472,7 @@ lxml.addindex = addindex
implement {
name = "xmladdindex",
arguments = "string",
+ public = true,
actions = addindex,
}
@@ -1754,6 +1755,23 @@ local function concatlist(collected,separator,lastseparator,textonly) -- test th
concatrange(collected,false,false,separator,lastseparator,textonly)
end
+local function depth(collected)
+ local d = 0
+ if collected then
+ local c = collected and collected[1]
+ if c.tg then
+ while c do
+ d = d + 1
+ c = c.__p__
+ if not c then
+ break
+ end
+ end
+ end
+ end
+ contextsprint(ctxcatcodes,d)
+end
+
texfinalizers.first = first
texfinalizers.last = last
texfinalizers.all = all
@@ -1777,6 +1795,7 @@ texfinalizers.concatrange = concatrange
texfinalizers.chainattribute = chainattribute
texfinalizers.chainpath = chainpath
texfinalizers.default = all -- !!
+texfinalizers.depth = depth
function texfinalizers.tag(collected,n)
if collected then
@@ -1862,6 +1881,10 @@ lxml.verbatim = verbatim
-- helpers
+function lxml.depth(id)
+ depth { getid(id) }
+end
+
function lxml.first(id,pattern)
local collected = xmlapplylpath(getid(id),pattern)
if collected then
@@ -2070,7 +2093,8 @@ do
implement {
name = "xmldoifatt",
arguments = "3 strings",
- actions = function(id,k,v)
+ public = true,
+ actions = function(id,k,v)
local e = getid(id)
ctx_doif(e and e.at[k] == v or false)
end
@@ -2079,7 +2103,8 @@ do
implement {
name = "xmldoifnotatt",
arguments = "3 strings",
- actions = function(id,k,v)
+ public = true,
+ actions = function(id,k,v)
local e = getid(id)
ctx_doifnot(e and e.at[k] == v or false)
end
@@ -2088,7 +2113,8 @@ do
implement {
name = "xmldoifelseatt",
arguments = "3 strings",
- actions = function(id,k,v)
+ public = true,
+ actions = function(id,k,v)
local e = getid(id)
ctx_doifelse(e and e.at[k] == v or false)
end
@@ -2356,8 +2382,8 @@ function lxml.nonspace(id,pattern) -- slow, todo loop
xmltprint(xmlcollect(getid(id),pattern,true))
end
-function lxml.strip(id,pattern,nolines,anywhere)
- xml.strip(getid(id),pattern,nolines,anywhere)
+function lxml.strip(id,pattern,nolines,anywhere,everywhere)
+ xml.strip(getid(id),pattern,nolines,anywhere,everywhere)
end
function lxml.stripped(id,pattern,nolines)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/m-gnuplot.mkxl b/Master/texmf-dist/tex/context/base/mkiv/m-gnuplot.mkxl
deleted file mode 100644
index 2077b174182..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/m-gnuplot.mkxl
+++ /dev/null
@@ -1,97 +0,0 @@
-%D \module
-%D [ file=m-gnuplot,
-%D version=2020.02.10,
-%D title=\CONTEXT\ Extra Modules,
-%D subtitle=Gnuplot,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-%D This is a variant on the \GNUPLOT\ terminal code. At some point (when there is a
-%D reason) I will make a proper environment that can be used for embedded code.
-
-\unexpanded\def\includegnuplotsvgfile[#1]%
- {\hbox\bgroup
- \ctxlua{metapost.startsvghashing()}%
- \includesvgfile[#1]%
- \ctxlua{metapost.stopsvghashing()}%
- \egroup}
-
-\startluacode
-
-local modificationtime = lfs.modification
-local longtostring = string.longtostring
-local formatters = string.formatters
-local expandfilename = dir.expandname
-local isfile = lfs.isfile
-
-local runner = sandbox.registerrunner {
- name = "gnuplot to svg",
- program = "gnuplot",
- template = longtostring [[
- -e "set output '%newname%'; set terminal svg"
- "%oldname%"
- ]],
- checkers = {
- oldname = "readable",
- newname = "writable",
- },
-}
-
-figures.programs.gnuplot = {
- runner = runner,
-}
-
-local function remap(specification)
- local oldname = specification.fullname
- if oldname then
- local newname = file.replacesuffix(oldname,"svg")
- local oldtime = modificationtime(oldname) or 0
- local newtime = modificationtime(newname) or 0
- if newtime == 0 or oldtime > newtime then
- runner {
- newname = expandfilename(newname),
- oldname = expandfilename(oldname),
- }
- end
- if isfile(newname) then
- local only = file.nameonly(newname)
- local name = formatters["svg-%s-inclusion"](only)
- local code = formatters["\\includegnuplotsvgfile[%s]\\resetbuffer[%s]"](newname,name)
- buffers.assign(name,code)
- specification.format = "buffer"
- specification.fullname = name
- end
- end
- return specification
-end
-
-figures.remappers.gp = { svg = remap }
-
-\stopluacode
-
-\continueifinputfile{m-gnuplot.mkxl}
-
-\startluacode
-io.savedata("m-gnuplot-demo.gp", [[
-set format xy "$%g$"
-
-set title 'This is a plot of $y=\\sin(x)$'
-set xlabel 'This is the $x$ axis'
-set ylabel 'This is the $y$ axis'
-
-plot [0:6.28] [0:1] sin(x)
-]])
-\stopluacode
-
-\starttext
-
- \externalfigure[m-gnuplot-demo.gp][conversion=svg,width=4cm]
-
- \externalfigure[m-gnuplot-demo.gp][conversion=svg,width=8cm]
-
-\stoptext
diff --git a/Master/texmf-dist/tex/context/base/mkiv/m-oldbibtex.mkiv b/Master/texmf-dist/tex/context/base/mkiv/m-oldbibtex.mkiv
index 08c23e7cc87..3300e0d799a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/m-oldbibtex.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/m-oldbibtex.mkiv
@@ -10,7 +10,12 @@
%C This module is part of the \CONTEXT\ macro||package and is therefore copyrighted
%D by \PRAGMA. See mreadme.pdf for details.
-\loadmarkfile{bibl-bib}
-\loadmarkfile{bibl-tra}
+\ifconditional\contextlmtxmode
+ \loadmkivfile{bibl-bib}
+ \loadmkivfile{bibl-tra}
+\else
+ \loadmkivfile{bibl-bib}
+ \loadmkxlfile{bibl-tra}
+\fi
\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-act.lua b/Master/texmf-dist/tex/context/base/mkiv/math-act.lua
index 1f0140960fe..e1ef751d7ed 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/math-act.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/math-act.lua
@@ -55,7 +55,11 @@ end
function mathematics.initializeparameters(target,original)
local mathparameters = original.mathparameters
if mathparameters and next(mathparameters) then
- target.mathparameters = mathematics.dimensions(mathparameters)
+ mathparameters = mathematics.dimensions(mathparameters)
+ if not mathparameters.SpaceBeforeScript then
+ mathparameters.SpaceBeforeScript = mathparameters.SpaceAfterScript
+ end
+ target.mathparameters = mathparameters
end
end
@@ -224,117 +228,6 @@ sequencers.appendaction("mathparameters","system","mathematics.overloadparameter
sequencers.appendaction("beforecopyingcharacters","system","mathematics.tweakbeforecopyingfont")
sequencers.appendaction("aftercopyingcharacters", "system","mathematics.tweakaftercopyingfont")
-local virtualized = mathematics.virtualized
-
-function mathematics.overloaddimensions(target,original,set)
- local goodies = target.goodies
- if goodies then
- for i=1,#goodies do
- local goodie = goodies[i]
- local mathematics = goodie.mathematics
- local dimensions = mathematics and mathematics.dimensions
- if dimensions then
- if trace_defining then
- report_math("overloading dimensions in %a @ %p",target.properties.fullname,target.parameters.size)
- end
- local characters = target.characters
- local descriptions = target.descriptions
- local parameters = target.parameters
- local factor = parameters.factor
- local hfactor = parameters.hfactor
- local vfactor = parameters.vfactor
- -- to be sure
- target.type = "virtual"
- target.properties.virtualized = true
- --
- local function overload(dimensions)
- for unicode, data in next, dimensions do
- local character = characters[unicode]
- if not character then
- local c = virtualized[unicode]
- if c then
- character = characters[c]
- end
- end
- if character then
- --
- local width = data.width
- local height = data.height
- local depth = data.depth
- if trace_defining and (width or height or depth) then
- report_math("overloading dimensions of %C, width %p, height %p, depth %p",
- unicode,width or 0,height or 0,depth or 0)
- end
- if width then character.width = width * hfactor end
- if height then character.height = height * vfactor end
- if depth then character.depth = depth * vfactor end
- --
- local xoffset = data.xoffset
- local yoffset = data.yoffset
- if xoffset == "llx" then
- local d = descriptions[unicode]
- if d then
- xoffset = - d.boundingbox[1] * hfactor
- character.width = character.width + xoffset
- xoffset = rightcommand[xoffset]
- else
- xoffset = nil
- end
- elseif xoffset and xoffset ~= 0 then
- xoffset = rightcommand[xoffset * hfactor]
- else
- xoffset = nil
- end
- if yoffset and yoffset ~= 0 then
- yoffset = upcommand[yoffset * vfactor]
- else
- yoffset = nil
- end
- if xoffset or yoffset then
- local commands = characters.commands
- if commands then
- prependcommands(commands,yoffset,xoffset)
- else
- local slot = charcommand[unicode]
- if xoffset and yoffset then
- character.commands = { xoffset, yoffset, slot }
- elseif xoffset then
- character.commands = { xoffset, slot }
- else
- character.commands = { yoffset, slot }
- end
- end
- end
- elseif trace_defining then
- report_math("no overloading dimensions of %C, not in font",unicode)
- end
- end
- end
- if set == nil then
- set = { "default" }
- end
- if set == "all" or set == true then
- for name, set in next, dimensions do
- overload(set)
- end
- else
- if type(set) == "string" then
- set = utilities.parsers.settings_to_array(set)
- end
- if type(set) == "table" then
- for i=1,#set do
- local d = dimensions[set[i]]
- if d then
- overload(d)
- end
- end
- end
- end
- end
- end
- end
-end
-
-- no, it's a feature now (see good-mth):
--
-- sequencers.appendaction("aftercopyingcharacters", "system","mathematics.overloaddimensions")
@@ -350,6 +243,8 @@ mathematics.tweaks = tweaks
-- these could go to math-fbk
+-- local virtualized = mathematics.virtualized
+--
-- local function accent_to_extensible(target,newchr,original,oldchr,height,depth,swap)
-- local characters = target.characters
-- -- if not characters[newchr] then -- xits needs an enforce
@@ -599,8 +494,10 @@ interfaces.implement {
-- if not fonts then
-- fonts = { }
-- target.fonts = fonts
+-- if not CONTEXTLMTXMODE or CONTEXTLMTXMODE == 0 then
-- target.type = "virtual"
-- target.properties.virtualized = true
+-- end
-- end
-- if #fonts == 0 then
-- fonts[1] = { id = 0, size = size } -- sel, will be resolved later
@@ -705,8 +602,10 @@ function mathematics.finishfallbacks(target,specification,fallbacks)
fonts = { }
target.fonts = fonts
end
+ --
target.type = "virtual"
target.properties.virtualized = true
+ --
if #fonts == 0 then
fonts[1] = { id = 0, size = size } -- self, will be resolved later
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-ali.mkiv b/Master/texmf-dist/tex/context/base/mkiv/math-ali.mkiv
index 400326d2691..e617224d22d 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/math-ali.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/math-ali.mkiv
@@ -50,23 +50,6 @@
\def\displayopenupvalue{.25\bodyfontsize}
-% \def\math_build_eqalign
-% {\scratchtoks\emptytoks
-% \d_math_eqalign_distance\mathalignmentparameter\c!distance
-% \scratchcounterone\mathalignmentparameter\c!m
-% \scratchcountertwo\mathalignmentparameter\c!n
-% \normalexpanded{\scratchtoks{\the\scratchtoks\the\t_math_align_a}}%
-% \scratchcounter\plusone
-% \dorecurse{\numexpr\scratchcounterone*\scratchcountertwo-\plusone\relax}
-% {\ifnum\scratchcounter=\scratchcountertwo
-% \scratchcounter\plusone
-% \scratchtoks\expandafter{\the\scratchtoks\math_eqalign_distance}%
-% \else
-% \advance\scratchcounter\plusone
-% \fi
-% \normalexpanded{\scratchtoks{\the\scratchtoks\the\t_math_align_b}}}%
-% \normalexpanded{\scratchtoks{\the\scratchtoks\the\t_math_align_c}}}
-
\def\math_build_eqalign
{\scratchtoks\emptytoks
\d_math_eqalign_distance\mathalignmentparameter\c!distance\relax
@@ -78,6 +61,7 @@
{\ifnum\scratchcounter=\scratchcountertwo
\scratchcounter\plusone
\etoksapp\scratchtoks{\math_eqalign_distance}%
+ \etoksapp\scratchtoks{\global\c_math_eqalign_column\zerocount}%
\else
\advance\scratchcounter\plusone
\fi
@@ -395,7 +379,7 @@
{\advance\c_math_eqalign_column\plusone\math_eqalign_set_column}% takes argument
\global\c_math_eqalign_column\plusone
\dostarttagged\t!math\empty
- \dostarttagged\t!mathtable\currentmathalignment
+ \dostarttagged\t!mtable\currentmathalignment
\numberedeqalign}
\def\math_alignment_stop
@@ -473,13 +457,13 @@
\def\math_first_in_eqalign
{\global\c_math_eqalign_column\plusone
- \dostarttagged\t!mathtablerow \empty
- \dostarttagged\t!mathtablecell\empty}
+ \dostarttagged\t!mtablerow \empty
+ \dostarttagged\t!mtablecell\empty}
\def\math_next_in_eqalign
{\global\advance\c_math_eqalign_column\plusone
\dostoptagged % finish cell
- \dostarttagged\t!mathtablecell\empty}
+ \dostarttagged\t!mtablecell\empty}
\def\math_left_of_eqalign
{\ifcsname\??mathalignmentvariant\number\c_math_eqalign_column\endcsname
@@ -832,7 +816,7 @@
\def\math_matrix_start_table
{\global\c_math_eqalign_column\zerocount
\dostarttagged\t!math\empty
- \dostarttagged\t!mathtable\empty}
+ \dostarttagged\t!mtable\empty}
\def\math_matrix_stop_table
{\dostoptagged
@@ -840,13 +824,13 @@
\def\math_matrix_start_row
{\noalign{\global\c_math_eqalign_column\zerocount}%
- \dostarttagged\t!mathtablerow\empty}
+ \dostarttagged\t!mtablerow\empty}
\def\math_matrix_stop_row
{\dostoptagged}
\unexpanded\def\math_matrix_start_cell
- {\dostarttagged\t!mathtablecell\empty
+ {\dostarttagged\t!mtablecell\empty
\hss
\math_left_of_eqalign
\startimath
@@ -1012,12 +996,12 @@
\let\mathmatrixleft \empty % experimental hook
\let\mathmatrixright\empty % experimental hook
-\setvalue{\??mathmatrixalignlocation\v!top }{\raise\dimexpr(\nextboxdp-\nextboxht)/2 +\mathaxisheight\textfont\zerocount\relax}
+\setvalue{\??mathmatrixalignlocation\v!top }{\raise\dimexpr(\nextboxdp-\nextboxht)/2 +\mathaxisheight\mathstyle\relax}
\setvalue{\??mathmatrixalignlocation\v!high }{\raise\dimexpr(\nextboxdp-\nextboxht)/2\relax}
\setvalue{\??mathmatrixalignlocation\v!center}{\relax}
\setvalue{\??mathmatrixalignlocation\v!lohi} {\relax}
\setvalue{\??mathmatrixalignlocation\v!normal}{\relax}
-\setvalue{\??mathmatrixalignlocation\v!bottom}{\lower\dimexpr(\nextboxdp-\nextboxht)/2 +\mathaxisheight\textfont\zerocount\relax}
+\setvalue{\??mathmatrixalignlocation\v!bottom}{\lower\dimexpr(\nextboxdp-\nextboxht)/2 +\mathaxisheight\mathstyle\relax}
\setvalue{\??mathmatrixalignlocation\v!low }{\lower\dimexpr(\nextboxdp-\nextboxht)/2\relax}
\def\math_matrix_finish_nextbox
@@ -1908,7 +1892,7 @@
\begingroup
\beforedisplayspace
% subset of \everydisplay:
- \attribute \mathmodeattribute \plusone
+ \c_attr_mathmode\plusone
\settrue \indisplaymath
% end of subset
\informulatrue}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-def.mkiv b/Master/texmf-dist/tex/context/base/mkiv/math-def.mkiv
index 641f7411edb..901f075d348 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/math-def.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/math-def.mkiv
@@ -1,4 +1,4 @@
-%D \module
+ %D \module
%D [ file=math-tex,
%D version=2001.04.12,
%D title=\CONTEXT\ Math Macros,
@@ -15,13 +15,15 @@
\unprotect
-%D Some day this will be done at the lua end.
+\pushoverloadmode % cap etc
\startluacode
mathematics.define(\number\defaultmathfamily)
-- mathematics.xml.registerentities()
\stopluacode
+\popoverloadmode
+
\activatemathcharacters
%D The \mfunction macro is an alternative for \hbox with a controlable font
@@ -80,6 +82,8 @@
{\savenormalmeaning{#1}%
\expandafter\def\expandafter#1\expandafter{\csname normal\csstring#1\endcsname#2}}
+\pushoverloadmode
+
\setoperatorlimits \int \intlimits
\setoperatorlimits \iint \intlimits
\setoperatorlimits \iiint \intlimits
@@ -90,6 +94,8 @@
\setoperatorlimits \ointclockwise \intlimits
\setoperatorlimits \ointctrclockwise \intlimits
+\popoverloadmode
+
%D \macros
%D {centercolon, colonminus, minuscolon, colonequals, equalscolon,
%D colonapprox, approxcolon, colonsim, simcolon, coloncolon,
@@ -131,6 +137,8 @@
%D The next macros take care of the space between the colon and the
%D relation symbol.
+\pushoverloadmode
+
\definemathcommand [colonsep] {\mkern-1.2mu}
\definemathcommand [doublecolonsep] {\mkern-0.9mu}
@@ -154,6 +162,8 @@
\definemathcommand [coloncolonsim] [rel] {\coloncolon\colonsep\sim}
\definemathcommand [simcoloncolon] [rel] {\sim\coloncolon\colonsep}
+\popoverloadmode
+
% \appendtoks
% \def\over{\primitive\over}%
% \to \everymathematics
diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-dim.lua b/Master/texmf-dist/tex/context/base/mkiv/math-dim.lua
index eb7adb53f97..06b4bbd97fd 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/math-dim.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/math-dim.lua
@@ -62,6 +62,7 @@ local defaults = {
radical_vgap = { default = { "RadicalVerticalGap", "default_rule_thickness+(abs(default_rule_thickness)/4)" },
display_style = { "RadicalDisplayStyleVerticalGap", "default_rule_thickness+(abs(math_x_height)/4)" }, },
space_after_script = { default = { "SpaceAfterScript", "script_space" }, },
+ space_before_script = { default = { "SpaceAfterScript", "script_space" }, },
stack_denom_down = { default = { "StackBottomShiftDown", "denom2" },
cramped_display_style = { "StackBottomDisplayStyleShiftDown", "denom1" },
display_style = { "StackBottomDisplayStyleShiftDown", "denom1" }, },
diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-fbk.lua b/Master/texmf-dist/tex/context/base/mkiv/math-fbk.lua
index 963461de5cf..6b43a901bdd 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/math-fbk.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/math-fbk.lua
@@ -53,13 +53,15 @@ function fallbacks.apply(target,original)
-- we also have forcedsize ... at this moment we already passed through
-- constructors.scale so we have this set
local parameters = target.parameters
+ local properties = target.properties
local mathsize = parameters.mathsize
if mathsize < 1 or mathsize > 3 then
return
end
- local characters = target.characters
- local size = parameters.size
- local usedfonts = target.fonts
+ local characters = target.characters
+ local size = parameters.size
+ local usedfonts = target.fonts
+ local compactmath = properties.compactmath
if not usedfonts then
usedfonts = { { id = 0 } } -- we need at least one entry (automatically done anyway)
target.fonts = usedfonts
@@ -91,6 +93,10 @@ function fallbacks.apply(target,original)
else
textdata = target
end
+ if compactmath then
+ scriptid = textid
+ scriptscriptid = textid
+ end
if scriptid and scriptid ~= 0 then
scriptindex = #usedfonts + 1
scriptdata = identifiers[scriptid]
diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-fen.mkiv b/Master/texmf-dist/tex/context/base/mkiv/math-fen.mkiv
index 6c6724bf52e..246ff989d93 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/math-fen.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/math-fen.mkiv
@@ -65,9 +65,39 @@
% we need the direct use of \Udelimiter because of { etc
+%D So we can do:
+%D
+%D \starttyping
+%D $ a + \fenced[bar][size=1] {\frac {b} {c}} + d $
+%D $ a + \fenced[bar][size=2] {\frac {b} {c}} + d $
+%D $ a + \fenced[bar][size=3] {\frac {b} {c}} + d $
+%D $ a + \fenced[bar][size=4] {\frac {b} {c}} + d $
+%D $ a + \fenced[bar][size=big] {\frac {b} {c}} + d $
+%D $ a + \fenced[bar][size=Big] {\frac {b} {c}} + d $
+%D $ a + \fenced[bar][size=bigg]{\frac {b} {c}} + d $
+%D $ a + \fenced[bar][size=Bigg]{\frac {b} {c}} + d $
+%D $ a + \fenced[bar][factor=1] {\frac {b} {c}} + d $
+%D $ a + \fenced[bar][factor=2] {\frac {b} {c}} + d $
+%D $ a + \fenced[bar][factor=4] {\frac {b} {c}} + d $
+%D $ a + \fenced[bar] {\frac {b} {c}} + d $
+%D \stoptyping
+
\newconditional\c_math_fenced_mirror \settrue \c_math_fenced_mirror
\newconditional\c_math_fenced_sized \setfalse\c_math_fenced_sized
+\installcorenamespace {mathfencesize}
+
+\setvalue{\??mathfencesize big}{1}
+\setvalue{\??mathfencesize Big}{2}
+\setvalue{\??mathfencesize bigg}{3}
+\setvalue{\??mathfencesize Bigg}{4}
+
+\def\math_fenced_force_size#1#2%
+ {\c_attr_mathsize\numexpr
+ #1*\plushundred
+ +\ifcsname\??mathfencesize#2\endcsname\lastnamedcs\else#2\fi
+ \relax}
+
\unexpanded\def\math_fenced_inject#1#2#3#4%
{\ifx#1\empty
#2.%
@@ -200,9 +230,6 @@
\edef\currentmathfence{#1}%
\dosingleempty\math_fenced_fenced_indeed}
-\def\math_fenced_force_size#1#2%
- {\attribute\mathsizeattribute\numexpr#1*\plushundred+#2\relax}
-
% \unexpanded\def\math_fenced_fenced_indeed[#1]#2%
% {\iffirstargument\setupcurrentmathfence[#1]\fi
% \math_fenced_fenced_common
@@ -635,6 +662,11 @@
\installcorenamespace{mathbig}
+\setvalue{\??mathbig1}{0.85}
+\setvalue{\??mathbig2}{1.15}
+\setvalue{\??mathbig3}{1.45}
+\setvalue{\??mathbig4}{1.75}
+
\unexpanded\def\choosemathbig#1#2% so we accept \big{||} as well
{{\naturalhbox\bgroup
\startimath
@@ -644,13 +676,32 @@
\math_fenced_force_size\bigmathdelimitervariant{#1}\relax
\math_fenced_step#2\relax
\else
- \math_fenced_step#2{\vpack to\csname\??mathbig\number#1\endcsname\bodyfontsize{}}%
+ \math_fenced_step#2{\vpack to\csname\??mathbig#1\endcsname\bodyfontsize{}}%
\fi
\nulldelimiterspace\zeropoint\relax
\mathsurround\zeropoint
\stopimath
\egroup}}
+% needs testing:
+%
+% \unexpanded\def\choosemathbig#1#2% so we accept \big{||} as well
+% {{\naturalhbox\bgroup
+% \startimath
+% \ifcase\bigmathdelimitermethod
+% \Uvextensible#2\relax
+% \or
+% \math_fenced_force_size\bigmathdelimitervariant{#1}\relax
+% \Uvextensible#2\relax
+% \else
+% \scratchdimen.5\dimexpr\csname\??mathbig\number#1\endcsname\bodyfontsize+1.1\exheight\relax
+% \Uvextensible\s!axis \s!depth \scratchdimen \s!height \scratchdimen #2\relax
+% \fi
+% \nulldelimiterspace\zeropoint\relax
+% \mathsurround\zeropoint
+% \stopimath
+% \egroup}}
+
\def\math_fenced_step#1#2%
{\setfalse\c_math_fenced_unknown
\setfalse\c_math_fenced_done
@@ -675,15 +726,10 @@
\math_fenced_step#2\relax
\endgroup}
-\setvalue{\??mathbig1}{0.85}
-\setvalue{\??mathbig2}{1.15}
-\setvalue{\??mathbig3}{1.45}
-\setvalue{\??mathbig4}{1.75}
-
-\definemathcommand [big] {\choosemathbig\plusone }
-\definemathcommand [Big] {\choosemathbig\plustwo }
-\definemathcommand [bigg] {\choosemathbig\plusthree}
-\definemathcommand [Bigg] {\choosemathbig\plusfour }
+\definemathcommand [big] {\choosemathbig1}
+\definemathcommand [Big] {\choosemathbig2}
+\definemathcommand [bigg] {\choosemathbig3}
+\definemathcommand [Bigg] {\choosemathbig4}
\definemathcommand [bigl] [open] [one] {\big}
\definemathcommand [bigm] [rel] [one] {\big}
@@ -789,10 +835,10 @@
\let\math_fences_normal_middle\middle
\let\math_fences_normal_both \leftorright
-\unexpanded\def\math_fences_auto_left #1{\attribute\mathautofenceattribute\plusone #1\attribute\mathautofenceattribute\attributeunsetvalue}
-\unexpanded\def\math_fences_auto_right #1{\attribute\mathautofenceattribute\plustwo #1\attribute\mathautofenceattribute\attributeunsetvalue}
-\unexpanded\def\math_fences_auto_middle#1{\attribute\mathautofenceattribute\plusthree#1\attribute\mathautofenceattribute\attributeunsetvalue}
-\unexpanded\def\math_fences_auto_both #1{\attribute\mathautofenceattribute\plusfour #1\attribute\mathautofenceattribute\attributeunsetvalue}
+\unexpanded\def\math_fences_auto_left #1{\c_attr_mathautofence\plusone #1\c_attr_mathautofence\attributeunsetvalue}
+\unexpanded\def\math_fences_auto_right #1{\c_attr_mathautofence\plustwo #1\c_attr_mathautofence\attributeunsetvalue}
+\unexpanded\def\math_fences_auto_middle#1{\c_attr_mathautofence\plusthree#1\c_attr_mathautofence\attributeunsetvalue}
+\unexpanded\def\math_fences_auto_both #1{\c_attr_mathautofence\plusfour #1\c_attr_mathautofence\attributeunsetvalue}
\let\autofenceopen \math_fences_auto_left % for testing
\let\autofenceclose \math_fences_auto_right % for testing
diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-frc.lua b/Master/texmf-dist/tex/context/base/mkiv/math-frc.lua
index 190c364101d..fa3ac515fe1 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/math-frc.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/math-frc.lua
@@ -13,6 +13,7 @@ local variables = interfaces.variables
local v_no = variables.no
local v_yes = variables.yes
+local v_hidden = variables.hidden
local resolved = {
[0x007B] = "\\{",
@@ -35,11 +36,12 @@ local function mathfraction(how,left,right,width)
else
context("\\atopwithdelims%s%s",resolved[left],resolved[right])
end
- elseif how == v_yes then
+ elseif how == v_yes or how == v_hidden then
+ local norule = how == v_hidden and LUATEXFUNCTIONALITY > 7361 and " norule " or ""
if left == 0x002E and right == 0x002E then
- context("\\normalabove%ssp",width)
+ context("\\normalabove%s%s%ssp",norule,width)
else
- context("\\abovewithdelims%s%s%ssp",resolved[left],resolved[right],width)
+ context("\\abovewithdelims%s%s%s%s%ssp",norule,resolved[left],resolved[right],width)
end
else -- v_auto
if left == 0x002E and right == 0x002E then
@@ -55,3 +57,41 @@ interfaces.implement {
actions = mathfraction,
arguments = { "string", "number", "number", "dimen" }
}
+
+-- experimental code in lmtx
+
+if CONTEXTLMTXMODE > 0 then
+
+ local ctx_Uatop = context.Uatop
+ local ctx_Uover = context.Uover
+
+ local function umathfraction(how,left,right,width)
+ if how == v_no then
+ if left == 0x002E and right == 0x002E then
+ ctx_Uatop()
+ else
+ context("\\Uatopwithdelims%s%s",resolved[left],resolved[right])
+ end
+ elseif how == v_yes or how == v_hidden then
+ local norule = how == v_hidden and " norule " or ""
+ if left == 0x002E and right == 0x002E then
+ context("\\Uabove%s%ssp",norule,width)
+ else
+ context("\\Uabovewithdelims%s%s%s%ssp",norule,resolved[left],resolved[right],width)
+ end
+ else -- v_auto
+ if left == 0x002E and right == 0x002E then
+ ctx_Uover()
+ else
+ context("\\Uoverwithdelims%s%s",resolved[left],resolved[right])
+ end
+ end
+ end
+
+ interfaces.implement {
+ name = "umathfraction",
+ actions = umathfraction,
+ arguments = { "string", "number", "number", "dimen" }
+ }
+
+end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-frc.mkiv b/Master/texmf-dist/tex/context/base/mkiv/math-frc.mkiv
index 97107a6bf91..1b0149f96b4 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/math-frc.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/math-frc.mkiv
@@ -361,10 +361,12 @@
\unexpanded\def\xfrac#1#2{\normalxfrac{\let\xfrac\xxfrac#1}{\let\xfrac\xxfrac#2}}
-%D Spacing:
+%D Spacing (sensitive for definition of \triggermathstyle:
-\unexpanded\def\nomathfractiongaps {\normalexpanded{\math_no_fraction_gaps \triggermathstyle\mathstyle}} % maybe collect settings
-\unexpanded\def\overlaymathfractiongaps{\normalexpanded{\math_overlay_fraction_gaps\triggermathstyle\mathstyle}} % maybe collect settings
+% \ifcase\contextlmtxmode
+
+\unexpanded\def\nomathfractiongaps {\normalexpanded{\math_no_fraction_gaps \mathstyletrigger\mathstyle}} % maybe collect settings
+\unexpanded\def\overlaymathfractiongaps{\normalexpanded{\math_overlay_fraction_gaps\mathstyletrigger\mathstyle}} % maybe collect settings
\unexpanded\def\math_no_fraction_gaps#1%
{\Umathfractionnumup #1\zeropoint
@@ -377,6 +379,21 @@
\Umathfractiondenomvgap#1\zeropoint
\Umathfractiondenomdown#1\zeropoint}
+% \else
+
+% \unexpanded\def\math_no_fraction_gaps
+% {\Umathfractionnumup \mathstyle\zeropoint
+% \Umathfractiondenomdown\mathstyle\zeropoint}
+%
+% \unexpanded\def\math_overlay_fraction_gaps
+% {\Umathfractionnumup \mathstyle\zeropoint
+% \Umathfractionnumvgap \mathstyle\zeropoint
+% %Umathfractionrule \mathstyle\zeropoint
+% \Umathfractiondenomvgap\mathstyle\zeropoint
+% \Umathfractiondenomdown\mathstyle\zeropoint}
+
+% \fi
+
\installcorenamespace{mathfractiondistance}
\letvalue{\??mathfractiondistance\v!none }\nomathfractiongaps
@@ -613,8 +630,6 @@
%D More fracking (for Alan):
-\def\s!vfrac{vfrac}
-
\unexpanded\def\math_frac_colored_vulgar#1#2%
{\savecolor
\colo_helpers_activate\p_math_fractions_color
diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-inc.lua b/Master/texmf-dist/tex/context/base/mkiv/math-inc.lua
index 010d29a359a..7c32adde6ca 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/math-inc.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/math-inc.lua
@@ -20,6 +20,8 @@ local undent = buffers.undent
local f_entity = string.formatters["&x%X;"]
local f_blob = string.formatters['<?xml version="2.0"?>\n\n<!-- formula %i -->\n\n%s']
+local report_tags = logs.reporter("structure","tags")
+
local all = nil
local back = nil
@@ -62,7 +64,12 @@ local function getblob(n)
local root = xml.load(full)
for c in xml.collected(root,"formulacontent") do
local index = tonumber(c.at.n)
- all[index] = f_blob(index,beautify(xmltext(c,"math") or ""))
+ local data = beautify(xmltext(c,"math") or "")
+ if index and data then
+ all[index] = f_blob(index,data)
+ else
+ report_tags("no formula content id")
+ end
end
local it = mathematics.alphabets.regular.it
for k, v in next, it.digits do back[v] = k end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/math-ini.lua
index 0af9a2121ba..19bf868020a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/math-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/math-ini.lua
@@ -97,9 +97,17 @@ local classes = allocate {
root = 16, -- a private one
}
-local open_class = 4
-local middle_class = 4
-local close_class = 5
+local open_class = 4
+local middle_class = 4
+local close_class = 5
+local accent_class = 8
+local radical_class = 9
+local topaccent_class = 11
+local botaccent_class = 12
+local under_class = 13
+local over_class = 14
+local delimiter_class = 15
+local root_class = 16
local accents = allocate {
accent = true, -- some can be both
@@ -231,39 +239,73 @@ local setmathcharacter = function(class,family,slot,unicode,mset,dset)
return mset, dset
end
-local f_accent = formatters[ [[\ugdef\%s{\Umathaccent 0 "%X "%X }]] ]
-local f_topaccent = formatters[ [[\ugdef\%s{\Umathaccent 0 "%X "%X }]] ]
-local f_botaccent = formatters[ [[\ugdef\%s{\Umathbotaccent 0 "%X "%X }]] ]
-local f_over = formatters[ [[\ugdef\%s{\Udelimiterover "%X "%X }]] ]
-local f_under = formatters[ [[\ugdef\%s{\Udelimiterunder "%X "%X }]] ]
-local f_fence = formatters[ [[\ugdef\%s{\Udelimiter "%X "%X "%X }]] ]
-local f_delimiter = formatters[ [[\ugdef\%s{\Udelimiter 0 "%X "%X }]] ]
-local f_radical = formatters[ [[\ugdef\%s{\Uradical "%X "%X }]] ]
-local f_root = formatters[ [[\ugdef\%s{\Uroot "%X "%X }]] ]
------ f_char = formatters[ [[\ugdef\%s{\Umathchar "%X "%X "%X }]]
-local f_char = formatters[ [[\Umathchardef\%s "%X "%X "%X ]] ]
+-- todo: make nice setters for this in lua
+
+local f_accent = formatters[ [[\defUmathtopaccent \%s{%X}{%X}{%X}]] ]
+local f_topaccent = formatters[ [[\defUmathtopaccent \%s{%X}{%X}{%X}]] ]
+local f_botaccent = formatters[ [[\defUmathbotaccent \%s{%X}{%X}{%X}]] ]
+local f_over = formatters[ [[\defUdelimiterover \%s{%X}{%X}{%X}]] ]
+local f_under = formatters[ [[\defUdelimiterunder\%s{%X}{%X}{%X}]] ]
+local f_fence = formatters[ [[\defUdelimiter \%s{%X}{%X}{%X}]] ]
+local f_delimiter = formatters[ [[\defUdelimiter \%s{%X}{%X}{%X}]] ]
+local f_radical = formatters[ [[\defUradical \%s{%X}{%X}]] ]
+local f_root = formatters[ [[\defUroot \%s{%X}{%X}]] ]
+local f_char = formatters[ [[\defUmathchar \%s{%X}{%X}{%X}]] ]
+
+local texmathchardef = tex.mathchardef
+
+-- local setmathsymbol = function(name,class,family,slot) -- hex is nicer for tracing
+-- if class == classes.accent then
+-- ctx_sprint(f_topaccent(name,0,family,slot))
+-- elseif class == classes.topaccent then
+-- ctx_sprint(f_topaccent(name,0,family,slot))
+-- elseif class == classes.botaccent then
+-- ctx_sprint(f_botaccent(name,0,family,slot))
+-- elseif class == classes.over then
+-- ctx_sprint(f_over(name,0,family,slot))
+-- elseif class == classes.under then
+-- ctx_sprint(f_under(name,0,family,slot))
+-- elseif class == open_class or class == close_class or class == middle_class then
+-- setdelcode("global",slot,{family,slot,0,0})
+-- ctx_sprint(f_fence(name,class,family,slot))
+-- elseif class == classes.delimiter then
+-- setdelcode("global",slot,{family,slot,0,0})
+-- ctx_sprint(f_delimiter(name,0,family,slot))
+-- elseif class == classes.radical then
+-- ctx_sprint(f_radical(name,family,slot))
+-- elseif class == classes.root then
+-- ctx_sprint(f_root(name,family,slot))
+-- elseif texmathchardef then
+-- texmathchardef(name,class,family,slot,"permanent")
+-- else
+-- -- beware, open/close and other specials should not end up here
+-- ctx_sprint(f_char(name,class,family,slot))
+-- end
+-- end
local setmathsymbol = function(name,class,family,slot) -- hex is nicer for tracing
- if class == classes.accent then
- ctx_sprint(f_accent(name,family,slot))
- elseif class == classes.topaccent then
- ctx_sprint(f_topaccent(name,family,slot))
- elseif class == classes.botaccent then
- ctx_sprint(f_botaccent(name,family,slot))
- elseif class == classes.over then
- ctx_sprint(f_over(name,family,slot))
- elseif class == classes.under then
- ctx_sprint(f_under(name,family,slot))
+ if class == accent_class then
+ ctx_sprint(f_topaccent(name,0,family,slot))
+ elseif class == topaccent_class then
+ ctx_sprint(f_topaccent(name,0,family,slot))
+ elseif class == botaccent_class then
+ ctx_sprint(f_botaccent(name,0,family,slot))
+ elseif class == over_class then
+ ctx_sprint(f_over(name,0,family,slot))
+ elseif class == under_class then
+ ctx_sprint(f_under(name,0,family,slot))
elseif class == open_class or class == close_class or class == middle_class then
setdelcode("global",slot,{family,slot,0,0})
ctx_sprint(f_fence(name,class,family,slot))
- elseif class == classes.delimiter then
+ elseif class == delimiter_class then
setdelcode("global",slot,{family,slot,0,0})
- ctx_sprint(f_delimiter(name,family,slot))
- elseif class == classes.radical then
+ ctx_sprint(f_delimiter(name,0,family,slot))
+ elseif class == radical_class then
ctx_sprint(f_radical(name,family,slot))
- elseif class == classes.root then
+ elseif class == root_class then
ctx_sprint(f_root(name,family,slot))
+ elseif texmathchardef then
+ texmathchardef(name,class,family,slot,"permanent")
else
-- beware, open/close and other specials should not end up here
ctx_sprint(f_char(name,class,family,slot))
@@ -642,7 +684,7 @@ function mathematics.big(tfmdata,unicode,n,method)
end
end
end
- elseif method == 3 then
+ elseif method >= 3 then
local size = 1.33^n
if method == 4 then
size = tfmdata.parameters.size * size
diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-ini.mkiv b/Master/texmf-dist/tex/context/base/mkiv/math-ini.mkiv
index c79d3579c8b..d0e18ff4b1b 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/math-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/math-ini.mkiv
@@ -103,9 +103,9 @@
\def\Umathaccents {\Umathaccent \s!both }
\ifdefined\Umathcharclass \else
- \def\Umathcharclass{\cldcontext{tex.getmathcode(token.scan_int())[1]}}
- \def\Umathcharfam {\cldcontext{tex.getmathcode(token.scan_int())[2]}}
- \def\Umathcharslot {\cldcontext{tex.getmathcode(token.scan_int())[3]}}
+ \def\Umathcharclass{\numexpr\cldcontext{tex.getmathcode(token.scan_int())[1]}\relax}
+ \def\Umathcharfam {\numexpr\cldcontext{tex.getmathcode(token.scan_int())[2]}\relax}
+ \def\Umathcharslot {\numexpr\cldcontext{tex.getmathcode(token.scan_int())[3]}\relax}
\fi
%D The attributes that we will use (todo: pack some into one but uglier code):
@@ -134,12 +134,12 @@
\fi
\appendtoks
- \attribute\mathmodeattribute\plusone
+ \c_attr_mathmode\plusone
\to \everydisplay
\appendtoks
- \attribute\mathmodeattribute\plusone
- \attribute\displaymathattribute\plusone
+ \c_attr_mathmode \plusone
+ \c_attr_displaymath\plusone
\to \everybeforedisplayformula
\setnewconstant\defaultmathfamily \zerocount % 255
@@ -596,7 +596,7 @@
\appendtoks
\ifcase\c_math_renderings_attribute\else
- \attribute\mathrenderingattribute\c_math_renderings_attribute
+ \c_attr_mathrendering\c_math_renderings_attribute
\fi
\to \everymathematics
@@ -867,10 +867,10 @@
\let\math_tags_mfunctiontxt\gobbletwoarguments
\let\math_tags_mfunctionlab\gobbletwoarguments
-\unexpanded\def\math_tags_mo_indeed#1{\begingroup \attribute\mathcategoryattribute\plusone #1\endgroup}
-\unexpanded\def\math_tags_mi_indeed#1{\begingroup \attribute\mathcategoryattribute\plustwo #1\endgroup}
-\unexpanded\def\math_tags_mn_indeed#1{\begingroup\mathupright\attribute\mathcategoryattribute\plusthree\math_set_o_both#1\endgroup}
-\unexpanded\def\math_tags_ms_indeed#1{\begingroup\mathupright\attribute\mathcategoryattribute\plusfour \math_set_p_both#1\endgroup} % todo: mathoptext
+\unexpanded\def\math_tags_mo_indeed#1{\begingroup \c_attr_mathcategory\plusone #1\endgroup}
+\unexpanded\def\math_tags_mi_indeed#1{\begingroup \c_attr_mathcategory\plustwo #1\endgroup}
+\unexpanded\def\math_tags_mn_indeed#1{\begingroup\mathupright\c_attr_mathcategory\plusthree\math_set_o_both#1\endgroup}
+\unexpanded\def\math_tags_ms_indeed#1{\begingroup\mathupright\c_attr_mathcategory\plusfour \math_set_p_both#1\endgroup} % todo: mathoptext
\newconditional\c_apply_function
@@ -1390,7 +1390,7 @@
\to \everysetupmathematics
\appendtoks
- \attribute\mathbidiattribute\ifconditional\c_math_right_to_left\c_math_bidi\else\attributeunsetvalue\fi
+ \c_attr_mathbidi\ifconditional\c_math_right_to_left\c_math_bidi\else\attributeunsetvalue\fi
\to \everyswitchmathematics
%D Delayed: greek.
@@ -1445,15 +1445,15 @@
% only used local
-\unexpanded\def\mathgreekupright{\attribute\mathgreekattribute"222\relax}
-\unexpanded\def\mathgreekitalic {\attribute\mathgreekattribute"333\relax}
-\unexpanded\def\mathgreekdefault{\attribute\mathgreekattribute"000\relax}
+\unexpanded\def\mathgreekupright{\c_attr_mathgreek"222\relax}
+\unexpanded\def\mathgreekitalic {\c_attr_mathgreek"333\relax}
+\unexpanded\def\mathgreekdefault{\c_attr_mathgreek"000\relax}
\let\mathgreeknormal\mathgreekupright
\let\mathgreeknone \mathgreekdefault
\appendtoks
- \attribute\mathgreekattribute\c_math_greek_attribute
+ \c_attr_mathgreek\c_math_greek_attribute
\to \everymathematics
\setupmathematics
@@ -1488,7 +1488,7 @@
\appendtoks
\math_collapsing_initialize
- \attribute\mathcollapsingattribute\c_math_collapsing_attribute
+ \c_attr_mathcollapsing\c_math_collapsing_attribute
\to \everymathematics
\setupmathematics
@@ -1526,7 +1526,7 @@
\appendtoks
\math_italics_initialize
- \attribute\mathitalicsattribute\c_math_italics_attribute
+ \c_attr_mathitalics\c_math_italics_attribute
\to \everymathematics
% \setupmathematics % done later
@@ -1563,7 +1563,7 @@
\appendtoks
\math_kernpairs_initialize
- \attribute\mathkernpairsattribute\c_math_kernpairs_attribute
+ \c_attr_mathkernpairs\c_math_kernpairs_attribute
\to \everymathematics
\setupmathematics
@@ -1611,13 +1611,13 @@
% \mathcode\c_math_period\c_math_special
% \let,\math_punctuation_comma
% \let.\math_punctuation_period
-% \attribute\mathpunctuationattribute\plustwo}
+% \c_attr_mathpunctuation\plustwo}
%
% \unexpanded\gdef\math_punctuation_initialize_yes
-% {\attribute\mathpunctuationattribute\plustwo}
+% {\c_attr_mathpunctuation\plustwo}
%
% \unexpanded\gdef\math_punctuation_initialize_nop
-% {\attribute\mathpunctuationattribute\plusone}
+% {\c_attr_mathpunctuation\plusone}
%
% \egroup
%
@@ -1760,7 +1760,7 @@
\setupmathematics
[\v!autopunctuation=\v!no] % no | yes | all | comma | yes,semicolon | all,semicolon
-%D The consequences of settign this are as follows:
+%D The consequences of setting this are as follows:
%D
%D \def\TestA#1#2#3%
%D {\ifnum#1=0 \type{#2}\else\setupmathematics[autopunctuation={#2}]$#3$\fi}
@@ -1841,6 +1841,8 @@
% error
\fi}
+\let\mathstyletrigger\triggermathstyle
+
\def\triggeredmathstyleparameter#1% to bypass the relax
{\ifcase\numexpr\normalmathstyle\relax
#1\displaystyle \or % 0
@@ -1980,7 +1982,7 @@
\scriptscriptfont \else
\textfont
\fi
- \zeropoint}
+ \zerocount}
\def\mathemwidth
{\fontdimen
@@ -1996,7 +1998,7 @@
\scriptscriptfont \else
\textfont
\fi
- \zeropoint}
+ \zerocount}
%D A plain inheritance:
@@ -2778,8 +2780,9 @@
%
% 0x002B=plus 0x2212=minus 0x2013=endash
-\unexpanded\def\mathplus {+}
-\unexpanded\def\mathminus{\ifmmode –\else\iffontchar\font`−−\else –\fi\fi}
+\unexpanded\def\mathplus {+}
+\unexpanded\def\mathminus {\ifmmode –\else\iffontchar\font`−−\else –\fi\fi}
+\unexpanded\def\mathplusminus{±}
%D The \type {\displaywidth} is only known inside a display formula, so we need to catch
%D it when still zero.
@@ -2825,7 +2828,7 @@
\to \everyswitchmathematics % only in mathematics
\appendtoks
- \attribute\mathdomainattribute\c_math_domain_attribute
+ \c_attr_mathdomain\c_math_domain_attribute
\to \everymathematics
\setupmathematics
@@ -2899,17 +2902,35 @@
%D Experiment
\unexpanded\def\math_scripts_stack
- {\attribute\mathunstackattribute\attributeunsetvalue}
+ {\c_attr_mathunstack\attributeunsetvalue}
\unexpanded\def\math_scripts_unstack
{\clf_enablescriptunstacking
- \attribute\mathunstackattribute\plusone}
+ \c_attr_mathunstack\plusone}
\appendtoks
\let\stackscripts \math_scripts_stack
\let\unstackscripts\math_scripts_unstack
\to \everymathematics
+%D Expensive (tracing and inject) but a primitive (using factors) is tricky as we
+%D want this frozen support.
+
+\def\math_openup_parameter#1#2%
+ {\ifzeropt#1\displaystyle \else\ifdim#1\displaystyle =\maxdimen\else\frozen#1\displaystyle #2#1\displaystyle \fi\fi
+ \ifzeropt#1\crampeddisplaystyle \else\ifdim#1\crampeddisplaystyle =\maxdimen\else\frozen#1\crampeddisplaystyle #2#1\crampeddisplaystyle \fi\fi
+ \ifzeropt#1\textstyle \else\ifdim#1\textstyle =\maxdimen\else\frozen#1\textstyle #2#1\textstyle \fi\fi
+ \ifzeropt#1\crampedtextstyle \else\ifdim#1\crampedtextstyle =\maxdimen\else\frozen#1\crampedtextstyle #2#1\crampedtextstyle \fi\fi
+ \ifzeropt#1\scriptstyle \else\ifdim#1\scriptstyle =\maxdimen\else\frozen#1\scriptstyle #2#1\scriptstyle \fi\fi
+ \ifzeropt#1\crampedscriptstyle \else\ifdim#1\crampedscriptstyle =\maxdimen\else\frozen#1\crampedscriptstyle #2#1\crampedscriptstyle \fi\fi
+ \ifzeropt#1\scriptscriptstyle \else\ifdim#1\scriptscriptstyle =\maxdimen\else\frozen#1\scriptscriptstyle #2#1\scriptscriptstyle \fi\fi
+ \ifzeropt#1\crampedscriptscriptstyle\else\ifdim#1\crampedscriptscriptstyle=\maxdimen\else\frozen#1\crampedscriptscriptstyle#2#1\crampedscriptscriptstyle\fi\fi}
+
+\unexpanded\def\mathopenupparameter#1#2%
+ {\ifdim#2\points=\zeropoint\else
+ \math_openup_parameter#1{#2}%
+ \fi}
+
\protect \endinput
% % not used (yet)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-map.lua b/Master/texmf-dist/tex/context/base/mkiv/math-map.lua
index 2233722a03d..97860b923ba 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/math-map.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/math-map.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['math-map'] = {
version = 1.001,
+ optimize = true,
comment = "companion to math-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-noa.lua b/Master/texmf-dist/tex/context/base/mkiv/math-noa.lua
index f53410b18cd..1fb763a3b6c 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/math-noa.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/math-noa.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['math-noa'] = {
version = 1.001,
+ optimize = true,
comment = "companion to math-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
@@ -124,10 +125,14 @@ local getdepth = nuts.getdepth
local getnucleus = nuts.getnucleus
local getsub = nuts.getsub
local getsup = nuts.getsup
+local getsubpre = nuts.getsubpre
+local getsuppre = nuts.getsuppre
local setnucleus = nuts.setnucleus
local setsub = nuts.setsub
local setsup = nuts.setsup
+local setsubpre = nuts.setsubpre
+local setsuppre = nuts.setsuppre
local flush_node = nuts.flush
local copy_node = nuts.copy
@@ -198,7 +203,7 @@ local subbox_code = nodecodes.subbox -- attr list
local submlist_code = nodecodes.submlist -- attr list
local mathchar_code = nodecodes.mathchar -- attr fam char
local mathtextchar_code = nodecodes.mathtextchar -- attr fam char
-local delim_code = nodecodes.delim -- attr small_fam small_char large_fam large_char
+local delimiter_code = nodecodes.delimiter -- attr small_fam small_char large_fam large_char
----- style_code = nodecodes.style -- attr style
----- parameter_code = nodecodes.parameter -- attr style
local math_choice = nodecodes.choice -- attr display text script scriptscript
@@ -273,7 +278,11 @@ local function process(start,what,n,parent)
local noad = getnucleus(start) if noad then process(noad,what,n,start) end -- list
noad = getsup (start) if noad then process(noad,what,n,start) end -- list
noad = getsub (start) if noad then process(noad,what,n,start) end -- list
- elseif id == mathchar_code or id == mathtextchar_code or id == delim_code then
+ if getsubpre then
+ noad = getsuppre (start) if noad then process(noad,what,n,start) end -- list
+ noad = getsubpre (start) if noad then process(noad,what,n,start) end -- list
+ end
+ elseif id == mathchar_code or id == mathtextchar_code or id == delimiter_code then
break
elseif id == subbox_code or id == submlist_code then
local noad = getlist(start) if noad then process(noad,what,n,start) end -- list (not getlist !)
@@ -293,12 +302,20 @@ local function process(start,what,n,parent)
local noad = getnucleus(start) if noad then process(noad,what,n,start) end -- list
noad = getsup (start) if noad then process(noad,what,n,start) end -- list
noad = getsub (start) if noad then process(noad,what,n,start) end -- list
+ if getsubpre then
+ noad = getsuppre (start) if noad then process(noad,what,n,start) end -- list
+ noad = getsubpre (start) if noad then process(noad,what,n,start) end -- list
+ end
noad = getfield(start,"left") if noad then process(noad,what,n,start) end -- delimiter
noad = getfield(start,"degree") if noad then process(noad,what,n,start) end -- list
elseif id == accent_code then
local noad = getnucleus(start) if noad then process(noad,what,n,start) end -- list
noad = getsup (start) if noad then process(noad,what,n,start) end -- list
noad = getsub (start) if noad then process(noad,what,n,start) end -- list
+ if getsubpre then
+ noad = getsuppre (start) if noad then process(noad,what,n,start) end -- list
+ noad = getsubpre (start) if noad then process(noad,what,n,start) end -- list
+ end
noad = getfield(start,"accent") if noad then process(noad,what,n,start) end -- list
noad = getfield(start,"bot_accent") if noad then process(noad,what,n,start) end -- list
-- elseif id == style_code then
@@ -322,6 +339,10 @@ local function processnested(current,what,n)
noad = getnucleus(current) if noad then process(noad,what,n,current) end -- list
noad = getsup (current) if noad then process(noad,what,n,current) end -- list
noad = getsub (current) if noad then process(noad,what,n,current) end -- list
+ if getsubpre then
+ noad = getsuppre (current) if noad then process(noad,what,n,current) end -- list
+ noad = getsubpre (current) if noad then process(noad,what,n,current) end -- list
+ end
elseif id == subbox_code or id == submlist_code then
noad = getlist(current) if noad then process(noad,what,n,current) end -- list (not getlist !)
elseif id == fraction_code then
@@ -340,12 +361,20 @@ local function processnested(current,what,n)
noad = getnucleus(current) if noad then process(noad,what,n,current) end -- list
noad = getsup (current) if noad then process(noad,what,n,current) end -- list
noad = getsub (current) if noad then process(noad,what,n,current) end -- list
+ if getsubpre then
+ noad = getsuppre (current) if noad then process(noad,what,n,current) end -- list
+ noad = getsubpre (current) if noad then process(noad,what,n,current) end -- list
+ end
noad = getfield(current,"left") if noad then process(noad,what,n,current) end -- delimiter
noad = getfield(current,"degree") if noad then process(noad,what,n,current) end -- list
elseif id == accent_code then
noad = getnucleus(current) if noad then process(noad,what,n,current) end -- list
noad = getsup (current) if noad then process(noad,what,n,current) end -- list
noad = getsub (current) if noad then process(noad,what,n,current) end -- list
+ if getsubpre then
+ noad = getsuppre (current) if noad then process(noad,what,n,current) end -- list
+ noad = getsubpre (current) if noad then process(noad,what,n,current) end -- list
+ end
noad = getfield(current,"accent") if noad then process(noad,what,n,current) end -- list
noad = getfield(current,"bot_accent") if noad then process(noad,what,n,current) end -- list
end
@@ -358,6 +387,10 @@ local function processstep(current,process,n,id)
noad = getnucleus(current) if noad then process(noad,n,current) end -- list
noad = getsup (current) if noad then process(noad,n,current) end -- list
noad = getsub (current) if noad then process(noad,n,current) end -- list
+ if getsubpre then
+ noad = getsuppre (current) if noad then process(noad,n,current) end -- list
+ noad = getsubpre (current) if noad then process(noad,n,current) end -- list
+ end
elseif id == subbox_code or id == submlist_code then
noad = getlist(current) if noad then process(noad,n,current) end -- list (not getlist !)
elseif id == fraction_code then
@@ -376,12 +409,20 @@ local function processstep(current,process,n,id)
noad = getnucleus(current) if noad then process(noad,n,current) end -- list
noad = getsup (current) if noad then process(noad,n,current) end -- list
noad = getsub (current) if noad then process(noad,n,current) end -- list
+ if getsubpre then
+ noad = getsuppre (current) if noad then process(noad,n,current) end -- list
+ noad = getsubpre (current) if noad then process(noad,n,current) end -- list
+ end
noad = getfield(current,"left") if noad then process(noad,n,current) end -- delimiter
noad = getfield(current,"degree") if noad then process(noad,n,current) end -- list
elseif id == accent_code then
noad = getnucleus(current) if noad then process(noad,n,current) end -- list
noad = getsup (current) if noad then process(noad,n,current) end -- list
noad = getsub (current) if noad then process(noad,n,current) end -- list
+ if getsubpre then
+ noad = getsuppre (current) if noad then process(noad,n,current) end -- list
+ noad = getsubpre (current) if noad then process(noad,n,current) end -- list
+ end
noad = getfield(current,"accent") if noad then process(noad,n,current) end -- list
noad = getfield(current,"bot_accent") if noad then process(noad,n,current) end -- list
end
@@ -542,7 +583,7 @@ do
end
end
end
- families[delim_code] = function(pointer)
+ families[delimiter_code] = function(pointer)
if getfield(pointer,"small_fam") == 0 then
local a = getattr(pointer,a_mathfamily)
if a and a > 0 then
@@ -574,7 +615,7 @@ do
-- will become:
- -- families[delim_code] = function(pointer)
+ -- families[delimiter_code] = function(pointer)
-- if getfam(pointer) == 0 then
-- local a = getattr(pointer,a_mathfamily)
-- if a and a > 0 then
@@ -717,7 +758,7 @@ do
end
end
- relocate[delim_code] = function(pointer)
+ relocate[delimiter_code] = function(pointer)
if trace_analyzing then
setnodecolor(pointer,"font:fina")
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-rad.mkvi b/Master/texmf-dist/tex/context/base/mkiv/math-rad.mkvi
index c0b128a616c..a11ec045d0d 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/math-rad.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/math-rad.mkvi
@@ -26,12 +26,24 @@
% \def\rootradical{\Uroot \defaultmathfamily "221A } % can be done in char-def
% \def\surdradical{\Uradical \defaultmathfamily "221A } % can be done in char-def
-\def\root#1\of{\rootradical{#1}} % #2
+\unexpanded\def\root#1\of{\rootradical{#1}} % #2
\unexpanded\def\sqrt{\doifelsenextoptionalcs\rootwithdegree\rootwithoutdegree}
-\unexpanded\def\styledrootradical#1#2% so that \text works ok ... \rootradical behaves somewhat weird
- {\normalexpanded{\rootradical{\normalunexpanded{#1}}{\noexpand\triggermathstyle{\normalmathstyle}\normalunexpanded{#2}}}}
+% \ifcase \contextlmtxmode
+
+ \unexpanded\def\styledrootradical#1#2% so that \text works ok ... \rootradical behaves somewhat weird
+ {\normalexpanded{\rootradical
+ {\normalunexpanded{#1}}%
+ {\noexpand\triggermathstyle{\number\normalmathstyle}%
+ \normalunexpanded{#2}}}}
+
+% \else % experimental new keyword: (maybe keywords should come after the symbol)
+%
+% \unexpanded\def\styledrootradical#1#2% so that \text works ok ... \rootradical behaves somewhat weird
+% {\Uroot style \normalmathstyle "0 "221A {#1}{#2}}
+%
+% \fi
\unexpanded\def\rootwithdegree[#1]{\rootradical{#1}}
\unexpanded\def\rootwithoutdegree {\rootradical {}}
@@ -43,8 +55,36 @@
% \let\normalsurd\surd % \Uradical "0 "221A
% \unexpanded\def\surd{\normalsurd{}}
-
-%D The real thing:
+%D The real thing. If needed one can control matters with one of the many
+%D \type {\Umath...} parameters.
+%D
+%D \starttyping
+%D \def\R {\Umathradicaldegreeafter\textstyle0pt}
+%D \def\RR{\Umathradicaldegreeafter\textstyle\dimexpr
+%D \Umathradicaldegreeafter\textstyle+.1em\relax}
+%D \def\RRR{\frozen\Umathradicaldegreeafter\textstyle\dimexpr
+%D \Umathradicaldegreeafter\textstyle+.2em\relax}
+%D
+%D $ \sqrt[3]{5} \RR\sqrt[3]{5} \sqrt[3]{5} $\par
+%D $ \sqrt[3]{5} {\RRR\sqrt[3]{5}} \sqrt[3]{5} $\par
+%D $ \RR\sqrt[3]{5} {\RRR\sqrt[3]{5}} \sqrt[3]{5} $\par
+%D
+%D \def\R {\Umathradicaldegreeafter\textstyle
+%D 0pt}
+%D \def\RR {\Umathradicaldegreeafter\textstyle
+%D 0.95\Umathradicaldegreeafter\textstyle}
+%D \def\RRR{\frozen\Umathradicaldegreeafter\textstyle
+%D 0.9\Umathradicaldegreeafter\textstyle}
+%D
+%D $ \sqrt[3]{5} \RR\sqrt[3]{5} \sqrt[3]{5} $\par
+%D $ \sqrt[3]{5} {\RRR\sqrt[3]{5}} \sqrt[3]{5} $\par
+%D $ \RR\sqrt[3]{5} {\RRR\sqrt[3]{5}} \sqrt[3]{5} $\par
+%D
+%D \def\RR {\mathopenupparameter\Umathradicaldegreeafter{.1}}
+%D
+%D $ \sqrt[3]{5} \RR\sqrt[3]{5} \sqrt[3]{5} $\par
+%D $ \sqrt[3]{5} {\RR\sqrt[3]{5}} \sqrt[3]{5} $\par
+%D \stoptyping
\installcorenamespace{mathradical}
\installcorenamespace{mathradicalalternative}
@@ -157,10 +197,11 @@
enddef ;
\stopMPextensions
-\startuniqueMPgraphic{math:radical:default}%{...}
+\startuniqueMPgraphic{minifun::math:radical:default}%{...}
draw
math_radical_simple(OverlayWidth,OverlayHeight,OverlayDepth,OverlayOffset)
- withpen pencircle xscaled (2OverlayLineWidth) yscaled (3OverlayLineWidth/4) rotated 30
+ % withpen pencircle xscaled (2OverlayLineWidth) yscaled (3OverlayLineWidth/4) rotated 30
+ withpen pencircle scaled OverlayLineWidth
% dashed evenly
withcolor OverlayLineColor ;
\stopuniqueMPgraphic
@@ -177,7 +218,8 @@
\d_overlay_height \ht\nextbox
\d_overlay_depth \dp\nextbox
\d_overlay_offset \scratchoffset
- \d_overlay_linewidth\linewidth
+ \d_overlay_linewidth\the\dimexpr\triggeredmathstyleparameter\Umathfractionrule
+ %
\edef\overlaylinecolor{\mathradicalparameter\c!color}%
%
\edef\p_mp{\mathradicalparameter\c!mp}%
@@ -201,7 +243,7 @@
\fi
\endgroup}
-\definemathradical[sqrt][mp=math:radical:default]
+\definemathradical[sqrt][mp=minifun::math:radical:default]
% \setupmathradical[sqrt][alternative=normal,color=darkblue]
% \setupmathradical[sqrt][alternative=mp,color=darkgreen]
diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-stc.mkvi b/Master/texmf-dist/tex/context/base/mkiv/math-stc.mkvi
index 8048bf92364..8f2a20440f3 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/math-stc.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/math-stc.mkvi
@@ -16,12 +16,12 @@
\unprotect
-%D WARNING: If the code here changes, the export needs to be checked! Stackers are rather
-%D special because the order in mathml matters, so we flush in [base under over] order. We
-%D also do some analysis at the \TEX\ end (passing the right variant). It's easy in the
-%D export to deal with it but in the pdf stream less trivial as we don't actually analyze
-%D there.
-
+%D WARNING: If the code here changes, the export needs to be checked! Stackers are
+%D rather special because the order in mathml matters, so we flush in [base under
+%D over] order. We also do some analysis at the \TEX\ end (passing the right
+%D variant). It's easy in the export to deal with it but in the pdf stream less
+%D trivial as we don't actually analyze there.
+%D
%D At some point the \MKII\ arrow mechanism has been converted to \MKIV, but we kept
%D most of the logic. We now have a more generic variant dealing with extensibles.
%D There are a few demands than we need to meet:
@@ -42,11 +42,11 @@
%D to support the traditional Latin Modern Virtual math font those were extended
%D with a couple of virtual extensibles as well.
%D
-%D {\em For the moment we still have some mess here: we can deal with known dimensions, but
-%D fillers (like \type {\rightarrowfil} don't work with \OPENTYPE\ extensibles yet
-%D because there is no way to let them stretch like leaders. At some point \LUATEX\
-%D might provide a auto||fit||to||encapsulated||box and if not I will cook up a \LUA\
-%D based variant.}
+%D {\em For the moment we still have some mess here: we can deal with known
+%D dimensions, but fillers (like \type {\rightarrowfil} don't work with \OPENTYPE\
+%D extensibles yet because there is no way to let them stretch like leaders. At some
+%D point \LUATEX\ might provide a auto||fit||to||encapsulated||box and if not I will
+%D cook up a \LUA\ based variant.}
%D
%D We could mess with something like \type {$mid\limits^{top}_{bottom}$} but we like
%D a bit more control. At some point we need to add some hacks to get exports
@@ -54,9 +54,9 @@
%D
%D In the end we have a more flexible mechanism which also handles text variants.
-%D When wrapping up some math developments I decided to add mp support here
-%D as well. A nice evening job with Joe Bonamassa performing live on the big
-%D screen (real nice bluray's). See meta-imp-mat.mkiv for examples.
+%D When wrapping up some math developments I decided to add mp support here as well.
+%D A nice evening job with Joe Bonamassa performing live on the big screen (real
+%D nice bluray's). See meta-imp-mat.mkiv for examples.
% possible improvements:
%
@@ -150,9 +150,9 @@
\let\math_stackers_stop_tagged \relax
\appendtoks
- \def\math_stackers_start_tagged_mid{\dostarttagged\t!mathstackermid\empty\hbox\bgroup}%
- \def\math_stackers_start_tagged_top{\dostarttagged\t!mathstackertop\empty\hbox\bgroup}%
- \def\math_stackers_start_tagged_bot{\dostarttagged\t!mathstackerbot\empty\hbox\bgroup}%
+ \def\math_stackers_start_tagged_mid{\dostarttagged\t!mstackermid\empty\hbox\bgroup}%
+ \def\math_stackers_start_tagged_top{\dostarttagged\t!mstackertop\empty\hbox\bgroup}%
+ \def\math_stackers_start_tagged_bot{\dostarttagged\t!mstackerbot\empty\hbox\bgroup}%
\def\math_stackers_stop_tagged {\egroup\dostoptagged}%
\to \everysetuptagging
@@ -328,7 +328,7 @@
{\begingroup
\edef\currentmathstackers{#category}%
\mathstackersparameter\c!left\relax
- \dostarttagged\t!mathstacker\currentmathstackers
+ \dostarttagged\t!mstacker\currentmathstackers
\ifmmode\math_class_by_parameter\mathstackersparameter\else\dontleavehmode\fi
{\edef\p_offset {\mathstackersparameter\c!offset}%
\edef\p_location {\mathstackersparameter\c!location}%
@@ -415,7 +415,7 @@
\advance\scratchwidth2\scratchhoffset
%
\ifcase#method\relax
- \dostarttagged\t!mathstackermid\empty
+ \dostarttagged\t!mstackermid\empty
\setbox\scratchboxthree\csname\??mathstackersalternative\p_alternative\endcsname
\dostoptagged
\fi
@@ -433,20 +433,15 @@
\ifcsname\??mathstackerslocation\p_location\endcsname
\ifcase\csname\??mathstackerslocation\p_location\endcsname\relax
\scratchdistance\zeropoint
- \or
- % top
+ \or % top
\scratchdistance\zeropoint
- \or
- % high
+ \or % high
\scratchdistance.25\htdp\scratchboxthree
- \or
- % centered
+ \or % centered
\scratchdistance.5\htdp\scratchboxthree
- \or
- % low
+ \or % low
\scratchdistance.75\htdp\scratchboxthree
- \or
- % bottom
+ \or % bottom
\scratchdistance\htdp\scratchboxthree
\else
\scratchdistance\zeropoint
@@ -602,7 +597,7 @@
\setupcurrentmathstackers[#settings]%
\fi
\mathstackersparameter\c!left\relax
- \dostarttagged\t!mathstacker\currentmathstackers
+ \dostarttagged\t!mstacker\currentmathstackers
\ifmmode\math_class_by_parameter\mathstackersparameter\else\dontleavehmode\fi
{\edef\m_math_stackers_text_middle {#text}%
%
@@ -798,7 +793,7 @@
\unexpanded\def\math_stackers_make_double_text#where#category#codepoint#text#extra%
{\math_stackers_start_group{#category}%
\mathstackersparameter\c!left\relax
- \dostarttagged\t!mathstacker\currentmathstackers
+ \dostarttagged\t!mstacker\currentmathstackers
\ifmmode\math_class_by_parameter\mathstackersparameter\else\dontleavehmode\fi
{\edef\currentmathstackers{#category}%
%
@@ -1069,8 +1064,8 @@
%D We save a few definitions that we automatically got from the \type {char-def.lua}
%D database.
-% Be careful in choosing what accents you take (the code below uses a
-% combining one):
+% Be careful in choosing what accents you take (the code below uses a combining
+% one):
%
% \startbuffer
% % $\Umathaccent top 0 0 "20D7 {example}$
@@ -1224,15 +1219,15 @@
% We don't use overline and underline. This is one of the overlooked aspects of
% unicode cq. opentype math: why treat rules different than e.g. arrows and
% accents. It is a bit unfortunate that the opportunity to move math to new
-% technologies happened outside the tex domain (and/or some aspects were kept
-% while in fact they were side effects of limitations of traditional fonts).
-% From the unicode aware tex engines' implementation point of view things
-% could have been done a bit nicer but then: the community didn't seem to care
-% too much and just has to follow now.
+% technologies happened outside the tex domain (and/or some aspects were kept while
+% in fact they were side effects of limitations of traditional fonts). From the
+% unicode aware tex engines' implementation point of view things could have been
+% done a bit nicer but then: the community didn't seem to care too much and just
+% has to follow now.
%
-% Anyhow, we use a character based approach so that at least we get unicode
-% stuff in the backend (okay, we still need to deal with some cut and paste
-% issues but at least we now know what we deal with.
+% Anyhow, we use a character based approach so that at least we get unicode stuff
+% in the backend (okay, we still need to deal with some cut and paste issues but at
+% least we now know what we deal with.
% alternatively we can move the original to FE*
diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-tag.lua b/Master/texmf-dist/tex/context/base/mkiv/math-tag.lua
index 9267e0f39c0..41373fcb58b 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/math-tag.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/math-tag.lua
@@ -52,7 +52,7 @@ local subbox_code = nodecodes.subbox -- attr list
local submlist_code = nodecodes.submlist -- attr list
local mathchar_code = nodecodes.mathchar -- attr fam char
local mathtextchar_code = nodecodes.mathtextchar -- attr fam char
-local delim_code = nodecodes.delim -- attr small_fam small_char large_fam large_char
+local delimiter_code = nodecodes.delimiter -- attr small_fam small_char large_fam large_char
local style_code = nodecodes.style -- attr style
local choice_code = nodecodes.choice -- attr display text script scriptscript
local fence_code = nodecodes.fence -- attr subtype
@@ -259,7 +259,7 @@ process = function(start) -- we cannot use the processor as we have no finalizer
stop_tagged()
-- showtag(start,id,false)
break
- elseif id == delim_code then
+ elseif id == delimiter_code then
-- check for code
setattr(start,a_tagged,start_tagged("mo"))
stop_tagged()
diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-ttv.lua b/Master/texmf-dist/tex/context/base/mkiv/math-ttv.lua
index 1f644e78834..151183212a3 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/math-ttv.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/math-ttv.lua
@@ -62,7 +62,7 @@ mathencodings["large-to-small"] = {
}
-- Beware: these are (in cm/lm) below the baseline due to limitations
--- in the tfm format bu the engien (combined with the mathclass) takes
+-- in the tfm format but the engine (combined with the mathclass) takes
-- care of it. If we need them in textmode, we should make them virtual
-- and move them up but we're in no hurry with that.
diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-vfu.lua b/Master/texmf-dist/tex/context/base/mkiv/math-vfu.lua
index 9090955e9c4..221bbff8975 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/math-vfu.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/math-vfu.lua
@@ -628,10 +628,6 @@ setmetatableindex(reverse, function(t,name)
return r
end)
--- use char and font hash
---
--- commands = { { "font", slot }, { "char", unicode } },
-
local function copy_glyph(main,target,original,unicode,slot)
local addprivate = fonts.helpers.addprivate
local olddata = original[unicode]
@@ -837,7 +833,6 @@ function vfmath.define(specification,set,goodies)
setmetatableindex(goodies,parent.goodies)
end
--
- properties.virtualized = true
properties.hasitalics = true
properties.hasmath = true
--
@@ -850,9 +845,11 @@ function vfmath.define(specification,set,goodies)
-- we need to set some values in main as well (still?)
--
main.fullname = properties.fullname
- main.type = "virtual"
main.nomath = false
--
+ properties.virtualized = true
+ main.type = "virtual"
+ --
parameters.x_height = parameters.x_height or 0
--
local already_reported = false
@@ -918,7 +915,7 @@ function vfmath.define(specification,set,goodies)
else
local vectorname = ss.vector
if vectorname then
- local offset = 0xFF000
+ local offset = 0xFF000 -- todo: -- private
local vector = mathencodings[vectorname]
local rotcev = reverse[vectorname]
local isextension = ss.extension
@@ -926,11 +923,11 @@ function vfmath.define(specification,set,goodies)
local fc = fs.characters
local fd = fs.descriptions
local si = shared[s]
+ local fontname = fs.properties.name or "unknown"
local skewchar = ss.skewchar
for unicode, index in next, vector do
local fci = fc[index]
if not fci then
- local fontname = fs.properties.name or "unknown"
local rf = reported[fontname]
if not rf then rf = { } reported[fontname] = rf end
local rv = rf[vectorname]
@@ -1111,7 +1108,8 @@ function vfmath.define(specification,set,goodies)
-- so better is to also reserve the id already which then involves some more
-- management (so not now).
fontlist[#fontlist+1] = {
- id = font.nextid(),
+ -- id = font.nextid(),
+ id = 0, -- self
size = size,
}
vfmath.addmissing(main,#fontlist,size)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/meta-blb.lua b/Master/texmf-dist/tex/context/base/mkiv/meta-blb.lua
index 9ee57d80dd1..c690f3902e7 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/meta-blb.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/meta-blb.lua
@@ -293,7 +293,7 @@ function mp.mf_inject_blob(category,str)
newblob(category,str) -- only for tracing
mp_category = category
mp_str = str
- tex.runtoks("mpblobtext")
+ tex.runlocal("mpblobtext")
end
interfaces.implement {
diff --git a/Master/texmf-dist/tex/context/base/mkiv/meta-fig.mkiv b/Master/texmf-dist/tex/context/base/mkiv/meta-fig.mkiv
index e89cb14425d..d18adc927c0 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/meta-fig.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/meta-fig.mkiv
@@ -65,8 +65,8 @@
\getfiguredimensions[#1]% [\c!object=\v!no] already set
\startMPcode
draw externalfigure "#1"
- xscaled \the\dimexpr\figurewidth \relax\space % must be points
- yscaled \the\dimexpr\figureheight\relax\space % must be points
+ xsized \the\dimexpr\figurewidth \relax\space % must be points
+ ysized \the\dimexpr\figureheight\relax\space % must be points
#2 ;
\stopMPcode
\egroup}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/meta-fnt.lua b/Master/texmf-dist/tex/context/base/mkiv/meta-fnt.lua
index 92bbe071617..54c66ceb976 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/meta-fnt.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/meta-fnt.lua
@@ -12,6 +12,7 @@ local format = string.format
local formatters = string.formatters
local chardata = characters.data
local fontdata = fonts.hashes.identifiers
+local round = math.round
local vffonts = fonts.handlers.vf
@@ -97,7 +98,7 @@ local function process(mpxformat,name,instances,scalefactor)
local fontname = file.removesuffix(file.basename(name))
local modification = attributes.modification
local filesize = attributes.size
- local hash = file.robustname(formatters["%s %05i %03i"](fontname,scalefactor*1000,instances))
+ local hash = file.robustname(formatters["%s %05i %03i"](fontname,round(scalefactor*1000),instances))
local lists = containers.read(mpfonts.cache,hash)
if not lists or lists.modification ~= modification or lists.filesize ~= filesize or lists.instances ~= instances or lists.scalefactor ~= scalefactor then
statistics.starttiming(flusher)
@@ -167,8 +168,8 @@ local function build(g,v)
local t = { }
for d=1,#data do
t = fonts.constructors.scale(data[d],-1000)
- -- local id = font.nextid()
- -- t.fonts = { { id = id } }
+ local id = font.nextid()
+ t.fonts = { { id = id } }
fontdata[id] = t
if v[5] then
vffonts.helpers.composecharacters(t)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/meta-imp-gamesymbols.mkxl b/Master/texmf-dist/tex/context/base/mkiv/meta-imp-gamesymbols.mkxl
deleted file mode 100644
index d79e59f69f4..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/meta-imp-gamesymbols.mkxl
+++ /dev/null
@@ -1,349 +0,0 @@
-%D \module
-%D [ file=meta-imp-gamesymbols,
-%D version=2019.10.10,
-%D title=\METAPOST\ Graphics,
-%D subtitle=Game Symbols,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-%D The \METAFUN\ code here is not optimal and efficient but as it serves as an
-%D example I decided to keep it simple. Also, performance is not really an issue
-%D here anyway. Inspired by the classic \quote {Concrete Mathematics} by Don Knuth
-%D we define dice and dominos, which happen to be \UNICODE\ characters now. We
-%D use this opportunity to demonstrate slightly different approached.
-
-%D Each dice gets it's own macro at the \METAPOST\ end. Watch how we use the \type
-%D {simplefun} instance in combination with a calculation wrapper. This will just
-%D execute the code and leave no traces in the text flow. The code itself is not
-%D that spectacular:
-
-\startMPcalculation{simplefun}
-
- def DiceFrame =
- pickup pencircle scaled 1/2 ;
- draw unitsquare scaled 8 ;
- pickup pencircle scaled 3/2 ;
- enddef ;
-
- vardef DiceOne =
- DiceFrame ;
- draw (4,4) ;
- enddef ;
- vardef DiceTwoA =
- DiceFrame ;
- draw (2,6) ; draw (6,2) ;
- enddef ;
- vardef DiceTwoB =
- DiceFrame ;
- draw (6,6) ; draw (2,2) ;
- enddef ;
- vardef DiceTwo =
- if hasoption "mpsfont" "option" "reverse" :
- DiceTwoB
- else :
- DiceTwoA
- fi ;
- enddef ;
- vardef DiceThreeA =
- DiceFrame ;
- draw (2,6) ; draw (4,4) ; draw (6,2) ;
- enddef ;
- vardef DiceThreeB =
- DiceFrame ;
- draw (6,6) ; draw (4,4) ; draw (2,2) ;
- enddef ;
- vardef DiceThree =
- if hasoption "mpsfont" "option" "reverse" :
- DiceThreeB
- else :
- DiceThreeA
- fi ;
- enddef ;
- vardef DiceFour =
- DiceFrame ;
- draw (2,6) ; draw (6,6) ; draw (2,2) ; draw (6,2) ;
- enddef ;
- vardef DiceFive =
- DiceFrame ;
- draw (2,6) ; draw (6,6) ; draw (4,4) ; draw (2,2) ; draw (6,2) ;
- enddef ;
- vardef DiceSix =
- DiceFrame ;
- draw (2,6) ; draw (6,6) ; draw (2,4) ; draw (6,4) ; draw (2,2) ; draw (6,2) ;
- enddef ;
-
- vardef DiceBad =
- pickup pencircle scaled 1/2 ;
- draw unitsquare scaled 8 ;
- draw (1,7) -- (7,1) ; draw (1,1) -- (7,7) ;
- enddef ;
-
- lmt_registerglyphs [
- name = "dice",
- units = 12,
- width = 8,
- height = 8,
- depth = 0,
- usecolor = true,
- ] ;
-
- lmt_registerglyph [ category = "dice", unicode = "0x2680", code = "DiceOne;" ] ;
- lmt_registerglyph [ category = "dice", unicode = "0x2681", code = "DiceTwo;" ] ;
- lmt_registerglyph [ category = "dice", unicode = "0x2682", code = "DiceThree;" ] ;
- lmt_registerglyph [ category = "dice", unicode = "0x2683", code = "DiceFour;" ] ;
- lmt_registerglyph [ category = "dice", unicode = "0x2684", code = "DiceFive;" ] ;
- lmt_registerglyph [ category = "dice", unicode = "0x2685", code = "DiceSix;" ] ;
-
- lmt_registerglyph [ category = "dice", private = "invaliddice", code = "DiceBad;" ] ;
-
-\stopMPcalculation
-
-%D At the \TEX\ end we define three features. The reverse is just there for fun. The
-%D digits features will map digits onto dice.
-
-\definefontfeature
- [dice:normal]
- [default]
- [metapost={category=dice}]
-
-\definefontfeature
- [dice:reverse]
- [default]
- [metapost={category=dice,option=reverse}]
-
-\definefontfeature
- [dice:digits]
- [dice:digits=yes]
-
-%D The mapping to dice happens here:
-
-\startluacode
-
- -- local invalid = fonts.helpers.privateslot("invaliddice")
-
- fonts.handlers.otf.addfeature("dice:digits", {
- type = "substitution",
- order = { "dice:digits" },
- nocheck = true,
- data = {
- [0x30] = "invaliddice",
- [0x31] = 0x2680,
- [0x32] = 0x2681,
- [0x33] = 0x2682,
- [0x34] = 0x2683,
- [0x35] = 0x2684,
- [0x36] = 0x2685,
- [0x37] = "invaliddice",
- [0x38] = "invaliddice",
- [0x39] = "invaliddice",
- },
- } )
-
-\stopluacode
-
-%D An example is given at the the end of this file so we now move forward with
-%D the dominos.
-
-\startMPcalculation{simplefun}
-
- %D Because there are so many dominos we predefine the shapes and then register
- %D the lot in a loop.
-
- picture Dominos[] ;
-
- Dominos[0] := image() ;
- Dominos[1] := image(draw(4,4);) ;
- Dominos[2] := image(draw(2,6);draw(6,2););
- Dominos[3] := image(draw(2,6);draw(4,4);draw(6,2););
- Dominos[4] := image(draw(2,6);draw(6,6);draw(2,2);draw(6,2););
- Dominos[5] := image(draw(2,6);draw(6,6);draw(4,4);draw(2,2);draw(6,2););
- Dominos[6] := image(draw(2,6);draw(4,6);draw(6,6);draw(2,2);draw(4,2);draw(6,2););
- % Dominos[7] := Dominos[0] ;
- % Dominos[8] := Dominos[0] ;
- % Dominos[9] := Dominos[0] ;
-
- %D Defining the font properties is straightforward:
-
- lmt_registerglyphs [
- name = "dominos",
- units = 12,
- width = 16,
- height = 8,
- depth = 0,
- usecolor = true,
- ] ;
-
- %D We have horizontal dominos:
-
- def DrawDominoH(expr a, b) =
- draw image (
- pickup pencircle scaled 1/2 ;
- if (getparameterdefault "mpsfont" "color" "") = "black" :
- fillup unitsquare xyscaled (16,8) ;
- draw (8,.5) -- (8,7.5) withcolor white ;
- pickup pencircle scaled 3/2 ;
- draw Dominos[a]
- withpen currentpen
- withcolor white ;
- draw Dominos[b] shifted (8,0)
- withpen currentpen
- withcolor white ;
- else :
- draw unitsquare xyscaled (16,8) ;
- draw (8,0) -- (8,8) ;
- pickup pencircle scaled 3/2 ;
- draw Dominos[a]
- withpen currentpen ;
- draw Dominos[b] shifted (8,0)
- withpen currentpen ;
- fi ;
- ) ;
- enddef ;
-
- %D and vertical ones. We could use the above macro and rotate and shift and reflect
- %D but why bother with it:
-
- def DrawDominoV(expr a, b) = % is H rotated and shifted
- draw image (
- pickup pencircle scaled 1/2 ;
- if (getparameterdefault "mpsfont" "color" "") = "black" :
- fillup unitsquare xyscaled (8,16) ;
- draw (.5,8) -- (7.5,8) withcolor white ;
- pickup pencircle scaled 3/2 ;
- draw Dominos[a] rotatedaround(center Dominos[a],90)
- withpen currentpen
- withcolor white ;
- draw Dominos[b] rotatedaround(center Dominos[b],90) shifted (0,8)
- withpen currentpen
- withcolor white ;
- else :
- draw unitsquare xyscaled (8,16) ;
- draw (0,8) -- (8,8) ;
- pickup pencircle scaled 3/2 ;
- draw Dominos[a] rotatedaround(center Dominos[a],90)
- withpen currentpen ;
- draw Dominos[b] rotatedaround(center Dominos[b],90) shifted (0,8)
- withpen currentpen ;
- fi ;
- ) ;
- enddef ;
-
- %D We have two simple loops that define the horizontal range:
-
- save unicode ; numeric unicode ; unicode := 127025 ; % 1F031
-
- for i=0 upto 6 :
- for j=0 upto 6 :
- lmt_registerglyph [
- category = "dominos",
- unicode = unicode,
- code = "DrawDominoH(" & decimal i & "," & decimal j & ");",
- width = 16,
- height = 8,
- ] ;
- unicode := unicode + 1 ;
- endfor ;
- endfor ;
-
- %D and the vertical range:
-
- save unicode ; numeric unicode ; unicode := 127075 ;
-
- for i=0 upto 6 :
- for j=0 upto 6 :
- lmt_registerglyph [
- category = "dominos",
- unicode = unicode,
- code = "DrawDominoV(" & decimal i & "," & decimal j & ");",
- width = 8,
- height = 16,
- ] ;
- unicode := unicode + 1 ;
- endfor ;
- endfor ;
-
- %D Now we're done at the \METAFUN\ end.
-
-\stopMPcalculation
-
-%D We predefine two features:
-
-\definefontfeature
- [dominos:white]
- [default]
- [metapost={category=dominos}]
-
-\definefontfeature
- [dominos:black]
- [default]
- [metapost={category=dominos,color=black}]
-
-\definefontfeature
- [dominos:digits]
- [dominos:digits=yes]
-
-%D This last feature is yet to be defined. We could deal with the invalid
-%D dominos with some substitution trickery but let's keep it simple.
-
-\startluacode
-
- local ligatures = { }
- local unicode = 127025
-
- for i=0x30,0x36 do
- for j=0x30,0x36 do
- ligatures[unicode] = { i, j }
- unicode = unicode + 1 ;
- end
- end
-
- fonts.handlers.otf.addfeature("dominos:digits", {
- type = "ligature",
- order = { "dominos:digits" },
- nocheck = true,
- data = ligatures,
- } )
-
-\stopluacode
-
-\continueifinputfile{meta-imp-gamesymbols.mkxl}
-
-\starttext
-
- \definefont[DominoW][Serif*dominos:white]
- \definefont[DominoB][Serif*dominos:black]
- \definefont[DominoD][Serif*dominos:white,dominos:digits]
-
- \startTEXpage[offset=3pt]
- \DominoW
- \char"1F043\quad 🀱\quad
- \char"1F052\quad 🀲\quad
- \char"1F038\quad 🀳\quad
- \darkgreen\char"1F049\quad \char"1F07B\quad
- \DominoB
- \char"1F087\quad
- \char"1F088\quad
- \char"1F089\quad
- \DominoD
- \darkred 12\quad56\quad64%
- \stopTEXpage
-
- \definefont[DiceN][Serif*dice:normal]
- \definefont[DiceR][Serif*dice:reverse]
- \definefont[DiceD][Serif*dice:normal,dice:digits]
-
- \startTEXpage[offset=3pt]
- \DiceN
- \dostepwiserecurse{"2680}{"2685}{1}{\char#1\quad}%
- \DiceN
- \dostepwiserecurse{"2680}{"2685}{1}{\char#1\quad}%
- \DiceD
- \darkblue 2\quad5\quad3\quad0
- \stopTEXpage
-
-\stoptext
diff --git a/Master/texmf-dist/tex/context/base/mkiv/meta-imp-mat.mkiv b/Master/texmf-dist/tex/context/base/mkiv/meta-imp-mat.mkiv
index 495864a9eeb..e1b5d9d0059 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/meta-imp-mat.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/meta-imp-mat.mkiv
@@ -129,7 +129,9 @@
% main handler
def math_stacker_draw_accent(expr p) =
- draw p withpen pencircle scaled OverlayLineWidth xyscaled (2,3) rotated 45 ;
+% draw p withpen pencircle scaled OverlayLineWidth xyscaled (2,3) rotated 45 ;
+% draw p withpen pencircle xscaled (2OverlayLineWidth) yscaled (3OverlayLineWidth/4) rotated 45 ;
+ draw p withpen pencircle scaled OverlayLineWidth ;
enddef ;
def math_stacker_draw_arrow(expr p) =
@@ -204,11 +206,16 @@
\startuniqueMPgraphic{minifun::math:radical:default}{axis,ex,em}
draw
math_radical_simple(OverlayWidth,OverlayHeight,OverlayDepth,OverlayOffset)
- withpen pencircle xscaled (2OverlayLineWidth) yscaled (3OverlayLineWidth/4) rotated 30
+ % withpen pencircle xscaled (2OverlayLineWidth) yscaled (3OverlayLineWidth/4) rotated 30
+ withpen pencircle scaled OverlayLineWidth
% dashed evenly
withcolor OverlayLineColor ;
\stopuniqueMPgraphic
+% already setup:
+%
+% definemathradical [sqrt] [mp=minifun::math:radical:default]
+
\continueifinputfile{meta-imp-mat.mkiv}
\setupmathstackers [both] [color=darkred,alternative=mp]
diff --git a/Master/texmf-dist/tex/context/base/mkiv/meta-imp-symbols.mkxl b/Master/texmf-dist/tex/context/base/mkiv/meta-imp-symbols.mkxl
deleted file mode 100644
index f88fd6f8787..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/meta-imp-symbols.mkxl
+++ /dev/null
@@ -1,99 +0,0 @@
-%D \module
-%D [ file=meta-imp-symbols,
-%D version=2019.10.01,
-%D title=\METAPOST\ Graphics,
-%D subtitle=Symbols,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-%D This is an (experimental) prelude to more.
-
-\startMPcalculation{simplefun}
-
- pen SymbolPen ; SymbolPen := pencircle scaled 1/4 ;
-
- vardef SymbolBullet = fill unitcircle scaled 3 shifted (1.5,1.5) withpen SymbolPen enddef ; % 0x2022 •
- vardef SymbolDash = draw (origin--right) scaled 3 shifted (1.5,3.0) withpen SymbolPen scaled 2 enddef ; % 0x2013 –
- vardef SymbolTriangle = draw unittriangle scaled 3 shifted (1.5,1.5) withpen SymbolPen enddef ; % 0x25B6 ⊳
- vardef SymbolCircle = fill unitcircle scaled 3 shifted (1.5,1.5) withpen SymbolPen enddef ; % 0x2218 ∘
- vardef SymbolSquare = draw unitsquare scaled (3-1/16) shifted (1.5,1.5) withpen SymbolPen enddef ; % 0x25A1 □
- vardef SymbolDiamond = draw unitdiamond scaled 3 shifted (1.5,1.5) withpen SymbolPen enddef ; % 0x22C4 ⋄
- vardef SymbolBlackTriangle = fillup unittriangle scaled (3-1/16) shifted (1.5,1.5) withpen SymbolPen enddef ; % 0x25B6 ▶
- vardef SymbolBlackSquare = fillup unitsquare scaled (3-1/16) shifted (1.5,1.5) withpen SymbolPen enddef ; % 0x25A0 ■
- vardef SymbolBlackDiamond = fillup unitdiamond scaled (3-1/16) shifted (1.5,1.5) withpen SymbolPen enddef ; % 0x25C6 ◆
-
- vardef SymbolNotDef =
- draw center unitcircle
- scaled 3
- shifted (1.5,1.5)
- withpen SymbolPen scaled 4
- enddef ;
-
- vardef SymbolStar = % 0x22C6 % ⋆
- SymbolNotDef
- enddef ;
-
- vardef SymbolCheckmark = % 0x2713 ✓
- SymbolNotDef
- enddef ;
-
- vardef SymbolAsterisk = % 0x2217 ∗
- SymbolNotDef
- enddef ;
-
- % We could set code directly to the meaning of the macro.
-
- lmt_registerglyphs [
- name = "symbols",
- units = 10,
- usecolor = true,
- width = 6,
- height = 6,
- depth = 0,
- code = "SymbolNotDef ;",
- ] ;
-
- lmt_registerglyph [ category = "symbols", unicode = "0x2022", code = "SymbolBullet ;" ] ;
- lmt_registerglyph [ category = "symbols", unicode = "0x2013", code = "SymbolDash ;" ] ;
- lmt_registerglyph [ category = "symbols", unicode = "0x22C6" ] ; % , code = "SymbolStar ;" ] ;
- lmt_registerglyph [ category = "symbols", unicode = "0x22B3", code = "SymbolTriangle ;" ] ;
- lmt_registerglyph [ category = "symbols", unicode = "0x2218", code = "SymbolCircle ;" ] ;
- lmt_registerglyph [ category = "symbols", unicode = "0x25A1", code = "SymbolSquare ;" ] ;
- lmt_registerglyph [ category = "symbols", unicode = "0x22C4", code = "SymbolDiamond ;" ] ;
- lmt_registerglyph [ category = "symbols", unicode = "0x2713" ] ; % , code = "SymbolCheckmark ;" ] ;
- lmt_registerglyph [ category = "symbols", unicode = "0x2217" ] ; % , code = "SymbolAsterisk ;" ] ;
- lmt_registerglyph [ category = "symbols", unicode = "0x25B6", code = "SymbolBlackTriangle ;" ] ;
- lmt_registerglyph [ category = "symbols", unicode = "0x25A0", code = "SymbolBlackSquare ;" ] ;
- lmt_registerglyph [ category = "symbols", unicode = "0x25C6", code = "SymbolBlackDiamond ;" ] ;
-
-\stopMPcalculation
-
-\continueifinputfile{meta-imp-symbols.mkxl}
-
-\usemodule[article-basic] \setupbodyfont[pagella]
-
-\starttext
-
-\definefontfeature[metasymbols][metapost=symbols]
-
-\definefont[MyFont] [Serif*default,metasymbols sa 1]
-
-Some metasymbols:
-
-\startitem {\MyFont • □ ◆}\quad Regular rendering. \stopitem
-\startitem {\MyFont\red • □ ◆}\quad Rendering with color. \stopitem
-\startitem {\MyFont\blue\showglyphs • □ ◆}\quad Idem but with boundingboxes shown. \stopitem
-
-And some more:
-
-\startlines
- • – ⋆ ⊳ ∘ □ ⋄ ✓ ∗ ▶ ■ ◆
- {\MyFont • – ⋆ ⊳ ∘ □ ⋄ ✓ ∗ ▶ ■ ◆}
-\stoplines
-
-\stoptext
diff --git a/Master/texmf-dist/tex/context/base/mkiv/meta-imp-threesix.mkxl b/Master/texmf-dist/tex/context/base/mkiv/meta-imp-threesix.mkxl
deleted file mode 100644
index 277aa85f717..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/meta-imp-threesix.mkxl
+++ /dev/null
@@ -1,253 +0,0 @@
-% not yet a module
-
-\startluacode
- local gsub, utfbyte = string.gsub, utf.byte
-
- -- The font from DEK's facs9b.ps (I wish I was clever enough to understand all the good
- -- stuff in there):
-
- local font36 = {
- ["0"] = [[00111100 01111110 11000011 11000011 11000011 11000011 01111110 00111100]],
- ["1"] = [[00011100 11111100 11101100 00001100 00001100 00001100 11111111 11111111]],
- ["2"] = [[00111110 01110011 01110011 00000011 00001110 00111000 11110001 11111111]],
- ["3"] = [[01111110 01100110 00000110 00111100 00000110 11100111 11100111 01111110]],
- ["4"] = [[00001110 00011110 00110110 01100110 11111111 11111111 00000110 00001110]],
- ["5"] = [[01111110 01111110 01000000 01111100 01000111 00000011 11000111 11111110]],
- ["6"] = [[01111110 01100110 11000000 11011100 11100110 11000011 01100011 01111110]],
- ["7"] = [[11111111 11111111 10000111 10001110 00011100 00011100 00011100 00011100]],
- ["8"] = [[01111110 01100110 01100110 00111100 11000011 11000011 11000011 01111110]],
- ["9"] = [[01111110 11000110 11000011 01100111 00111011 00000011 01100110 01111110]],
- ["A"] = [[000110000 000111000 001111100 001101100 011001110 011111110 010000110 111100111]],
- ["B"] = [[1111100 1110110 0110110 0111100 0110011 0110011 1110011 1111100]],
- ["C"] = [[01111101 11110011 11100001 11100001 11100000 11100000 11100001 01111110]],
- ["D"] = [[11111100 11100010 01100011 01100011 01100011 01100011 11100010 11111100]],
- ["E"] = [[1111111 1110001 0110101 0111100 0110100 0110001 1110001 1111111]],
- ["F"] = [[11111111 11100001 01100101 01111100 01100100 01100000 11111000 11111000]],
- ["G"] = [[01111010 11100110 11100010 11100000 11100111 11100010 11100010 01111100]],
- ["H"] = [[11100111 11100111 01000010 01111110 01000010 01000010 11100111 11100111]],
- ["I"] = [[1111111 1111111 0011000 0011000 0011000 0011000 1111111 1111111]],
- ["J"] = [[01111111 01111111 00000110 00000110 11110110 01100110 01100110 00111100]],
- ["K"] = [[11101110 11100100 01101000 01110000 01111000 01101100 11100110 11101111]],
- ["L"] = [[111111000 111111000 011000000 011000000 011000000 011000011 111000011 111111111]],
- ["M"] = [[1100000011 1110000111 0111111110 0100110010 0100110010 0100000010 1100000011 1100000011]],
- ["N"] = [[11000011 11100011 01110010 01111010 01011110 01001110 11100110 11100010]],
- ["O"] = [[01111110 11000011 11000011 11000011 11000011 11000011 11000011 01111110]],
- ["P"] = [[11111110 11100011 01100011 01111110 01100000 01100000 11111000 11111000]],
- ["Q"] = [[01111100 11000110 11000110 11000110 11000110 11001110 11000110 01111101]],
- ["R"] = [[11111100 11100110 01100110 01111100 01101000 01100100 11100010 11100111]],
- ["S"] = [[01111110 11100001 11100001 01111000 00011110 10000111 11000011 10111110]],
- ["T"] = [[1111111111 1100110011 1100110011 0000110000 0000110000 0000110000 0001111000 0001111000]],
- ["U"] = [[111101111 111101111 011000010 011000010 011000010 011000010 011000010 001111100]],
- ["V"] = [[11111000111 11111000111 01110000010 00110000100 00111000100 00011001000 00001101000 00001110000]],
- ["W"] = [[111000000111 111000000111 110000000010 011000000100 011001000100 001101101000 001101101000 000110110000]],
- ["X"] = [[1111001110 1111000110 0001101000 0000110000 0000110000 0001011000 0110001111 0111001111]],
- ["Y"] = [[111100011 111100011 011000010 001110100 000111000 000011000 001111110 001111110]],
- ["Z"] = [[11111111 10000111 00001110 00011100 00111000 01110000 11100001 11111111]],
- }
-
- local f_code = string.formatters["ThreeSix(%s);"]
- local replace = { ["0"] = "N;", ["1"] = "Y;", [" "] = "L;" }
-
- local function remap(str)
- -- permit abundant spacing (bonus)
- str = gsub(str,"%s+", " ")
- -- remap what we got to macro calls
- str = gsub(str,".",replace)
- -- return the result
- return str
- end
-
- function MP.registerthreesix(name)
- fonts.dropins.registerglyphs {
- name = name,
- units = 12,
- usecolor = true,
- preamble = "InitializeThreeSix;",
- }
- for u, v in table.sortedhash(font36) do
- local ny = 8
- local nx = (#v - ny + 1) // ny
- local height = ny * 1.1 - 0.1
- local width = nx * 1.1 - 0.1
- fonts.dropins.registerglyph {
- category = name,
- unicode = utfbyte(u),
- width = width,
- height = height,
- code = f_code(remap(v)),
- }
- end
- end
-
- MP.registerthreesix("fontthreesix")
-\stopluacode
-
-% \startMPcalculation{simplefun}
-% def InitializeThreeSix =
-% save Y, N, L, S ; save dx, dy, nx, ny ;
-% save shape, fillcolor, mypen, random, currentpen, spread, hoffset ;
-% string shape, fillcolor, mypen ; boolean random ; pen currentpen ;
-% dx := 11/10 ;
-% dy := - 11/10 ;
-% nx := - dx ;
-% ny := 0 ;
-% shape := getparameterdefault "mpsfont" "shape" "circle" ;
-% random := hasoption "mpsfont" "random" "true" ;
-% fillcolor := getparameterdefault "mpsfont" "color" "" ;
-% mypen := getparameterdefault "mpsfont" "pen" "" ;
-% spread := getparameterdefault "mpsfont" "spread" 0 ;
-% hoffset := 12 * spread / 2 ;
-% currentpen := pencircle
-% if mypen = "fancy" :
-% xscaled 1/20 yscaled 2/20 rotated 45
-% else :
-% scaled 1/20
-% fi ;
-% if shape == "square" :
-% def S =
-% unitsquare if random : randomized 1/10 fi
-% shifted (nx,ny)
-% enddef ;
-% elseif shape = "diamond" :
-% def S =
-% unitdiamond if random : randomized 1/10 fi
-% shifted (nx,ny)
-% enddef ;
-% else :
-% def S =
-% unitcircle if random : randomizedcontrols 1/20 fi
-% shifted (nx,ny)
-% enddef ;
-% fi ;
-% def N =
-% nx := nx + dx ;
-% draw S ;
-% enddef ;
-% if fillcolor = "random" :
-% def Y =
-% nx := nx + dx ;
-% fillup S withcolor white randomized (2/3,2/3,2/3) ;
-% enddef ;
-% elseif fillcolor = "" :
-% def Y =
-% nx := nx + dx ;
-% fillup S ;
-% enddef ;
-% else :
-% def Y =
-% nx := nx + dx ;
-% fillup S withcolor fillcolor ;
-% enddef ;
-% fi ;
-% def L =
-% nx := - dx ;
-% ny := ny + dy ;
-% enddef ;
-% enddef ;
-%
-% vardef ThreeSix (text code) =
-% InitializeThreeSix ;
-% draw image (code) shifted (hoffset,-ny) ;
-% enddef ;
-% \stopMPcalculation
-
-\startMPcalculation{simplefun}
- def InitializeThreeSix =
- save Y, N, L, S ;
- % save dx, dy, nx, ny ;
- save shape, fillcolor, mypen, random, threesixpen, spread, hoffset ;
- string shape, fillcolor, mypen ; boolean random ; pen threesixpen ;
- % dx := 11/10 ;
- % dy := - 11/10 ;
- % nx := - dx ;
- % ny := 0 ;
- shape := getparameterdefault "mpsfont" "shape" "circle" ;
- random := hasoption "mpsfont" "random" "true" ;
- fillcolor := getparameterdefault "mpsfont" "color" "" ;
- mypen := getparameterdefault "mpsfont" "pen" "" ;
- spread := getparameterdefault "mpsfont" "spread" 0 ;
- hoffset := 12 * spread / 2 ;
- threesixpen := pencircle
- if mypen = "fancy" :
- xscaled 1/20 yscaled 2/20 rotated 45
- else :
- scaled 1/20
- fi ;
- if shape == "square" :
- def S =
- unitsquare if random : randomized 1/10 fi
- shifted (nx,ny)
- enddef ;
- elseif shape = "diamond" :
- def S =
- unitdiamond if random : randomized 1/10 fi
- shifted (nx,ny)
- enddef ;
- else :
- def S =
- unitcircle if random : randomizedcontrols 1/20 fi
- shifted (nx,ny)
- enddef ;
- fi ;
- def N =
- nx := nx + dx ;
- draw S ;
- enddef ;
- if fillcolor = "random" :
- def Y =
- nx := nx + dx ;
- fillup S withcolor white randomized (2/3,2/3,2/3) ;
- enddef ;
- elseif fillcolor = "" :
- def Y =
- nx := nx + dx ;
- fillup S ;
- enddef ;
- else :
- def Y =
- nx := nx + dx ;
- fillup S withcolor fillcolor ;
- enddef ;
- fi ;
- def L =
- nx := - dx ;
- ny := ny + dy ;
- enddef ;
- enddef ;
-
- vardef ThreeSix (text code) =
- save dx, dy, nx, ny ;
- dx := 11/10 ;
- dy := - 11/10 ;
- nx := - dx ;
- ny := 0 ;
- pickup threesixpen ;
- draw image (code) shifted (hoffset,-ny) ;
- enddef ;
-\stopMPcalculation
-
-\definefontfeature % black and white, with some spread
- [fontthreesix]
- [default]
- [metapost=fontthreesix]
-
-\definefontfeature % color, with some spread
- [fontthreesix-tweak]
- [default]
- [metapost={category=fontthreesix,spread=.1}]
-
-\definefontfeature % color, with some spread
- [fontthreesix-color]
- [default]
- [metapost={category=fontthreesix,shape=diamond,color=random,pen=fancy,spread=.1}]
-
-\definefontfeature % color, tight
- [fontthreesix-initial]
- [metapost={category=fontthreesix,color=random,shape=circle}] % units?
-
-\definefont[DEKFontA][Serif*fontthreesix]
-\definefont[DEKFontB][Serif*fontthreesix-color]
-\definefont[DEKFontC][Serif*fontthreesix-initial]
-\definefont[DEKFontD][Serif*fontthreesix-tweak]
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/meta-imp-txt.mkiv b/Master/texmf-dist/tex/context/base/mkiv/meta-imp-txt.mkiv
index e683c3766c9..2c28acf7290 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/meta-imp-txt.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/meta-imp-txt.mkiv
@@ -25,7 +25,7 @@
\unprotect
-\definesystemvariable {sh} % ShapedText .. todo: commandhandler
+\ifdefined\??sh \else \definesystemvariable {sh} \fi % ShapedText .. todo: commandhandler
\unexpanded\def\setupshapetexts
{\dodoubleempty\getparameters[\??sh]}
@@ -80,16 +80,17 @@
\unexpanded\def\adaptparshape
{\def\docommand##1%
- {\ifcase\scratchcounter
- \expandafter\appendtoks\space##1 \to\scratchtoks
- \else
- \advance\scratchcounter\minusone
- \fi}%
+ {\doifsomething{##1}%
+ {\ifcase\scratchcounter\relax
+ \expandafter\appendtoks\space##1 \to\scratchtoks
+ \else
+ \advance\scratchcounter\minusone
+ \fi}}%
\scratchcounter\prevgraf
\doglobal\decrement(\totalparlines,\scratchcounter)%
\multiply\scratchcounter\plustwo
\scratchtoks\emptytoks
- \expanded{\processseparatedlist[\the\partoks][\space]}\docommand
+ \expanded{\processseparatedlist[\the\partoks][\space]}\docommand % we can have two spaces
\global\partoks\scratchtoks
\parshape\totalparlines\the\partoks\relax}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/meta-ini.mkiv b/Master/texmf-dist/tex/context/base/mkiv/meta-ini.mkiv
index ac920450e84..9305a04957e 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/meta-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/meta-ini.mkiv
@@ -136,25 +136,34 @@
\let\stopMPinclusions\relax
+% The next was broken since we added instances so it will go away!
+
\unexpanded\def\MPinclusions
{\dosingleempty\meta_inclusions}
\def\meta_inclusions[#1]%
{\edef\m_meta_option{#1}%
- \dosinglegroupempty\meta_inclusions_indeed}
+ \dodoublegroupempty\meta_inclusions_indeed}
\def\meta_inclusions_indeed#1#2%
{\let\m_meta_saved_instance\currentMPinstance
- \edef\currentMPinstance{#1}%
- \ifx\currentMPinstance\empty
- \let\currentMPinstance\defaultMPinstance
- \fi
\ifx\m_meta_option\!!plustoken \else
\global\t_meta_inclusions\emptytoks
\fi
- \gtoksapp\t_meta_inclusions{#2}%
+ \ifsecondargument
+ \edef\currentMPinstance{#1}%
+ \ifx\currentMPinstance\empty
+ \let\currentMPinstance\defaultMPinstance
+ \fi
+ \gtoksapp\t_meta_inclusions{#2}%
+ \else
+ \let\currentMPinstance\defaultMPinstance
+ \gtoksapp\t_meta_inclusions{#1}%
+ \fi
\let\currentMPinstance\m_meta_saved_instance}
+% so far
+
\installcommandhandler \??mpinstance {MPinstance} \??mpinstance
\setupMPinstance
@@ -874,11 +883,8 @@
{\meta_prepare_instance_variable{#1}%
\edef\overlaystamp{\overlaystamp:\MPvariable{#1}}}
-\unexpanded\def\getMPdata {\clf_getMPdata}
- \let\rawMPdata \clf_getMPdata
-
-\unexpanded\def\getMPstored{\clf_getMPstored}
- \let\rawMPstored \clf_getMPstored
+\unexpanded\def\getMPdata{\clf_getMPdata}
+ \let\rawMPdata \clf_getMPdata
%D We need this trick because we need to make sure that the tex scanner sees
%D newlines and does not quit. Also, we do need to flush the buffer under a normal
@@ -1110,7 +1116,7 @@
% \newcount\c_overlay_linetransparency
% \appendtoks
-% \c_overlay_colormodel \attribute\colormodelattribute
+% \c_overlay_colormodel \c_attr_colormodel
% \c_overlay_color \colo_helpers_inherited_current_ca\overlaycolor
% \c_overlay_transparency \colo_helpers_inherited_current_ta\overlaycolor
% \c_overlay_linecolor \colo_helpers_inherited_current_ca\overlaylinecolor
@@ -1368,8 +1374,8 @@
\appendtoks
\clf_mpsetoutercolor
\MPcolormethod\space
- \attribute\colormodelattribute\space
- \attribute\colorattribute\space
+ \c_attr_colormodel\space
+ \c_attr_color\space
\dogetattribute{transparency}\relax
\to \everyMPgraphic
diff --git a/Master/texmf-dist/tex/context/base/mkiv/meta-ini.mkxl b/Master/texmf-dist/tex/context/base/mkiv/meta-ini.mkxl
deleted file mode 100644
index e08aa560a71..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/meta-ini.mkxl
+++ /dev/null
@@ -1,1465 +0,0 @@
-%D \module
-%D [ file=meta-ini,
-%D version=2008.03.25,
-%D title=\METAPOST\ Graphics,
-%D subtitle=Initialization,
-%D author=Hans Hagen,
-%D date=\ currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% initializations:
-%
-% - pass settings from tex to mp (delayed expansion)
-% - used by context core (and modules)
-% - cummulative definitions
-% - flushed each graphic
-% - can be disabled per instance
-% - managed at the tex end
-%
-% extensions:
-%
-% - add mp functionality (immediate expansion)
-% - cummulative
-% - all instances or subset of instances
-% - can be disabled per instance
-% - managed at the lua/mp end
-% - could be managed at the tex end but no real reason and also messy
-%
-% definitions:
-%
-% - add mp functionality (delayed expansion)
-% - cummulative
-% - per instance
-% - managed at the tex end
-%
-% inclusions:
-%
-% - add mp functionality (delayed expansion)
-% - cummulative only when [+]
-% - per instance
-% - managed at the tex end
-%
-% order of execution:
-%
-% definitions
-% extensions
-% inclusions
-% beginfig
-% initializations
-% graphic
-% endfig
-
-% The instance will be implemented stepwise ... I should redo some code in order to
-% make the macros look better than they do now.
-
-\writestatus{loading}{MetaPost Graphics / Initializations}
-
-\registerctxluafile{meta-ini}{}
-
-\unprotect
-
-\newtoks \everyMPgraphic % mp % public or not ?
-
-\appendtoks
- \restoreendofline % see interferences-001.tex
-\to \everyMPgraphic
-
-\def\MPruntimefile {mprun}
-\def\currentMPformat {metafun}
-\def\defaultMPinstance{metafun}
-
-\installcorenamespace{mpinstance}
-\installcorenamespace{mpinclusions}
-\installcorenamespace{mpdefinitions}
-\installcorenamespace{mpgraphic}
-\installcorenamespace{mpstaticgraphic}
-\installcorenamespace{mpclip}
-
-\newtoks \t_meta_initializations % tex, each
-\def \t_meta_inclusions {\csname\??mpinclusions \currentMPinstance\endcsname} % token register
-\def \t_meta_definitions {\csname\??mpdefinitions\currentMPinstance\endcsname} % token register
-
-%D The next command is, of course, dedicated to Mojca, who needs it for gnuplot.
-%D Anyway, the whole multiple engine mechanism is to keep her gnuplot from
-%D interfering.
-
-\unexpanded\def\startMPdefinitions
- {\dosinglegroupempty\meta_start_definitions}
-
-\def\meta_start_definitions#1#2\stopMPdefinitions
- {\let\m_meta_saved_instance\currentMPinstance
- \edef\currentMPinstance{#1}%
- \ifx\currentMPinstance\empty
- \let\currentMPinstance\defaultMPinstance
- \fi
- \gtoksapp\t_meta_definitions{#2}%
- \let\currentMPinstance\m_meta_saved_instance}
-
-\let\stopMPdefinitions\relax
-
-\unexpanded\def\startMPextensions
- {\dosinglegroupempty\meta_start_extensions}
-
-\def\meta_start_extensions#1#2\stopMPextensions % we could use buffers instead
- {\clf_setmpextensions{#1}{#2}}
-
-\let\stopMPextensions\relax
-
-\unexpanded\def\startMPinitializations#1\stopMPinitializations % for all instances, when enabled
- {\gtoksapp\t_meta_initializations{#1}}
-
-\let\stopMPinitializations\relax
-
-\unexpanded\def\startMPinclusions
- {\dosingleempty\meta_start_inclusions}
-
-\unexpanded\def\meta_start_inclusions[#1]%
- {\edef\m_meta_option{#1}%
- \dosinglegroupempty\meta_start_inclusions_indeed}
-
-\def\meta_start_inclusions_indeed#1#2\stopMPinclusions
- {\let\m_meta_saved_instance\currentMPinstance
- \edef\currentMPinstance{#1}%
- \ifx\currentMPinstance\empty
- \let\currentMPinstance\defaultMPinstance
- \fi
- \ifx\m_meta_option\!!plustoken \else
- \global\t_meta_inclusions\emptytoks
- \fi
- \gtoksapp\t_meta_inclusions{#2}%
- \let\currentMPinstance\m_meta_saved_instance}
-
-\let\stopMPinclusions\relax
-
-\unexpanded\def\MPinclusions
- {\dosingleempty\meta_inclusions}
-
-\def\meta_inclusions[#1]%
- {\edef\m_meta_option{#1}%
- \dosinglegroupempty\meta_inclusions_indeed}
-
-\def\meta_inclusions_indeed#1#2%
- {\let\m_meta_saved_instance\currentMPinstance
- \edef\currentMPinstance{#1}%
- \ifx\currentMPinstance\empty
- \let\currentMPinstance\defaultMPinstance
- \fi
- \ifx\m_meta_option\!!plustoken \else
- \global\t_meta_inclusions\emptytoks
- \fi
- \gtoksapp\t_meta_inclusions{#2}%
- \let\currentMPinstance\m_meta_saved_instance}
-
-\installcommandhandler \??mpinstance {MPinstance} \??mpinstance
-
-\setupMPinstance
- [\s!format=metafun,
- \s!extensions=\v!no,
- \s!initializations=\v!no,
- \c!method=\s!default,
- \c!textstyle=,
- \c!textcolor=]
-
-\appendtoks
- \ifcsname\??mpdefinitions\currentMPinstance\endcsname \else
- \expandafter\newtoks\csname\??mpdefinitions\currentMPinstance\endcsname
- \fi
- \ifcsname\??mpinclusions\currentMPinstance\endcsname \else
- \expandafter\newtoks\csname\??mpinclusions\currentMPinstance\endcsname
- \fi
- \t_meta_definitions\emptytoks % in case we redefine
- \t_meta_inclusions \emptytoks % in case we redefine
-\to \everydefineMPinstance
-
-\unexpanded\def\resetMPinstance[#1]%
- {\writestatus\m!metapost{reset will be implemented when needed}}
-
-\def\meta_analyze_graphicname[#1]%
- %{\normalexpanded{\meta_analyze_graphicname_indeed[#1::::]}}
- {\normalexpanded{\meta_analyze_graphicname_indeed[#1}::::]}
-
-\def\meta_show_properties_indeed
- {\writestatus{metapost}{name: \currentMPgraphicname, instance: \currentMPinstance, format: \currentMPformat}}
-
-\let\meta_show_properties\donothing
-
-\installtextracker
- {metapost.properties}
- {\let\meta_show_properties\meta_show_properties_indeed}
- {\let\meta_show_properties\donothing}
-
-\unexpanded\def\meta_analyze_graphicname_indeed[#1::#2::#3]% instance ::
- {\edef\currentMPgraphicname{#2}%
- \ifx\currentMPgraphicname\empty
- \edef\currentMPgraphicname{#1}%
- \let\currentMPinstance\defaultMPinstance
- \orelse\ifcsname\??mpdefinitions#1\endcsname
- \edef\currentMPinstance{#1}%
- \else
- \let\currentMPinstance\defaultMPinstance
- \fi
- \edef\currentMPformat{\MPinstanceparameter\s!format}%
- \meta_show_properties}
-
-\def\currentMPgraphicname{\s!unknown}
-\def\currentMPinstance {\defaultMPinstance}
-\def\currentMPformat {\currentMPinstance}
-
-\defineMPinstance[metafun] [\s!format=metafun,\s!extensions=\v!yes,\s!initializations=\v!yes]
-\defineMPinstance[minifun] [\s!format=minifun,\s!extensions=\v!yes,\s!initializations=\v!yes]
-\defineMPinstance[extrafun] [\s!format=metafun,\s!extensions=\v!yes,\s!initializations=\v!yes]
-\defineMPinstance[lessfun] [\s!format=metafun]
-\defineMPinstance[doublefun] [\s!format=metafun,\s!extensions=\v!yes,\s!initializations=\v!yes,\c!method=\s!double]
-\defineMPinstance[binaryfun] [\s!format=metafun,\s!extensions=\v!yes,\s!initializations=\v!yes,\c!method=\s!binary]
-\defineMPinstance[decimalfun] [\s!format=metafun,\s!extensions=\v!yes,\s!initializations=\v!yes,\c!method=\s!decimal]
-
-\defineMPinstance[mprun] [\s!format=metafun,\s!extensions=\v!yes,\s!initializations=\v!yes]
-
-\defineMPinstance[metapost] [\s!format=mpost]
-\defineMPinstance[nofun] [\s!format=mpost]
-\defineMPinstance[doublepost] [\s!format=mpost,\c!method=\s!double]
-\defineMPinstance[binarypost] [\s!format=mpost,\c!method=\s!binary]
-\defineMPinstance[decimalpost][\s!format=mpost,\c!method=\s!decimal]
-
-\defineMPinstance[simplefun] [\s!format=metafun,\c!method=\s!double] % maybe use minifun
-
-%defineMPinstance[megapost] [\s!format=mpost,\c!method=\s!decimal]
-
-\newconditional\c_meta_include_initializations
-
-\def\meta_begin_graphic_group#1%
- {\begingroup
- \meta_analyze_graphicname[#1]}
-
-\def\meta_end_graphic_group
- {\endgroup}
-
-\def\MPaskedfigure{false}
-
-\def\meta_flush_current_initializations
- {\ifconditional\c_meta_include_initializations
- \the\t_meta_initializations
- \fi}
-
-\def\meta_flush_current_inclusions
- {\the\t_meta_inclusions}
-
-\def\meta_flush_current_definitions
- {\the\t_meta_definitions}
-
-\def\meta_start_current_graphic
- {\begingroup
- \meta_enable_include
- \the\everyMPgraphic
- \edef\p_initializations{\MPinstanceparameter\s!initializations}%
- \ifx\p_initializations\v!yes
- \settrue \c_meta_include_initializations
- \else
- \setfalse\c_meta_include_initializations
- \fi
- \edef\p_setups{\MPinstanceparameter\c!setups}%
- \ifx\p_setups\empty \else
- \setups[\p_setups]%
- \fi
- \useMPinstancestyleparameter\c!textstyle}
-
-\def\meta_set_current_color
- {\useMPinstancecolorparameter\c!textcolor}
-
-\def\meta_stop_current_graphic
- {\global\t_meta_definitions\emptytoks
- \global\t_meta_inclusions\emptytoks
- \endgroup}
-
-\def\meta_process_graphic_start
- {\pushMPboundingbox
- \setbox\b_meta_graphic\hpack\bgroup}
-
-\let\meta_relocate_graphic\relax % experimental hook
-
-\def\meta_process_graphic_stop
- {\egroup
- \meta_place_graphic
- \meta_relocate_graphic
- \popMPboundingbox}
-
-\unexpanded\def\meta_process_graphic_instance#1%
- {\edef\currentMPinstance{#1}%
- \ifx\currentMPinstance\empty
- \let\currentMPinstance\defaultMPinstance
- \fi
- \edef\currentMPformat{\MPinstanceparameter\s!format}%
- \meta_process_graphic}
-
-\unexpanded\def\meta_process_graphic#1% todo: extensions and inclusions outside beginfig
- {\meta_start_current_graphic
- \forgetall
- \edef\p_extensions{\MPinstanceparameter\s!extensions}%
- \meta_process_graphic_start
- \normalexpanded{\noexpand\clf_mpgraphic
- instance {\currentMPinstance}%
- format {\currentMPformat}%
- data {#1;}%
- initializations {\meta_flush_current_initializations}%
- \ifx\p_extensions\v!yes
- extensions {\clf_getmpextensions{\currentMPinstance}}% goes through tex again
- \fi
- inclusions {\meta_flush_current_inclusions}%
- definitions {\meta_flush_current_definitions}%
- figure {\MPaskedfigure}%
- method {\MPinstanceparameter\c!method}%
- namespace {\??graphicvariable\currentmpvariableclass:}%
- \relax}%
- \meta_process_graphic_stop
- \meta_stop_current_graphic}
-
-\let\meta_process_graphic_figure_start\relax
-\let\meta_process_graphic_figure_stop \relax
-
-\unexpanded\def\processMPfigurefile#1% special case: obeys beginfig .. endfig and makes pages
- {\begingroup
- \let\normal_meta_process_graphic_start\meta_process_graphic_start
- \let\normal_meta_process_graphic_stop \meta_process_graphic_stop
- \let\meta_process_graphic_start\relax
- \let\meta_process_graphic_stop \relax
- \def\meta_process_graphic_figure_start{\startTEXpage[\c!offset=\v!overlay,\c!align=]\normal_meta_process_graphic_start}%
- \def\meta_process_graphic_figure_stop {\normal_meta_process_graphic_stop\stopTEXpage}
- \def\MPaskedfigure{all}%
- \meta_process_graphic{input "#1" ;}%
- \endgroup}
-
-%D Calling up previously defined graphics.
-
-% \def\includeMPgraphic#1% gets expanded !
-% {\ifcsname\??mpgraphic#1\endcsname
-% \csname\??mpgraphic#1\endcsname ; % ; is safeguard
-% \fi}
-%
-% \unexpanded\def\meta_enable_include % public
-% {\let\meta_handle_use_graphic \thirdofthreearguments
-% \let\meta_handle_reusable_graphic\thirdofthreearguments}
-%
-% but ... we want this too:
-%
-% \startuseMPgraphic{x}
-% draw textext("\externalfigure[foo.pdf]") ;
-% \stopuseMPgraphic
-%
-% \useMPgraphic{x}
-%
-% so we cannot overload unless we let back to the original meanings each graphic
-% ... a better solution is:
-
-\def\includeMPgraphic#1% gets expanded !
- {\ifcsname\??mpgraphic#1\endcsname
- \doubleexpandafter\fourthoffourarguments\lastnamedcs ; % ; is safeguard
- \fi}
-
-\let\meta_enable_include\relax
-
-%D Drawings (stepwise built):
-
-\newif\ifMPdrawingdone \MPdrawingdonefalse
-
-\unexpanded\def\finalizeMPdrawing
- {\MPdrawingdonetrue}
-
-\let\MPdrawingdata\empty
-
-\unexpanded\def\resetMPdrawing
- {\glet\MPdrawingdata\empty
- \global\MPdrawingdonefalse}
-
-\unexpanded\def\pushMPdrawing
- {\globalpushmacro\MPdrawingdata
- \glet\MPdrawingdata\empty}
-
-\unexpanded\def\popMPdrawing
- {\globalpopmacro\MPdrawingdata}
-
-\unexpanded\def\getMPdrawing
- {\ifMPdrawingdone
- \expandafter\meta_process_graphic\expandafter{\MPdrawingdata}% is this expansion still needed?
- \fi}
-
-\def\startMPdrawing
- {\dosingleempty\meta_start_drawing}
-
-\def\meta_start_drawing[#1]#2\stopMPdrawing % to be redone, this ascii stuff
- {\relax
- \bgroup
- \meta_enable_include
- \doifelse{#1}{-}{\convertargument#2\to\asciia}{\def\asciia{#2}}%
- \xdef\MPdrawingdata{\MPdrawingdata\asciia}%
- \egroup}
-
-\let\stopMPdrawing\relax
-
-\def\MPdrawing#1%
- {\relax
- \bgroup
- \meta_enable_include
- \xdef\MPdrawingdata{\MPdrawingdata#1}%
- \egroup}
-
-\unexpanded\def\startMPclip#1#2\stopMPclip % todo: store at the lua end or just store less
- {\setgvalue{\??mpclip#1}{#2}}
-
-\let\stopMPclip\relax
-
-\unexpanded\def\meta_grab_clip_path#1#2#3%
- {\begingroup
- \d_overlay_width #2\relax
- \d_overlay_height#3\relax
- \edef\width {\the\d_overlay_width \space}%
- \edef\height{\the\d_overlay_height\space}%
- \edef\currentMPclip{#1}%
- \ifcsname\??mpclip\currentMPclip\endcsname
- \meta_grab_clip_path_yes
- \else
- \meta_grab_clip_path_nop
- \fi
- \endgroup}
-
-\def\meta_grab_clip_path_yes
- {\meta_start_current_graphic
- \normalexpanded{\noexpand\clf_mpsetclippath
- instance {\currentMPinstance}%
- format {\currentMPformat}%
- data {\csname\??mpclip\currentMPclip\endcsname}%
- initializations {\meta_flush_current_initializations}%
- useextensions {\MPinstanceparameter\s!extensions}%
- inclusions {\meta_flush_current_inclusions}%
- method {\MPinstanceparameter\c!method}%
- width \d_overlay_width
- height \d_overlay_height
- \relax}%
- \meta_stop_current_graphic}
-
-\def\meta_grab_clip_path_nop
- {\clf_mpsetclippath
- width \d_overlay_width
- height \d_overlay_height
- \relax}
-
-%D Since we want labels to follow the document settings, we also set the font
-%D related variables.
-
-\unexpanded\def\MPfontsizehskip#1%
- {\dontleavehmode
- \begingroup
- \definedfont[#1]%
- \hskip\clf_currentdesignsize\scaledpoint\relax
- \endgroup}
-
-\definefontsynonym[MetafunDefault][Regular*default]
-
-\startMPinitializations % scale is not yet ok
- defaultfont:="\truefontname{MetafunDefault}";
- % defaultscale:=\the\bodyfontsize/10pt; % only when hard coded 10pt
- % defaultscale:=1;
-\stopMPinitializations
-
-%D A signal that we're in combined \CONTEXT||\METAFUN mode:
-
-\startMPextensions
- string contextversion;contextversion:="\contextversion"; % expanded
-\stopMPextensions
-
-%D \macros
-%D {setupMPvariables}
-%D
-%D When we build collections of \METAPOST\ graphics, like background and buttons,
-%D the need for passing settings arises. By (mis|)|using the local prefix that
-%D belongs to \type {\framed}, we get a rather natural interface to backgrounds. To
-%D prevent conflicts, we will use the \type {-} in \METAPOST\ specific variables,
-%D like:
-%D
-%D \starttyping
-%D \setupMPvariables[meta:button][size=20pt]
-%D \stoptyping
-
-% \lineheight 2pt 2 \scratchcounter red 0.4 .5\bodyfontsize
-%
-% see cont-loc for test code
-
-%D Currently the inheritance of backgrounds does not work and we might drop it
-%D anyway (too messy)
-
-\newbox\b_meta_variable_box
-
-\let \currentmpvariableclass \empty
-\let \m_meta_current_variable \empty
-\let \m_meta_current_variable_template\empty
-
-\installcorenamespace{graphicvariable}
-
-\def\meta_prepare_variable_default{\MPcolor{black}} % just to be sure we use a color but ...
-
-\unexpanded\def\setupMPvariables
- {\dodoubleempty\meta_setup_variables}
-
-\def\meta_setup_variables[#1][#2]%
- {\ifsecondargument
- \getrawparameters[\??graphicvariable#1:][#2]%
- \else
- \getrawparameters[\??graphicvariable:][#1]%
- \fi}
-
-\unexpanded\def\presetMPvariable
- {\dodoubleargument\meta_preset_variable}
-
-\def\meta_preset_variable[#1][#2=#3]%
- {\ifcsname\??graphicvariable#1:#2\endcsname \else
- \setvalue{\??graphicvariable#1:#2}{#3}%
- \fi}
-
-\def\MPrawvar#1#2% no checking
- {\begincsname\??graphicvariable#1:#2\endcsname}
-
-\def\MPvariable#1% todo: could be a framed chain
- {\begincsname\??graphicvariable\currentmpvariableclass:#1\endcsname}
-
-\unexpanded\def\useMPvariables
- {\dodoubleargument\meta_use_variables}
-
-\def\meta_use_variables[#1][#2]%
- {\edef\currentmpvariableclass{#1}%
- \meta_prepare_variables{#2}}
-
-\unexpanded\def\meta_prepare_variables#1%
- {\processcommalist[#1]\meta_prepare_variable}
-
-\unexpanded\def\meta_prepare_variable#1%
- {\edef\m_meta_current_variable_template
- {\??graphicvariable\currentmpvariableclass:#1}%
- \edef\m_meta_current_variable
- {\begincsname\m_meta_current_variable_template\endcsname}%
- \ifx\m_meta_current_variable\empty
- \expandafter\meta_prepare_variable_nop
- \else
- \expandafter\meta_prepare_variable_yes
- \fi}
-
-\unexpanded\def\meta_prepare_instance_variables
- {\expandafter\processcommalist\expandafter[\m_meta_instance_variables]\meta_prepare_instance_variable}
-
-\unexpanded\def\meta_prepare_instance_variable#1%
- {\edef\m_meta_current_variable_template
- {\??graphicvariable\currentmpvariableclass:#1}%
- \edef\m_meta_current_variable
- {\ifcsname\m_meta_current_variable_template\endcsname
- \lastnamedcs
- \else
- \begincsname\??graphicvariable\currentMPgraphicname:#1\endcsname
- \fi}%
- \ifx\m_meta_current_variable\empty
- \expandafter\meta_prepare_variable_nop
- \else
- \expandafter\meta_prepare_variable_yes
- \fi}
-
-\def\meta_prepare_variable_nop
- {\expandafter \let\csname\m_meta_current_variable_template\endcsname\meta_prepare_variable_default}
-
-\def\meta_prepare_variable_color % we use the attribute so we dont' go through namedcolor (why not)
- {\expandafter\edef\csname\m_meta_current_variable_template\endcsname{\MPcolor\m_meta_current_variable}}
-
-\def\meta_prepare_variable_number
- {\expandafter\edef\csname\m_meta_current_variable_template\endcsname{\number\m_meta_current_variable}}% also accepts 0.number
-
-\def\meta_prepare_variable_dimension
- {\expandafter\edef\csname\m_meta_current_variable_template\endcsname{\the\dimexpr\m_meta_current_variable}}
-
-\def\meta_prepare_variable_yes
- {\ifchkdim\m_meta_current_variable\or
- \meta_prepare_variable_dimension
- \else\ifchknum\m_meta_current_variable\or
- \meta_prepare_variable_number
- \else
- \doifelsecolor\m_meta_current_variable
- \meta_prepare_variable_color
- \meta_prepare_variable_dimension
- \fi\fi}
-
-\let\MPvar \MPvariable
-\let\setMPvariables\setupMPvariables
-
-%D \macros
-%D {startuniqueMPgraphic, uniqueMPgraphic}
-%D
-%D This macros is probably of most use to myself, since I like to use graphics that
-%D adapt themselves. The next \METAPOST\ kind of graphic is both unique and reused
-%D when possible.
-%D
-%D \starttyping
-%D \defineoverlay[example][\uniqueMPgraphic{test}]
-%D
-%D \startuniqueMPgraphic {test}
-%D draw OverlayBox ;
-%D \stopuniqueMPgraphic
-%D
-%D \startuniqueMPgraphic {test}
-%D draw OverlayBox ;
-%D \stopuniqueMPgraphic
-%D \stoptyping
-
-\def\overlaystamp % watch the \MPcolor, since colors can be redefined
- {\the\d_overlay_width :%
- \the\d_overlay_height :%
- \the\d_overlay_depth :%
- \the\d_overlay_offset :%
- \the\d_overlay_linewidth:%
- \MPcolor\overlaycolor :% % todo, expand once \m_overlaycolor
- \MPcolor\overlaylinecolor} % todo, expand once \m_overlaylinecolor
-
-%D A better approach is to let additional variables play a role in determining the
-%D uniqueness. In the next macro, the second, optional, argument is used to
-%D guarantee the uniqueness, as well as prepare variables for passing them to
-%D \METAPOST.
-%D
-%D \starttyping
-%D \startuniqueMPgraphic{meta:hash}{gap,angle,...}
-%D \stoptyping
-%D
-%D The calling macro also accepts a second argument. For convenient use in overlay
-%D definitions, we use \type {{}} instead of \type {[]}.
-%D
-%D \starttyping
-%D \uniqueMPgraphic{meta:hash}{gap=10pt,angle=30}
-%D \stoptyping
-
-\newcount\c_meta_object_counter
-\newbox \b_meta_graphic
-
-% hm, isn't this already done elsewhere?
-
-\unexpanded\def\meta_obey_box_depth
- {\setbox\b_meta_graphic\hpack\bgroup
- \raise\MPlly\box\b_meta_graphic
- \egroup}
-
-\unexpanded\def\meta_ignore_box_depth
- {\normalexpanded
- {\meta_obey_box_depth % hence the \unexpanded
- \wd\b_meta_graphic\the\wd\b_meta_graphic
- \ht\b_meta_graphic\the\ht\b_meta_graphic
- \dp\b_meta_graphic\the\dp\b_meta_graphic}}
-
-\unexpanded\def\meta_obey_box_origin
- {\setbox\b_meta_graphic\hpack\bgroup
- \kern\MPllx\raise\MPlly\box\b_meta_graphic
- \egroup}
-
-\unexpanded\def\obeyMPboxdepth {\let\meta_relocate_box\meta_obey_box_depth}
-\unexpanded\def\ignoreMPboxdepth{\let\meta_relocate_box\meta_ignore_box_depth}
-\unexpanded\def\obeyMPboxorigin {\let\meta_relocate_box\meta_obey_box_origin}
-\unexpanded\def\normalMPboxdepth{\let\meta_relocate_box\relax}
-
-\let\meta_relocate_box\relax
-
-\unexpanded\def\meta_place_graphic % the converter also displaces so in fact we revert
- {\meta_relocate_box
- \box\b_meta_graphic}
-
-\unexpanded\def\meta_reuse_box#1#2#3#4#5% space delimiting would save some tokens
- {\MPllx#2\MPlly#3\MPurx#4\MPury#5%
- \hpack{\forcecolorhack\getobject{MP}{#1}}} % else no proper color intent
-
-\unexpanded\def\meta_use_box
- {\setunreferencedobject{MP}}
-
-\def\meta_handle_unique_graphic#1#2#3% when there are too many, we can store data at the lua end, although,
- {\begingroup % when there are that many they're probably not that unique anyway
- \edef\currentmpvariableclass{#1}%
- \extendMPoverlaystamp{#2}% incl prepare
- \ifcsname\??mpgraphic\overlaystamp:#1\endcsname
- \lastnamedcs
- \else
- \meta_enable_include % redundant
- \global\advance\c_meta_object_counter\plusone
- \meta_use_box{\number\c_meta_object_counter}\hpack{\meta_process_graphic{#3}}% was vbox, graphic must end up as hbox
- \setxvalue{\??mpgraphic\overlaystamp:#1}{\meta_reuse_box{\number\c_meta_object_counter}{\the\MPllx}{\the\MPlly}{\the\MPurx}{\the\MPury}}%
- \csname\??mpgraphic\overlaystamp:#1\endcsname\empty
- \fi
- \endgroup}
-
-\unexpanded\def\startuniqueMPgraphic
- {\dodoublegroupempty\meta_start_unique_graphic}
-
-\let\stopuniqueMPgraphic\relax
-
-\def\meta_start_unique_graphic#1%
- {\normalexpanded{\meta_start_unique_graphic_indeed{#1}}}
-
-\unexpanded\def\meta_start_unique_graphic_indeed#1#2#3\stopuniqueMPgraphic
- {\setgvalue{\??mpgraphic#1}{\meta_handle_unique_graphic{#1}{#2}{#3}}}
-
-\unexpanded\def\uniqueMPgraphic
- {\dodoublegroupempty\meta_unique_graphic}
-
-\def\meta_unique_graphic#1#2%
- {\meta_begin_graphic_group{#1}%
- \setupMPvariables[#1][#2]%
- \begincsname\??mpgraphic#1\endcsname\empty
- \meta_end_graphic_group}
-
-\def\meta_handle_use_graphic#1#2#3%
- {\begingroup
- \edef\currentmpvariableclass{#1}%
- \edef\m_meta_instance_variables{#2}%
- \ifx\m_meta_instance_variables\empty \else
- \meta_prepare_instance_variables
- \fi
- \meta_enable_include % redundant
- \meta_process_graphic{#3}%
- \endgroup}
-
-\unexpanded\def\startuseMPgraphic
- {\dodoublegroupempty\meta_start_use_graphic}
-
-\let\stopuseMPgraphic\relax
-
-\def\meta_start_use_graphic#1%
- {\normalexpanded{\meta_start_use_graphic_indeed{#1}}}
-
-\unexpanded\def\meta_start_use_graphic_indeed#1#2#3\stopuseMPgraphic
- {\setgvalue{\??mpgraphic#1}{\meta_handle_use_graphic{#1}{#2}{#3}}}
-
-\unexpanded\def\startusableMPgraphic % redundant but handy
- {\dodoublegroupempty\meta_start_usable_graphic}
-
-\let\stopusableMPgraphic\relax
-
-\def\meta_start_usable_graphic#1%
- {\normalexpanded{\meta_start_usable_graphic_indeed{#1}}}
-
-\unexpanded\def\meta_start_usable_graphic_indeed#1#2#3\stopusableMPgraphic
- {\setgvalue{\??mpgraphic#1}{\meta_handle_use_graphic{#1}{#2}{#3}}}
-
-\def\meta_handle_reusable_graphic#1#2#3%
- {\begingroup
- \edef\currentmpvariableclass{#1}%
- \edef\m_meta_instance_variables{#2}%
- \ifx\m_meta_instance_variables\empty \else
- \meta_prepare_instance_variables
- \fi
- \meta_enable_include % redundant
- \global\advance\c_meta_object_counter\plusone
- \meta_use_box{\number\c_meta_object_counter}\hpack{\meta_process_graphic{#3}}% was vbox, graphic must end up as hbox
- \setxvalue{\??mpgraphic#1}{\meta_reuse_box{\number\c_meta_object_counter}{\the\MPllx}{\the\MPlly}{\the\MPurx}{\the\MPury}}%
- \csname\??mpgraphic#1\endcsname\empty
- \endgroup}
-
-\unexpanded\def\startreusableMPgraphic
- {\dodoublegroupempty\meta_start_reusable_graphic}
-
-\let\stopreusableMPgraphic\relax
-
-\def\meta_start_reusable_graphic#1%
- {\normalexpanded{\meta_start_reusable_graphic_indeed{#1}}}
-
-\unexpanded\def\meta_start_reusable_graphic_indeed#1#2#3\stopreusableMPgraphic
- {\setgvalue{\??mpgraphic#1}{\meta_handle_reusable_graphic{#1}{#2}{#3}}}
-
-\unexpanded\def\useMPgraphic
- {\dodoublegroupempty\meta_use_graphic}
-
-\def\meta_use_graphic#1#2%
- {\meta_begin_graphic_group{#1}%
- \ifcsname\??mpgraphic#1\endcsname
- \edef\usedMPgraphicname{#1}%
- \orelse\ifcsname\??mpgraphic\currentMPgraphicname\endcsname
- \let\usedMPgraphicname\currentMPgraphicname
- \else
- \let\usedMPgraphicname\empty
- \fi
- \ifx\usedMPgraphicname\empty
- % message
- \else
- \doifsomething{#2}{\setupMPvariables[\usedMPgraphicname][#2]}%
- \csname\??mpgraphic\usedMPgraphicname\endcsname
- \fi
- \meta_end_graphic_group}
-
-\let\reuseMPgraphic \useMPgraphic % we can save a setup here if needed
-\let\reusableMPgraphic\reuseMPgraphic % we can save a setup here if needed
-
-%D \macros
-%D {startuniqueMPpagegraphic,uniqueMPpagegraphic}
-%D
-%D Experimental.
-
-\def\m_meta_page_prefix{\doifelseoddpage oe}
-
-\def\overlaypagestamp
- {\m_meta_page_prefix :%
- \the\d_overlay_width :%
- \the\d_overlay_height :%
- \the\d_overlay_depth :%
- \the\d_overlay_offset :%
- \the\d_overlay_linewidth:%
- \MPcolor\overlaycolor :%
- \MPcolor\overlaylinecolor}
-
-\unexpanded\def\startuniqueMPpagegraphic
- {\dodoublegroupempty\meta_start_unique_page_graphic}
-
-\let\stopuniqueMPpagegraphic\relax
-
-\def\meta_start_unique_page_graphic#1%
- {\normalexpanded{\meta_start_unique_page_graphic_indeed{#1}}}
-
-\unexpanded\def\meta_start_unique_page_graphic_indeed#1#2#3\stopuniqueMPpagegraphic % inefficient, double storage
- {\setgvalue{\??mpgraphic o:#1}{\meta_handle_unique_graphic{o:#1}{#2}{#3}}% % but these also keep the state
- \setgvalue{\??mpgraphic e:#1}{\meta_handle_unique_graphic{e:#1}{#2}{#3}}} % and meaning will be redefined
-
-\unexpanded\def\uniqueMPpagegraphic
- {\dodoublegroupempty\meta_unique_page_graphic}
-
-\def\meta_unique_page_graphic#1#2%
- {\meta_begin_graphic_group{#1}%
- \let\overlaystamp\overlaypagestamp
- \setupMPvariables[\m_meta_page_prefix:#1][#2]% prefix is new here
- \csname\??mpgraphic\m_meta_page_prefix:#1\endcsname\empty
- \meta_end_graphic_group}
-
-%D One way of defining a stamp is:
-%D
-%D \starttyping
-%D \def\extendMPoverlaystamp#1%
-%D {\def\docommand##1%
-%D {\edef\overlaystamp{\overlaystamp:\MPvariable{##1}}}%
-%D \processcommalist[#1]\docommand}
-%D \stoptyping
-%D
-%D Since we need to feed \METAPOST\ with expanded dimensions, we introduce a
-%D dedicated expansion engine. We redefine \type {\extendMPoverlaystamp} to
-
-\unexpanded\def\extendMPoverlaystamp#1%
- {\processcommalist[#1]\meta_extend_overlay_stamp}
-
-\def\meta_extend_overlay_stamp#1%
- {\meta_prepare_instance_variable{#1}%
- \edef\overlaystamp{\overlaystamp:\MPvariable{#1}}}
-
-\unexpanded\def\getMPdata {\clf_getMPdata}
- \let\rawMPdata \clf_getMPdata
-
-\unexpanded\def\getMPstored{\clf_getMPstored}
- \let\rawMPstored \clf_getMPstored
-
-%D We need this trick because we need to make sure that the tex scanner sees
-%D newlines and does not quit. Also, we do need to flush the buffer under a normal
-%D catcode regime in order to expand embedded tex macros. As usual with buffers,
-%D \type {#1} can be a list.
-
-\unexpanded\def\processMPbuffer
- {\dosingleempty\meta_process_buffer}
-
-\def\meta_process_buffer[#1]%
- {\meta_begin_graphic_group{#1}%
- \meta_process_graphic{\clf_feedback{\currentMPgraphicname}}%
- \meta_end_graphic_group}
-
-\unexpanded\def\runMPbuffer
- {\dosingleempty\meta_run_buffer}
-
-\def\meta_run_buffer[#1]% processing only
- {\startnointerference\meta_process_buffer[#1]\stopnointerference}
-
-%D \macros
-%D {startMPenvironment, resetMPenvironment}
-%D
-%D In order to synchronize the main \TEX\ run and the runs local to \METAPOST,
-%D environments can be passed.
-
-\unexpanded\def\startMPenvironment
- {\begingroup
- \catcode\endoflineasciicode \ignorecatcode
- \dosingleempty\meta_start_environment}
-
-\def\meta_start_environment[#1]#2\stopMPenvironment
- {\endgroup
- \edef\m_meta_option{#1}
- \ifx\m_meta_option\s!reset
- \resetMPenvironment % reset mp toks
- \orelse\ifx\m_meta_option\v!global
- #2% % use in main doc too
- \orelse\ifx\m_meta_option\!!plustoken
- #2% % use in main doc too
- \fi
- \clf_mptexset{\detokenize{#2}}}
-
-\let\stopMPenvironment\relax
-
-\unexpanded\def\resetMPenvironment
- {\clf_mptexreset}
-
-\unexpanded\def\useMPenvironmentbuffer[#1]%
- {\clf_mptexsetfrombuffer{#1}}
-
-%D This command takes \type {[reset]} as optional argument.
-%D
-%D \starttyping
-%D \startMPenvironment
-%D \setupbodyfont[pos,14.4pt]
-%D \stopMPenvironment
-%D
-%D \startMPcode
-%D draw btex \sl Hans Hagen etex scaled 5 ;
-%D \stopMPcode
-%D \stoptyping
-%D
-%D The most simple case:
-
-\unexpanded\def\startMPcode
- {\dosinglegroupempty\meta_start_code}
-
-\let\stopMPcode\relax
-
-\def\meta_start_code
- {\iffirstargument
- \expandafter\meta_start_code_instance
- \else
- \expandafter\meta_start_code_standard
- \fi}
-
-\def\meta_start_code_instance#1#2\stopMPcode
- {\begingroup
- \edef\currentMPinstance{#1}%
- \let\currentMPgraphicname\empty
- \edef\currentMPformat{\MPinstanceparameter\s!format}%
- \meta_enable_include
- \meta_process_graphic{#2}%
- \endgroup}
-
-\def\meta_start_code_standard#1#2\stopMPcode
- {\begingroup
- \let\currentMPinstance\defaultMPinstance
- \let\currentMPgraphicname\empty
- \edef\currentMPformat{\MPinstanceparameter\s!format}%
- \meta_process_graphic{#2}%
- \endgroup}
-
-\unexpanded\def\MPcode
- {\dodoublegroupempty\meta_code}
-
-\def\meta_code
- {\ifsecondargument
- \expandafter\meta_code_instance
- \else
- \expandafter\meta_code_standard
- \fi}
-
-\def\meta_code_instance#1#2%
- {\meta_begin_graphic_group{#1}%
- \meta_enable_include
- \meta_process_graphic{#2}%
- \meta_end_graphic_group}
-
-\def\meta_code_standard#1#2%
- {\let\currentMPinstance\defaultMPinstance
- \meta_enable_include
- \meta_process_graphic{#1}}
-
-% a bit nasty (also needed for compatibility:
-
-% \startMPrun input mp-www.mp ; \stopMPrun
-% \externalfigure[mprun.3][width=10cm,height=8cm]
-
-% \startMPrun{mprun} input mp-www.mp ; \stopMPrun % instance
-% \externalfigure[mprun.4][width=10cm,height=8cm]
-
-\let\MPruninstance\defaultMPinstance
-
-\unexpanded\def\useMPrun#1#2% name n
- {\begingroup
- \def\MPaskedfigure{#2}%
- \doifelsenothing{#1}
- {\useMPgraphic{mprun}}%
- {\useMPgraphic{#1}}%
- \endgroup}
-
-\unexpanded\def\startMPrun
- {\dosinglegroupempty\meta_start_run}
-
-\def\meta_start_run#1#2\stopMPrun
- {\iffirstargument
- \startuseMPgraphic{#1}#2\stopuseMPgraphic
- \else
- \startuseMPgraphic{mprun}#2\stopuseMPgraphic
- \fi}
-
-\let\stopMPrun\relax
-
-%D The \type {\resetMPenvironment} is a quick way to erase
-%D the token list.
-%D
-%D You should be aware of independencies. For instance, if you use a font
-%D in a graphic that is not used in the main document, you need to load the
-%D typescript at the outer level (either directly or by using the global
-%D option).
-%D
-%D \starttyping
-%D \usetypescript[palatino][texnansi]
-%D
-%D \startMPenvironment
-%D \usetypescript[palatino][texnansi]
-%D \enableregime[utf]
-%D \setupbodyfont[palatino]
-%D \stopMPenvironment
-%D
-%D \startMPpage
-%D draw btex aap‒noot coördinatie – één etex ;
-%D \stopMPpage
-%D \stoptyping
-
-%D Loading specific \METAPOST\ related definitions is
-%D accomplished by:
-
-\unexpanded\def\useMPlibrary[#1]{\clf_useMPlibrary{#1}}
-
-%D \macros
-%D {setMPtext, MPtext, MPstring, MPbetex}
-%D
-%D To be documented:
-%D
-%D \starttyping
-%D \setMPtext{identifier}{text}
-%D
-%D \MPtext {identifier}
-%D \MPstring{identifier}
-%D \MPbetex {identifier}
-%D \stoptyping
-
-\installcorenamespace{mptext}
-
-\unexpanded\def\setMPtext#1#2% todo : #1 must be made : safe
- {\defconvertedargument\ascii{#2}%
- \dodoglobal\letvalue{\??mptext#1}\ascii}
-
-\def\MPtext #1{\begincsname\??mptext#1\endcsname\empty}
-\def\MPstring#1{"\begincsname\??mptext#1\endcsname\empty"}
-\def\MPbetex #1{btex \begincsname\??mptext#1\endcsname\space etex}
-
-%D In order to communicate conveniently with the \TEX\ engine, we introduce some
-%D typesetting variables.
-
-% \setupcolors[state=stop,conversion=never] % quite tricky ... type mismatch
-
-% \startMPextensions
-% color OverlayColor,OverlayLineColor;
-% \stopMPextensions
-
-\startMPinitializations
- CurrentLayout:="\currentlayout";
-\stopMPinitializations
-
-% \startMPinitializations
-% OverlayWidth:=\overlaywidth;
-% OverlayHeight:=\overlayheight;
-% OverlayDepth:=\overlaydepth;
-% OverlayLineWidth:=\overlaylinewidth;
-% OverlayOffset:=\overlayoffset;
-% \stopMPinitializations
-
-%D A dirty trick, ** in colo-ini.lua (mpcolor). We cannot use a vardef, because
-%D that fails with spot colors.
-
-\startMPinitializations
- def OverlayLineColor=\ifx\overlaylinecolor\empty black \else\MPcolor{\overlaylinecolor} \fi enddef;
- def OverlayColor =\ifx\overlaycolor \empty black \else\MPcolor{\overlaycolor} \fi enddef;
-\stopMPinitializations
-
-% \newcount\c_overlay_colormodel
-% \newcount\c_overlay_color
-% \newcount\c_overlay_transparency
-% \newcount\c_overlay_linecolor
-% \newcount\c_overlay_linetransparency
-
-% \appendtoks
-% \c_overlay_colormodel \attribute\colormodelattribute
-% \c_overlay_color \colo_helpers_inherited_current_ca\overlaycolor
-% \c_overlay_transparency \colo_helpers_inherited_current_ta\overlaycolor
-% \c_overlay_linecolor \colo_helpers_inherited_current_ca\overlaylinecolor
-% \c_overlay_linetransparency\colo_helpers_inherited_current_ta\overlaylinecolor
-% \to \everyMPgraphic
-
-% \startMPinitializations
-% BaseLineSkip:=\the\baselineskip;
-% LineHeight:=\the\baselineskip;
-% BodyFontSize:=\the\bodyfontsize;
-% %
-% TopSkip:=\the\topskip;
-% StrutHeight:=\strutheight;
-% StrutDepth:=\strutdepth;
-% %
-% CurrentWidth:=\the\hsize;
-% CurrentHeight:=\the\vsize;
-% HSize:=\the\hsize ;
-% VSize:=\the\vsize ;
-% %
-% EmWidth:=\the\emwidth;
-% ExHeight:=\the\exheight;
-% \stopMPinitializations
-
-\appendtoks
- \disablediscretionaries
- %\disablecompoundcharacters
-\to \everyMPgraphic
-
-% \appendtoks % before color, inefficient, replace by low level copy
-% \doregistercolor{currentcolor}\currentcolorname
-% \to \everyMPgraphic
-
-% \color[green]{abc \startMPcode
-% fill fullcircle scaled 3cm withoutcolor;
-% fill fullcircle scaled 2cm withcolor \MPcolor{currentcolor} ;
-% fill fullcircle scaled 1cm withcolor \MPcolor{red} ;
-% \stopMPcode def}
-
-\appendtoks
- \baselineskip1\baselineskip
- \lineheight 1\lineheight
- \topskip 1\topskip
-\to \everyMPgraphic
-
-\appendtoks
- \let \# \letterhash
- \let \_ \letterunderscore
- \let \& \letterampersand
- \let \{ \letteropenbrace
- \let \} \letterclosebrace
-\to \everyMPgraphic
-
-%D \macros
-%D {PDFMPformoffset}
-%D
-%D In \PDF, forms are clipped and therefore we have to take precautions to get this
-%D right. Since this is related to objects, we use the same offset as used there.
-
-\def\PDFMPformoffset{\objectoffset}
-
-\newtoks\everyinsertMPfile
-
-\startMPextensions
- def initialize_form_numbers =
- do_initialize_numbers;
- enddef;
-\stopMPextensions
-
-\startMPextensions
- vardef ForegroundBox =
- unitsquare xysized(HSize,VSize)
- enddef ;
-\stopMPextensions
-
-% \startMPextensions
-% PageFraction := 1 ;
-% \stopMPextensions
-
-% \startMPinitializations
-% PageFraction := if \lastpage>1: (\realfolio-1)/(\lastpage-1) else: 1 fi ;
-% \stopMPinitializations
-
-\startMPdefinitions {metapost}
- if unknown context_bare : input mp-bare.mpiv ; fi ;
-\stopMPdefinitions
-\startMPdefinitions {binarypost}
- if unknown context_bare : input mp-bare.mpiv ; fi ;
-\stopMPdefinitions
-\startMPdefinitions {decimalpost}
- if unknown context_bare : input mp-bare.mpiv ; fi ;
-\stopMPdefinitions
-\startMPdefinitions {doublepost}
- if unknown context_bare : input mp-bare.mpiv ; fi ;
-\stopMPdefinitions
-
-% \startMPdefinitions {nofun}
-% if unknown context_bare : input mp-bare.mpiv ; fi ;
-% \stopMPdefinitions
-
-%D And some more. These are not really needed since we don't use the normal figure
-%D inclusion macros any longer.
-
-\appendtoks
- \externalfigurepostprocessors\emptytoks % safeguard
-\to \everyinsertMPfile
-
-%D We also take care of disabling fancy figure features, that can terribly interfere
-%D when dealing with symbols, background graphics and running (postponed) graphics.
-%D You won't believe me if I tell you what funny side effects can occur. One took me
-%D over a day to uncover when processing the screen version of the \METAFUN\ manual.
-
-\def\doifelseMPgraphic#1%
- {\ifcsname\??mpgraphic #1\endcsname\expandafter\firstoftwoarguments \orelse
- \ifcsname\??mpgraphic o:#1\endcsname\expandafter\firstoftwoarguments \orelse
- \ifcsname\??mpgraphic e:#1\endcsname\expandafter\firstoftwoarguments \else
- \expandafter\secondoftwoarguments\fi}
-
-\let\doifMPgraphicelse\doifelseMPgraphic
-
-%D New:
-
-\definelayerpreset % no dx,dy - else nasty non-mp placement
- [mp]
- [\c!y=-\MPury,
- \c!x=\MPllx,
- \c!method=\v!fit]
-
-\definelayer
- [mp]
- [\c!preset=mp]
-
-%D Usage:
-%D
-%D \starttyping
-%D \defineviewerlayer[one][state=start]
-%D \defineviewerlayer[two][state=stop]
-%D
-%D \startuseMPgraphic{step-1}
-%D fill fullcircle scaled 10cm withcolor red ;
-%D \stopuseMPgraphic
-%D
-%D \startuseMPgraphic{step-2}
-%D fill fullcircle scaled 5cm withcolor green ;
-%D \stopuseMPgraphic
-%D
-%D \setlayer[mp]{\viewerlayer[one]{\useMPgraphic{step-1}}}
-%D \setlayer[mp]{\viewerlayer[two]{\useMPgraphic{step-2}}}
-%D
-%D \ruledhbox{\flushlayer[mp]}
-%D \stoptyping
-%D
-%D Reusing graphics is also possible (now):
-%D
-%D \starttyping
-%D \startreusableMPgraphic{axis}
-%D tickstep := 1cm ; ticklength := 2mm ;
-%D drawticks unitsquare xscaled 4cm yscaled 3cm shifted (-1cm,-1cm) ;
-%D tickstep := tickstep/2 ; ticklength := ticklength/2 ;
-%D drawticks unitsquare xscaled 4cm yscaled 3cm shifted (-1cm,-1cm) ;
-%D \stopreusableMPgraphic
-%D
-%D \startuseMPgraphic{demo}
-%D drawpoint "1cm,1.5cm" ;
-%D \stopuseMPgraphic
-%D
-%D \definelayer[mp][preset=mp]
-%D \setlayer[mp]{\reuseMPgraphic{axis}}
-%D \setlayer[mp]{\useMPgraphic{demo}}
-%D \ruledhbox{\flushlayer[mp]}
-%D \stoptyping
-
-%D \macros
-%D {startstaticMPfigure,useMPstaticfigure}
-%D
-%D Static figures are processed only when there has been something changed. Here is
-%D Aditya Mahajan's testcase:
-%D
-%D \startbuffer
-%D \startstaticMPfigure{circle}
-%D fill fullcircle scaled 1cm withcolor blue;
-%D \stopstaticMPfigure
-%D
-%D \startstaticMPfigure{axis}
-%D drawarrow (0,0)--(2cm,0) ;
-%D drawarrow (0,0)--(0,2cm) ;
-%D label.llft(textext("(0,0)") ,origin) ;
-%D \stopstaticMPfigure
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-
-\unexpanded\def\startstaticMPfigure#1#2\stopstaticMPfigure
- {\startreusableMPgraphic{\??mpstaticgraphic#1}#2\stopreusableMPgraphic}
-
-\unexpanded\def\startstaticMPgraphic
- {\dodoublegroupempty\meta_start_static_graphic}
-
-\def\meta_start_static_graphic#1#2#3\stopstaticMPgraphic
- {\startreusableMPgraphic{\??mpstaticgraphic#1}{#2}#3\stopreusableMPgraphic}
-
-\let\stopstaticMPfigure \relax
-\let\stopstaticMPgraphic\relax
-
-\unexpanded\def\usestaticMPfigure
- {\dodoubleempty\meta_use_static_figure}
-
-\def\meta_use_static_figure[#1][#2]%
- {\ifsecondargument
- \scale[#2]{\reuseMPgraphic{\??mpstaticgraphic#1}}%
- \else
- \reuseMPgraphic{\??mpstaticgraphic#1}%
- \fi}
-
-%D Goody for preventing overflows:
-
-\def\MPdivten[#1]{\withoutpt\the\dimexpr#1pt/10\relax}
-
-%D There is no way to distinguish the black color that you get when you issue a
-%D \type {draw} without color specification from a color that has an explicit black
-%D specification unless you set the variable \type {defaultcolormodel} to 1.
-%D Hoewever, in that case you cannot distinguish that draw from one with a \type
-%D {withoutcolor} specification. This means that we have to provide multiple
-%D variants of inheritance.
-%D
-%D In any case we need to tell the converter what the inherited color is to start
-%D with. Case~3 is kind of unpredictable as it closely relates to the order in which
-%D paths are flushed. If you want to inherit automatically from the surrounding, you
-%D can best stick to variant 1. Variant 0 (an isolated graphic) is the default.
-%D
-%D \startbuffer
-%D \startuseMPgraphic{test}
-%D drawoptions(withpen pencircle scaled 1pt) ;
-%D def shift_cp = currentpicture := currentpicture shifted (-15pt,0) ; enddef ;
-%D draw fullcircle scaled 10pt withoutcolor ; shift_cp ;
-%D fill fullcircle scaled 10pt ; shift_cp ;
-%D draw fullcircle scaled 10pt withoutcolor ; shift_cp ;
-%D fill fullcircle scaled 10pt withcolor red ; shift_cp ;
-%D draw fullcircle scaled 10pt withoutcolor ; shift_cp ;
-%D fill fullcircle scaled 10pt ; shift_cp ;
-%D \stopuseMPgraphic
-%D
-%D \starttabulate
-%D \NC 0\quad \NC \MPcolormethod0 \green XX\quad \useMPgraphic{test}\quad XX \NC \NR
-%D \NC 1\quad \NC \MPcolormethod1 \green XX\quad \useMPgraphic{test}\quad XX \NC \NR
-%D \NC 2\quad \NC \MPcolormethod2 \green XX\quad \useMPgraphic{test}\quad XX \NC \NR
-%D \NC 3\quad \NC \MPcolormethod3 \green XX\quad \useMPgraphic{test}\quad XX \NC \NR
-%D \stoptabulate
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-
-\newconstant\MPcolormethod
-
-\appendtoks
- \clf_mpsetoutercolor
- \MPcolormethod\space
- \attribute\colormodelattribute\space
- \attribute\colorattribute\space
- \dogetattribute{transparency}\relax
-\to \everyMPgraphic
-
-% \startMPinitializations
-% defaultcolormodel := \ifcase\MPcolormethod1\or1\or3\else3\fi;
-% \stopMPinitializations
-
-%D macros
-%D {mprunvar,mpruntab,mprunset}
-%D
-%D \starttyping
-%D \startMPcode
-%D passvariable("version","1.0") ;
-%D passvariable("number",123) ;
-%D passvariable("string","whatever") ;
-%D passvariable("point",(1.5,2.8)) ;
-%D passvariable("triplet",(1/1,1/2,1/3)) ;
-%D passvariable("quad",(1.1,2.2,3.3,4.4)) ;
-%D passvariable("boolean",false) ;
-%D passvariable("path",fullcircle scaled 1cm) ;
-%D draw fullcircle scaled 20pt ;
-%D \stopMPcode
-%D
-%D \ctxlua{inspect(metapost.variables)}
-%D
-%D \MPrunvar{version} \MPruntab{quad}{3} (\MPrunset{triplet}{,})
-%D
-%D $(x,y) = (\MPruntab{point}{1},\MPruntab{point}{2})$
-%D $(x,y) = (\MPrunset{point}{,})$
-%D \stoptyping
-
-\def\MPrunvar #1{\clf_mprunvar{#1}} \let\mprunvar\MPrunvar
-\def\MPruntab#1#2{\clf_mpruntab{#1}#2\relax} \let\mpruntab\MPruntab % #2 is number
-\def\MPrunset#1#2{\clf_mprunset{#1}{#2}} \let\mprunset\MPrunset
-
-\prependtoks \clf_mppushvariables \to \everybeforepagebody
-\appendtoks \clf_mppopvariables \to \everyafterpagebody
-
-\let\MPpushvariables\clf_mppushvariables
-\let\MPpopvariables \clf_mppopvariables
-
-%D We also provide an outputless run:
-
-\unexpanded\def\startMPcalculation
- {\begingroup
- \setbox\nextbox\hpack\bgroup
- \dosinglegroupempty\meta_start_calculation}
-
-\let\stopMPcalculation\relax
-
-\def\meta_start_calculation
- {\iffirstargument
- \expandafter\meta_start_calculation_instance
- \else
- \expandafter\meta_start_calculation_standard
- \fi}
-
-\def\meta_start_calculation_instance#1#2\stopMPcalculation
- {\edef\currentMPinstance{#1}%
- \let\currentMPgraphicname\empty
- \edef\currentMPformat{\MPinstanceparameter\s!format}%
- \meta_enable_include
- \meta_process_graphic{#2;draw origin}%
- \egroup
- \endgroup}
-
-\def\meta_start_calculation_standard#1#2\stopMPcalculation
- {\let\currentMPinstance\defaultMPinstance
- \let\currentMPgraphicname\empty
- \edef\currentMPformat{\MPinstanceparameter\s!format}%
- \meta_process_graphic{#2;draw origin}%
- \egroup
- \endgroup}
-
-%D \macros
-%D {setupMPgraphics}
-%D
-%D Here is a generic setup command:
-
-\installcorenamespace{MPgraphics}
-
-\installsetuponlycommandhandler \??MPgraphics {MPgraphics}
-
-%D Here we hook in the outer color. When \type {color} is set to \type {global} we
-%D get the outer color automatically. If you change this setting, you should do it
-%D grouped in order not to make other graphics behave in unexpected ways.
-
-\appendtoks
- \doifelse{\directMPgraphicsparameter\c!color}\v!global{\MPcolormethod\plusone}{\MPcolormethod\zerocount}%
-\to \everysetupMPgraphics
-
-\setupMPgraphics
- [\c!color=\v!local]
-
-%D This can save some runtime: rename the mpy file from a first run (when stable) to
-%D another file and reuse it. One can also use the original filename, but a copy is
-%D often better.
-%D
-%D \starttyping
-%D \setupMPgraphics
-%D [mpy=\jobname.mpy]
-%D \stoptyping
-
-\appendtoks
- \edef\p_mpy{\directMPgraphicsparameter{mpy}}%
- \ifx\p_mpy\empty \else
- \let\MPdataMPYfile\p_mpy
- \clf_registermpyfile{\p_mpy}%
- \fi
-\to \everysetupMPgraphics
-
-%D Some more helpers (see \type {meta-grd.mkiv} for an example of usage):
-
-\def\MPdpar#1#2{\the\dimexpr#1#2\relax\empty}
-\def\MPnpar#1#2{\the\numexpr#1#2\relax\empty}
-\def\MPspar#1#2{"#1#2"}
-
-%D Done.
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/meta-lua.lua b/Master/texmf-dist/tex/context/base/mkiv/meta-lua.lua
index 42d0366308c..cdcd5c0a857 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/meta-lua.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/meta-lua.lua
@@ -89,7 +89,7 @@ mplib.finders.mpstemplate = function(specification,name,mode,ftype)
data = errorformatter(nameonly)
end
local name = luatex.registertempfile(nameonly,true)
- local data = metapost.checktexts(data)
+-- local data = metapost.checktexts(data)
io.savedata(name,data)
return name
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/meta-mac.mkxl b/Master/texmf-dist/tex/context/base/mkiv/meta-mac.mkxl
deleted file mode 100644
index 3bf38b4c826..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/meta-mac.mkxl
+++ /dev/null
@@ -1,66 +0,0 @@
-%D \module
-%D [ file=meta-scn,
-%D version=2019.07.19,
-%D title=\METAPOST\ Graphics,
-%D subtitle=LMTX support,
-%D author=Hans Hagen,
-%D date=\ currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\unprotect
-
-\unexpanded\def\defineMPparameterset[#1]{\clf_lmt_parameters_define{#1}}
-\unexpanded\def\presetMPparameters [#1]{\clf_lmt_parameters_preset{#1}}
-\unexpanded\def\resetMPparameters [#1]{\clf_lmt_parameters_reset {#1}}
-
-% \unexpanded\def\useMPgraphic
-% {\doifnextoptionalelse\meta_use_MP_graphic_yes\meta_use_MP_graphic_nop}
-
-% \def\meta_use_MP_graphic_nop
-% {\dodoublegroupempty\meta_use_graphic}
-
-% \def\meta_use_MP_graphic_yes
-% {\dodoubleempty\meta_use_graphic_new}
-
-% \def\meta_use_graphic_new[#1][#2]%
-% {\begingroup
-% % If really needed weh can use grouplevel but normally these graphics are
-% % not nested.
-% \clf_lmt_parameters_preset{#1}[#2]%
-% \meta_use_graphic{#1}{}%
-% \clf_lmt_parameters_reset{#1}%
-% \endgroup}
-
-\unexpanded\def\useMPmacro
- {\dotripleempty\meta_use_macro}
-
-\def\meta_use_macro[#1][#2][#3]%
- {\ifthirdargument
- \meta_begin_graphic_group{#1}%
- \meta_enable_include
- \clf_lmt_parameters_preset{#2}[#3]%
- \meta_process_graphic{lmt_#2;}%
- \clf_lmt_parameters_reset{#2}%
- \meta_end_graphic_group
- \else\ifsecondargument
- \doifelseassignment{#2}
- {\let\currentMPinstance\defaultMPinstance
- \meta_enable_include
- \clf_lmt_parameters_preset{#1}[#2]%
- \meta_process_graphic{lmt_#1;}%
- \clf_lmt_parameters_reset{#1}}%
- {\meta_begin_graphic_group{#1}%
- \meta_enable_include
- \meta_process_graphic{lmt_#1;}%
- \meta_end_graphic_group}%
- \else
- \let\currentMPinstance\defaultMPinstance
- \meta_enable_include
- \meta_process_graphic{lmt_#1;}%
- \fi\fi}
-
-\protect
diff --git a/Master/texmf-dist/tex/context/base/mkiv/meta-pag.mkxl b/Master/texmf-dist/tex/context/base/mkiv/meta-pag.mkxl
deleted file mode 100644
index 86de11eeb5c..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/meta-pag.mkxl
+++ /dev/null
@@ -1,26 +0,0 @@
-%D \module
-%D [ file=meta-pag,
-%D version=1999.07.10,
-%D title=\METAPOST\ Graphics,
-%D subtitle=Initialization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-%D These definitions used to be part of the old \type {core-mps} file, later changed
-%D into \type {meta-ini}, but keeping them separate is cleaner. In the meantime not
-%D that much is left here.
-
-\writestatus{loading}{MetaPost Graphics / Page Data Management}
-
-\unprotect
-
-\prependtoks
- \calculatereducedvsizes % bah, this is really needed
-\to \everyMPgraphic
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mlib-cnt.lua b/Master/texmf-dist/tex/context/base/mkiv/mlib-cnt.lua
deleted file mode 100644
index 761eac6551a..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/mlib-cnt.lua
+++ /dev/null
@@ -1,2021 +0,0 @@
-if not modules then modules = { } end modules ['mlib-cnt'] = {
- version = 1.001,
- comment = "companion to mlib-ctx.mkiv",
- author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
- copyright = "PRAGMA ADE / ConTeXt Development Team",
- license = "see context related readme files",
-}
-
--- The only useful reference that I could find about this topic is in wikipedia:
---
--- https://en.wikipedia.org/wiki/Marching_squares
---
--- I derived the edge code from:
---
--- https://physiology.arizona.edu/people/secomb/contours
---
--- and also here:
---
--- https://github.com/secomb/GreensV4
---
--- which has the banner:
---
--- TWS, November 1989. Converted to C September 2007. Revised February 2009.
---
--- and has a liberal licence. I optimized the code so that it runs a bit faster in Lua and
--- there's probably more room for optimization (I tried several variants). For instance I
--- don't use that many tables because access is costly. We don't have a compiler that does
--- some optimizing (even then the c code can probably be made more efficient).
---
--- We often have the same node so it's cheaper to reuse the wsp tables and reconstruct
--- the point in the path then to alias the original point. We can be more clever:
--- straighten, but it's more work so maybe I will do that later; for now I only added
--- a test for equality. There are some experiments in this file too and not all might
--- work. It's a playground for me.
---
--- The code is meant for metafun so it is not general purpose. The bitmap variant is
--- relatively fast and bitmaps compress well. When all is settled I might make a couple
--- of helpers in C for this purpose but not now.
---
--- I removed optimization code (more aggressive flattening and such because it didn't really
--- pay off now that we use combined paths with just line segments. I also moved some other
--- code to a experimental copy. So we now only have the bare helpers needed here.
-
--- Todo: look into zero case (lavel 1) for shapes ... omiting the background calculation
--- speeds up quite a bit.
-
-local next, type, tostring = next, type, tostring
-local round, abs, min, max, floor = math.round, math.abs, math.min, math.max, math.floor
-local concat, move = table.concat, table.move
-
-local bor = bit32.bor -- it's really time to ditch support for luajit
-
-local starttiming = statistics.starttiming
-local stoptiming = statistics.stoptiming
-local elapsedtime = statistics.elapsedtime
-
-local formatters = string.formatters
-local setmetatableindex = table.setmetatableindex
-local sortedkeys = table.sortedkeys
-local sequenced = table.sequenced
-
-local metapost = metapost or { }
-local mp = mp or { }
-
-local getparameterset = metapost.getparameterset
-
-local mpflush = mp.flush
-local mpcolor = mp.color
-local mpstring = mp.string
-local mpdraw = mp.draw
-local mpfill = mp.fill
-local mpflatten = mp.flatten
-
-local report = logs.reporter("mfun contour")
-
-local version = 0.007
-
--- we iterate using integers so that we get a better behaviour at zero
-
-local f_function_n = formatters [ [[
- local math = math
- local round = math.round
- %s
- return function(data,nx,ny,nxmin,nxmax,xstep,nymin,nymax,ystep)
- local sx = nxmin
- for mx=1,nx do
- local dx = data[mx]
- local x = sx * xstep
- local sy = nymin
- for my=1,ny do
- local y = sy * ystep
- dx[my] = %s
- sy = sy + 1
- end
- sx = sx + 1
- end
- return 0
- end
-]] ]
-
-local f_function_y = formatters [ [[
- local math = math
- local round = math.round
- local nan = NaN
- local inf = math.huge
- %s
- return function(data,nx,ny,nxmin,nxmax,xstep,nymin,nymax,ystep,dnan,dinf,report)
- local sx = nxmin
- local er = 0
- for mx=nxmin,nxmax do
- local dx = data[mx]
- local x = sx * xstep
- local sy = nymin
- for my=nymin,nymax do
- local y = sy * ystep
- local n = %s
- if n == nan then
- er = er + 1
- if er < 10 then
- report("nan at (%s,%s)",x,y)
- end
- n = dnan
- elseif n == inf then
- er = er + 1
- if er < 10 then
- report("inf at (%s,%s)",x,y)
- end
- n = dinf
- end
- dx[my] = n
- sy = sy + 1
- end
- sx = sx + 1
- end
- return er
- end
-]] ]
-
-local f_color = formatters [ [[
- local math = math
- local min = math.min
- local max = math.max
- local n = %s
- local minz = %s
- local maxz = %s
-
- local color_value = 0
- local color_step = mp.lmt_color_functions.step
- local color_shade = mp.lmt_color_functions.shade
-
- local function step(...)
- return color_step(color_value,n,...)
- end
- local function shade(...)
- return color_shade(color_value,n,...)
- end
- local function lin(l)
- return l/n
- end
- %s
- return function(l)
- color_value = l
- return %s
- end
-]] ]
-
-local inbetween = attributes and attributes.colors.helpers.inbetween
-
-mp.lmt_color_functions = {
- step = function(l,n,r,g,b,s)
- if not s then
- s = 1
- end
- local f = l / n
- local r = s * 1.5 - 4 * abs(f-r)
- local g = s * 1.5 - 4 * abs(f-g)
- local b = s * 1.5 - 4 * abs(f-b)
- return min(max(r,0),1), min(max(g,0),1), min(max(b,0),1)
- end,
- shade = function(l,n,one,two)
- local f = l / n
- local r = inbetween(one,two,1,f)
- local g = inbetween(one,two,2,f)
- local b = inbetween(one,two,3,f)
- return min(max(r,0),1), min(max(g,0),1), min(max(b,0),1)
- end,
-}
-
-local f_box = formatters [ [[draw rawtexbox("contour",%s) xysized (%s,%s) ;]] ]
-
-local n_box = 0
-
--- todo: remove old one, so we need to store old hashes
-
-local nofcontours = 0
-
--- We don't want cosmetics like axis and labels to trigger a calculation,
--- especially a slow one.
-
-local hashfields = {
- "xmin", "xmax", "xstep", "ymin", "ymax", "ystep",
- "levels", "colors", "level", "preamble", "function", "functions", "color", "values",
- "background", "foreground", "linewidth", "backgroundcolor", "linecolor",
-}
-
-local function prepare(p)
- local h = { }
- for i=1,#hashfields do
- local f = hashfields[i]
- h[f] = p[f]
- end
- local hash = md5.HEX(sequenced(h))
- local name = formatters["%s-m-c-%03i.lua"](tex.jobname,nofcontours)
- return name, hash
-end
-
-local function getcache(p)
- local cache = p.cache
- if cache then
- local name, hash = prepare(p)
- local data = table.load(name)
- if data and data.hash == hash and data.version == version then
- p.result = data
- return true
- else
- return false, hash, name
- end
- end
- return false, nil, nil
-end
-
-local function setcache(p)
- local result = p.result
- local name = result.name
- if name then
- if result.bitmap then
- result.bitmap = nil
- else
- result.data = nil
- end
- result.color = nil
- result.action = nil
- result.cached = nil
- io.savedata(name, table.fastserialize(result))
- else
- os.remove((prepare(p)))
- end
-end
-
-function mp.lmt_contours_start()
-
- starttiming("lmt_contours")
-
- nofcontours = nofcontours + 1
-
- local p = getparameterset()
-
- local xmin = p.xmin
- local xmax = p.xmax
- local ymin = p.ymin
- local ymax = p.ymax
- local xstep = p.xstep
- local ystep = p.ystep
- local levels = p.levels
- local colors = p.colors
- local nx = 0
- local ny = 0
- local means = setmetatableindex("number")
- local values = setmetatableindex("number")
- local data = setmetatableindex("table")
- local minmean = false
- local maxmean = false
-
- local cached, hash, name = getcache(p)
-
- local function setcolors(preamble,levels,minz,maxz,color,nofvalues)
- if colors then
- local function f(k)
- return #colors[1] == 1 and 0 or { 0, 0, 0 }
- end
- setmetatableindex(colors, function(t,k)
- local v = f(k)
- t[k] = v
- return v
- end)
- local c = { }
- local n = 1
- for i=1,nofvalues do
- c[i] = colors[n]
- n = n + 1
- end
- return c, f
- else
- local tcolor = f_color(levels,minz,maxz,preamble,color)
- local colors = { }
- local fcolor = load(tcolor)
- if type(fcolor) ~= "function" then
- report("error in color function, case %i: %s",1,color)
- fcolor = false
- else
- fcolor = fcolor()
- if type(fcolor) ~= "function" then
- report("error in color function, case %i: %s",2,color)
- fcolor = false
- end
- end
- if not fcolor then
- local color_step = mp.lmt_color_functions.step
- fcolor = function(l)
- return color_step(l,levels,0.25,0.50,0.75)
- end
- end
- for i=1,nofvalues do
- colors[i] = { fcolor(i) }
- end
- if attributes.colors.model == "cmyk" then
- for i=1,#colors do
- local c = colors[i]
- colors[i] = { 1 - c[1], 1 - c[2], 1 - c[3], 0 }
- end
- end
- return colors, fcolor
- end
- end
-
- if cached then
- local result = p.result
- local colors, color = setcolors(
- p.preamble,
- p.levels,
- result.minz,
- result.maxz,
- p.color,
- result.nofvalues
- )
- result.color = color
- result.colors = colors
- result.cached = true
- return
- end
-
- local functioncode = p["function"]
- local functionrange = p.range
- local functionlist = functionrange and p.functions
- local preamble = p.preamble
-
- if xstep == 0 then xstep = (xmax - xmin)/100 end
- if ystep == 0 then ystep = (ymax - ymin)/100 end
-
- local nxmin = round(xmin/xstep)
- local nxmax = round(xmax/xstep)
- local nymin = round(ymin/ystep)
- local nymax = round(ymax/ystep)
- local nx = nxmax - nxmin + 1
- local ny = nymax - nymin + 1
-
- local function executed(data,code)
- local fcode = p.check and f_function_y or f_function_n
- fcode = fcode(preamble,code)
- fcode = load(fcode)
- if type(fcode) == "function" then
- fcode = fcode()
- end
- if type(fcode) == "function" then
- local er = fcode(
- data, nx, ny,
- nxmin, nxmax, xstep,
- nymin, nymax, ystep,
- p.defaultnan, p.defaultinf, report
- )
- if er > 0 then
- report("%i errors in: %s",er,code)
- end
- return true
- else
- return false -- fatal error
- end
- end
-
- -- for i=1,nx do
- -- data[i] = lua.newtable(ny,0)
- -- end
-
- if functionlist then
-
- local datalist = { }
- local minr = functionrange[1]
- local maxr = functionrange[2] or minr
- local size = #functionlist
-
- for l=1,size do
-
- local func = setmetatableindex("table")
- if not executed(func,functionlist[l]) then
- report("error in executing function %i from functionlist",l)
- return
- end
-
- local bit = l -- + 1
-
- if l == 1 then
- for i=1,nx do
- local di = data[i]
- local fi = func[i]
- for j=1,ny do
- local f = fi[j]
- if f >= minr and f <= maxr then
- di[j] = bit
- else
- di[j] = 0
- end
- end
- end
- else
- for i=1,nx do
- local di = data[i]
- local fi = func[i]
- for j=1,ny do
- local f = fi[j]
- if f >= minr and f <= maxr then
- di[j] = bor(di[j],bit)
- end
- end
- end
- end
-
- end
-
- -- we can simplify the value mess below
-
- elseif functioncode then
-
- if not executed(data,functioncode) then
- report("error in executing function")
- return -- fatal error
- end
-
- else
-
- report("no valid function(s)")
- return -- fatal error
-
- end
-
- minz = data[1][1]
- maxz = minz
-
- for i=1,nx do
- local d = data[i]
- for j=1,ny do
- local v = d[j]
- if v < minz then
- minz = v
- elseif v > maxz then
- maxz = v
- end
- end
- end
-
- if functionlist then
-
- for i=minz,maxz do
- values[i] = i
- end
-
- levels = maxz
-
- minmean = minz
- maxmean = maxz
-
- else
-
- local snap = (maxz - minz + 1) / levels
-
- for i=1,nx do
- local d = data[i]
- for j=1,ny do
- local dj = d[j]
- local v = round((dj - minz) / snap)
- values[v] = values[v] + 1
- means [v] = means [v] + dj
- d[j] = v
- end
- end
-
- local list = sortedkeys(values)
- local count = values
- local remap = { }
-
- values = { }
-
- for i=1,#list do
- local v = list[i]
- local m = means[v] / count[v]
- remap [v] = i
- values[i] = m
- if not minmean then
- minmean = m
- maxmean = m
- elseif m < minmean then
- minmean = m
- elseif m > maxmean then
- maxmean = m
- end
- end
-
- for i=1,nx do
- local d = data[i]
- for j=1,ny do
- d[j] = remap[d[j]]
- end
- end
-
- end
-
- -- due to rounding we have values + 1 so we can have a floor, ceil, round
- -- option as well as levels -1
-
- local nofvalues = #values
-
- local colors = setcolors(
- p.preamble,levels,minz,maxz,p.color,nofvalues
- )
-
- p.result = {
- version = version,
- values = values,
- nofvalues = nofvalues,
- minz = minz,
- maxz = maxz,
- minmean = minmean,
- maxmean = maxmean,
- data = data,
- color = color,
- nx = nx,
- ny = ny,
- colors = colors,
- name = name,
- hash = hash,
- islist = functionlist and true or false,
- }
-
- report("index %i, nx %i, ny %i, levels %i", nofcontours, nx, ny, nofvalues)
-end
-
-function mp.lmt_contours_stop()
- local p = getparameterset()
- local e = stoptiming("lmt_contours")
- setcache(p)
- p.result = nil
- local f = p["function"]
- local l = p.functions
- report("index %i, %0.3f seconds for: %s",
- nofcontours, e, "[ " .. concat(l or { f } ," ] [ ") .. " ]"
- )
-end
-
-function mp.lmt_contours_bitmap_set()
- local p = getparameterset()
- local result = p.result
-
- local values = result.values
- local nofvalues = result.nofvalues
- local rawdata = result.data
- local nx = result.nx
- local ny = result.ny
- local colors = result.colors
- local depth = #colors[1] -- == 3 and "rgb" or "gray"
-
- -- i need to figure out this offset of + 1
-
- local bitmap = graphics.bitmaps.new(
- nx, ny,
- (depth == 3 and "rgb") or (depth == 4 and "cmyk") or "gray",
- 1, false, true
- )
-
- local palette = bitmap.index or { } -- has to start at 0
- local data = bitmap.data
- local p = 0
-
- if depth == 3 or depth == 4 then
- for i=1,nofvalues do
- local c = colors[i]
- local r = round((c[1] or 0) * 255)
- local g = round((c[2] or 0) * 255)
- local b = round((c[3] or 0) * 255)
- local k = depth == 4 and round((c[4] or 0) * 255) or nil
- palette[p] = {
- (r > 255 and 255) or (r < 0 and 0) or r,
- (g > 255 and 255) or (g < 0 and 0) or g,
- (b > 255 and 255) or (b < 0 and 0) or b,
- k
- }
- p = p + 1
- end
- else
- for i=1,nofvalues do
- local s = colors[i][1]
- local s = round((s or 0) * 255)
- palette[p] = (
- (s > 255 and 255) or (s < 0 and 0) or s
- )
- p = p + 1
- end
- end
-
- -- As (1,1) is the left top corner so we need to flip of we start in
- -- the left bottom (we cannot loop reverse because we want a properly
- -- indexed table.
-
- local k = 0
- for y=ny,1,-1 do
- k = k + 1
- local d = data[k]
- for x=1,nx do
- d[x] = rawdata[x][y] - 1
- end
- end
-
- result.bitmap = bitmap
-end
-
-function mp.lmt_contours_bitmap_get()
- local p = getparameterset()
- local result = p.result
- local bitmap = result.bitmap
- local box = nodes.hpack(graphics.bitmaps.flush(bitmap))
- n_box = n_box + 1
- nodes.boxes.savenode("contour",tostring(n_box),box)
- return f_box(n_box,bitmap.xsize,bitmap.ysize)
-end
-
-function mp.lmt_contours_cleanup()
- nodes.boxes.reset("contour")
- n_box = 0
-end
-
-function mp.lmt_contours_edge_set()
- local p = getparameterset()
- local result = p.result
-
- if result.cached then return end
-
- local values = result.values
- local nofvalues = result.nofvalues
- local data = result.data
- local nx = result.nx
- local ny = result.ny
-
- local xmin = p.xmin
- local xmax = p.xmax
- local ymin = p.ymin
- local ymax = p.ymax
- local xstep = p.xstep
- local ystep = p.ystep
-
- local wsp = { }
- local edges = { }
-
- for value=1,nofvalues do
-
- local iwsp = 0
- local di = data[1]
- local dc
- local edge = { }
- local e = 0
- -- the next loop is fast
- for i=1,nx do
- local di1 = data[i+1]
- local dij = di[1]
- local d = dij - value
- local dij1
- for j=1,ny do
- if j < ny then
- dij1 = di[j+1]
- dc = dij1 - value
- if (d >= 0 and dc < 0) or (d < 0 and dc >= 0) then
- iwsp = iwsp + 1
- local y = (d * (j+1) - dc * j) / (d - dc)
- if i == 1 then
- wsp[iwsp] = { i, y, 0, (i + (j-1)*nx) }
- elseif i == nx then
- wsp[iwsp] = { i, y, (i - 1 + (j-1)*nx), 0 }
- else
- local jx = (i + (j-1)*nx)
- wsp[iwsp] = { i, y, jx - 1, jx }
- end
- end
- end
- if i < nx then
- local dc = di1[j] - value
- if (d >= 0 and dc < 0) or (d < 0 and dc >= 0) then
- iwsp = iwsp + 1
- local x = (d * (i+1) - dc * i) / (d - dc)
- if j == 1 then
- wsp[iwsp] = { x, j, 0, (i + (j-1)*nx) }
- elseif j == ny then
- wsp[iwsp] = { x, j, (i + (j-2)*nx), 0 }
- else
- local jx = i + (j-1)*nx
- wsp[iwsp] = { x, j, jx - nx, jx }
- end
- end
- end
- dij = dij1
- d = dc
- end
- di = di1
- end
- -- the next loop takes time
- for i=1,iwsp do
- local wspi = wsp[i]
- for isq=3,4 do
- local nsq = wspi[isq]
- if nsq ~= 0 then
- local px = wspi[1]
- local py = wspi[2]
- local p = { px, py }
- local pn = 2
- wspi[isq] = 0
- while true do
- for ii=1,iwsp do
- local w = wsp[ii]
- local n1 = w[3]
- local n2 = w[4]
- if n1 == nsq then
- local x = w[1]
- local y = w[2]
- if x ~= px or y ~= py then
- pn = pn + 1
- p[pn] = x
- pn = pn + 1
- p[pn] = y
- px = x
- py = y
- end
- nsq = n2
- w[3] = 0
- w[4] = 0
- if nsq == 0 then
- if pn == 1 then
- pn = pn + 1
- p[pn] = w
- end
- goto flush
- end
- elseif n2 == nsq then
- local x = w[1]
- local y = w[2]
- if x ~= px or y ~= py then
- pn = pn + 1
- p[pn] = x
- pn = pn + 1
- p[pn] = y
- px = x
- py = y
- end
- nsq = n1
- w[3] = 0
- w[4] = 0
- if nsq == 0 then
- goto flush
- end
- end
- end
- end
- ::flush::
- e = e + 1
- edge[e] = p
- if mpflatten then
- mpflatten(p)
- end
- end
- end
- end
-
-
- edges[value] = edge
-
- end
-
- result.edges = edges
-
-end
-
-function mp.lmt_contours_shade_set(edgetoo)
- local p = getparameterset()
- local result = p.result
-
- if result.cached then return end
-
- local values = result.values
- local nofvalues = result.nofvalues
- local data = result.data
- local nx = result.nx
- local ny = result.ny
- local color = result.color
-
- local edges = setmetatableindex("table")
- local shades = setmetatableindex("table")
-
- local sqtype = setmetatableindex("table")
-
- local xspoly = { 0, 0, 0, 0, 0, 0 }
- local yspoly = { 0, 0, 0, 0, 0, 0 }
- local xrpoly = { }
- local yrpoly = { }
-
- local xrpoly = { } -- lua.newtable(2000,0)
- local yrpoly = { } -- lua.newtable(2000,0)
-
- -- for i=1,2000 do
- -- xrpoly[i] = 0
- -- yrpoly[i] = 0
- -- end
-
- -- Unlike a c compiler lua will not optimize loops to run in parallel so we expand
- -- some of the loops and make sure we don't calculate when not needed. Not that nice
- -- but not that bad either. Maybe I should just write this from scratch.
-
--- local i = 0
--- local j = 0
-
- -- Analyze each rectangle separately. Overwrite lower colors
-
- -- Unrolling the loops and copying code and using constants is faster and doesn't
- -- produce much more code in the end, also because we then can leave out the not
- -- seen branches. One can argue about the foundit2* blobs but by stepwise optimizing
- -- this is the result.
-
- shades[1] = { { 0, 0, nx - 1, 0, nx - 1, ny - 1, 0, ny - 1 } }
- edges [1] = { { } }
-
- -- this is way too slow ... i must have messed up some loop .. what is this with value 1
-
- for value=1,nofvalues do
--- for value=2,nofvalues do
-
- local edge = { }
- local nofe = 0
- local shade = { }
- local nofs = 0
-
- for i=1,nx-1 do
- local s = sqtype[i]
- for j=1,ny-1 do
- s[j] = 0
- end
- end
-
- local nrp = 0
-
- local function addedge(a,b,c,d)
- nofe = nofe + 1 edge[nofe] = a
- nofe = nofe + 1 edge[nofe] = b
- nofe = nofe + 1 edge[nofe] = c
- nofe = nofe + 1 edge[nofe] = d
- end
- while true do
- -- search for a square of type 0 with >= 1 corner above contour level
- local i
- local j
- local d0 = data[1]
- local d1 = data[2]
- for ii=1,nx do
- local s = sqtype[ii]
- for jj=1,ny do
- if s[jj] == 0 then
- if d0[jj] > value then i = ii j = jj goto foundit end
- if d1[jj] > value then i = ii j = jj goto foundit end
- local j1 = jj + 1
- if d1[j1] > value then i = ii j = jj goto foundit end
- if d0[j1] > value then i = ii j = jj goto foundit end
- end
- end
- d0 = d1
- d1 = data[ii+1]
- end
- break
- ::foundit::
- -- initialize r-polygon (nrp seems to be 1 or 2)
- nrp = nrp + 1
-
- local first = true
- local nrpoly = 0
- local nspoly = 0
- local nrpm = -nrp
- -- this is the main loop
- while true do
- -- search for a square of type -nrp
- if first then
- first = false
- if sqtype[i][j] == 0 then -- true anyway
- goto foundit1
- end
- end
- for ii=1,nx do
- local s = sqtype[ii]
- for jj=1,ny do
- if s[jj] == nrpm then
- i = ii
- j = jj
- goto foundit1
- end
- end
- end
- break
- ::foundit1::
- while true do
-
- -- search current then neighboring squares for square type 0, with a corner in common with current square above contour level
-
- -- top/bottom ... a bit cheating here
-
- local i_l, i_c, i_r -- i left current right
- local j_b, j_c, j_t -- j bottom current top
-
- local i_n = i + 1 -- i next (right)
- local j_n = j + 1 -- j next (top)
-
- local i_p = i - 1 -- i previous (bottom)
- local j_p = j - 1 -- j previous (right)
-
- local d_c = data[i]
- local d_r = data[i_n]
-
- local sq
-
- i_c = i ; j_c = j ; if i_c < nx and j_c < ny then sq = sqtype[i_c] if sq[j_c] == 0 then
- if d_c[j_c] > value then i_l = i_p ; i_r = i_n ; j_b = j_p ; j_t = j_n ; goto foundit21 end
- if d_c[j_n] > value then i_l = i_p ; i_r = i_n ; j_b = j_p ; j_t = j_n ; goto foundit22 end
- if d_r[j_c] > value then i_l = i_p ; i_r = i_n ; j_b = j_p ; j_t = j_n ; goto foundit23 end
- if d_r[j_n] > value then i_l = i_p ; i_r = i_n ; j_b = j_p ; j_t = j_n ; goto foundit24 end
- end end
-
- i_c = i_n ; j_c = j ; if i_c < nx and j_c < ny then sq = sqtype[i_c] if sq[j_c] == 0 then
- if d_r[j_c] > value then i_l = i ; i_r = i_n + 1 ; j_b = j_p ; j_t = j_n ; d_c = d_r ; d_r = data[i_r] ; goto foundit21 end
- if d_r[j_n] > value then i_l = i ; i_r = i_n + 1 ; j_b = j_p ; j_t = j_n ; d_c = d_r ; d_r = data[i_r] ; goto foundit22 end
- end end
-
- i_c = i ; j_c = j_n ; if i_c < nx and j_c < ny then sq = sqtype[i_c] if sq[j_c] == 0 then
- if d_c[j_n] > value then i_l = i_p ; i_r = i_n ; j_b = j ; j_t = j_n + 1 ; goto foundit21 end
- if d_r[j_n] > value then i_l = i_p ; i_r = i_n ; j_b = j ; j_t = j_n + 1 ; goto foundit23 end
- end end
-
- i_c = i_p ; j_c = j ; if i_c > 0 and j_c < ny then sq = sqtype[i_c] if sq[j_c] == 0 then
- if d_c[j_c] > value then i_l = i_p - 1 ; i_r = i ; j_b = j_p ; j_t = j_n ; d_r = d_c ; d_c = data[i_p] ; goto foundit23 end
- if d_c[j_n] > value then i_l = i_p - 1 ; i_r = i ; j_b = j_p ; j_t = j_n ; d_r = d_c ; d_c = data[i_p] ; goto foundit24 end
- end end
-
- i_c = i ; j_c = j_p ; if i < nx and j_c > 0 then sq = sqtype[i_c] if sq[j_c] == 0 then
- if d_c[j] > value then i_l = i_p ; i_r = i_n ; j_b = j_p - 1 ; j_t = j ; goto foundit22 end
- if d_r[j] > value then i_l = i_p ; i_r = i_n ; j_b = j_p - 1 ; j_t = j ; goto foundit24 end
- end end
-
- -- not found
-
- sqtype[i][j] = nrp
-
- break
-
- -- define s-polygon for found square (i_c,j_c) - may have up to 6 sides
-
- ::foundit21:: -- 1 2 3 4
-
- sq[j_c] = nrpm
-
- xspoly[1] = i_l ; yspoly[1] = j_b
- xspoly[2] = i_c ; yspoly[2] = j_b
- if d_r[j_c] > value then -- dd2
- xspoly[3] = i_c ; yspoly[3] = j_c
- if d_r[j_t] > value then -- dd3
- xspoly[4] = i_l ; yspoly[4] = j_c
- if d_c[j_t] > value then -- dd4
- nspoly = 4
- else
- xspoly[5] = i_l ; yspoly[5] = j_c ; nspoly = 5
- end
- elseif d_c[j_t] > value then -- dd4
- xspoly[4] = i_c ; yspoly[4] = j_c ;
- xspoly[5] = i_l ; yspoly[5] = j_c ; nspoly = 5
- else
- xspoly[4] = i_l ; yspoly[4] = j_c ; nspoly = 4
- if edgetoo then addedge(i_c, j_c, i_l, j_c) end
- end
- elseif d_r[j_t] > value then -- dd3
- xspoly[3] = i_c ; yspoly[3] = j_b
- xspoly[4] = i_c ; yspoly[4] = j_c
- if d_c[j_t] > value then -- dd4
- xspoly[5] = i_l ; yspoly[5] = j_c ; nspoly = 5
- else
- xspoly[5] = i_l ; yspoly[5] = j_c ;
- xspoly[6] = i_l ; yspoly[6] = j_c ; nspoly = 6
- end
- elseif d_c[j_t] > value then -- dd4
- if edgetoo then addedge(i_c, j_b, i_c, j_c) end
- xspoly[3] = i_c ; yspoly[3] = j_c ;
- xspoly[4] = i_l ; yspoly[4] = j_c ; nspoly = 4
- else
- if edgetoo then addedge(i_c, j_b, i_l, j_c) end
- xspoly[3] = i_l ; yspoly[3] = j_c ; nspoly = 3
- end
- goto done
-
- ::foundit22:: -- 4 1 2 3
-
- sq[j_c] = nrpm
-
- xspoly[1] = i_l ; yspoly[1] = j_c
- xspoly[2] = i_l ; yspoly[2] = j_b
- if d_c[j_c] > value then -- dd2
- xspoly[3] = i_c ; yspoly[3] = j_b
- if d_r[j_c] > value then -- dd3
- xspoly[4] = i_c ; yspoly[4] = j_c
- if d_r[j_t] > value then -- dd4
- nspoly = 4
- else
- xspoly[5] = i_c ; yspoly[5] = j_c ; nspoly = 5 -- suspicious, the same
- end
- elseif d_r[j_t] > value then -- dd4
- xspoly[4] = i_c ; yspoly[4] = j_b ;
- xspoly[5] = i_c ; yspoly[5] = j_c ; nspoly = 5
- else
- if edgetoo then addedge(i_c, j_b, i_c, j_c) end
- xspoly[4] = i_c ; yspoly[4] = j_c ; nspoly = 4
- end
- elseif d_r[j_c] > value then -- dd3
- xspoly[3] = i_l ; yspoly[3] = j_b
- xspoly[4] = i_c ; yspoly[4] = j_b
- xspoly[5] = i_c ; yspoly[5] = j_c
- if d_r[j_t] > value then -- dd4
- nspoly = 5
- else
- xspoly[6] = i_c ; yspoly[6] = j_c ; nspoly = 6
- end
- elseif d_r[j_t] > value then -- dd4
- if edgetoo then addedge(i_l, j_b, i_c, j_b) end
- xspoly[3] = i_c ; yspoly[3] = j_b
- xspoly[4] = i_c ; yspoly[4] = j_c ; nspoly = 4
- else
- if edgetoo then addedge(i_l, j_b, i_c, j_c) end
- xspoly[3] = i_c ; yspoly[3] = j_c ; nspoly = 3
- end
- goto done
-
- ::foundit23:: -- 2 3 4 1
-
- sq[j_c] = nrpm
-
- xspoly[1] = i_c ; yspoly[1] = j_b
- xspoly[2] = i_c ; yspoly[2] = j_c
- if d_r[j_t] > value then -- dd2
- xspoly[3] = i_l ; yspoly[3] = j_c
- if d_c[j_t] > value then -- dd3
- xspoly[4] = i_l ; yspoly[4] = j_b
- if d_c[j_c] > value then -- dd4
- nspoly = 4
- else
- xspoly[5] = i_l ; yspoly[5] = j_b ; nspoly = 5
- end
- elseif d_c[j_c] > value then -- dd4
- xspoly[4] = i_l ; yspoly[4] = j_c
- xspoly[5] = i_l ; yspoly[5] = j_b ; nspoly = 5
- else
- if edgetoo then addedge(i_l, j_c, i_l, j_b) end
- xspoly[4] = i_l ; yspoly[4] = j_b ; nspoly = 4
- end
- elseif d_c[j_t] > value then -- dd3
- xspoly[3] = i_c ; yspoly[3] = j_c
- xspoly[4] = i_l ; yspoly[4] = j_c
- xspoly[5] = i_l ; yspoly[5] = j_b
- if d_c[j_c] > value then -- dd4
- nspoly = 5
- else
- xspoly[6] = i_l ; yspoly[6] = j_b ; nspoly = 6
- end
- elseif d_c[j_c] > value then -- dd4
- if edgetoo then addedge(i_c, j_c, i_l, j_c) end
- xspoly[3] = i_l ; yspoly[3] = j_c ;
- xspoly[4] = i_l ; yspoly[4] = j_b ; nspoly = 4
- else
- if edgetoo then addedge(i_c, j_c, i_l, j_b) end
- xspoly[3] = i_l ; yspoly[3] = j_b ; nspoly = 3
- end
- goto done
-
- ::foundit24:: -- 3 4 1 2
-
- sq[j_c] = nrpm
-
- xspoly[1] = i_c ; yspoly[1] = j_c
- xspoly[2] = i_l ; yspoly[2] = j_c
- if d_c[j_t] > value then -- dd2
- if d_c[j_c] > value then -- dd3
- xspoly[3] = i_l ; yspoly[3] = j_b
- xspoly[4] = i_c ; yspoly[4] = j_b
- if d_r[j_c] > value then -- dd4
- nspoly = 4
- else
- xspoly[5] = i_c ; yspoly[5] = j_b ; nspoly = 5
- end
- else
- xspoly[3] = i_l ; yspoly[3] = j_b
- if d_r[j_c] > value then -- dd4
-
- local xv34 = (dd3*i_c-dd4*i_l)/(dd3 - dd4) -- probably i_l
- print("4.4 : xv34",xv34,i_c,i_l)
-
- -- if edgetoo then addedge(i_l, j_b, xv34, j_b) end
- xspoly[4] = xv34 ; yspoly[4] = j_b ;
- xspoly[5] = i_c ; yspoly[5] = j_b ; nspoly = 5
- else
- if edgetoo then addedge(i_l, j_b, i_c, j_b) end
- xspoly[4] = i_c ; yspoly[4] = j_b ; nspoly = 4
- end
- end
- elseif d_c[j_c] > value then -- dd3
- xspoly[3] = i_l ; yspoly[3] = j_b
- xspoly[4] = i_l ; yspoly[4] = j_b
- xspoly[5] = i_c ; yspoly[5] = j_b
- if d_r[j_c] > value then -- dd4
- nspoly = 5
- else
- xspoly[6] = i_c ; yspoly[6] = j_b ; nspoly = 6
- end
- elseif d_r[j_c] > value then -- dd4
- if edgetoo then addedge(i_l, j_c, i_l, j_b) end
- xspoly[3] = i_l ; yspoly[3] = j_b
- xspoly[4] = i_c ; yspoly[4] = j_b ; nspoly = 4
- else
- if edgetoo then addedge(i_l, j_c, i_c, j_b) end
- xspoly[3] = i_c ; yspoly[3] = j_b ; nspoly = 3
- end
- -- goto done
-
- ::done::
- -- combine s-polygon with existing r-polygon, eliminating redundant segments
-
- if nrpoly == 0 then
- -- initiate r-polygon
- for i=1,nspoly do
- xrpoly[i] = xspoly[i]
- yrpoly[i] = yspoly[i]
- end
- nrpoly = nspoly
- else
- -- search r-polygon and s-polygon for one side that matches
- --
- -- this is a bottleneck ... we keep this variant here but next go for a faster
- -- alternative
- --
- -- local ispoly, irpoly
- -- for r=nrpoly,1,-1 do
- -- local r1
- -- for s=1,nspoly do
- -- local s1 = s % nspoly + 1
- -- if xrpoly[r] == xspoly[s1] and yrpoly[r] == yspoly[s1] then
- -- if not r1 then
- -- r1 = r % nrpoly + 1
- -- end
- -- if xrpoly[r1] == xspoly[s] and yrpoly[r1] == yspoly[s] then
- -- ispoly = s
- -- irpoly = r
- -- goto foundit3
- -- end
- -- end
- -- end
- -- end
- --
- -- local ispoly, irpoly
- -- local xr1 = xrpoly[1]
- -- local yr1 = yrpoly[1]
- -- for r0=nrpoly,1,-1 do
- -- for s0=1,nspoly do
- -- if xr1 == xspoly[s0] and yr1 == yspoly[s0] then
- -- if s0 == nspoly then
- -- if xr0 == xspoly[1] and yr0 == yspoly[1] then
- -- ispoly = s0
- -- irpoly = r0
- -- goto foundit3
- -- end
- -- else
- -- local s1 = s0 + 1
- -- if xr0 == xspoly[s1] and yr0 == yspoly[s1] then
- -- ispoly = s0
- -- irpoly = r0
- -- goto foundit3
- -- end
- -- end
- -- end
- -- end
- -- xr1 = xrpoly[r0]
- -- yr1 = yrpoly[r0]
- -- end
- --
- -- but ...
- --
- local minx = xspoly[1]
- local miny = yspoly[1]
- local maxx = xspoly[1]
- local maxy = yspoly[1]
- for i=1,nspoly do
- local y = yspoly[i]
- if y < miny then
- miny = y
- elseif y > maxy then
- maxy = y
- end
- local x = xspoly[i]
- if x < minx then
- minx = y
- elseif x > maxx then
- maxx = x
- end
- end
- -- we can delay accessing y ...
- local ispoly, irpoly
- local xr1 = xrpoly[1]
- local yr1 = yrpoly[1]
- for r0=nrpoly,1,-1 do
- if xr1 >= minx and xr1 <= maxx and yr1 >= miny and yr1 <= maxy then
- local xr0 = xrpoly[r0]
- local yr0 = yrpoly[r0]
- for s0=1,nspoly do
- if xr1 == xspoly[s0] and yr1 == yspoly[s0] then
- if s0 == nspoly then
- if xr0 == xspoly[1] and yr0 == yspoly[1] then
- ispoly = s0
- irpoly = r0
- goto foundit3
- end
- else
- local s1 = s0 + 1
- if xr0 == xspoly[s1] and yr0 == yspoly[s1] then
- ispoly = s0
- irpoly = r0
- goto foundit3
- end
- end
- end
- end
- xr1 = xr0
- yr1 = yr0
- else
- xr1 = xrpoly[r0]
- yr1 = yrpoly[r0]
- end
- end
- --
- goto nomatch3
- ::foundit3::
- local match1 = 0
- local rpoly1 = irpoly + nrpoly
- local spoly1 = ispoly - 1
- for i=2,nspoly-1 do
- -- search for further matches nearby
- local ir = (rpoly1 - i) % nrpoly + 1
- local is = (spoly1 + i) % nspoly + 1
- if xrpoly[ir] == xspoly[is] and yrpoly[ir] == yspoly[is] then
- match1 = match1 + 1
- else
- break -- goto nomatch1
- end
- end
- ::nomatch1::
- local match2 = 0
- local rpoly2 = irpoly - 1
- local spoly2 = ispoly + nspoly
- for i=2,nspoly-1 do
- -- search other way for further matches nearby
- local ir = (rpoly2 + i) % nrpoly + 1
- local is = (spoly2 - i) % nspoly + 1
- if xrpoly[ir] == xspoly[is] and yrpoly[ir] == yspoly[is] then
- match2 = match2 + 1
- else
- break -- goto nomatch2
- end
- end
- ::nomatch2::
- -- local dnrpoly = nspoly - 2 - 2*match1 - 2*match2
- local dnrpoly = nspoly - 2*(match1 + match2 + 1)
- local ispolystart = (ispoly + match1) % nspoly + 1 -- first node of s-polygon to include
- local irpolyend = (rpoly1 - match1 - 1) % nrpoly + 1 -- last node of s-polygon to include
- if dnrpoly ~= 0 then
- local irpolystart = (irpoly + match2) % nrpoly + 1 -- first node of s-polygon to include
- if irpolystart > irpolyend then
- -- local ispolyend = (spoly1 - match2 + nspoly)%nspoly + 1 -- last node of s-polygon to include
- if dnrpoly > 0 then
- -- expand the arrays xrpoly and yrpoly
- for i=nrpoly,irpolystart,-1 do
- local k = i + dnrpoly
- xrpoly[k] = xrpoly[i]
- yrpoly[k] = yrpoly[i]
- end
- else -- if dnrpoly < 0 then
- -- contract the arrays xrpoly and yrpoly
- for i=irpolystart,nrpoly do
- local k = i + dnrpoly
- xrpoly[k] = xrpoly[i]
- yrpoly[k] = yrpoly[i]
- end
- end
- end
- nrpoly = nrpoly + dnrpoly
- end
- if nrpoly < irpolyend then
- for i=irpolyend,nrpoly+1,-1 do
- -- otherwise these values get lost!
- local k = i - nrpoly
- xrpoly[k] = xrpoly[i]
- yrpoly[k] = yrpoly[i]
- end
- end
- local n = nspoly - 2 - match1 - match2
- if n == 1 then
- local irpoly1 = irpolyend % nrpoly + 1
- local ispoly1 = ispolystart % nspoly + 1
- xrpoly[irpoly1] = xspoly[ispoly1]
- yrpoly[irpoly1] = yspoly[ispoly1]
- elseif n > 0 then
- -- often 2
- for i=1,n do
- local ii = i - 1
- local ir = (irpolyend + ii) % nrpoly + 1
- local is = (ispolystart + ii) % nspoly + 1
- xrpoly[ir] = xspoly[is]
- yrpoly[ir] = yspoly[is]
- end
- end
- ::nomatch3::
- end
- end
- end
-
- if nrpoly > 0 then
- local t = { }
- local n = 0
- for i=1,nrpoly do
- n = n + 1 t[n] = xrpoly[i]
- n = n + 1 t[n] = yrpoly[i]
- end
- if mpflatten then
- mpflatten(t) -- maybe integrate
- end
- nofs = nofs + 1
- shade[nofs] = t
- -- print(value,nrpoly,#t,#t-nrpoly*2)
- end
-
- end
-
- edges [value+1] = edge
- shades[value+1] = shade
--- edges [value] = edge
--- shades[value] = shade
- end
-
- result.shades = shades
- result.shapes = edges
-
-end
-
--- accessors
-
-function mp.lmt_contours_nx (i) return getparameterset().result.nx end
-function mp.lmt_contours_ny (i) return getparameterset().result.ny end
-
-function mp.lmt_contours_nofvalues() return getparameterset().result.nofvalues end
-function mp.lmt_contours_value (i) return getparameterset().result.values[i] end
-
-function mp.lmt_contours_minz (i) return getparameterset().result.minz end
-function mp.lmt_contours_maxz (i) return getparameterset().result.maxz end
-
-function mp.lmt_contours_minmean (i) return getparameterset().result.minmean end
-function mp.lmt_contours_maxmean (i) return getparameterset().result.maxmean end
-
-function mp.lmt_contours_xrange () local p = getparameterset() mpstring(formatters["x = [%.3N,%.3N] ;"](p.xmin,p.xmax)) end
-function mp.lmt_contours_yrange () local p = getparameterset() mpstring(formatters["y = [%.3N,%.3N] ;"](p.ymin,p.ymax)) end
-
-function mp.lmt_contours_format()
- local p = getparameterset()
- return mpstring(p.result.islist and "@i" or p.zformat or p.format)
-end
-
-function mp.lmt_contours_function()
- local p = getparameterset()
- return mpstring(p.result.islist and concat(p["functions"], ", ") or p["function"])
-end
-
-function mp.lmt_contours_range()
- local p = getparameterset()
- local r = p.result.islist and p.range
- if not r or #r == 0 then
- return mpstring("")
- elseif #r == 1 then
- return mpstring(r[1])
- else
- return mpstring(formatters["z = [%s,%s]"](r[1],r[2]))
- end
-end
-
-function mp.lmt_contours_edge_paths(value)
- mpdraw(getparameterset().result.edges[value],true)
- mpflush()
-end
-
-function mp.lmt_contours_shape_paths(value)
- mpdraw(getparameterset().result.shapes[value],false)
- mpflush()
-end
-
-function mp.lmt_contours_shade_paths(value)
- mpfill(getparameterset().result.shades[value],true)
- mpflush()
-end
-
-function mp.lmt_contours_color(value)
- local p = getparameterset()
- local color = p.result.colors[value]
- if color then
- mpcolor(color)
- end
-end
-
--- The next code is based on the wikipedia page. It was a bit tedius job to define the
--- coordinates but hupefully I made no errors. I rendered all shapes independently and
--- tripple checked bit one never knows ...
-
--- maybe some day write from scatch, like this (axis are swapped):
-
-local d = 1/2
-
-local paths = {
- { 0, d, d, 0 },
- { 1, d, d, 0 },
- { 0, d, 1, d },
- { 1, d, d, 1 },
- { 0, d, d, 1, d, 0, 1, d }, -- saddle
- { d, 0, d, 1 },
- { 0, d, d, 1 },
- { 0, d, d, 1 },
- { d, 0, d, 1 },
- { 0, d, d, 0, 1, d, d, 1 }, -- saddle
- { 1, d, d, 1 },
- { 0, d, 1, d },
- { d, 0, 1, d },
- { d, 0, 0, d },
-}
-
-local function whatever(data,nx,ny,threshold)
- local edges = { }
- local e = 0
- local d0 = data[1]
- for j=1,ny-1 do
- local d1 = data[j+1]
- local k = j + 1
- for i=1,nx-1 do
- local v = 0
- local l = i + 1
- local c1 = d0[i]
- if c1 < threshold then
- v = v + 8
- end
- local c2 = d0[l]
- if c2 < threshold then
- v = v + 4
- end
- local c3 = d1[l]
- if c3 < threshold then
- v = v + 2
- end
- local c4 = d1[i]
- if c4 < threshold then
- v = v + 1
- end
- if v > 0 and v < 15 then
- if v == 5 or v == 10 then
- local a = (c1 + c2 + c3 + c4) / 4
- if a < threshold then
- v = v == 5 and 10 or 5
- end
- local p = paths[v]
- e = e + 1 edges[e] = k - p[2]
- e = e + 1 edges[e] = i + p[1]
- e = e + 1 edges[e] = k - p[4]
- e = e + 1 edges[e] = i + p[3]
- e = e + 1 edges[e] = k - p[6]
- e = e + 1 edges[e] = i + p[5]
- e = e + 1 edges[e] = k - p[8]
- e = e + 1 edges[e] = i + p[7]
- else
- local p = paths[v]
- e = e + 1 edges[e] = k - p[2]
- e = e + 1 edges[e] = i + p[1]
- e = e + 1 edges[e] = k - p[4]
- e = e + 1 edges[e] = i + p[3]
- end
- end
- end
- d0 = d1
- end
- return edges
-end
-
--- todo: just fetch when needed, no need to cache
-
-function mp.lmt_contours_edge_set_by_cell()
- local p = getparameterset()
- local result = p.result
-
- if result.cached then return end
-
- local values = result.values
- local nofvalues = result.nofvalues
- local data = result.data
- local nx = result.nx
- local ny = result.ny
- local lines = { }
- result.lines = lines
- for value=1,nofvalues do
- lines[value] = whatever(data,ny,nx,value)
- end
-end
-
-function mp.lmt_contours_edge_get_cell(value)
- mpdraw(getparameterset().result.lines[value])
- mpflush()
-end
-
-local singles = {
- { d, 0, 0, 0, 0, d }, -- 1 0001
- { d, 0, 0, d }, -- 2 0002
- { 1, d, 1, 0, d, 0 }, -- 3 0010
- { 1, d, 1, 0, 0, 0, 0, d }, -- 4 0011
- { 1, d, 1, 0, d, 0, 0, d }, -- 5 0012
- { 1, d, d, 0 }, -- 6 0020
- { 1, d, d, 0, 0, 0, 0, d }, -- 7 0021
- { 1, d, 0, d }, -- 8 0022
- { d, 1, 1, 1, 1, d }, -- 9 0100
- false, -- 10 0101
- false, -- 11 0102
- { d, 1, 1, 1, 1, 0, d, 0 }, -- 12 0110
- { d, 1, 1, 1, 1, 0, 0, 0, 0, d }, -- 13 0111
- { d, 1, 1, 1, 1, 0, d, 0, 0, d }, -- 14 0112
- { d, 1, 1, 1, 1, d, d, 0 }, -- 15 0120
- { d, 1, 1, 1, 1, d, d, 0, 0, 0, 0, d }, -- 16 0121
- { d, 1, 1, 1, 1, d, 0, d }, -- 17 0122
- { d, 1, 1, d }, -- 18 0200
- false, -- 19 0201
- false, -- 20 0202
- { d, 1, 1, d, 1, 0, d, 0 }, -- 21 0210
- { d, 1, 1, d, 1, 0, 0, 0, 0, d }, -- 22 0211
- false, -- 23 0212
- { d, 1, d, 0 }, -- 24 0220
- { d, 1, d, 0, 0, 0, 0, d }, -- 25 0221
- { d, 1, 0, d }, -- 26 0222
- { 0, 1, d, 1, 0, d }, -- 27 1000
- { 0, 1, d, 1, d, 0, 0, 0 }, -- 28 1001
- { 0, 1, d, 1, d, 0, 0, d }, -- 29 1002
- false, -- 30 1010
- { 0, 1, d, 1, 1, d, 1, 0, 0, 0 }, -- 31 1011
- { 0, 1, d, 1, 1, d, 1, 0, d, 0, 0, d }, -- 32 1012
- false, -- 33 1020
- { 0, 1, d, 1, 1, d, d, 0, 0, 0 }, -- 34 1021
- { 0, 1, d, 1, 1, d, 0, d }, -- 35 1022
- { 0, 1, 1, 1, 1, d, 0, d }, -- 36 1100
- { 0, 1, 1, 1, 1, d, d, 0, 0, 0 }, -- 37 1101
- { 0, 1, 1, 1, 1, d, d, 0, 0, d }, -- 38 1102
- { 0, 1, 1, 1, 1, 0, d, 0, 0, d }, -- 39 1110
- { 0, 1, 1, 1, 1, 0, 0, 0 }, -- 40 1111
- { 0, 1, 1, 1, 1, 0, d, 0, 0, d }, -- 41 1112
- { 0, 1, 1, 1, 1, d, d, 0, 0, d }, -- 42 1120
- { 0, 1, 1, 1, 1, d, d, 0, 0, 0 }, -- 43 1121
- { 0, 1, 1, 1, 1, d, 0, d }, -- 44 1122
- { 0, 1, d, 1, 1, d, 0, d }, -- 45 1200
- { 0, 1, d, 1, 1, d, d, 0, 0, 0 }, -- 46 1201
- false, -- 47 1202
- { 0, 1, d, 1, 1, d, 1, 0, d, 0, 0, d }, -- 48 1210
- { 0, 1, d, 1, 1, d, 1, 0, 0, 0 }, -- 49 1211
- false, -- 50 1212
- { 0, 1, d, 1, d, 0, 0, d }, -- 51 1220
- { 0, 1, d, 1, d, 0, 0, 0 }, -- 52 1221
- { 0, 1, d, 1, 0, d }, -- 53 1222
- { d, 1, 0, d }, -- 54 2000
- { d, 1, d, 0, 0, 0, 0, d }, -- 55 2001
- { d, 1, d, 0 }, -- 56 2002
- false, -- 57 2010
- { d, 1, 1, d, 1, 0, 0, 0, 0, d }, -- 58 2011
- { d, 1, 1, d, 1, 0, d, 0 }, -- 59 2012
- false, -- 60 2020
- false, -- 61 2021
- { d, 1, 1, d }, -- 62 2022
- { d, 1, 1, 1, 1, d, 0, d }, -- 63 2100
- { d, 1, 1, 1, 1, d, d, 0, 0, 0, 0, d }, -- 64 2101
- { d, 1, 1, 1, 1, d, d, 0 }, -- 65 2102
- { d, 1, 1, 1, 1, 0, d, 0, 0, d }, -- 66 2110
- { d, 1, 1, 1, 1, 0, 0, 0, 0, d }, -- 67 2111
- { d, 1, 1, 1, 1, 0, d, 0 }, -- 68 2112
- false, -- 69 2120
- false, -- 70 2121
- { d, 1, 1, 1, 1, d }, -- 71 2122
- { 1, d, 0, d }, -- 72 2200
- { 1, d, d, 0, 0, 0, 0, d }, -- 73 2201
- { 1, d, d, 0 }, -- 74 2202
- { 1, d, 1, 0, d, 0, 0, d }, -- 75 2210
- { 1, d, 1, 0, 0, 0, 0, d }, -- 76 2211
- { 1, d, 1, 0, d, 0 }, -- 77 2212
- { d, 0, 0, d }, -- 78 2220
- { 0, d, 0, 0, d, 0 }, -- 79 2221
-}
-
-local sadles = {
- false, false, false, false, false, false, false, false, false,
- { { d, 1, 1, 1, 1, d }, { d, 0, 0, 0, 0, d }, { d, 1, 1, 1, 1, d, d, 0, 0, 0, 0, d }, false, false, false }, -- 10 0101
- { { d, 1, 1, 1, 1, d }, { d, 0, 0, d }, { d, 1, 1, 1, 1, d, d, 0, 0, d }, false, false, false }, -- 11 0102
- false, false, false, false, false, false, false,
- { { d, 1, 1, d }, { d, 0, 0, 0, 0, d }, { d, 1, 1, d, d, 0, 0, 0, 0, d }, false, false, false }, -- 19 0201
- { { d, 1, 1, d }, { d, 0, 0, d }, { d, 1, 1, d, d, 0, 0, d }, false, { d, 1, 0, d }, { 1, d, d, 0 } }, -- 20 0202
- false, false,
- { false, false, { d, 1, 1, d, 1, 0, d, 0, 0, d }, false, { d, 1, 0,d, }, { 1, d, 1, 0,d, 0 } }, -- 23 0212
- false, false, false, false, false, false,
- { { 0, 1, d, 1, 0, d }, { 1, d, 1, 0, d, 0 }, { 0, 1, d, 1, 1, d, 1, 0, d, 0, 0, d }, false, false, false }, -- 30 1010
- false, false,
- { { 1, 0, d, 0, 0, d, }, { 1, d, d, 0 }, { 0, 1, d, 1, 1, d, d, 0, 0, d }, false, false, false }, -- 33 1020
- false, false, false, false, false, false, false, false, false, false, false, false, false,
- { false, false, { 0,1, d, 1, 1, d, d, 0, 0, d }, false, { 0,1, d, 1, 0, d }, {1, d, d, 0 } }, -- 47 1202
- false, false,
- { false, false, { 0, 1, d, 1, 1, d, 1, 0, d, 0, 0, d }, false, { 0, 1, d, 1, 0, d }, { 1, d, 1, 0, d, 0 } }, -- 50 1212
- false, false, false, false, false, false,
- { { d, 1, 0, d }, { 1, d, 1, 0, 0, d }, { d, 1, 1, d, 1, 0, d, 0, 0, d }, false, false, false }, -- 57 2010
- false, false,
- { { d, 1, 0,d }, { 1, d, d, 0 }, { d, 1, 1, d, d, 0, 0, d }, false, { d, 1, 1, d }, { d, 0, 0, d } }, -- 60 2020
- { false, false, { d, 1, 1, d, d, 0, 0, 0, 0, d }, false, { d, 1, 1, d }, { d, 0, 0, 0, 0, d } }, -- 61 2021
- false, false, false, false, false, false, false,
- { false, false, { d, 1, 1, 1, 1, d, d, 0, 0, d }, false, { d, 1, 1, 1, 1, d }, { d, 0,0,d } }, -- 69 2120
- { false, false, { d, 1, 1, 1, 1, d, d, 0, 0, 0, 0, d }, false, { d, 1, 1, 1, 1, d }, { d, 0, 0, 0, 0, d } }, -- 70 2121
-}
-
-local function whatever(data,nx,ny,threshold,background)
-
- if background then
-
- local llx = 1/2
- local lly = llx
- local urx = ny + llx
- local ury = nx + lly
-
- return { { llx, lly, urx, 0, urx, ury, 0, ury } }
-
- else
-
- local bands = { }
- local b = 0
-
- local function band(s,n,x,y) -- simple. no closure so fast
- if n == 6 then
- return {
- x - s[ 2], y + s[ 1], x - s[ 4], y + s[ 3], x - s[ 6], y + s[ 5],
- }
- elseif n == 8 then
- return {
- x - s[ 2], y + s[ 1], x - s[ 4], y + s[ 3], x - s[ 6], y + s[ 5],
- x - s[ 8], y + s[ 7],
- }
- elseif n == 10 then
- return {
- x - s[ 2], y + s[ 1], x - s[ 4], y + s[ 3], x - s[ 6], y + s[ 5],
- x - s[ 8], y + s[ 7], x - s[10], y + s[ 9],
- }
- elseif n == 4 then
- return {
- x - s[ 2], y + s[ 1], x - s[ 4], y + s[ 3],
- }
- else -- 12
- return {
- x - s[ 2], y + s[ 1], x - s[ 4], y + s[ 3], x - s[ 6], y + s[ 5],
- x - s[ 8], y + s[ 7], x - s[10], y + s[ 9], x - s[12], y + s[11],
- }
- end
- end
-
- local pp = { }
-
- local d0 = data[1]
- for j=1,ny-1 do
- local d1 = data[j+1]
- local k = j + 1
- local p = false
- for i=1,nx-1 do
- local v = 0
- local l = i + 1
- local c1 = d0[i]
- if c1 == threshold then
- v = v + 27
- elseif c1 > threshold then
- v = v + 54
- end
- local c2 = d0[l]
- if c2 == threshold then
- v = v + 9
- elseif c2 > threshold then
- v = v + 18
- end
- local c3 = d1[l]
- if c3 == threshold then
- v = v + 3
- elseif c3 > threshold then
- v = v + 6
- end
- local c4 = d1[i]
- if c4 == threshold then
- v = v + 1
- elseif c4 > threshold then
- v = v + 2
- end
- if v > 0 and v < 80 then
- if v == 40 then
- -- a little optimization: full areas appended horizontally
- if p then
- p[4] = l -- i + 1
- p[6] = l -- i + 1
- else
- -- x-0 y+1 x-1 y+1 x-1 y+0 x-0 y+0
- p = { j, i, j, l, k, l, k, i }
- b = b + 1 ; bands[b] = p
- end
- else
- local s = singles[v]
- if s then
- b = b + 1 ; bands[b] = band(s,#s,k,i)
- else
- local s = sadles[v]
- if s then
- local m = (c1 + c2 + c3 + c4) / 4
- if m < threshold then
- local s1 = s[1] if s1 then b = b + 1 ; bands[b] = band(s1,#s1,i,j) end
- local s2 = s[2] if s2 then b = b + 1 ; bands[b] = band(s2,#s2,i,j) end
- elseif m == threshold then
- local s3 = s[3] if s3 then b = b + 1 ; bands[b] = band(s3,#s3,i,j) end
- local s4 = s[4] if s4 then b = b + 1 ; bands[b] = band(s4,#s4,i,j) end
- else
- local s5 = s[5] if s5 then b = b + 1 ; bands[b] = band(s5,#s5,i,j) end
- local s6 = s[6] if s6 then b = b + 1 ; bands[b] = band(s6,#s6,i,j) end
- end
- end
- end
- p = false
- end
- else
- p = false
- end
- end
- d0 = d1
- end
- return bands
- end
-end
-
-function mp.lmt_contours_edge_set_by_band(value)
- local p = getparameterset()
- local result = p.result
-
- if result.cached then return end
-
- local values = result.values
- local nofvalues = result.nofvalues
- local data = result.data
- local nx = result.nx
- local ny = result.ny
- local bands = { }
- result.bands = bands
- for value=1,nofvalues do
- bands[value] = whatever(data,ny,nx,value,value == 1)
- end
-end
-
-function mp.lmt_contours_edge_get_band(value)
- mpfill(getparameterset().result.bands[value],true)
- mpflush()
-end
-
--- Because we share some code surface plots also end up here. When working on the
--- contour macros by concidence I ran into a 3D plot in
---
--- https://staff.science.uva.nl/a.j.p.heck/Courses/mptut.pdf
---
--- The code is pure MetaPost and works quite well. With a bit of optimization
--- performance is also ok, but in the end a Lua solution is twice as fast and also
--- permits some more tweaking at no cost. So, below is an adaptation of an example
--- in the mentioned link. It's one of these cases where access to pseudo arrays
--- is slowing down MP.
-
-local sqrt, sin, cos = math.sqrt, math.sin, math.cos
-
-local f_fill_rgb = formatters["F (%.6N,%.6N)--(%.6N,%.6N)--(%.6N,%.6N)--(%.6N,%.6N)--C withcolor (%.3N,%.3N,%.3N) ;"]
-local f_draw_rgb = formatters["D (%.6N,%.6N)--(%.6N,%.6N)--(%.6N,%.6N)--(%.6N,%.6N)--C withcolor %.3F ;"]
-local f_mesh_rgb = formatters["U (%.6N,%.6N)--(%.6N,%.6N)--(%.6N,%.6N)--(%.6N,%.6N)--C withcolor (%.3N,%.3N,%.3N) ;"]
-local f_fill_cmy = formatters["F (%.6N,%.6N)--(%.6N,%.6N)--(%.6N,%.6N)--(%.6N,%.6N)--C withcolor (%.3N,%.3N,%.3N,0) ;"]
-local f_draw_cmy = formatters["D (%.6N,%.6N)--(%.6N,%.6N)--(%.6N,%.6N)--(%.6N,%.6N)--C withcolor %.3F ;"]
-local f_mesh_cmy = formatters["U (%.6N,%.6N)--(%.6N,%.6N)--(%.6N,%.6N)--(%.6N,%.6N)--C withcolor (%.3N,%.3N,%.3N,0) ;"]
-
-local f_function_n = formatters [ [[
- local math = math
- local round = math.round
- %s
- return function(x,y)
- return %s
- end
-]] ]
-
-local f_function_y = formatters [ [[
- local math = math
- local round = math.round
- local nan = NaN
- local inf = math.huge
- local er = 0
- %s
- return function(x,y,dnan,dinf,report)
- local n = %s
- if n == nan then
- er = er + 1
- if er < 10 then
- report("nan at (%s,%s)",x,y)
- end
- n = dnan
- elseif n == inf then
- er = er + 1
- if er < 10 then
- report("inf at (%s,%s)",x,y)
- end
- n = dinf
- end
- dx[my] = n
- sy = sy + 1
- end
- return n, er
-end
-]] ]
-
-local f_color = formatters [ [[
- local math = math
- return function(f)
- return %s
- end
-]] ]
-
-function mp.lmt_surface_do(specification)
- --
- -- The projection and color brightness calculation have been inlined. We also store
- -- differently.
- --
- -- todo: ignore weird paths
- --
- -- The prototype is now converted to use lmt parameter sets.
- --
- local p = getparameterset("surface")
- --
- local preamble = p.preamble or ""
- local code = p.code or "return x + y"
- local colorcode = p.color or "return f, f, f"
- local linecolor = p.linecolor or 1
- local xmin = p.xmin or -1
- local xmax = p.xmax or 1
- local ymin = p.ymin or -1
- local ymax = p.ymax or 1
- local xstep = p.xstep or .1
- local ystep = p.ystep or .1
- local bf = p.brightness or 100
- local clip = p.clip or false
- local lines = p.lines
- local ha = p.snap or 0.01
- local hb = 2 * ha
- --
- if lines == nil then lines = true end
- --
- if xstep == 0 then xstep = (xmax - xmin)/100 end
- if ystep == 0 then ystep = (ymax - ymin)/100 end
-
- local nxmin = round(xmin/xstep)
- local nxmax = round(xmax/xstep)
- local nymin = round(ymin/ystep)
- local nymax = round(ymax/ystep)
- local nx = nxmax - nxmin + 1
- local ny = nymax - nymin + 1
- --
- local xvector = p.xvector or { -0.7, -0.7 }
- local yvector = p.yvector or { 1, 0 }
- local zvector = p.zvector or { 0, 1 }
- local light = p.light or { 3, 3, 10 }
- --
- local xrx, xry = xvector[1], xvector[2]
- local yrx, yry = yvector[1], yvector[2]
- local zrx, zry = zvector[1], zvector[2]
- local xp, yp, zp = light[1], light[2], light[3]
- --
- local data = setmetatableindex("table")
- local dx = (xmax - xmin) / nx
- local dy = (ymax - ymin) / ny
- local xt = xmin
- --
- local minf, maxf
- --
- -- similar as contours but no data loop here
- --
- local fcode = load((p.check and f_function_y or f_function_n)(preamble,code))
- local func = type(fcode) == "function" and fcode()
- if type(func) ~= "function" then
- return false -- fatal error
- end
- --
- local ccode = load(f_color(colorcode))
- local color = type(ccode) == "function" and ccode()
- if type(color) ~= "function" then
- return false -- fatal error
- end
- --
- for i=0,nx do
- local yt = ymin
- for j=0,ny do
- local zt = func(xt,yt)
- -- projection from 3D to 2D coordinates
- local x = xt * xrx + yt * yrx + zt * zrx
- local y = xt * xry + yt * yry + zt * zry
- local z = zt
- -- numerical derivatives by central differences
- local dfx = (func(xt+ha,yt) - func(xt-ha,yt)) / hb
- local dfy = (func(xt,yt+ha) - func(xt,yt-ha)) / hb
- -- compute brightness factor at a point
- local ztp = zt - zp
- local ytp = yt - yp
- local xtp = xt - xp
- local ztp = zt - zp
- local ytp = yt - yp
- local xtp = xt - xp
- local ca = -ztp + dfy*ytp + dfx*xtp
- local cb = sqrt(1+dfx*dfx+dfy*dfy)
- local cc = sqrt(ztp*ztp + ytp*ytp + xtp*xtp)
- local fac = bf*ca/(cb*cc*cc*cc)
- -- addition: check range
- if not minf then
- minf = fac
- maxf = fac
- elseif fac < minf then
- minf = fac
- elseif fac > maxf then
- maxf = fac
- end
- --
- data[i][j] = { x, y, fac }
- --
- yt = yt + dy
- end
- xt = xt + dx
- end
- local result = { }
- local r = 0
- local range = maxf - minf
- local cl = linecolor or 1
- local enforce = attributes.colors.model == "cmyk"
- for i=0,nx-1 do
- for j=0,ny-1 do
- -- points
- local z1 = data[i] [j]
- local z2 = data[i] [j+1]
- local z3 = data[i+1][j+1]
- local z4 = data[i+1][j]
- -- color
- local cf = z1[3]
- if clip then
- -- best clip here if needed
- if cf < 0 then
- cf = 0
- elseif cf > 1 then
- cf = 1
- end
- else
- -- or remap when we want to
- cf = (z1[3] - minf) / range
- end
- local z11 = z1[1]
- local z12 = z1[2]
- local z21 = z2[1]
- local z22 = z2[2]
- local z31 = z3[1]
- local z32 = z3[2]
- local z41 = z4[1]
- local z42 = z4[2]
- -- if lines then
- -- -- fill first and draw then, previous shapes can be covered
- -- else
- -- -- fill and draw in one go to prevent artifacts
- -- end
- local cr, cg, cb = color(cf)
- if not cr then cr = 0 end
- if not cg then cg = 0 end
- if not cb then cb = 0 end
- if enforce then
- cr, cg, cb = 1 - cr, 1 - cg, 1 - cb
- r = r + 1
- if lines then
- result[r] = f_fill_cmy(z11,z12,z21,z22,z31,z32,z41,z42,cr,cg,cb)
- r = r + 1
- result[r] = f_draw_cmy(z11,z12,z21,z22,z31,z32,z41,z42,cl)
- else
- result[r] = f_mesh_cmy(z11,z12,z21,z22,z31,z32,z41,z42,cr,cg,cb)
- end
- else
- r = r + 1
- if lines then
- result[r] = f_fill_rgb(z11,z12,z21,z22,z31,z32,z41,z42,cr,cg,cb)
- r = r + 1
- result[r] = f_draw_rgb(z11,z12,z21,z22,z31,z32,z41,z42,cl)
- else
- result[r] = f_mesh_rgb(z11,z12,z21,z22,z31,z32,z41,z42,cr,cg,cb)
- end
- end
- end
- end
- mp.direct(concat(result))
-end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mlib-ctx.lua b/Master/texmf-dist/tex/context/base/mkiv/mlib-ctx.lua
index c913408cd05..24b02f6f6a6 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mlib-ctx.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/mlib-ctx.lua
@@ -266,10 +266,10 @@ function metapost.getclippath(specification) -- why not a special instance for t
result = metapost.filterclippath(result)
end
stoptiming(metapost)
- metapost.pushformat()
+ metapost.popformat()
return result
else
- metapost.pushformat()
+ metapost.popformat()
end
end
@@ -335,12 +335,13 @@ statistics.register("metapost", function()
if n and n > 0 then
local elapsedtime = statistics.elapsedtime
local elapsed = statistics.elapsed
+ local runs, stats = metapost.nofscriptruns()
local instances,
memory = metapost.getstatistics(true)
- return format("%s seconds, loading: %s, execution: %s, n: %s, average: %s, instances: %i, luacalls: %i, memory: %0.3f M",
+ return format("%s seconds, loading: %s, execution: %s, n: %s, average: %s, instances: %i, luacalls: %s, memory: %0.3f M",
elapsedtime(metapost), elapsedtime(mplib), elapsedtime(metapost.exectime), n,
elapsedtime((elapsed(metapost) + elapsed(mplib) + elapsed(metapost.exectime)) / n),
- instances, metapost.nofscriptruns(),memory/(1024*1024))
+ instances, stats and stats or runs, memory/(1024*1024))
else
return nil
end
@@ -400,3 +401,31 @@ implement {
name = "mptexreset",
actions = mptex.reset
}
+
+-- moved from mlib-lua:
+
+mp = mp or { -- system namespace
+ set = { },
+ get = { },
+ aux = { },
+ scan = { },
+ skip = { },
+ inject = { },
+}
+
+MP = MP or { } -- user namespace
+
+-- We had this:
+--
+-- table.setmetatablecall(mp,function(t,k) mpprint(k) end)
+--
+-- but the next one is more interesting because we cannot use calls like:
+--
+-- lua.mp.somedefdname("foo")
+--
+-- which is due to expansion of somedefdname during suffix creation. So:
+--
+-- lua.mp("somedefdname","foo")
+
+table.setmetatablecall(mp,function(t,k,...) return t[k](...) end)
+table.setmetatablecall(MP,function(t,k,...) return t[k](...) end)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mlib-ctx.mkiv b/Master/texmf-dist/tex/context/base/mkiv/mlib-ctx.mkiv
index a1ed7efeb8c..7fb567746d0 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mlib-ctx.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/mlib-ctx.mkiv
@@ -13,14 +13,13 @@
\writestatus{loading}{MetaPost Library Graphics / Initializations}
+\registerctxluafile{mlib-fio}{}
\registerctxluafile{mlib-run}{}
\registerctxluafile{mlib-ctx}{}
-\registerctxluafile{mlib-lua}{}
-\registerctxluafile{mlib-lmp}{}
-\registerctxluafile{mlib-int}{}
-
-\doifelsefileexists{mlib-cnt.lua}{\registerctxluafile{mlib-cnt}{optimize}}{}
-\doifelsefileexists{mlib-svg.lua}{\registerctxluafile{mlib-svg}{optimize}}{}
+\registerctxluafile{mlib-lua}{autosuffix}
+\registerctxluafile{mlib-mpf}{}
+\registerctxluafile{mlib-lmp}{autosuffix}
+\registerctxluafile{mlib-int}{autosuffix}
\unprotect
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mlib-ctx.mkxl b/Master/texmf-dist/tex/context/base/mkiv/mlib-ctx.mkxl
deleted file mode 100644
index bb246062710..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/mlib-ctx.mkxl
+++ /dev/null
@@ -1,31 +0,0 @@
-%D \module
-%D [ file=mlib-ctx,
-%D version=2008.03.25,
-%D title=\METAPOST\ Integrated Graphics,
-%D subtitle=Basics,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{MetaPost Library Graphics / Initializations}
-
-\registerctxluafile{mlib-run}{}
-\registerctxluafile{mlib-ctx}{}
-\registerctxluafile{mlib-lua}{}
-\registerctxluafile{mlib-scn}{}
-\registerctxluafile{mlib-mat}{}
-\registerctxluafile{mlib-lmp}{}
-\registerctxluafile{mlib-int}{}
-\registerctxluafile{mlib-lmt}{}
-
-\doifelsefileexists{mlib-cnt.lua}{\registerctxluafile{mlib-cnt}{}}{}
-\doifelsefileexists{mlib-svg.lua}{\registerctxluafile{mlib-svg}{}}{}
-
-\unprotect
-
-\protect \endinput
-
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mlib-fio.lua b/Master/texmf-dist/tex/context/base/mkiv/mlib-fio.lua
new file mode 100644
index 00000000000..51c88eb2237
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkiv/mlib-fio.lua
@@ -0,0 +1,85 @@
+if not modules then modules = { } end modules ['mlib-run'] = {
+ version = 1.001,
+ comment = "companion to mlib-ctx.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files",
+}
+
+local concat = table.concat
+local mplib = mplib
+
+local report_logger = logs.reporter("metapost log")
+local report_error = logs.reporter("metapost error")
+
+local l, nl, dl = { }, 0, false
+local t, nt, dt = { }, 0, false
+local e, ne, de = { }, 0, false
+
+mplib.realtimelogging = false
+
+local function logger(target,str)
+ if target == 1 then
+ -- log
+ elseif target == 2 or target == 3 then
+ -- term
+ if str == "\n" then
+ mplib.realtimelogging = true
+ if nl > 0 then
+ report_logger(concat(l,"",1,nl))
+ nl, dl = 0, false
+ elseif not dl then
+ report_logger("")
+ dl = true
+ end
+ else
+ nl = nl + 1
+ l[nl] = str
+ end
+ elseif target == 4 then
+ report_error(str)
+ end
+end
+
+local finders = { }
+mplib.finders = finders -- also used in meta-lua.lua
+
+local new_instance = mplib.new
+
+local function validftype(ftype)
+ if ftype == "mp" then
+ return "mp"
+ else
+ return nil
+ end
+end
+
+finders.file = function(specification,name,mode,ftype)
+ return resolvers.findfile(name,validftype(ftype))
+end
+
+local function i_finder(name,mode,ftype) -- fake message for mpost.map and metafun.mpvi
+ local specification = url.hashed(name)
+ local finder = finders[specification.scheme] or finders.file
+ local found = finder(specification,name,mode,validftype(ftype))
+ return found
+end
+
+local function o_finder(name,mode,ftype)
+ return name
+end
+
+o_finder = sandbox.register(o_finder,sandbox.filehandlerone,"mplib output finder")
+
+local function finder(name,mode,ftype)
+ return (mode == "w" and o_finder or i_finder)(name,mode,validftype(ftype))
+end
+
+function mplib.new(specification)
+ specification.find_file = finder
+ specification.run_logger = logger
+ return new_instance(specification)
+end
+
+mplib.finder = finder
+
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mlib-int.lua b/Master/texmf-dist/tex/context/base/mkiv/mlib-int.lua
index 6fca9530236..2f5f539e9ec 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mlib-int.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/mlib-int.lua
@@ -20,8 +20,6 @@ local mpcolor = attributes.colors.mpcolor
local emwidths = fonts.hashes.emwidths
local exheights = fonts.hashes.exheights
-local mpgetdimen = mp.getdimen
-
local registerscript = metapost.registerscript
local on_right_page = structures.pages.on_right
@@ -34,233 +32,123 @@ local function defaultcolormodel() -- can be helper
return (colormethod == 0 or colormethod == 1) and 1 or 3
end
-if CONTEXTLMTXMODE > 0 then
-
- local t = os.date("*t") -- maybe this should be a very early on global
-
- registerscript("year", function() return t.year end)
- registerscript("month", function() return t.month end)
- registerscript("day", function() return t.day end)
- registerscript("hour", function() return t.hour end)
- registerscript("minute", function() return t.min end)
- registerscript("second", function() return t.sec end)
-
- registerscript("PaperHeight", function() return getdimen("paperheight") * factor end)
- registerscript("PaperWidth", function() return getdimen("paperwidth") * factor end)
- registerscript("PrintPaperHeight", function() return getdimen("printpaperheight") * factor end)
- registerscript("PrintPaperWidth", function() return getdimen("printpaperwidth") * factor end)
- registerscript("TopSpace", function() return getdimen("topspace") * factor end)
- registerscript("BottomSpace", function() return getdimen("bottomspace") * factor end)
- registerscript("BackSpace", function() return getdimen("backspace") * factor end)
- registerscript("CutSpace", function() return getdimen("cutspace") * factor end)
- registerscript("MakeupHeight", function() return getdimen("makeupheight") * factor end)
- registerscript("MakeupWidth", function() return getdimen("makeupwidth") * factor end)
- registerscript("TopHeight", function() return getdimen("topheight") * factor end)
- registerscript("TopDistance", function() return getdimen("topdistance") * factor end)
- registerscript("HeaderHeight", function() return getdimen("headerheight") * factor end)
- registerscript("HeaderDistance", function() return getdimen("headerdistance") * factor end)
- registerscript("TextHeight", function() return getdimen("textheight") * factor end)
- registerscript("FooterDistance", function() return getdimen("footerdistance") * factor end)
- registerscript("FooterHeight", function() return getdimen("footerheight") * factor end)
- registerscript("BottomDistance", function() return getdimen("bottomdistance") * factor end)
- registerscript("BottomHeight", function() return getdimen("bottomheight") * factor end)
- registerscript("LeftEdgeWidth", function() return getdimen("leftedgewidth") * factor end)
- registerscript("LeftEdgeDistance", function() return getdimen("leftedgedistance") * factor end)
- registerscript("LeftMarginWidth", function() return getdimen("leftmarginwidth") * factor end)
- registerscript("LeftMarginDistance", function() return getdimen("leftmargindistance") * factor end)
- registerscript("TextWidth", function() return getdimen("textwidth") * factor end)
- registerscript("RightMarginDistance", function() return getdimen("rightmargindistance") * factor end)
- registerscript("RightMarginWidth", function() return getdimen("rightmarginwidth") * factor end)
- registerscript("RightEdgeDistance", function() return getdimen("rightedgedistance") * factor end)
- registerscript("RightEdgeWidth", function() return getdimen("rightedgewidth") * factor end)
- registerscript("InnerMarginDistance", function() return getdimen("innermargindistance") * factor end)
- registerscript("InnerMarginWidth", function() return getdimen("innermarginwidth") * factor end)
- registerscript("OuterMarginDistance", function() return getdimen("outermargindistance") * factor end)
- registerscript("OuterMarginWidth", function() return getdimen("outermarginwidth") * factor end)
- registerscript("InnerEdgeDistance", function() return getdimen("inneredgedistance") * factor end)
- registerscript("InnerEdgeWidth", function() return getdimen("inneredgewidth") * factor end)
- registerscript("OuterEdgeDistance", function() return getdimen("outeredgedistance") * factor end)
- registerscript("OuterEdgeWidth", function() return getdimen("outeredgewidth") * factor end)
- registerscript("PageOffset", function() return getdimen("pagebackgroundoffset") * factor end)
- registerscript("PageDepth", function() return getdimen("pagebackgrounddepth") * factor end)
- registerscript("LayoutColumns", function() return getcount("layoutcolumns") end)
- registerscript("LayoutColumnDistance", function() return getdimen("layoutcolumndistance") * factor end)
- registerscript("LayoutColumnWidth", function() return getdimen("layoutcolumnwidth") * factor end)
- registerscript("SpineWidth", function() return getdimen("spinewidth") * factor end)
- registerscript("PaperBleed", function() return getdimen("paperbleed") * factor end)
-
- registerscript("RealPageNumber", function() return getcount("realpageno") end)
- registerscript("LastPageNumber", function() return getcount("lastpageno") end)
-
- registerscript("PageNumber", function() return getcount("pageno") end)
- registerscript("NOfPages", function() return getcount("lastpageno") end)
-
- registerscript("SubPageNumber", function() return getcount("subpageno") end)
- registerscript("NOfSubPages", function() return getcount("lastsubpageno") end)
-
- registerscript("CurrentColumn", function() return getcount("mofcolumns") end)
- registerscript("NOfColumns", function() return getcount("nofcolumns") end)
-
- registerscript("BaseLineSkip", function() return get ("baselineskip",true) * factor end)
- registerscript("LineHeight", function() return getdimen("lineheight") * factor end)
- registerscript("BodyFontSize", function() return getdimen("bodyfontsize") * factor end)
-
- registerscript("TopSkip", function() return get ("topskip",true) * factor end)
- registerscript("StrutHeight", function() return getdimen("strutht") * factor end)
- registerscript("StrutDepth", function() return getdimen("strutdp") * factor end)
-
- registerscript("PageNumber", function() return getcount("pageno") end)
- registerscript("RealPageNumber", function() return getcount("realpageno") end)
- registerscript("NOfPages", function() return getcount("lastpageno") end)
-
- registerscript("CurrentWidth", function() return get ("hsize") * factor end)
- registerscript("CurrentHeight", function() return get ("vsize") * factor end)
-
- registerscript("EmWidth", function() return emwidths [false] * factor end)
- registerscript("ExHeight", function() return exheights[false] * factor end)
-
- registerscript("HSize", function() return get ("hsize") * factor end)
- registerscript("VSize", function() return get ("vsize") * factor end)
- registerscript("LastPageNumber", function() return getcount("lastpageno") end)
-
- registerscript("OverlayWidth", function() return getdimen("d_overlay_width") * factor end)
- registerscript("OverlayHeight", function() return getdimen("d_overlay_height") * factor end)
- registerscript("OverlayDepth", function() return getdimen("d_overlay_depth") * factor end)
- registerscript("OverlayLineWidth", function() return getdimen("d_overlay_linewidth") * factor end)
- registerscript("OverlayOffset", function() return getdimen("d_overlay_offset") * factor end)
- registerscript("OverlayRegion", function() mpstring(getmacro("m_overlay_region")) end)
- -- ("CurrentLayout", function() mpstring(getmacro("currentlayout")) end)
-
- registerscript("PageFraction", page_fraction)
- registerscript("OnRightPage", on_right_page)
- registerscript("OnOddPage", is_odd_page )
- registerscript("InPageBody", in_body_page )
-
- registerscript("defaultcolormodel", defaultcolormodel)
-
-else
-
- function mp.PaperHeight () mpnumeric(getdimen("paperheight") * factor) end
- function mp.PaperWidth () mpnumeric(getdimen("paperwidth") * factor) end
- function mp.PrintPaperHeight () mpnumeric(getdimen("printpaperheight") * factor) end
- function mp.PrintPaperWidth () mpnumeric(getdimen("printpaperwidth") * factor) end
- function mp.TopSpace () mpnumeric(getdimen("topspace") * factor) end
- function mp.BottomSpace () mpnumeric(getdimen("bottomspace") * factor) end
- function mp.BackSpace () mpnumeric(getdimen("backspace") * factor) end
- function mp.CutSpace () mpnumeric(getdimen("cutspace") * factor) end
- function mp.MakeupHeight () mpnumeric(getdimen("makeupheight") * factor) end
- function mp.MakeupWidth () mpnumeric(getdimen("makeupwidth") * factor) end
- function mp.TopHeight () mpnumeric(getdimen("topheight") * factor) end
- function mp.TopDistance () mpnumeric(getdimen("topdistance") * factor) end
- function mp.HeaderHeight () mpnumeric(getdimen("headerheight") * factor) end
- function mp.HeaderDistance () mpnumeric(getdimen("headerdistance") * factor) end
- function mp.TextHeight () mpnumeric(getdimen("textheight") * factor) end
- function mp.FooterDistance () mpnumeric(getdimen("footerdistance") * factor) end
- function mp.FooterHeight () mpnumeric(getdimen("footerheight") * factor) end
- function mp.BottomDistance () mpnumeric(getdimen("bottomdistance") * factor) end
- function mp.BottomHeight () mpnumeric(getdimen("bottomheight") * factor) end
- function mp.LeftEdgeWidth () mpnumeric(getdimen("leftedgewidth") * factor) end
- function mp.LeftEdgeDistance () mpnumeric(getdimen("leftedgedistance") * factor) end
- function mp.LeftMarginWidth () mpnumeric(getdimen("leftmarginwidth") * factor) end
- function mp.LeftMarginDistance () mpnumeric(getdimen("leftmargindistance") * factor) end
- function mp.TextWidth () mpnumeric(getdimen("textwidth") * factor) end
- function mp.RightMarginDistance () mpnumeric(getdimen("rightmargindistance") * factor) end
- function mp.RightMarginWidth () mpnumeric(getdimen("rightmarginwidth") * factor) end
- function mp.RightEdgeDistance () mpnumeric(getdimen("rightedgedistance") * factor) end
- function mp.RightEdgeWidth () mpnumeric(getdimen("rightedgewidth") * factor) end
- function mp.InnerMarginDistance () mpnumeric(getdimen("innermargindistance") * factor) end
- function mp.InnerMarginWidth () mpnumeric(getdimen("innermarginwidth") * factor) end
- function mp.OuterMarginDistance () mpnumeric(getdimen("outermargindistance") * factor) end
- function mp.OuterMarginWidth () mpnumeric(getdimen("outermarginwidth") * factor) end
- function mp.InnerEdgeDistance () mpnumeric(getdimen("inneredgedistance") * factor) end
- function mp.InnerEdgeWidth () mpnumeric(getdimen("inneredgewidth") * factor) end
- function mp.OuterEdgeDistance () mpnumeric(getdimen("outeredgedistance") * factor) end
- function mp.OuterEdgeWidth () mpnumeric(getdimen("outeredgewidth") * factor) end
- function mp.PageOffset () mpnumeric(getdimen("pagebackgroundoffset") * factor) end
- function mp.PageDepth () mpnumeric(getdimen("pagebackgrounddepth") * factor) end
- function mp.LayoutColumns () mpnumeric(getcount("layoutcolumns")) end
- function mp.LayoutColumnDistance() mpnumeric(getdimen("layoutcolumndistance") * factor) end
- function mp.LayoutColumnWidth () mpnumeric(getdimen("layoutcolumnwidth") * factor) end
- function mp.SpineWidth () mpnumeric(getdimen("spinewidth") * factor) end
- function mp.PaperBleed () mpnumeric(getdimen("paperbleed") * factor) end
-
- function mp.RealPageNumber () mpnumeric(getcount("realpageno") ) end
- function mp.LastPageNumber () mpnumeric(getcount("lastpageno") ) end
-
- function mp.PageNumber () mpnumeric(getcount("pageno") ) end
- function mp.NOfPages () mpnumeric(getcount("lastpageno") ) end
-
- function mp.SubPageNumber () mpnumeric(getcount("subpageno") ) end
- function mp.NOfSubPages () mpnumeric(getcount("lastsubpageno") ) end
-
- function mp.CurrentColumn () mpnumeric(getcount("mofcolumns") ) end
- function mp.NOfColumns () mpnumeric(getcount("nofcolumns") ) end
-
- function mp.BaseLineSkip () mpnumeric(get ("baselineskip",true) * factor) end
- function mp.LineHeight () mpnumeric(getdimen("lineheight") * factor) end
- function mp.BodyFontSize () mpnumeric(getdimen("bodyfontsize") * factor) end
-
- function mp.TopSkip () mpnumeric(get ("topskip",true) * factor) end
- function mp.StrutHeight () mpnumeric(getdimen("strutht") * factor) end
- function mp.StrutDepth () mpnumeric(getdimen("strutdp") * factor) end
-
- function mp.PageNumber () mpnumeric(getcount("pageno") ) end
- function mp.RealPageNumber () mpnumeric(getcount("realpageno") ) end
- function mp.NOfPages () mpnumeric(getcount("lastpageno") ) end
-
- function mp.CurrentWidth () mpnumeric(get ("hsize") * factor) end
- function mp.CurrentHeight () mpnumeric(get ("vsize") * factor) end
-
- function mp.EmWidth () mpnumeric(emwidths [false] * factor) end
- function mp.ExHeight () mpnumeric(exheights[false] * factor) end
-
- function mp.OverlayWidth () mpnumeric(getdimen("d_overlay_width") * factor) end
- function mp.OverlayHeight () mpnumeric(getdimen("d_overlay_height") * factor) end
- function mp.OverlayDepth () mpnumeric(getdimen("d_overlay_depth") * factor) end
- function mp.OverlayLineWidth () mpnumeric(getdimen("d_overlay_linewidth") * factor) end
- function mp.OverlayOffset () mpnumeric(getdimen("d_overlay_offset") * factor) end
- function mp.OverlayRegion () mpstring (getmacro("m_overlay_region") ) end
-
- function mp.PageFraction () mpnumeric(page_fraction() ) end
- function mp.OnRightPage () mpboolean(on_right_page() ) end
- function mp.OnOddPage () mpboolean(is_odd_page () ) end
- function mp.InPageBody () mpboolean(in_body_page () ) end
-
- function mp.OverlayWidth () mpnumeric(getdimen("d_overlay_width") * factor) end
- function mp.OverlayHeight () mpnumeric(getdimen("d_overlay_height") * factor) end
- function mp.OverlayDepth () mpnumeric(getdimen("d_overlay_depth") * factor) end
- function mp.OverlayLineWidth () mpnumeric(getdimen("d_overlay_linewidth") * factor) end
- function mp.OverlayOffset () mpnumeric(getdimen("d_overlay_offset") * factor) end
- function mp.OverlayRegion () mpstring (getmacro("m_overlay_region") ) end
- -- mp.CurrentLayout () mpstring (getmacro("currentlayout")) end
-
- function mp.defaultcolormodel () mpnumeric(defaultcolormodel()) end
-
- mp.HSize = mp.CurrentWidth
- mp.VSize = mp.CurrentHeight
- mp.LastPageNumber = mp.NOfPages
-
- -- not much difference (10000 calls in a graphic neither as expansion seems to win
- -- over defining the macro etc) so let's not waste counters then
-
- -- function mp.OverlayColor()
- -- local c = mpcolor(
- -- getcount("c_overlay_colormodel"),
- -- getcount("c_overlay_color"),
- -- getcount("c_overlay_transparency")
- -- )
- -- mpquoted(c)
- -- end
- --
- -- function mp.OverlayLineColor()
- -- local c = mpcolor(
- -- getcount("c_overlay_colormodel"),
- -- getcount("c_overlay_linecolor"),
- -- getcount("c_overlay_linetransparency")
- -- )
- -- mpquoted(c)
- -- end
-
-end
-
-
+function mp.PaperHeight () mpnumeric(getdimen("paperheight") * factor) end
+function mp.PaperWidth () mpnumeric(getdimen("paperwidth") * factor) end
+function mp.PrintPaperHeight () mpnumeric(getdimen("printpaperheight") * factor) end
+function mp.PrintPaperWidth () mpnumeric(getdimen("printpaperwidth") * factor) end
+function mp.TopSpace () mpnumeric(getdimen("topspace") * factor) end
+function mp.BottomSpace () mpnumeric(getdimen("bottomspace") * factor) end
+function mp.BackSpace () mpnumeric(getdimen("backspace") * factor) end
+function mp.CutSpace () mpnumeric(getdimen("cutspace") * factor) end
+function mp.MakeupHeight () mpnumeric(getdimen("makeupheight") * factor) end
+function mp.MakeupWidth () mpnumeric(getdimen("makeupwidth") * factor) end
+function mp.TopHeight () mpnumeric(getdimen("topheight") * factor) end
+function mp.TopDistance () mpnumeric(getdimen("topdistance") * factor) end
+function mp.HeaderHeight () mpnumeric(getdimen("headerheight") * factor) end
+function mp.HeaderDistance () mpnumeric(getdimen("headerdistance") * factor) end
+function mp.TextHeight () mpnumeric(getdimen("textheight") * factor) end
+function mp.FooterDistance () mpnumeric(getdimen("footerdistance") * factor) end
+function mp.FooterHeight () mpnumeric(getdimen("footerheight") * factor) end
+function mp.BottomDistance () mpnumeric(getdimen("bottomdistance") * factor) end
+function mp.BottomHeight () mpnumeric(getdimen("bottomheight") * factor) end
+function mp.LeftEdgeWidth () mpnumeric(getdimen("leftedgewidth") * factor) end
+function mp.LeftEdgeDistance () mpnumeric(getdimen("leftedgedistance") * factor) end
+function mp.LeftMarginWidth () mpnumeric(getdimen("leftmarginwidth") * factor) end
+function mp.LeftMarginDistance () mpnumeric(getdimen("leftmargindistance") * factor) end
+function mp.TextWidth () mpnumeric(getdimen("textwidth") * factor) end
+function mp.RightMarginDistance () mpnumeric(getdimen("rightmargindistance") * factor) end
+function mp.RightMarginWidth () mpnumeric(getdimen("rightmarginwidth") * factor) end
+function mp.RightEdgeDistance () mpnumeric(getdimen("rightedgedistance") * factor) end
+function mp.RightEdgeWidth () mpnumeric(getdimen("rightedgewidth") * factor) end
+function mp.InnerMarginDistance () mpnumeric(getdimen("innermargindistance") * factor) end
+function mp.InnerMarginWidth () mpnumeric(getdimen("innermarginwidth") * factor) end
+function mp.OuterMarginDistance () mpnumeric(getdimen("outermargindistance") * factor) end
+function mp.OuterMarginWidth () mpnumeric(getdimen("outermarginwidth") * factor) end
+function mp.InnerEdgeDistance () mpnumeric(getdimen("inneredgedistance") * factor) end
+function mp.InnerEdgeWidth () mpnumeric(getdimen("inneredgewidth") * factor) end
+function mp.OuterEdgeDistance () mpnumeric(getdimen("outeredgedistance") * factor) end
+function mp.OuterEdgeWidth () mpnumeric(getdimen("outeredgewidth") * factor) end
+function mp.PageOffset () mpnumeric(getdimen("pagebackgroundoffset") * factor) end
+function mp.PageDepth () mpnumeric(getdimen("pagebackgrounddepth") * factor) end
+function mp.LayoutColumns () mpnumeric(getcount("layoutcolumns")) end
+function mp.LayoutColumnDistance() mpnumeric(getdimen("layoutcolumndistance") * factor) end
+function mp.LayoutColumnWidth () mpnumeric(getdimen("layoutcolumnwidth") * factor) end
+function mp.SpineWidth () mpnumeric(getdimen("spinewidth") * factor) end
+function mp.PaperBleed () mpnumeric(getdimen("paperbleed") * factor) end
+
+function mp.RealPageNumber () mpnumeric(getcount("realpageno") ) end
+function mp.LastPageNumber () mpnumeric(getcount("lastpageno") ) end
+
+function mp.PageNumber () mpnumeric(getcount("pageno") ) end
+function mp.NOfPages () mpnumeric(getcount("lastpageno") ) end
+
+function mp.SubPageNumber () mpnumeric(getcount("subpageno") ) end
+function mp.NOfSubPages () mpnumeric(getcount("lastsubpageno") ) end
+
+function mp.CurrentColumn () mpnumeric(getcount("mofcolumns") ) end
+function mp.NOfColumns () mpnumeric(getcount("nofcolumns") ) end
+
+function mp.BaseLineSkip () mpnumeric(get ("baselineskip",true) * factor) end
+function mp.LineHeight () mpnumeric(getdimen("lineheight") * factor) end
+function mp.BodyFontSize () mpnumeric(getdimen("bodyfontsize") * factor) end
+
+function mp.TopSkip () mpnumeric(get ("topskip",true) * factor) end
+function mp.StrutHeight () mpnumeric(getdimen("strutht") * factor) end
+function mp.StrutDepth () mpnumeric(getdimen("strutdp") * factor) end
+
+function mp.PageNumber () mpnumeric(getcount("pageno") ) end
+function mp.RealPageNumber () mpnumeric(getcount("realpageno") ) end
+function mp.NOfPages () mpnumeric(getcount("lastpageno") ) end
+
+function mp.CurrentWidth () mpnumeric(get ("hsize") * factor) end
+function mp.CurrentHeight () mpnumeric(get ("vsize") * factor) end
+
+function mp.EmWidth () mpnumeric(emwidths [false] * factor) end
+function mp.ExHeight () mpnumeric(exheights[false] * factor) end
+
+function mp.OverlayWidth () mpnumeric(getdimen("d_overlay_width") * factor) end
+function mp.OverlayHeight () mpnumeric(getdimen("d_overlay_height") * factor) end
+function mp.OverlayDepth () mpnumeric(getdimen("d_overlay_depth") * factor) end
+function mp.OverlayLineWidth () mpnumeric(getdimen("d_overlay_linewidth") * factor) end
+function mp.OverlayOffset () mpnumeric(getdimen("d_overlay_offset") * factor) end
+function mp.OverlayRegion () mpstring (getmacro("m_overlay_region") ) end
+
+function mp.PageFraction () mpnumeric(page_fraction() ) end
+function mp.OnRightPage () mpboolean(on_right_page() ) end
+function mp.OnOddPage () mpboolean(is_odd_page () ) end
+function mp.InPageBody () mpboolean(in_body_page () ) end
+
+function mp.OverlayWidth () mpnumeric(getdimen("d_overlay_width") * factor) end
+function mp.OverlayHeight () mpnumeric(getdimen("d_overlay_height") * factor) end
+function mp.OverlayDepth () mpnumeric(getdimen("d_overlay_depth") * factor) end
+function mp.OverlayLineWidth () mpnumeric(getdimen("d_overlay_linewidth") * factor) end
+function mp.OverlayOffset () mpnumeric(getdimen("d_overlay_offset") * factor) end
+function mp.OverlayRegion () mpstring (getmacro("m_overlay_region") ) end
+-- mp.CurrentLayout () mpstring (getmacro("currentlayout")) end
+
+function mp.defaultcolormodel () mpnumeric(defaultcolormodel()) end
+
+mp.HSize = mp.CurrentWidth
+mp.VSize = mp.CurrentHeight
+mp.LastPageNumber = mp.NOfPages
+
+-- not much difference (10000 calls in a graphic neither as expansion seems to win
+-- over defining the macro etc) so let's not waste counters then
+
+-- function mp.OverlayColor()
+-- local c = mpcolor(
+-- getcount("c_overlay_colormodel"),
+-- getcount("c_overlay_color"),
+-- getcount("c_overlay_transparency")
+-- )
+-- mpquoted(c)
+-- end
+--
+-- function mp.OverlayLineColor()
+-- local c = mpcolor(
+-- getcount("c_overlay_colormodel"),
+-- getcount("c_overlay_linecolor"),
+-- getcount("c_overlay_linetransparency")
+-- )
+-- mpquoted(c)
+-- end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mlib-lmp.lua b/Master/texmf-dist/tex/context/base/mkiv/mlib-lmp.lua
index f000f428245..79370d2ce8d 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mlib-lmp.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/mlib-lmp.lua
@@ -6,219 +6,60 @@ if not modules then modules = { } end modules ['mlib-lmp'] = {
license = "see context related readme files",
}
+-- path relates stuff ... todo: use a stack (or numeric index to list)
+
local type = type
local aux = mp.aux
local mpnumeric = aux.numeric
local mppair = aux.pair
-local mpquoted = aux.quoted
-local mpdirect = aux.direct
-
--- todo: use a stack?
-
-do
-
- local p = nil
- local n = 0
-
- local function mf_path_reset()
- p = nil
- n = 0
- end
-
- if CONTEXTLMTXMODE > 0 then
-
- local scan = mp.scan
- local scannumber = scan.number
- local scanpath = scan.path
-
- local function mf_path_length()
- p = scanpath()
- n = p and #p or 1
- mpnumeric(n)
- end
-
- local function mf_path_point()
- local i = scannumber()
- if i > 0 and i <= n then
- local pi = p[i]
- mppair(pi[1],pi[2])
- end
- end
-
- local function mf_path_left()
- local i = scannumber()
- if i > 0 and i <= n then
- local pi = p[i]
- mppair(pi[5],pi[6])
- end
- end
-
- local function mf_path_right()
- local i = scannumber()
- if i > 0 and i <= n then
- local pn
- if i == 1 then
- pn = p[2] or p[1]
- else
- pn = p[i+1] or p[1]
- end
- mppair(pn[3],pn[4])
- end
- end
-
- local registerscript = metapost.registerscript
-
- registerscript("pathreset", mf_path_reset)
- registerscript("pathlengthof", mf_path_length)
- registerscript("pathpointof", mf_path_point)
- registerscript("pathleftof", mf_path_left)
- registerscript("pathrightof", mf_path_right)
-
- else
-
- local get = mp.get
- local mpgetpath = get.path
-
- local function mf_path_length(name)
- p = mpgetpath(name)
- n = p and #p or 0
- mpnumeric(n)
- end
-
- local function mf_path_point(i)
- if i > 0 and i <= n then
- local pi = p[i]
- mppair(pi[1],pi[2])
- end
- end
-
- local function mf_path_left(i)
- if i > 0 and i <= n then
- local pi = p[i]
- mppair(pi[5],pi[6])
- end
- end
- local function mf_path_right(i)
- if i > 0 and i <= n then
- local pn
- if i == 1 then
- pn = p[2] or p[1]
- else
- pn = p[i+1] or p[1]
- end
- mppair(pn[3],pn[4])
- end
- end
-
- mp.mf_path_length = mf_path_length mp.pathlength = mf_path_length
- mp.mf_path_point = mf_path_point mp.pathpoint = mf_path_point
- mp.mf_path_left = mf_path_left mp.pathleft = mf_path_left
- mp.mf_path_right = mf_path_right mp.pathright = mf_path_right
- mp.mf_path_reset = mf_path_reset mp.pathreset = mf_path_reset
-
- end
+local p = nil
+local n = 0
+local function mf_path_reset()
+ p = nil
+ n = 0
end
-do
+local get = mp.get
+local mpgetpath = get.path
- -- if needed we can optimize the sub (cache last split)
-
- local utflen, utfsub = utf.len, utf.sub
-
- function mp.utflen(s)
- mpnumeric(utflen(s))
- end
+local function mf_path_length(name)
+ p = mpgetpath(name)
+ n = p and #p or 0
+ mpnumeric(n)
+end
- function mp.utfsub(s,f,t)
- mpquoted(utfsub(s,f,t or f))
+local function mf_path_point(i)
+ if i > 0 and i <= n then
+ local pi = p[i]
+ mppair(pi[1],pi[2])
end
-
end
-if CONTEXTLMTXMODE > 0 then
-
- function mp.lmt_svg_include()
- local labelfile = metapost.getparameter { "labelfile" }
- if labelfile and labelfile ~= "" then
- local labels = table.load(labelfile) -- todo: same path as svg file
- if type(labels) == "table" then
- for i=1,#labels do
- metapost.remaptext(labels[i])
- end
- end
- end
- local fontname = metapost.getparameter { "fontname" }
- if fontname and fontname ~= "" then
- local unicode = metapost.getparameter { "unicode" }
- if unicode then
- mpdirect (
- metapost.svgglyphtomp(fontname,math.round(unicode))
- )
- end
- return
- end
- local colorfile = metapost.getparameter { "colormap" }
- local colormap = false
- if colorfile and colorfile ~= "" then
- colormap = metapost.svgcolorremapper(colorfile)
- end
- local filename = metapost.getparameter { "filename" }
- if filename and filename ~= "" then
- mpdirect ( metapost.svgtomp {
- data = io.loaddata(filename),
- remap = true,
- colormap = colormap,
- } )
- else
- local buffer = metapost.getparameter { "buffer" }
- if buffer then
- mpdirect ( metapost.svgtomp {
- data = buffers.getcontent(buffer),
- -- remap = true,
- colormap = colormap,
- } )
- else
- local code = metapost.getparameter { "code" }
- if code then
- mpdirect ( metapost.svgtomp {
- data = code,
- colormap = colormap,
- } )
- end
- end
- end
+local function mf_path_left(i)
+ if i > 0 and i <= n then
+ local pi = p[i]
+ mppair(pi[5],pi[6])
end
-
end
-if CONTEXTLMTXMODE > 0 then
-
- function mp.lmt_do_remaptext()
- local parameters = metapost.scanparameters()
- if parameters and parameters.label then
- metapost.remaptext(parameters)
+local function mf_path_right(i)
+ if i > 0 and i <= n then
+ local pn
+ if i == 1 then
+ pn = p[2] or p[1]
+ else
+ pn = p[i+1] or p[1]
end
+ mppair(pn[3],pn[4])
end
-
end
-if CONTEXTLMTXMODE > 0 then
-
- local dropins = fonts.dropins
- local registerglyphs = dropins.registerglyphs
- local registerglyph = dropins.registerglyph
-
- function mp.lmt_register_glyph()
- registerglyph(metapost.getparameterset("mpsglyph"))
- end
-
- function mp.lmt_register_glyphs()
- registerglyphs(metapost.getparameterset("mpsglyphs"))
- end
-
-end
+mp.mf_path_length = mf_path_length mp.pathlength = mf_path_length
+mp.mf_path_point = mf_path_point mp.pathpoint = mf_path_point
+mp.mf_path_left = mf_path_left mp.pathleft = mf_path_left
+mp.mf_path_right = mf_path_right mp.pathright = mf_path_right
+mp.mf_path_reset = mf_path_reset mp.pathreset = mf_path_reset
-todecimal = xdecimal and xdecimal.new or tonumber -- bonus
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mlib-lmt.lua b/Master/texmf-dist/tex/context/base/mkiv/mlib-lmt.lua
deleted file mode 100644
index 9137861a58e..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/mlib-lmt.lua
+++ /dev/null
@@ -1,63 +0,0 @@
-if not modules then modules = { } end modules ['mlib-lmt'] = {
- version = 1.001,
- comment = "companion to mlib-ctx.mkiv",
- author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
- copyright = "PRAGMA ADE / ConTeXt Development Team",
- license = "see context related readme files",
-}
-
-local mppath = mp.path
-
-local scannumeric = mp.scan.numeric
-local scanpath = mp.scan.path
-
-local getparameter = metapost.getparameter
-
-function mp.lmt_function_x(xmin,xmax,xstep,code,shape) -- experimental
- local code = "return function(x) return " .. code .. " end"
- local action = load(code)
- local points = { }
- local nofpoints = 0
- if action then
- action = action()
- end
- if shape == "steps" then
- local halfx = xstep / 2
- local lastx = xmin
- local lasty = action(xmin)
- for xi = xmin, xmax, xstep do
- local yi = action(xi)
- local xx = lastx + halfx
- nofpoints = nofpoints + 1 ; points[nofpoints] = { xx, lasty }
- nofpoints = nofpoints + 1 ; points[nofpoints] = { xx, yi }
- lastx = xi
- lasty = yi
- end
- if points[nofpoints][1] ~= xmax then
- local yi = action(xmax)
- local xx = lastx + halfx
- nofpoints = nofpoints + 1 ; points[nofpoints] = { xx, lasty }
- nofpoints = nofpoints + 1 ; points[nofpoints] = { xx, yi }
- lastx = xi
- lasty = yi
- end
- else
- for xi = xmin, xmax, xstep do
- nofpoints = nofpoints + 1 ; points[nofpoints] = { xi, action(xi) }
- end
- if points[nofpoints][1] ~= xmax then
- nofpoints = nofpoints + 1 ; points[nofpoints] = { xmax, action(xmax) }
- end
- end
- mppath(points,shape == "curve" and ".." or "--",false)
-end
-
-function mp.lmt_mesh_set()
- local mesh = getparameter { "mesh", "paths" }
- structures.references.currentset.mesh = mesh
-end
-
-function mp.lmt_mesh_update()
- local mesh = getparameter { "paths" } or getparameter { "mesh", "paths" }
- mesh[scannumeric()] = scanpath(true)
-end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mlib-lua.lua b/Master/texmf-dist/tex/context/base/mkiv/mlib-lua.lua
index 83ce152e201..b38dbdcf6ea 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mlib-lua.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/mlib-lua.lua
@@ -6,1305 +6,45 @@ if not modules then modules = { } end modules ['mlib-lua'] = {
license = "see context related readme files",
}
--- This is very preliminary code!
+local type = type
+local insert, remove = table.insert, table.remove
--- maybe we need mplib.model, but how with instances
+local set = mp.set
+local get = mp.get
-local type, tostring, tonumber, select, loadstring = type, tostring, tonumber, select, loadstring
-local find, match, gsub, gmatch = string.find, string.match, string.gsub, string.gmatch
-local concat, insert, remove = table.concat, table.insert, table.remove
+local currentmpx = nil
+local stack = { }
-local formatters = string.formatters
-local lpegmatch = lpeg.match
-local lpegpatterns = lpeg.patterns
+local get_numeric = mplib.get_numeric
+local get_integer = mplib.get_integer
+local get_string = mplib.get_string
+local get_boolean = mplib.get_boolean
+local get_path = mplib.get_path
+local set_path = mplib.set_path
-local P, S, Ct, Cs, Cc, C = lpeg.P, lpeg.S, lpeg.Ct, lpeg.Cs, lpeg.Cc, lpeg.C
-
-local report_luarun = logs.reporter("metapost","lua")
-local report_script = logs.reporter("metapost","script")
-local report_message = logs.reporter("metapost")
-
-local trace_luarun = false trackers.register("metapost.lua",function(v) trace_luarun = v end)
-
-local be_tolerant = true directives.register("metapost.lua.tolerant", function(v) be_tolerant = v end)
-
-local get, set, aux, scan = { }, { }, { }, { }
-
-mp = mp or { -- system namespace
- set = set,
- get = get,
- aux = aux,
- scan = scan,
-}
-
-MP = MP or { -- user namespace
-}
-
--- We had this:
---
--- table.setmetatablecall(mp,function(t,k) mpprint(k) end)
---
--- but the next one is more interesting because we cannot use calls like:
---
--- lua.mp.somedefdname("foo")
---
--- which is due to expansion of somedefdname during suffix creation. So:
---
--- lua.mp("somedefdname","foo")
-
-table.setmetatablecall(mp,function(t,k,...) return t[k](...) end)
-table.setmetatablecall(MP,function(t,k,...) return t[k](...) end)
-
-do
-
- local currentmpx = nil
- local stack = { }
-
- if CONTEXTLMTXMODE > 0 then
-
- local scan_next = mplib.scan_next
- local scan_expression = mplib.scan_expression
- local scan_token = mplib.scan_token
- local scan_symbol = mplib.scan_symbol
- local scan_numeric = mplib.scan_numeric
- local scan_integer = mplib.scan_integer
- local scan_boolean = mplib.scan_boolean
- local scan_string = mplib.scan_string
- local scan_pair = mplib.scan_pair
- local scan_color = mplib.scan_color
- local scan_cmykcolor = mplib.scan_cmykcolor
- local scan_transform = mplib.scan_transform
- local scan_path = mplib.scan_path
- local scan_pen = mplib.scan_pen
-
- scan.next = function(k) return scan_next (currentmpx,k) end
- scan.expression = function(k) return scan_expression(currentmpx,k) end
- scan.token = function(k) return scan_token (currentmpx,k) end
- scan.symbol = function(k,e) return scan_symbol (currentmpx,k,e) end
- scan.numeric = function() return scan_numeric (currentmpx) end
- scan.number = function() return scan_numeric (currentmpx) end
- scan.integer = function() return scan_integer (currentmpx) end
- scan.boolean = function() return scan_boolean (currentmpx) end
- scan.string = function() return scan_string (currentmpx) end
- scan.pair = function(t) return scan_pair (currentmpx,t) end
- scan.color = function(t) return scan_color (currentmpx,t) end
- scan.cmykcolor = function(t) return scan_cmykcolor (currentmpx,t) end
- scan.transform = function(t) return scan_transform (currentmpx,t) end
- scan.path = function(t) return scan_path (currentmpx,t) end
- scan.pen = function(t) return scan_pen (currentmpx,t) end
-
- else
-
- local get_numeric = mplib.get_numeric
- local get_integer = mplib.get_integer
- local get_string = mplib.get_string
- local get_boolean = mplib.get_boolean
- local get_path = mplib.get_path
- local set_path = mplib.set_path
-
- get.numeric = function(s) return get_numeric(currentmpx,s) end
- get.number = function(s) return get_numeric(currentmpx,s) end
- get.integer = function(s) return get_integer(currentmpx,s) end
- get.string = function(s) return get_string (currentmpx,s) end
- get.boolean = function(s) return get_boolean(currentmpx,s) end
- get.path = function(s) return get_path (currentmpx,s) end
- set.path = function(s,t) return set_path (currentmpx,s,t) end -- not working yet
-
- end
-
- function metapost.pushscriptrunner(mpx)
- insert(stack,mpx)
- currentmpx = mpx
- end
-
- function metapost.popscriptrunner()
- currentmpx = remove(stack,mpx)
- end
-
- function metapost.currentmpx()
- return currentmpx
- end
-
- local status = mplib.status
-
- function metapost.currentmpxstatus()
- return status and status(currentmpx) or 0
- end
-
-end
-
-do
-
- -- serializers
-
- local f_integer = formatters["%i"]
- local f_numeric = formatters["%F"]
-
- -- no %n as that can produce -e notation and that is not so nice for scaled butmaybe we
- -- should then switch between ... i.e. make a push/pop for the formatters here ... not now.
-
- local f_integer = formatters["%i"]
- local f_numeric = formatters["%F"]
- local f_pair = formatters["(%F,%F)"]
- local f_ctrl = formatters["(%F,%F) .. controls (%F,%F) and (%F,%F)"]
- local f_triplet = formatters["(%F,%F,%F)"]
- local f_quadruple = formatters["(%F,%F,%F,%F)"]
- local f_transform = formatters["totransform(%F,%F,%F,%F,%F,%F)"]
- local f_pen = formatters["(pencircle transformed totransform(%F,%F,%F,%F,%F,%F))"]
-
- local f_points = formatters["%p"]
- local f_pair_pt = formatters["(%p,%p)"]
- local f_ctrl_pt = formatters["(%p,%p) .. controls (%p,%p) and (%p,%p)"]
- local f_triplet_pt = formatters["(%p,%p,%p)"]
- local f_quadruple_pt = formatters["(%p,%p,%p,%p)"]
-
- local r = P('%') / "percent"
- + P('"') / "dquote"
- + P('\n') / "crlf"
- -- + P(' ') / "space"
- local a = Cc("&")
- local q = Cc('"')
- local p = Cs(q * (r * a)^-1 * (a * r * (P(-1) + a) + P(1))^0 * q)
-
- mp.cleaned = function(s) return lpegmatch(p,s) or s end
-
- -- management
-
- -- sometimes we gain (e.g. .5 sec on the sync test)
-
- local cache = table.makeweak()
-
- local runscripts = { }
- local runnames = { }
- local nofscripts = 0
-
- function metapost.registerscript(name,f)
- nofscripts = nofscripts + 1
- if f then
- runscripts[nofscripts] = f
- runnames[name] = nofscripts
- else
- runscripts[nofscripts] = name
- end
- return nofscripts
- end
-
- function metapost.scriptindex(name)
- return runnames[name] or 0
- end
-
- -- The gbuffer sharing and such is not really needed now but make a dent when
- -- we have a high volume of simpel calls (loops) so we keep it around for a
- -- while.
-
- local nesting = 0
- local runs = 0
- local gbuffer = { }
- local buffer = gbuffer
- local n = 0
-
- local function mpdirect1(a)
- n = n + 1 buffer[n] = a
- end
- local function mpdirect2(a,b)
- n = n + 1 buffer[n] = a
- n = n + 1 buffer[n] = b
- end
- local function mpdirect3(a,b,c)
- n = n + 1 buffer[n] = a
- n = n + 1 buffer[n] = b
- n = n + 1 buffer[n] = c
- end
- local function mpdirect4(a,b,c,d)
- n = n + 1 buffer[n] = a
- n = n + 1 buffer[n] = b
- n = n + 1 buffer[n] = c
- n = n + 1 buffer[n] = d
- end
- local function mpdirect5(a,b,c,d,e)
- n = n + 1 buffer[n] = a
- n = n + 1 buffer[n] = b
- n = n + 1 buffer[n] = c
- n = n + 1 buffer[n] = d
- n = n + 1 buffer[n] = e
- end
-
- local function mpflush(separator)
- buffer[1] = concat(buffer,separator or "",1,n)
- n = 1
- end
-
- function metapost.runscript(code)
- nesting = nesting + 1
- runs = runs + 1
-
- local index = type(code) == "number"
- local f
- local result
-
- if index then
- f = runscripts[code]
- if not f then
- report_luarun("%i: bad index: %s",nesting,code)
- elseif trace_luarun then
- report_luarun("%i: index: %i",nesting,code)
- end
- else
- if trace_luarun then
- report_luarun("%i: code: %s",nesting,code)
- end
- f = cache[code]
- if not f then
- f = loadstring("return " .. code)
- if f then
- cache[code] = f
- elseif be_tolerant then
- f = loadstring(code)
- if f then
- cache[code] = f
- end
- end
- end
- end
-
- -- returning nil is more efficient and a signal not to scan in mp
-
- if f then
-
- local lbuffer, ln
-
- if nesting == 1 then
- buffer = gbuffer
- n = 0
- else
- lbuffer = buffer
- ln = n
- buffer = { }
- n = 0
- end
-
- result = f()
-
- if result then
- local t = type(result)
- if t == "number" then
- result = f_numeric(result)
- elseif t == "table" then
- result = concat(result) -- no spaces here
- else
- result = tostring(result)
- end
- if trace_luarun then
- report_luarun("%i: %s result: %s",nesting,t,result)
- end
- elseif n == 0 then
- result = ""
- if trace_luarun then
- report_luarun("%i: no buffered result",nesting)
- end
- elseif n == 1 then
- result = buffer[1]
- if trace_luarun then
- report_luarun("%i: 1 buffered result: %s",nesting,result)
- end
- else
- -- the space is why we sometimes have collectors
- if nesting == 1 then
- result = concat(buffer," ",1,n)
- if n > 500 or #result > 10000 then
- gbuffer = { } -- newtable(20,0)
- lbuffer = gbuffer
- end
- else
- result = concat(buffer," ")
- end
- if trace_luarun then
- report_luarun("%i: %i buffered results: %s",nesting,n,result)
- end
- end
-
- if nesting == 1 then
- n = 0
- else
- buffer = lbuffer
- n = ln
- end
-
- else
- report_luarun("%i: no result, invalid code: %s",nesting,code)
- result = ""
- end
-
- nesting = nesting - 1
-
- return result
- end
-
- function metapost.nofscriptruns()
- return runs
- end
-
- -- writers
-
- local function mpp(value)
- n = n + 1
- local t = type(value)
- if t == "number" then
- buffer[n] = f_numeric(value)
- elseif t == "string" then
- buffer[n] = value
- elseif t == "table" then
- if #t == 6 then
- buffer[n] = "totransform(" .. concat(value,",") .. ")"
- else
- buffer[n] = "(" .. concat(value,",") .. ")"
- end
- else -- boolean or whatever
- buffer[n] = tostring(value)
- end
- end
-
- local function mpprint(first,second,...)
- if second == nil then
- if first ~= nil then
- mpp(first)
- end
- else
- for i=1,select("#",first,second,...) do
- local value = (select(i,first,second,...))
- if value ~= nil then
- mpp(value)
- end
- end
- end
- end
-
- local function mpp(value)
- n = n + 1
- local t = type(value)
- if t == "number" then
- buffer[n] = f_numeric(value)
- elseif t == "string" then
- buffer[n] = lpegmatch(p,value)
- elseif t == "table" then
- if #t > 4 then
- buffer[n] = ""
- else
- buffer[n] = "(" .. concat(value,",") .. ")"
- end
- else -- boolean or whatever
- buffer[n] = tostring(value)
- end
- end
-
- local function mpvprint(first,second,...) -- variable print
- if second == nil then
- if first ~= nil then
- mpp(first)
- end
- else
- for i=1,select("#",first,second,...) do
- local value = (select(i,first,second,...))
- if value ~= nil then
- mpp(value)
- end
- end
- end
- end
-
- local function mpstring(value)
- n = n + 1
- buffer[n] = lpegmatch(p,value)
- end
-
- local function mpboolean(b)
- n = n + 1
- buffer[n] = b and "true" or "false"
- end
-
- local function mpnumeric(f)
- n = n + 1
- if not f or f == 0 then
- buffer[n] = "0"
- else
- buffer[n] = f_numeric(f)
- end
- end
-
- local function mpinteger(i)
- n = n + 1
- -- buffer[n] = i and f_integer(i) or "0"
- buffer[n] = i or "0"
- end
-
- local function mppoints(i)
- n = n + 1
- if not i or i == 0 then
- buffer[n] = "0pt"
- else
- buffer[n] = f_points(i)
- end
- end
-
- local function mppair(x,y)
- n = n + 1
- if type(x) == "table" then
- buffer[n] = f_pair(x[1],x[2])
- else
- buffer[n] = f_pair(x,y)
- end
- end
-
- local function mppairpoints(x,y)
- n = n + 1
- if type(x) == "table" then
- buffer[n] = f_pair_pt(x[1],x[2])
- else
- buffer[n] = f_pair_pt(x,y)
- end
- end
-
- local function mptriplet(x,y,z)
- n = n + 1
- if type(x) == "table" then
- buffer[n] = f_triplet(x[1],x[2],x[3])
- else
- buffer[n] = f_triplet(x,y,z)
- end
- end
-
- local function mptripletpoints(x,y,z)
- n = n + 1
- if type(x) == "table" then
- buffer[n] = f_triplet_pt(x[1],x[2],x[3])
- else
- buffer[n] = f_triplet_pt(x,y,z)
- end
- end
-
- local function mpquadruple(w,x,y,z)
- n = n + 1
- if type(w) == "table" then
- buffer[n] = f_quadruple(w[1],w[2],w[3],w[4])
- else
- buffer[n] = f_quadruple(w,x,y,z)
- end
- end
-
- local function mpquadruplepoints(w,x,y,z)
- n = n + 1
- if type(w) == "table" then
- buffer[n] = f_quadruple_pt(w[1],w[2],w[3],w[4])
- else
- buffer[n] = f_quadruple_pt(w,x,y,z)
- end
- end
-
- local function mptransform(x,y,xx,xy,yx,yy)
- n = n + 1
- if type(x) == "table" then
- buffer[n] = f_transform(x[1],x[2],x[3],x[4],x[5],x[6])
- else
- buffer[n] = f_transform(x,y,xx,xy,yx,yy)
- end
- end
-
- local function mpcolor(c,m,y,k)
- n = n + 1
- if type(c) == "table" then
- local l = #c
- if l == 4 then
- buffer[n] = f_quadruple(c[1],c[2],c[3],c[4])
- elseif l == 3 then
- buffer[n] = f_triplet(c[1],c[2],c[3])
- else
- buffer[n] = f_numeric(c[1])
- end
- else
- if k then
- buffer[n] = f_quadruple(c,m,y,k)
- elseif y then
- buffer[n] = f_triplet(c,m,y)
- else
- buffer[n] = f_numeric(c)
- end
- end
- end
-
- -- we have three kind of connectors:
- --
- -- .. ... -- (true)
-
- local function mp_path(f2,f6,t,connector,cycle)
- if type(t) == "table" then
- local tn = #t
- if tn == 1 then
- local t1 = t[1]
- n = n + 1
- if t.pen then
- buffer[n] = f_pen(unpack(t1))
- else
- buffer[n] = f2(t1[1],t1[2])
- end
- elseif tn > 0 then
- if connector == true or connector == nil then
- connector = ".."
- elseif connector == false then
- connector = "--"
- end
- if cycle == nil then
- cycle = t.cycle
- if cycle == nil then
- cycle = true
- end
- end
- local six = connector == ".." -- otherwise we use whatever gets asked for
- local controls = connector -- whatever
- local a = t[1]
- local b = t[2]
- n = n + 1
- buffer[n] = "("
- n = n + 1
- if six and #a == 6 and #b == 6 then
- buffer[n] = f6(a[1],a[2],a[5],a[6],b[3],b[4])
- controls = ".."
- else
- buffer[n] = f2(a[1],a[2])
- controls = connector
- end
- for i=2,tn-1 do
- a = b
- b = t[i+1]
- n = n + 1
- buffer[n] = connector
- n = n + 1
- if six and #a == 6 and #b == 6 then
- buffer[n] = f6(a[1],a[2],a[5],a[6],b[3],b[4])
- controls = ".."
- else
- buffer[n] = f2(a[1],a[2])
- controls = connector
- end
- end
- n = n + 1
- buffer[n] = connector
- a = b
- b = t[1]
- n = n + 1
- if cycle then
- if six and #a == 6 and #b == 6 then
- buffer[n] = f6(a[1],a[2],a[5],a[6],b[3],b[4])
- controls = ".."
- else
- buffer[n] = f2(a[1],a[2])
- controls = connector
- end
- n = n + 1
- buffer[n] = connector
- n = n + 1
- buffer[n] = "cycle"
- else
- buffer[n] = f2(a[1],a[2])
- end
- n = n + 1
- buffer[n] = ")"
- end
- end
- end
-
- local function mppath(...)
- mp_path(f_pair,f_ctrl,...)
- end
-
- local function mppathpoints(...)
- mp_path(f_pair_pt,f_ctrl_pt,...)
- end
-
- local function mpsize(t)
- n = n + 1
- buffer[n] = type(t) == "table" and f_numeric(#t) or "0"
- end
-
- local replacer = lpeg.replacer("@","%%")
-
- local function mpfprint(fmt,...)
- n = n + 1
- if not find(fmt,"%",1,true) then
- fmt = lpegmatch(replacer,fmt)
- end
- buffer[n] = formatters[fmt](...)
- end
-
- local function mpquoted(fmt,s,...)
- if s then
- n = n + 1
- if not find(fmt,"%",1,true) then
- fmt = lpegmatch(replacer,fmt)
- end
- -- buffer[n] = '"' .. formatters[fmt](s,...) .. '"'
- buffer[n] = lpegmatch(p,formatters[fmt](s,...))
- elseif fmt then
- n = n + 1
- -- buffer[n] = '"' .. fmt .. '"'
- buffer[n] = lpegmatch(p,fmt)
- else
- -- something is wrong
- end
- end
-
- aux.direct = mpdirect1
- aux.direct1 = mpdirect1
- aux.direct2 = mpdirect2
- aux.direct3 = mpdirect3
- aux.direct4 = mpdirect4
- aux.flush = mpflush
-
- aux.print = mpprint
- aux.vprint = mpvprint
- aux.boolean = mpboolean
- aux.string = mpstring
- aux.numeric = mpnumeric
- aux.number = mpnumeric
- aux.integer = mpinteger
- aux.points = mppoints
- aux.pair = mppair
- aux.pairpoints = mppairpoints
- aux.triplet = mptriplet
- aux.tripletpoints = mptripletpoints
- aux.quadruple = mpquadruple
- aux.quadruplepoints = mpquadruplepoints
- aux.path = mppath
- aux.pathpoints = mppathpoints
- aux.size = mpsize
- aux.fprint = mpfprint
- aux.quoted = mpquoted
- aux.transform = mptransform
- aux.color = mpcolor
-
- -- for the moment
-
- local function mpdraw(lines,list) -- n * 4
- if list then
- local c = #lines
- for i=1,c do
- local ci = lines[i]
- local ni = #ci
- n = n + 1 buffer[n] = i < c and "d(" or "D("
- for j=1,ni,2 do
- local l = j + 1
- n = n + 1 buffer[n] = ci[j]
- n = n + 1 buffer[n] = ","
- n = n + 1 buffer[n] = ci[l]
- n = n + 1 buffer[n] = l < ni and ")--(" or ");"
- end
- end
- else
- local l = #lines
- local m = l - 4
- for i=1,l,4 do
- n = n + 1 buffer[n] = i < m and "d(" or "D("
- n = n + 1 buffer[n] = lines[i]
- n = n + 1 buffer[n] = ","
- n = n + 1 buffer[n] = lines[i+1]
- n = n + 1 buffer[n] = ")--("
- n = n + 1 buffer[n] = lines[i+2]
- n = n + 1 buffer[n] = ","
- n = n + 1 buffer[n] = lines[i+3]
- n = n + 1 buffer[n] = ");"
- end
- end
- end
-
- local function mpfill(lines,list)
- if list then
- local c = #lines
- for i=1,c do
- local ci = lines[i]
- local ni = #ci
- n = n + 1 buffer[n] = i < c and "f(" or "F("
- for j=1,ni,2 do
- local l = j + 1
- n = n + 1 buffer[n] = ci[j]
- n = n + 1 buffer[n] = ","
- n = n + 1 buffer[n] = ci[l]
- n = n + 1 buffer[n] = l < ni and ")--(" or ")--C;"
- end
- end
- else
- local l = #lines
- local m = l - 4
- for i=1,l,4 do
- n = n + 1 buffer[n] = i < m and "f(" or "F("
- n = n + 1 buffer[n] = lines[i]
- n = n + 1 buffer[n] = ","
- n = n + 1 buffer[n] = lines[i+1]
- n = n + 1 buffer[n] = ")--("
- n = n + 1 buffer[n] = lines[i+2]
- n = n + 1 buffer[n] = ","
- n = n + 1 buffer[n] = lines[i+3]
- n = n + 1 buffer[n] = ")--C;"
- end
- end
- end
-
- aux.draw = mpdraw
- aux.fill = mpfill
-
- for k, v in next, aux do mp[k] = v end
-
-end
-
-do
-
- -- Another experimental feature:
-
- local mpnumeric = mp.numeric
- local scanstring = scan.string
- local scriptindex = metapost.scriptindex
-
- function mp.mf_script_index(name)
- local index = scriptindex(name)
- -- report_script("method %i, name %a, index %i",1,name,index)
- mpnumeric(index)
- end
-
- -- once bootstrapped ... (needs pushed mpx instances)
-
- metapost.registerscript("scriptindex",function()
- local name = scanstring()
- local index = scriptindex(name)
- -- report_script("method %i, name %a, index %i",2,name,index)
- mpnumeric(index)
- end)
-
-end
-
--- the next will move to mlib-lmp.lua
-
-do
-
- local mpnamedcolor = attributes.colors.mpnamedcolor
- local mpprint = aux.print
- local scanstring = scan.string
-
- mp.mf_named_color = function(str)
- mpprint(mpnamedcolor(str))
- end
-
- metapost.registerscript("namedcolor",function()
- mpprint(mpnamedcolor(scanstring()))
--- test: return mpnamedcolor(scanstring())
- end)
+get.numeric = function(s) return get_numeric(currentmpx,s) end
+get.number = function(s) return get_numeric(currentmpx,s) end
+get.integer = function(s) return get_integer(currentmpx,s) end
+get.string = function(s) return get_string (currentmpx,s) end
+get.boolean = function(s) return get_boolean(currentmpx,s) end
+get.path = function(s) return get_path (currentmpx,s) end
+set.path = function(s,t) return set_path (currentmpx,s,t) end -- not working yet
+function metapost.pushscriptrunner(mpx)
+ insert(stack,mpx)
+ currentmpx = mpx
end
-function mp.n(t) -- used ?
- return type(t) == "table" and #t or 0
+function metapost.popscriptrunner()
+ currentmpx = remove(stack,mpx)
end
-do
-
- -- experiment: names can change
-
- local mppath = aux.path
- local mpsize = aux.size
-
- local whitespace = lpegpatterns.whitespace
- local newline = lpegpatterns.newline
- local setsep = newline^2
- local comment = (S("#%") + P("--")) * (1-newline)^0 * (whitespace - setsep)^0
- local value = (1-whitespace)^1 / tonumber
- local entry = Ct( value * whitespace * value)
- local set = Ct((entry * (whitespace-setsep)^0 * comment^0)^1)
- local series = Ct((set * whitespace^0)^1)
-
- local pattern = whitespace^0 * series
-
- local datasets = { }
- mp.datasets = datasets
-
- function mp.dataset(str)
- return lpegmatch(pattern,str)
- end
-
- function datasets.load(tag,filename)
- if not filename then
- tag, filename = file.basename(tag), tag
- end
- local data = lpegmatch(pattern,io.loaddata(filename) or "")
- datasets[tag] = {
- data = data,
- line = function(n) mppath(data[n or 1]) end,
- size = function() mpsize(data) end,
- }
- end
-
- table.setmetatablecall(datasets,function(t,k,f,...)
- local d = datasets[k]
- local t = type(d)
- if t == "table" then
- d = d[f]
- if type(d) == "function" then
- d(...)
- else
- mpvprint(...)
- end
- elseif t == "function" then
- d(f,...)
- end
- end)
-
+function metapost.currentmpx()
+ return currentmpx
end
--- \startluacode
--- local str = [[
--- 10 20 20 20
--- 30 40 40 60
--- 50 10
---
--- 10 10 20 30
--- 30 50 40 50
--- 50 20 -- the last one
---
--- 10 20 % comment
--- 20 10
--- 30 40 # comment
--- 40 20
--- 50 10
--- ]]
---
--- MP.myset = mp.dataset(str)
---
--- inspect(MP.myset)
--- \stopluacode
---
--- \startMPpage
--- color c[] ; c[1] := red ; c[2] := green ; c[3] := blue ;
--- for i=1 upto lua("mp.print(mp.n(MP.myset))") :
--- draw lua("mp.path(MP.myset[" & decimal i & "])") withcolor c[i] ;
--- endfor ;
--- \stopMPpage
-
--- texts:
-
-do
-
- local mptriplet = mp.triplet
-
- local bpfactor = number.dimenfactors.bp
- local textexts = nil
- local mptriplet = mp.triplet
- local nbdimensions = nodes.boxes.dimensions
-
- function mp.mf_tt_initialize(tt)
- textexts = tt
- end
-
- function mp.mf_tt_dimensions(n)
- local box = textexts and textexts[n]
- if box then
- -- could be made faster with nuts but not critical
- mptriplet(box.width*bpfactor,box.height*bpfactor,box.depth*bpfactor)
- else
- mptriplet(0,0,0)
- end
- end
-
- function mp.mf_tb_dimensions(category,name)
- local w, h, d = nbdimensions(category,name)
- mptriplet(w*bpfactor,h*bpfactor,d*bpfactor)
- end
-
- function mp.report(a,b,c,...)
- if c then
- report_message("%s : %s",a,formatters[(gsub(b,"@","%%"))](c,...))
- elseif b then
- report_message("%s : %s",a,b)
- elseif a then
- report_message("%s : %s","message",a)
- end
- end
+local status = mplib.status
+function metapost.currentmpxstatus()
+ return status and status(currentmpx) or 0
end
-
-do
-
- local mpprint = aux.print
- local modes = tex.modes
- local systemmodes = tex.systemmodes
-
- function mp.mode(s)
- mpprint(modes[s] and true or false)
- end
-
- function mp.systemmode(s)
- mpprint(systemmodes[s] and true or false)
- end
-
- mp.processingmode = mp.mode
-
-end
-
--- for alan's nodes:
-
-do
-
- local mpprint = aux.print
- local mpquoted = aux.quoted
-
- function mp.isarray(str)
- mpprint(find(str,"%d") and true or false)
- end
-
- function mp.prefix(str)
- mpquoted(match(str,"^(.-)[%d%[]") or str)
- end
-
- -- function mp.dimension(str)
- -- local n = 0
- -- for s in gmatch(str,"%[?%-?%d+%]?") do --todo: lpeg
- -- n = n + 1
- -- end
- -- mpprint(n)
- -- end
-
- mp.dimension = lpeg.counter(P("[") * lpegpatterns.integer * P("]") + lpegpatterns.integer,mpprint)
-
- -- faster and okay as we don't have many variables but probably only
- -- basename makes sense and even then it's not called that often
-
- -- local hash = table.setmetatableindex(function(t,k)
- -- local v = find(k,"%d") and true or false
- -- t[k] = v
- -- return v
- -- end)
- --
- -- function mp.isarray(str)
- -- mpprint(hash[str])
- -- end
- --
- -- local hash = table.setmetatableindex(function(t,k)
- -- local v = '"' .. (match(k,"^(.-)%d") or k) .. '"'
- -- t[k] = v
- -- return v
- -- end)
- --
- -- function mp.prefix(str)
- -- mpprint(hash[str])
- -- end
-
-end
-
-do
-
- local getmacro = tex.getmacro
- local getdimen = tex.getdimen
- local getcount = tex.getcount
- local gettoks = tex.gettoks
- local setmacro = tex.setmacro
- local setdimen = tex.setdimen
- local setcount = tex.setcount
- local settoks = tex.settoks
-
- local mpprint = mp.print
- local mpquoted = mp.quoted
-
- local bpfactor = number.dimenfactors.bp
-
- -- more helpers
-
- local function getmacro(k) mpprint (getmacro(k)) end
- local function getdimen(k) mpprint (getdimen(k)*bpfactor) end
- local function getcount(k) mpprint (getcount(k)) end
- local function gettoks (k) mpquoted(gettoks (k)) end
-
- local function setmacro(k,v) setmacro(k,v) end
- local function setdimen(k,v) setdimen(k,v/bpfactor) end
- local function setcount(k,v) setcount(k,v) end
- local function settoks (k,v) settoks (k,v) end
-
- -- def foo = lua.mp.foo ... enddef ; % loops due to foo in suffix
-
- mp._get_macro_ = getmacro mp.getmacro = getmacro
- mp._get_dimen_ = getdimen mp.getdimen = getdimen
- mp._get_count_ = getcount mp.getcount = getcount
- mp._get_toks_ = gettoks mp.gettoks = gettoks
-
- mp._set_macro_ = setmacro mp.setmacro = setmacro
- mp._set_dimen_ = setdimen mp.setdimen = setdimen
- mp._set_count_ = setcount mp.setcount = setcount
- mp._set_toks_ = settoks mp.settoks = settoks
-
-end
-
--- position fun
-
-do
-
- local mprint = mp.print
- local fprint = mp.fprint
- local qprint = mp.quoted
- local jobpositions = job.positions
- local getwhd = jobpositions.whd
- local getxy = jobpositions.xy
- local getposition = jobpositions.position
- local getpage = jobpositions.page
- local getregion = jobpositions.region
- local getmacro = tokens.getters.macro
-
- function mp.positionpath(name)
- local w, h, d = getwhd(name)
- if w then
- fprint("((%p,%p)--(%p,%p)--(%p,%p)--(%p,%p)--cycle)",0,-d,w,-d,w,h,0,h)
- else
- mprint("(origin--cycle)")
- end
- end
-
- function mp.positioncurve(name)
- local w, h, d = getwhd(name)
- if w then
- fprint("((%p,%p)..(%p,%p)..(%p,%p)..(%p,%p)..cycle)",0,-d,w,-d,w,h,0,h)
- else
- mprint("(origin--cycle)")
- end
- end
-
- function mp.positionbox(name)
- local p, x, y, w, h, d = getposition(name)
- if p then
- fprint("((%p,%p)--(%p,%p)--(%p,%p)--(%p,%p)--cycle)",x,y-d,x+w,y-d,x+w,y+h,x,y+h)
- else
- mprint("(%p,%p)",x,y)
- end
- end
-
- function mp.positionxy(name)
- local x, y = getxy(name)
- if x then
- fprint("(%p,%p)",x,y)
- else
- mprint("origin")
- end
- end
-
- function mp.positionpage(name)
- fprint("%i",getpage(name) or 0)
- end
-
- function mp.positionregion(name)
- local r = getregion(name)
- if r then
- qprint(r)
- else
- qprint("unknown")
- end
- end
-
- function mp.positionwhd(name)
- local w, h, d = getwhd(name)
- if w then
- fprint("(%p,%p,%p)",w,h,d)
- else
- mprint("(0,0,0)")
- end
- end
-
- function mp.positionpxy(name)
- local p, x, y = getposition(name)
- if p then
- fprint("(%p,%p,%p)",p,x,y)
- else
- mprint("(0,0,0)")
- end
- end
-
- function mp.positionanchor()
- qprint(getmacro("MPanchorid"))
- end
-
-end
-
-do
-
- local mppair = mp.pair
-
- function mp.textextanchor(s)
- local x, y = match(s,"tx_anchor=(%S+) (%S+)") -- todo: make an lpeg
- if x and y then
- x = tonumber(x)
- y = tonumber(y)
- end
- mppair(x or 0,y or 0)
- end
-
-end
-
-do
-
- local mprint = mp.print
- local qprint = mp.quoted
- local getmacro = tokens.getters.macro
-
- function mp.texvar(name)
- mprint(getmacro(metapost.namespace .. name))
- end
-
- function mp.texstr(name)
- qprint(getmacro(metapost.namespace .. name))
- end
-
-end
-
-do
-
- local mpprint = aux.print
- local mpvprint = aux.vprint
-
- local hashes = { }
-
- function mp.newhash(name)
- if name then
- hashes[name] = { }
- else
- for i=1,#hashes+1 do
- if not hashes[i] then
- hashes[i] = { }
- mpvprint(i)
- return
- end
- end
- end
- end
-
- function mp.disposehash(n)
- if tonumber(n) then
- hashes[n] = false
- else
- hashes[n] = nil
- end
- end
-
- function mp.inhash(n,key)
- local h = hashes[n]
- mpvprint(h and h[key] and true or false)
- end
-
- function mp.tohash(n,key,value)
- local h = hashes[n]
- if h then
- if value == nil then
- h[key] = true
- else
- h[key] = value
- end
- end
- end
-
- function mp.fromhash(n,key)
- local h = hashes[n]
- mpvprint(h and h[key] or false)
- end
-
- interfaces.implement {
- name = "MPfromhash",
- arguments = "2 strings",
- actions = function(name,key)
- local h = hashes[name] or hashes[tonumber(name)]
- if h then
- local v = h[key] or h[tonumber(key)]
- if v then
- context(v)
- end
- end
- end
- }
-
-end
-
-do
-
- -- a bit overkill: just a find(str,"mf_object=") can be enough
- --
- -- todo : share with mlib-pps.lua metapost,isobject
-
- local mpboolean = aux.boolean
-
- local p1 = P("mf_object=")
- local p2 = lpegpatterns.eol * p1
- local pattern = (1-p2)^0 * p2 + p1
-
- function mp.isobject(str)
- mpboolean(pattern and str ~= "" and lpegmatch(pattern,str))
- end
-
-end
-
-function mp.flatten(t)
- local tn = #t
-
- local t1 = t[1]
- local t2 = t[2]
- local t3 = t[3]
- local t4 = t[4]
-
- for i=1,tn-5,2 do
- local t5 = t[i+4]
- local t6 = t[i+5]
- if t1 == t3 and t3 == t5 and ((t2 <= t4 and t4 <= t6) or (t6 <= t4 and t4 <= t2)) then
- t[i+3] = t2
- t4 = t2
- t[i] = false
- t[i+1] = false
- elseif t2 == t4 and t4 == t6 and ((t1 <= t3 and t3 <= t5) or (t5 <= t3 and t3 <= t1)) then
- t[i+2] = t1
- t3 = t1
- t[i] = false
- t[i+1] = false
- end
- t1 = t3
- t2 = t4
- t3 = t5
- t4 = t6
- end
-
- -- remove duplicates
-
- local t1 = t[1]
- local t2 = t[2]
- for i=1,tn-2,2 do
- local t3 = t[i+2]
- local t4 = t[i+3]
- if t1 == t3 and t2 == t4 then
- t[i] = false
- t[i+1] = false
- end
- t1 = t3
- t2 = t4
- end
-
- -- move coordinates
-
- local m = 0
- for i=1,tn,2 do
- if t[i] then
- m = m + 1 t[m] = t[i]
- m = m + 1 t[m] = t[i+1]
- end
- end
-
- -- prune the table (not gc'd)
-
- for i=tn,m+1,-1 do
- t[i] = nil
- end
-
- -- safeguard so that we have at least one segment
-
- if m == 2 then
- t[3] = t[1]
- t[4] = t[2]
- end
-
-end
-
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mlib-mat.lua b/Master/texmf-dist/tex/context/base/mkiv/mlib-mat.lua
deleted file mode 100644
index 6c82a4658b5..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/mlib-mat.lua
+++ /dev/null
@@ -1,137 +0,0 @@
-if not modules then modules = { } end modules ['mlib-mat'] = {
- version = 1.001,
- comment = "companion to mlib-ctx.mkiv",
- author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
- copyright = "PRAGMA ADE / ConTeXt Development Team",
- license = "see context related readme files",
-}
-
-local scanners = mp.scan
-local registerscript = metapost.registerscript
-
-local scannumeric = scanners.numeric
-local scanpair = scanners.pair
-local scancolor = scanners.color
-
-local mppair = mp.pair
-
-local m = xmath
-local c = xcomplex
-
-local m_acos = m.acos registerscript("m_acos", function() return m_acos (scannumeric()) end)
-local m_acosh = m.acosh registerscript("m_acosh", function() return m_acosh (scannumeric()) end)
-local m_asin = m.asin registerscript("m_asin", function() return m_asin (scannumeric()) end)
-local m_asinh = m.asinh registerscript("m_asinh", function() return m_asinh (scannumeric()) end)
-local m_atan = m.atan registerscript("m_atan", function() return m_atan (scannumeric()) end)
-local m_atan2 = m.atan2 registerscript("m_atan2", function() return m_atan2 (scanpair ()) end)
-local m_atanh = m.atanh registerscript("m_atanh", function() return m_atanh (scannumeric()) end)
-local m_cbrt = m.cbrt registerscript("m_cbrt", function() return m_cbrt (scannumeric()) end)
-local m_ceil = m.ceil registerscript("m_ceil", function() return m_ceil (scannumeric()) end)
-local m_copysign = m.copysign registerscript("m_copysign", function() return m_copysign (scanpair ()) end)
-local m_cos = m.cos registerscript("m_cos", function() return m_cos (scannumeric()) end)
-local m_cosh = m.cosh registerscript("m_cosh", function() return m_cosh (scannumeric()) end)
-local m_deg = m.deg registerscript("m_deg", function() return m_deg (scannumeric()) end)
-local m_erf = m.erf registerscript("m_erf", function() return m_erf (scannumeric()) end)
-local m_erfc = m.erfc registerscript("m_erfc", function() return m_erfc (scannumeric()) end)
-local m_exp = m.exp registerscript("m_exp", function() return m_exp (scannumeric()) end)
-local m_exp2 = m.exp2 registerscript("m_exp2", function() return m_exp2 (scannumeric()) end)
-local m_expm1 = m.expm1 registerscript("m_expm1", function() return m_expm1 (scannumeric()) end)
-local m_fabs = m.fabs registerscript("m_fabs", function() return m_fabs (scannumeric()) end)
-local m_fdim = m.fdim registerscript("m_fdim", function() return m_fdim (scanpair ()) end)
-local m_floor = m.floor registerscript("m_floor", function() return m_floor (scannumeric()) end)
-local m_fma = m.fma registerscript("m_fma", function() return m_fma (scancolor ()) end)
-local m_fmax = m.fmax registerscript("m_fmax", function() return m_fmax (scannumeric()) end)
-local m_fmin = m.fmin registerscript("m_fmin", function() return m_fmin (scannumeric()) end)
-local m_fmod = m.fmod registerscript("m_fmod", function() return m_fmod (scanpair ()) end)
-local m_frexp = m.frexp registerscript("m_frexp", function() return m_frexp (scannumeric()) end)
-local m_gamma = m.gamma registerscript("m_gamma", function() return m_gamma (scannumeric()) end)
-local m_hypot = m.hypot registerscript("m_hypot", function() return m_hypot (scanpair ()) end)
-local m_isfinite = m.isfinite registerscript("m_isfinite", function() return m_isfinite (scannumeric()) end)
-local m_isinf = m.isinf registerscript("m_isinf", function() return m_isinf (scannumeric()) end)
-local m_isnan = m.isnan registerscript("m_isnan", function() return m_isnan (scannumeric()) end)
-local m_isnormal = m.isnormal registerscript("m_isnormal", function() return m_isnormal (scannumeric()) end)
-local m_j0 = m.j0 registerscript("m_j0", function() return m_j0 (scannumeric()) end)
-local m_j1 = m.j1 registerscript("m_j1", function() return m_j1 (scannumeric()) end)
-local m_jn = m.jn registerscript("m_jn", function() return m_jn (scanpair ()) end)
-local m_ldexp = m.ldexp registerscript("m_ldexp", function() return m_ldexp (scanpair ()) end)
-local m_lgamma = m.lgamma registerscript("m_lgamma", function() return m_lgamma (scannumeric()) end)
-local m_log = m.log registerscript("m_log", function() return m_log (scannumeric()) end)
-local m_log10 = m.log10 registerscript("m_log10", function() return m_log10 (scannumeric()) end)
-local m_log1p = m.log1p registerscript("m_log1p", function() return m_log1p (scannumeric()) end)
-local m_log2 = m.log2 registerscript("m_log2", function() return m_log2 (scannumeric()) end)
-local m_logb = m.logb registerscript("m_logb", function() return m_logb (scannumeric()) end)
-local m_modf = m.modf registerscript("m_modf", function() return m_modf (scannumeric()) end)
-local m_nearbyint = m.nearbyint registerscript("m_nearbyint", function() return m_nearbyint(scannumeric()) end)
-local m_nextafter = m.nextafter registerscript("m_nextafter", function() return m_nextafter(scanpair ()) end)
-local m_pow = m.pow registerscript("m_pow", function() return m_pow (scanpair ()) end)
-local m_rad = m.rad registerscript("m_rad", function() return m_rad (scannumeric()) end)
-local m_remainder = m.remainder registerscript("m_remainder", function() return m_remainder(scanpair ()) end)
-local m_remquo = m.remquo registerscript("m_remquo", function() return m_remquo (scannumeric()) end)
-local m_round = m.round registerscript("m_round", function() return m_round (scannumeric()) end)
-local m_scalbn = m.scalbn registerscript("m_scalbn", function() return m_scalbn (scanpair ()) end)
-local m_sin = m.sin registerscript("m_sin", function() return m_sin (scannumeric()) end)
-local m_sinh = m.sinh registerscript("m_sinh", function() return m_sinh (scannumeric()) end)
-local m_sqrt = m.sqrt registerscript("m_sqrt", function() return m_sqrt (scannumeric()) end)
-local m_tan = m.tan registerscript("m_tan", function() return m_tan (scannumeric()) end)
-local m_tanh = m.tanh registerscript("m_tanh", function() return m_tanh (scannumeric()) end)
-local m_tgamma = m.tgamma registerscript("m_tgamma", function() return m_tgamma (scannumeric()) end)
-local m_trunc = m.trunc registerscript("m_trunc", function() return m_trunc (scannumeric()) end)
-local m_y0 = m.y0 registerscript("m_y0", function() return m_y0 (scannumeric()) end)
-local m_y1 = m.y1 registerscript("m_y1", function() return m_y1 (scannumeric()) end)
-local m_yn = m.yn registerscript("m_yn", function() return m_yn (scanpair ()) end)
-
-if not (c and c.sin) then
- return
-end
-
-local c_topair = c.topair
-local c_new = c.new
-
-local c_sin = c.sin registerscript("c_sin", function() return mppair(c_topair(c_sin (c_new(scanpair())))) end)
-local c_cos = c.cos registerscript("c_cos", function() return mppair(c_topair(c_cos (c_new(scanpair())))) end)
-local c_tan = c.tan registerscript("c_tan", function() return mppair(c_topair(c_tan (c_new(scanpair())))) end)
-local c_sinh = c.sinh registerscript("c_sinh", function() return mppair(c_topair(c_sinh (c_new(scanpair())))) end)
-local c_cosh = c.cosh registerscript("c_cosh", function() return mppair(c_topair(c_cosh (c_new(scanpair())))) end)
-local c_tanh = c.tanh registerscript("c_tanh", function() return mppair(c_topair(c_tanh (c_new(scanpair())))) end)
-
-local c_asin = c.asin registerscript("c_asin", function() return mppair(c_topair(c_sin (c_new(scanpair())))) end)
-local c_acos = c.acos registerscript("c_acos", function() return mppair(c_topair(c_cos (c_new(scanpair())))) end)
-local c_atan = c.atan registerscript("c_atan", function() return mppair(c_topair(c_tan (c_new(scanpair())))) end)
-local c_asinh = c.asinh registerscript("c_asinh", function() return mppair(c_topair(c_sinh (c_new(scanpair())))) end)
-local c_acosh = c.acosh registerscript("c_acosh", function() return mppair(c_topair(c_cosh (c_new(scanpair())))) end)
-local c_atanh = c.atanh registerscript("c_atanh", function() return mppair(c_topair(c_tanh (c_new(scanpair())))) end)
-
-local c_sqrt = c.sqrt registerscript("c_sqrt", function() return mppair(c_topair(c_sqrt (c_new(scanpair())))) end)
-local c_abs = c.abs registerscript("c_abs", function() return c_topair(c_abs (c_new(scanpair()))) end)
-local c_arg = c.arg registerscript("c_arg", function() return c_topair(c_arg (c_new(scanpair()))) end)
-local c_conj = c.conj registerscript("c_conj", function() return mppair(c_topair(c_conj (c_new(scanpair())))) end)
-local c_exp = c.exp registerscript("c_exp", function() return mppair(c_topair(c_exp (c_new(scanpair())))) end)
-local c_log = c.log registerscript("c_log", function() return mppair(c_topair(c_log (c_new(scanpair())))) end)
-local c_proj = c.proj registerscript("c_proj", function() return mppair(c_topair(c_proj (c_new(scanpair())))) end)
-
-local c_erf = c.erf registerscript("c_erf", function() return mppair(c_topair(c_erf (c_new(scanpair())))) end)
-local c_erfc = c.erfc registerscript("c_erfc", function() return mppair(c_topair(c_erfc (c_new(scanpair())))) end)
-local c_erfcx = c.erfcx registerscript("c_erfcx", function() return mppair(c_topair(c_erfcx (c_new(scanpair())))) end)
-local c_erfi = c.erfi registerscript("c_erfi", function() return mppair(c_topair(c_erfi (c_new(scanpair())))) end)
-local c_dawson = c.dawson registerscript("c_dawson", function() return mppair(c_topair(c_dawson(c_new(scanpair())))) end)
-
-local c_voigt = c.voigt
-local c_voigt_hwhm = c.voigt_hwhm
-
-registerscript("c_voigt", function()
- return mppair(c_topair(c_voigt(c_new(scanpair()),c_new(scanpair()),c_new(scanpair()))))
-end)
-
-registerscript("c_voigt_hwhm", function()
- return mppair(c_topair(c_voigt_hwhm(c_new(scanpair()),c_new(scanpair()))))
-end)
-
-local c_pow = c.pow registerscript("c_pow", function() return mppair(c_topair(c_pow(c_new(scanpair()),c_new(scanpair())))) end)
-local c_add = c.add registerscript("c_add", function() return mppair(c_topair(c_add(c_new(scanpair()),c_new(scanpair())))) end)
-local c_sub = c.sub registerscript("c_sub", function() return mppair(c_topair(c_sub(c_new(scanpair()),c_new(scanpair())))) end)
-local c_mul = c.mul registerscript("c_mul", function() return mppair(c_topair(c_mul(c_new(scanpair()),c_new(scanpair())))) end)
-local c_div = c.div registerscript("c_div", function() return mppair(c_topair(c_div(c_new(scanpair()),c_new(scanpair())))) end)
-
-local c_imag = c.imag registerscript("c_imag", function() return c_topair(c_imag(c_new(scanpair()))) end)
-local c_real = c.real registerscript("c_real", function() return c_topair(c_real(c_new(scanpair()))) end)
-local c_neg = c.neg registerscript("c_new", function() return c_topair(c_neg (c_new(scanpair()))) end)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mlib-mpf.lua b/Master/texmf-dist/tex/context/base/mkiv/mlib-mpf.lua
new file mode 100644
index 00000000000..7452c011187
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkiv/mlib-mpf.lua
@@ -0,0 +1,1244 @@
+if not modules then modules = { } end modules ['mlib-mpf'] = {
+ version = 1.001,
+ comment = "companion to mlib-ctx.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files",
+}
+
+-- moved from mlib-lua:
+
+local type, tostring, tonumber, select, loadstring = type, tostring, tonumber, select, loadstring
+local find, match, gsub, gmatch = string.find, string.match, string.gsub, string.gmatch
+local concat = table.concat
+
+local formatters = string.formatters
+local lpegmatch = lpeg.match
+local lpegpatterns = lpeg.patterns
+
+local P, S, Ct, Cs, Cc, C = lpeg.P, lpeg.S, lpeg.Ct, lpeg.Cs, lpeg.Cc, lpeg.C
+
+local report_luarun = logs.reporter("metapost","lua")
+local report_script = logs.reporter("metapost","script")
+local report_message = logs.reporter("metapost")
+
+local trace_luarun = false trackers.register("metapost.lua",function(v) trace_luarun = v end)
+
+local be_tolerant = true directives.register("metapost.lua.tolerant", function(v) be_tolerant = v end)
+
+local set = mp.set
+local get = mp.get
+local aux = mp.aux
+local scan = mp.scan
+local inject = mp.inject
+
+do
+
+ -- serializers
+
+ local f_integer = formatters["%i"]
+ local f_numeric = formatters["%F"]
+
+ -- no %n as that can produce -e notation and that is not so nice for scaled butmaybe we
+ -- should then switch between ... i.e. make a push/pop for the formatters here ... not now.
+
+ local f_integer = formatters["%i"]
+ local f_numeric = formatters["%F"]
+ local f_pair = formatters["(%F,%F)"]
+ local f_ctrl = formatters["(%F,%F) .. controls (%F,%F) and (%F,%F)"]
+ local f_triplet = formatters["(%F,%F,%F)"]
+ local f_quadruple = formatters["(%F,%F,%F,%F)"]
+ local f_transform = formatters["totransform(%F,%F,%F,%F,%F,%F)"]
+ local f_pen = formatters["(pencircle transformed totransform(%F,%F,%F,%F,%F,%F))"]
+
+ local f_points = formatters["%p"]
+ local f_pair_pt = formatters["(%p,%p)"]
+ local f_ctrl_pt = formatters["(%p,%p) .. controls (%p,%p) and (%p,%p)"]
+ local f_triplet_pt = formatters["(%p,%p,%p)"]
+ local f_quadruple_pt = formatters["(%p,%p,%p,%p)"]
+
+ local r = P('%') / "percent"
+ + P('"') / "dquote"
+ + P('\n') / "crlf"
+ -- + P(' ') / "space"
+ local a = Cc("&")
+ local q = Cc('"')
+ local p = Cs(q * (r * a)^-1 * (a * r * (P(-1) + a) + P(1))^0 * q)
+
+ mp.cleaned = function(s) return lpegmatch(p,s) or s end
+
+ -- management
+
+ -- sometimes we gain (e.g. .5 sec on the sync test)
+
+ local cache = table.makeweak()
+
+ local runscripts = { }
+ local runnames = { }
+ local nofscripts = 0
+
+ function metapost.registerscript(name,f)
+ nofscripts = nofscripts + 1
+ if f then
+ runscripts[nofscripts] = f
+ runnames[name] = nofscripts
+ else
+ runscripts[nofscripts] = name
+ end
+ return nofscripts
+ end
+
+ function metapost.scriptindex(name)
+ return runnames[name] or 0
+ end
+
+ -- The gbuffer sharing and such is not really needed now but make a dent when
+ -- we have a high volume of simpel calls (loops) so we keep it around for a
+ -- while.
+
+ local nesting = 0
+ local runs = 0
+ local gbuffer = { }
+ local buffer = gbuffer
+ local n = 0
+
+ local function mpdirect1(a)
+ n = n + 1 buffer[n] = a
+ end
+ local function mpdirect2(a,b)
+ n = n + 1 buffer[n] = a
+ n = n + 1 buffer[n] = b
+ end
+ local function mpdirect3(a,b,c)
+ n = n + 1 buffer[n] = a
+ n = n + 1 buffer[n] = b
+ n = n + 1 buffer[n] = c
+ end
+ local function mpdirect4(a,b,c,d)
+ n = n + 1 buffer[n] = a
+ n = n + 1 buffer[n] = b
+ n = n + 1 buffer[n] = c
+ n = n + 1 buffer[n] = d
+ end
+ local function mpdirect5(a,b,c,d,e)
+ n = n + 1 buffer[n] = a
+ n = n + 1 buffer[n] = b
+ n = n + 1 buffer[n] = c
+ n = n + 1 buffer[n] = d
+ n = n + 1 buffer[n] = e
+ end
+
+ local function mpflush(separator)
+ buffer[1] = concat(buffer,separator or "",1,n)
+ n = 1
+ end
+
+ function metapost.runscript(code)
+ nesting = nesting + 1
+ runs = runs + 1
+
+ local index = type(code) == "number"
+ local f
+ local result
+
+ if index then
+ f = runscripts[code]
+ if not f then
+ report_luarun("%i: bad index: %s",nesting,code)
+ elseif trace_luarun then
+ report_luarun("%i: index: %i",nesting,code)
+ end
+ else
+ if trace_luarun then
+ report_luarun("%i: code: %s",nesting,code)
+ end
+ f = cache[code]
+ if not f then
+ f = loadstring("return " .. code)
+ if f then
+ cache[code] = f
+ elseif be_tolerant then
+ f = loadstring(code)
+ if f then
+ cache[code] = f
+ end
+ end
+ end
+ end
+
+ -- returning nil is more efficient and a signal not to scan in mp
+
+ if f then
+
+ local lbuffer, ln
+
+ if nesting == 1 then
+ buffer = gbuffer
+ n = 0
+ else
+ lbuffer = buffer
+ ln = n
+ buffer = { }
+ n = 0
+ end
+
+ result = f()
+ if result then
+ local t = type(result)
+ if t == "number" then
+ result = f_numeric(result)
+ elseif t == "table" then
+ result = concat(result) -- no spaces here
+ else
+ result = tostring(result)
+ end
+ if trace_luarun then
+ report_luarun("%i: %s result: %s",nesting,t,result)
+ end
+ elseif n == 0 then
+ -- result = ""
+ result = nil -- no scantokens done then
+ if trace_luarun then
+ report_luarun("%i: no buffered result",nesting)
+ end
+ elseif n == 1 then
+ result = buffer[1]
+ if trace_luarun then
+ report_luarun("%i: 1 buffered result: %s",nesting,result)
+ end
+ else
+ -- the space is why we sometimes have collectors
+ if nesting == 1 then
+ -- if we had no space we could pass result directly in lmtx
+ result = concat(buffer," ",1,n)
+ if n > 500 or #result > 10000 then
+ gbuffer = { } -- newtable(20,0)
+ lbuffer = gbuffer
+ end
+ else
+ -- if we had no space we could pass result directly in lmtx
+ result = concat(buffer," ")
+ end
+ if trace_luarun then
+ report_luarun("%i: %i buffered results: %s",nesting,n,result)
+ end
+ end
+
+ if nesting == 1 then
+ n = 0
+ else
+ buffer = lbuffer
+ n = ln
+ end
+
+ else
+ report_luarun("%i: no result, invalid code: %s",nesting,code)
+ result = ""
+ end
+
+ nesting = nesting - 1
+
+ return result
+ end
+
+ function metapost.nofscriptruns()
+ return runs
+ end
+
+ -- writers
+
+ local function mpp(value)
+ n = n + 1
+ local t = type(value)
+ if t == "number" then
+ buffer[n] = f_numeric(value)
+ elseif t == "string" then
+ buffer[n] = value
+ elseif t == "table" then
+ if #t == 6 then
+ buffer[n] = "totransform(" .. concat(value,",") .. ")"
+ else
+ buffer[n] = "(" .. concat(value,",") .. ")"
+ end
+ else -- boolean or whatever
+ buffer[n] = tostring(value)
+ end
+ end
+
+ local function mpprint(first,second,...)
+ if second == nil then
+ if first ~= nil then
+ mpp(first)
+ end
+ else
+ for i=1,select("#",first,second,...) do
+ local value = (select(i,first,second,...))
+ if value ~= nil then
+ mpp(value)
+ end
+ end
+ end
+ end
+
+ local function mpp(value)
+ n = n + 1
+ local t = type(value)
+ if t == "number" then
+ buffer[n] = f_numeric(value)
+ elseif t == "string" then
+ buffer[n] = lpegmatch(p,value)
+ elseif t == "table" then
+ if #t > 4 then
+ buffer[n] = ""
+ else
+ buffer[n] = "(" .. concat(value,",") .. ")"
+ end
+ else -- boolean or whatever
+ buffer[n] = tostring(value)
+ end
+ end
+
+ local function mpvprint(first,second,...) -- variable print
+ if second == nil then
+ if first ~= nil then
+ mpp(first)
+ end
+ else
+ for i=1,select("#",first,second,...) do
+ local value = (select(i,first,second,...))
+ if value ~= nil then
+ mpp(value)
+ end
+ end
+ end
+ end
+
+ local function mpstring(value)
+ n = n + 1
+ buffer[n] = lpegmatch(p,value)
+ end
+
+ local function mpboolean(b)
+ n = n + 1
+ buffer[n] = b and "true" or "false"
+ end
+
+ local function mpnumeric(f)
+ n = n + 1
+ if not f or f == 0 then
+ buffer[n] = "0"
+ else
+ buffer[n] = f_numeric(f)
+ end
+ end
+
+ local function mpinteger(i)
+ n = n + 1
+ -- buffer[n] = i and f_integer(i) or "0"
+ buffer[n] = i or "0"
+ end
+
+ local function mppoints(i)
+ n = n + 1
+ if not i or i == 0 then
+ buffer[n] = "0pt"
+ else
+ buffer[n] = f_points(i)
+ end
+ end
+
+ local function mppair(x,y)
+ n = n + 1
+ if type(x) == "table" then
+ buffer[n] = f_pair(x[1],x[2])
+ else
+ buffer[n] = f_pair(x,y)
+ end
+ end
+
+ local function mppairpoints(x,y)
+ n = n + 1
+ if type(x) == "table" then
+ buffer[n] = f_pair_pt(x[1],x[2])
+ else
+ buffer[n] = f_pair_pt(x,y)
+ end
+ end
+
+ local function mptriplet(x,y,z)
+ n = n + 1
+ if type(x) == "table" then
+ buffer[n] = f_triplet(x[1],x[2],x[3])
+ else
+ buffer[n] = f_triplet(x,y,z)
+ end
+ end
+
+ local function mptripletpoints(x,y,z)
+ n = n + 1
+ if type(x) == "table" then
+ buffer[n] = f_triplet_pt(x[1],x[2],x[3])
+ else
+ buffer[n] = f_triplet_pt(x,y,z)
+ end
+ end
+
+ local function mpquadruple(w,x,y,z)
+ n = n + 1
+ if type(w) == "table" then
+ buffer[n] = f_quadruple(w[1],w[2],w[3],w[4])
+ else
+ buffer[n] = f_quadruple(w,x,y,z)
+ end
+ end
+
+ local function mpquadruplepoints(w,x,y,z)
+ n = n + 1
+ if type(w) == "table" then
+ buffer[n] = f_quadruple_pt(w[1],w[2],w[3],w[4])
+ else
+ buffer[n] = f_quadruple_pt(w,x,y,z)
+ end
+ end
+
+ local function mptransform(x,y,xx,xy,yx,yy)
+ n = n + 1
+ if type(x) == "table" then
+ buffer[n] = f_transform(x[1],x[2],x[3],x[4],x[5],x[6])
+ else
+ buffer[n] = f_transform(x,y,xx,xy,yx,yy)
+ end
+ end
+
+ local function mpcolor(c,m,y,k)
+ n = n + 1
+ if type(c) == "table" then
+ local l = #c
+ if l == 4 then
+ buffer[n] = f_quadruple(c[1],c[2],c[3],c[4])
+ elseif l == 3 then
+ buffer[n] = f_triplet(c[1],c[2],c[3])
+ else
+ buffer[n] = f_numeric(c[1])
+ end
+ else
+ if k then
+ buffer[n] = f_quadruple(c,m,y,k)
+ elseif y then
+ buffer[n] = f_triplet(c,m,y)
+ else
+ buffer[n] = f_numeric(c)
+ end
+ end
+ end
+
+ -- we have three kind of connectors:
+ --
+ -- .. ... -- (true)
+
+ local function mp_path(f2,f6,t,connector,cycle)
+ if type(t) == "table" then
+ local tn = #t
+ if tn == 1 then
+ local t1 = t[1]
+ n = n + 1
+ if t.pen then
+ buffer[n] = f_pen(unpack(t1))
+ else
+ buffer[n] = f2(t1[1],t1[2])
+ end
+ elseif tn > 0 then
+ if connector == true or connector == nil then
+ connector = ".."
+ elseif connector == false then
+ connector = "--"
+ end
+ if cycle == nil then
+ cycle = t.cycle
+ if cycle == nil then
+ cycle = true
+ end
+ end
+ local six = connector == ".." -- otherwise we use whatever gets asked for
+ local controls = connector -- whatever
+ local a = t[1]
+ local b = t[2]
+ n = n + 1
+ buffer[n] = "("
+ n = n + 1
+ if six and #a == 6 and #b == 6 then
+ buffer[n] = f6(a[1],a[2],a[5],a[6],b[3],b[4])
+ controls = ".."
+ else
+ buffer[n] = f2(a[1],a[2])
+ controls = connector
+ end
+ for i=2,tn-1 do
+ a = b
+ b = t[i+1]
+ n = n + 1
+ buffer[n] = connector
+ n = n + 1
+ if six and #a == 6 and #b == 6 then
+ buffer[n] = f6(a[1],a[2],a[5],a[6],b[3],b[4])
+ controls = ".."
+ else
+ buffer[n] = f2(a[1],a[2])
+ controls = connector
+ end
+ end
+ n = n + 1
+ buffer[n] = connector
+ a = b
+ b = t[1]
+ n = n + 1
+ if cycle then
+ if six and #a == 6 and #b == 6 then
+ buffer[n] = f6(a[1],a[2],a[5],a[6],b[3],b[4])
+ controls = ".."
+ else
+ buffer[n] = f2(a[1],a[2])
+ controls = connector
+ end
+ n = n + 1
+ buffer[n] = connector
+ n = n + 1
+ buffer[n] = "cycle"
+ else
+ buffer[n] = f2(a[1],a[2])
+ end
+ n = n + 1
+ buffer[n] = ")"
+ end
+ end
+ end
+
+ local function mppath(...)
+ mp_path(f_pair,f_ctrl,...)
+ end
+
+ local function mppathpoints(...)
+ mp_path(f_pair_pt,f_ctrl_pt,...)
+ end
+
+ local function mpsize(t)
+ n = n + 1
+ buffer[n] = type(t) == "table" and f_numeric(#t) or "0"
+ end
+
+ local replacer = lpeg.replacer("@","%%")
+
+ local function mpfprint(fmt,...)
+ n = n + 1
+ if not find(fmt,"%",1,true) then
+ fmt = lpegmatch(replacer,fmt)
+ end
+ buffer[n] = formatters[fmt](...)
+ end
+
+ local function mpquoted(fmt,s,...)
+ if s then
+ n = n + 1
+ if not find(fmt,"%",1,true) then
+ fmt = lpegmatch(replacer,fmt)
+ end
+ -- buffer[n] = '"' .. formatters[fmt](s,...) .. '"'
+ buffer[n] = lpegmatch(p,formatters[fmt](s,...))
+ elseif fmt then
+ n = n + 1
+ -- buffer[n] = '"' .. fmt .. '"'
+ buffer[n] = lpegmatch(p,fmt)
+ else
+ -- something is wrong
+ end
+ end
+
+ aux.direct = mpdirect1
+ aux.direct1 = mpdirect1
+ aux.direct2 = mpdirect2
+ aux.direct3 = mpdirect3
+ aux.direct4 = mpdirect4
+ aux.flush = mpflush
+
+ aux.print = mpprint
+ aux.vprint = mpvprint
+ aux.boolean = mpboolean
+ aux.string = mpstring
+ aux.numeric = mpnumeric
+ aux.number = mpnumeric
+ aux.integer = mpinteger
+ aux.points = mppoints
+ aux.pair = mppair
+ aux.pairpoints = mppairpoints
+ aux.triplet = mptriplet
+ aux.tripletpoints = mptripletpoints
+ aux.quadruple = mpquadruple
+ aux.quadruplepoints = mpquadruplepoints
+ aux.path = mppath
+ aux.pathpoints = mppathpoints
+ aux.size = mpsize
+ aux.fprint = mpfprint
+ aux.quoted = mpquoted
+ aux.transform = mptransform
+ aux.color = mpcolor
+
+ -- for the moment
+
+ local function mpdraw(lines,list) -- n * 4
+ if list then
+ local c = #lines
+ for i=1,c do
+ local ci = lines[i]
+ local ni = #ci
+ n = n + 1 buffer[n] = i < c and "d(" or "D("
+ for j=1,ni,2 do
+ local l = j + 1
+ n = n + 1 buffer[n] = ci[j]
+ n = n + 1 buffer[n] = ","
+ n = n + 1 buffer[n] = ci[l]
+ n = n + 1 buffer[n] = l < ni and ")--(" or ");"
+ end
+ end
+ else
+ local l = #lines
+ local m = l - 4
+ for i=1,l,4 do
+ n = n + 1 buffer[n] = i < m and "d(" or "D("
+ n = n + 1 buffer[n] = lines[i]
+ n = n + 1 buffer[n] = ","
+ n = n + 1 buffer[n] = lines[i+1]
+ n = n + 1 buffer[n] = ")--("
+ n = n + 1 buffer[n] = lines[i+2]
+ n = n + 1 buffer[n] = ","
+ n = n + 1 buffer[n] = lines[i+3]
+ n = n + 1 buffer[n] = ");"
+ end
+ end
+ end
+
+ local function mpfill(lines,list)
+ if list then
+ local c = #lines
+ for i=1,c do
+ local ci = lines[i]
+ local ni = #ci
+ n = n + 1 buffer[n] = i < c and "f(" or "F("
+ for j=1,ni,2 do
+ local l = j + 1
+ n = n + 1 buffer[n] = ci[j]
+ n = n + 1 buffer[n] = ","
+ n = n + 1 buffer[n] = ci[l]
+ n = n + 1 buffer[n] = l < ni and ")--(" or ")--C;"
+ end
+ end
+ else
+ local l = #lines
+ local m = l - 4
+ for i=1,l,4 do
+ n = n + 1 buffer[n] = i < m and "f(" or "F("
+ n = n + 1 buffer[n] = lines[i]
+ n = n + 1 buffer[n] = ","
+ n = n + 1 buffer[n] = lines[i+1]
+ n = n + 1 buffer[n] = ")--("
+ n = n + 1 buffer[n] = lines[i+2]
+ n = n + 1 buffer[n] = ","
+ n = n + 1 buffer[n] = lines[i+3]
+ n = n + 1 buffer[n] = ")--C;"
+ end
+ end
+ end
+
+ aux.draw = mpdraw
+ aux.fill = mpfill
+
+ for k, v in next, aux do mp[k] = v end
+
+end
+
+do
+
+ -- Another experimental feature:
+
+ local mpnumeric = mp.numeric
+ local scanstring = scan.string
+ local scriptindex = metapost.scriptindex
+
+ function mp.mf_script_index(name)
+ local index = scriptindex(name)
+ -- report_script("method %i, name %a, index %i",1,name,index)
+ mpnumeric(index)
+ end
+
+ -- once bootstrapped ... (needs pushed mpx instances)
+
+ metapost.registerscript("scriptindex",function()
+ local name = scanstring()
+ local index = scriptindex(name)
+ -- report_script("method %i, name %a, index %i",2,name,index)
+ mpnumeric(index)
+ end)
+
+end
+
+-- the next will move to mlib-lmp.lua
+
+do
+
+ local mpnamedcolor = attributes.colors.mpnamedcolor
+ local mpprint = aux.print
+ local scanstring = scan.string
+
+ mp.mf_named_color = function(str)
+ mpprint(mpnamedcolor(str))
+ end
+
+ -- todo: we can inject but currently we always get a string back so then
+ -- we need to deal with it upstream in the color module ... not now
+
+ metapost.registerscript("namedcolor",function()
+ mpprint(mpnamedcolor(scanstring()))
+ end)
+
+end
+
+function mp.n(t) -- used ?
+ return type(t) == "table" and #t or 0
+end
+
+do
+
+ -- experiment: names can change
+
+ local mppath = aux.path
+ local mpsize = aux.size
+
+ local whitespace = lpegpatterns.whitespace
+ local newline = lpegpatterns.newline
+ local setsep = newline^2
+ local comment = (S("#%") + P("--")) * (1-newline)^0 * (whitespace - setsep)^0
+ local value = (1-whitespace)^1 / tonumber
+ local entry = Ct( value * whitespace * value)
+ local set = Ct((entry * (whitespace-setsep)^0 * comment^0)^1)
+ local series = Ct((set * whitespace^0)^1)
+
+ local pattern = whitespace^0 * series
+
+ local datasets = { }
+ mp.datasets = datasets
+
+ function mp.dataset(str)
+ return lpegmatch(pattern,str)
+ end
+
+ function datasets.load(tag,filename)
+ if not filename then
+ tag, filename = file.basename(tag), tag
+ end
+ local data = lpegmatch(pattern,io.loaddata(filename) or "")
+ datasets[tag] = {
+ data = data,
+ line = function(n) mppath(data[n or 1]) end,
+ size = function() mpsize(data) end,
+ }
+ end
+
+ table.setmetatablecall(datasets,function(t,k,f,...)
+ local d = datasets[k]
+ local t = type(d)
+ if t == "table" then
+ d = d[f]
+ if type(d) == "function" then
+ d(...)
+ else
+ mpvprint(...)
+ end
+ elseif t == "function" then
+ d(f,...)
+ end
+ end)
+
+end
+
+-- \startluacode
+-- local str = [[
+-- 10 20 20 20
+-- 30 40 40 60
+-- 50 10
+--
+-- 10 10 20 30
+-- 30 50 40 50
+-- 50 20 -- the last one
+--
+-- 10 20 % comment
+-- 20 10
+-- 30 40 # comment
+-- 40 20
+-- 50 10
+-- ]]
+--
+-- MP.myset = mp.dataset(str)
+--
+-- inspect(MP.myset)
+-- \stopluacode
+--
+-- \startMPpage
+-- color c[] ; c[1] := red ; c[2] := green ; c[3] := blue ;
+-- for i=1 upto lua("mp.print(mp.n(MP.myset))") :
+-- draw lua("mp.path(MP.myset[" & decimal i & "])") withcolor c[i] ;
+-- endfor ;
+-- \stopMPpage
+
+-- texts:
+
+do
+
+ local mptriplet = mp.triplet
+
+ local bpfactor = number.dimenfactors.bp
+ local textexts = nil
+ local mptriplet = mp.triplet
+ local nbdimensions = nodes.boxes.dimensions
+
+ function mp.mf_tt_initialize(tt)
+ textexts = tt
+ end
+
+ function mp.mf_tt_dimensions(n)
+ local box = textexts and textexts[n]
+ if box then
+ -- could be made faster with nuts but not critical
+ mptriplet(box.width*bpfactor,box.height*bpfactor,box.depth*bpfactor)
+ else
+ mptriplet(0,0,0)
+ end
+ end
+
+ function mp.mf_tb_dimensions(category,name)
+ local w, h, d = nbdimensions(category,name)
+ mptriplet(w*bpfactor,h*bpfactor,d*bpfactor)
+ end
+
+ function mp.report(a,b,c,...)
+ if c then
+ report_message("%s : %s",a,formatters[(gsub(b,"@","%%"))](c,...))
+ elseif b then
+ report_message("%s : %s",a,b)
+ elseif a then
+ report_message("%s : %s","message",a)
+ end
+ end
+
+end
+
+do
+
+ local mpprint = aux.print
+ local modes = tex.modes
+ local systemmodes = tex.systemmodes
+
+ function mp.mode(s)
+ mpprint(modes[s] and true or false)
+ end
+
+ function mp.systemmode(s)
+ mpprint(systemmodes[s] and true or false)
+ end
+
+ mp.processingmode = mp.mode
+
+end
+
+-- for alan's nodes:
+
+do
+
+ local mpprint = aux.print
+ local mpquoted = aux.quoted
+
+ function mp.isarray(str)
+ mpprint(find(str,"%d") and true or false)
+ end
+
+ function mp.prefix(str)
+ mpquoted(match(str,"^(.-)[%d%[]") or str)
+ end
+
+ -- function mp.dimension(str)
+ -- local n = 0
+ -- for s in gmatch(str,"%[?%-?%d+%]?") do --todo: lpeg
+ -- n = n + 1
+ -- end
+ -- mpprint(n)
+ -- end
+
+ mp.dimension = lpeg.counter(P("[") * lpegpatterns.integer * P("]") + lpegpatterns.integer,mpprint)
+
+ -- faster and okay as we don't have many variables but probably only
+ -- basename makes sense and even then it's not called that often
+
+ -- local hash = table.setmetatableindex(function(t,k)
+ -- local v = find(k,"%d") and true or false
+ -- t[k] = v
+ -- return v
+ -- end)
+ --
+ -- function mp.isarray(str)
+ -- mpprint(hash[str])
+ -- end
+ --
+ -- local hash = table.setmetatableindex(function(t,k)
+ -- local v = '"' .. (match(k,"^(.-)%d") or k) .. '"'
+ -- t[k] = v
+ -- return v
+ -- end)
+ --
+ -- function mp.prefix(str)
+ -- mpprint(hash[str])
+ -- end
+
+end
+
+do
+
+ local getmacro = tokens.getters.macro
+ local setmacro = tokens.setters.macro
+
+ local getdimen = tex.getdimen
+ local getcount = tex.getcount
+ local gettoks = tex.gettoks
+ local setdimen = tex.setdimen
+ local setcount = tex.setcount
+ local settoks = tex.settoks
+
+ local mpprint = mp.print
+ local mpquoted = mp.quoted
+
+ local bpfactor = number.dimenfactors.bp
+
+ -- more helpers
+
+ function mp.getmacro(k) mpquoted(getmacro(k)) end
+ function mp.getdimen(k) mpprint (getdimen(k)*bpfactor) end
+ function mp.getcount(k) mpprint (getcount(k)) end
+ function mp.gettoks (k) mpquoted(gettoks (k)) end
+
+ function mp.setmacro(k,v) setmacro(k,v) end
+ function mp.setdimen(k,v) setdimen(k,v/bpfactor) end
+ function mp.setcount(k,v) setcount(k,v) end
+ function mp.settoks (k,v) settoks (k,v) end
+
+ function mp.setglobalmacro(k,v) setmacro(k,v,"global") end
+ function mp.setglobaldimen(k,v) setdimen("global",k,v/bpfactor) end
+ function mp.setglobalcount(k,v) setcount("global",k,v) end
+ function mp.setglobaltoks (k,v) settoks ("global",k,v) end
+
+ -- def foo = lua.mp.foo ... enddef ; % loops due to foo in suffix
+
+ mp._get_macro_ = mp.getmacro
+ mp._get_dimen_ = mp.getdimen
+ mp._get_count_ = mp.getcount
+ mp._get_toks_ = mp.gettoks
+
+ mp._set_macro_ = mp.setmacro
+ mp._set_dimen_ = mp.setdimen
+ mp._set_count_ = mp.setcount
+ mp._set_toks_ = mp.settoks
+
+ mp._set_global_macro_ = mp.setglobalmacro
+ mp._set_global_dimen_ = mp.setglobaldimen
+ mp._set_global_count_ = mp.setglobalcount
+ mp._set_global_toks_ = mp.setglobaltoks
+
+end
+
+-- position fun
+
+do
+
+ local mpprint = mp.print
+ local mpfprint = mp.fprint
+ local mpquoted = mp.quoted
+ local jobpositions = job.positions
+ local getwhd = jobpositions.whd
+ local getxy = jobpositions.xy
+ local getposition = jobpositions.position
+ local getpage = jobpositions.page
+ local getregion = jobpositions.region
+ local getmacro = tokens.getters.macro
+
+ function mp.positionpath(name)
+ local w, h, d = getwhd(name)
+ if w then
+ mpfprint("((%p,%p)--(%p,%p)--(%p,%p)--(%p,%p)--cycle)",0,-d,w,-d,w,h,0,h)
+ else
+ mpprint("(origin--cycle)")
+ end
+ end
+
+ function mp.positioncurve(name)
+ local w, h, d = getwhd(name)
+ if w then
+ mpfprint("((%p,%p)..(%p,%p)..(%p,%p)..(%p,%p)..cycle)",0,-d,w,-d,w,h,0,h)
+ else
+ mpprint("(origin--cycle)")
+ end
+ end
+
+ function mp.positionbox(name)
+ local p, x, y, w, h, d = getposition(name)
+ if p then
+ mpfprint("((%p,%p)--(%p,%p)--(%p,%p)--(%p,%p)--cycle)",x,y-d,x+w,y-d,x+w,y+h,x,y+h)
+ else
+ mpprint("(%p,%p)",x,y)
+ end
+ end
+
+ function mp.positionxy(name)
+ local x, y = getxy(name)
+ if x then
+ mpfprint("(%p,%p)",x,y)
+ else
+ mpprint("origin")
+ end
+ end
+
+ function mp.positionpage(name)
+ mpfprint("%i",getpage(name) or 0)
+ end
+
+ function mp.positionregion(name)
+ local r = getregion(name)
+ if r then
+ mpquoted(r)
+ else
+ mpquoted("unknown")
+ end
+ end
+
+ function mp.positionwhd(name)
+ local w, h, d = getwhd(name)
+ if w then
+ mpfprint("(%p,%p,%p)",w,h,d)
+ else
+ mpprint("(0,0,0)")
+ end
+ end
+
+ function mp.positionpxy(name)
+ local p, x, y = getposition(name)
+ if p then
+ mpfprint("(%p,%p,%p)",p,x,y)
+ else
+ mpprint("(0,0,0)")
+ end
+ end
+
+ function mp.positionanchor()
+ mpquoted(getmacro("MPanchorid"))
+ end
+
+end
+
+do
+
+ local mppair = mp.pair
+
+ function mp.textextanchor(s)
+ local x, y = match(s,"tx_anchor=(%S+) (%S+)") -- todo: make an lpeg
+ if x and y then
+ x = tonumber(x)
+ y = tonumber(y)
+ end
+ mppair(x or 0,y or 0)
+ end
+
+end
+
+do
+
+ local mpprint = mp.print
+ local mpquoted = mp.quoted
+ local getmacro = tokens.getters.macro
+
+ function mp.texvar(name)
+ mpprint(getmacro(metapost.namespace .. name))
+ end
+
+ function mp.texstr(name)
+ mpquoted(getmacro(metapost.namespace .. name))
+ end
+
+end
+
+do
+
+ local mpprint = aux.print
+ local mpvprint = aux.vprint
+
+ local hashes = { }
+
+ function mp.newhash(name)
+ if name then
+ hashes[name] = { }
+ else
+ for i=1,#hashes+1 do
+ if not hashes[i] then
+ hashes[i] = { }
+ mpvprint(i)
+ return
+ end
+ end
+ end
+ end
+
+ function mp.disposehash(n)
+ if tonumber(n) then
+ hashes[n] = false
+ else
+ hashes[n] = nil
+ end
+ end
+
+ function mp.inhash(n,key)
+ local h = hashes[n]
+ mpvprint(h and h[key] and true or false)
+ end
+
+ function mp.tohash(n,key,value)
+ local h = hashes[n]
+ if h then
+ if value == nil then
+ h[key] = true
+ else
+ h[key] = value
+ end
+ end
+ end
+
+ function mp.fromhash(n,key)
+ local h = hashes[n]
+ mpvprint(h and h[key] or false)
+ end
+
+ interfaces.implement {
+ name = "MPfromhash",
+ arguments = "2 strings",
+ actions = function(name,key)
+ local h = hashes[name] or hashes[tonumber(name)]
+ if h then
+ local v = h[key] or h[tonumber(key)]
+ if v then
+ context(v)
+ end
+ end
+ end
+ }
+
+end
+
+do
+
+ -- a bit overkill: just a find(str,"mf_object=") can be enough
+ --
+ -- todo : share with mlib-pps.lua metapost,isobject
+
+ local mpboolean = aux.boolean
+
+ local p1 = P("mf_object=")
+ local p2 = lpegpatterns.eol * p1
+ local pattern = (1-p2)^0 * p2 + p1
+
+ function mp.isobject(str)
+ mpboolean(pattern and str ~= "" and lpegmatch(pattern,str))
+ end
+
+end
+
+function mp.flatten(t)
+ local tn = #t
+
+ local t1 = t[1]
+ local t2 = t[2]
+ local t3 = t[3]
+ local t4 = t[4]
+
+ for i=1,tn-5,2 do
+ local t5 = t[i+4]
+ local t6 = t[i+5]
+ if t1 == t3 and t3 == t5 and ((t2 <= t4 and t4 <= t6) or (t6 <= t4 and t4 <= t2)) then
+ t[i+3] = t2
+ t4 = t2
+ t[i] = false
+ t[i+1] = false
+ elseif t2 == t4 and t4 == t6 and ((t1 <= t3 and t3 <= t5) or (t5 <= t3 and t3 <= t1)) then
+ t[i+2] = t1
+ t3 = t1
+ t[i] = false
+ t[i+1] = false
+ end
+ t1 = t3
+ t2 = t4
+ t3 = t5
+ t4 = t6
+ end
+
+ -- remove duplicates
+
+ local t1 = t[1]
+ local t2 = t[2]
+ for i=1,tn-2,2 do
+ local t3 = t[i+2]
+ local t4 = t[i+3]
+ if t1 == t3 and t2 == t4 then
+ t[i] = false
+ t[i+1] = false
+ end
+ t1 = t3
+ t2 = t4
+ end
+
+ -- move coordinates
+
+ local m = 0
+ for i=1,tn,2 do
+ if t[i] then
+ m = m + 1 t[m] = t[i]
+ m = m + 1 t[m] = t[i+1]
+ end
+ end
+
+ -- prune the table (not gc'd)
+
+ for i=tn,m+1,-1 do
+ t[i] = nil
+ end
+
+ -- safeguard so that we have at least one segment
+
+ if m == 2 then
+ t[3] = t[1]
+ t[4] = t[2]
+ end
+
+end
+
+do
+
+ -- if needed we can optimize the sub (cache last split)
+
+ local mpnumeric = mp.numeric
+ local mpquoted = mp.quoted
+
+ local utflen = utf.len
+ local utfsub = utf.sub
+
+ function mp.utflen(s)
+ mpnumeric(utflen(s))
+ end
+
+ function mp.utfsub(s,f,t)
+ mpquoted(utfsub(s,f,t))
+ end
+
+end
+
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mlib-pdf.lua b/Master/texmf-dist/tex/context/base/mkiv/mlib-pdf.lua
index 372a77f4181..e737b5d8688 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mlib-pdf.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/mlib-pdf.lua
@@ -27,7 +27,7 @@ local copy_node = node.copy
local write_node = node.write
local pen_info = mplib.pen_info
-local object_fields = mplib.fields
+local getfields = mplib.getfields or mplib.fields -- todo: in lmtx get them once and then use gettype
local save_table = false
local force_stroke = false
@@ -363,18 +363,20 @@ end
local stack = { }
local function pushproperties(figure)
+ -- maybe there will be getters in lmtx
local boundingbox = figure:boundingbox()
+ local slot = figure:charcode() or 0
local properties = {
llx = boundingbox[1],
lly = boundingbox[2],
urx = boundingbox[3],
ury = boundingbox[4],
- slot = figure:charcode(),
+ slot = slot,
width = figure:width(),
height = figure:height(),
depth = figure:depth(),
- italic = figure:italcorr(),
- number = figure:charcode() or 0,
+ italic = figure:italcorr(), -- figure:italic() in lmtx
+ number = slot,
}
insert(stack,properties)
metapost.properties = properties
@@ -460,7 +462,7 @@ function metapost.flush(specification,result)
result[#result+1] = evenodd and "W* n" or "W n"
elseif objecttype == "stop_clip" then
result[#result+1] = "Q"
- miterlimit, linecap, linejoin, dashed = -1, -1, -1, "" -- was false
+ miterlimit, linecap, linejoin, dashed, linewidth = -1, -1, -1, "", false
elseif objecttype == "start_bounds" or objecttype == "stop_bounds" then
-- skip
elseif objecttype == "start_group" then
@@ -475,7 +477,7 @@ function metapost.flush(specification,result)
bbox = toboundingbox(object.path),
})
result = { }
-miterlimit, linecap, linejoin, dashed, linewidth = -1, -1, -1, "", false
+ miterlimit, linecap, linejoin, dashed, linewidth = -1, -1, -1, "", false
else
insert(groupstack,false)
end
@@ -490,7 +492,7 @@ miterlimit, linecap, linejoin, dashed, linewidth = -1, -1, -1, "", false
result[#result+1] = reference
result = pluginactions(data.after,result,flushfigure)
result[#result+1] = "Q"
-miterlimit, linecap, linejoin, dashed, linewidth = -1, -1, -1, "", false
+ miterlimit, linecap, linejoin, dashed, linewidth = -1, -1, -1, "", false
end
else
-- we use an indirect table as we want to overload
@@ -744,9 +746,9 @@ function metapost.totable(result,askedfig)
for o=1,#objects do
local object = objects[o]
local result = { }
- local fields = object_fields(object) -- hm, is this the whole list, if so, we can get it once
+ local fields = getfields(object) -- hm, is this the whole list, if so, we can get it once
for f=1,#fields do
- local field = fields[f]
+ local field = fields[f]
result[field] = object[field]
end
results[o] = result
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mlib-pdf.mkxl b/Master/texmf-dist/tex/context/base/mkiv/mlib-pdf.mkxl
deleted file mode 100644
index 763e7ecdd46..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/mlib-pdf.mkxl
+++ /dev/null
@@ -1,171 +0,0 @@
-%D \module
-%D [ file=mlib-pdf,
-%D version=2008.03.25,
-%D title=\METAPOST\ Integrated Graphics,
-%D subtitle=Conversion to PDF,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\unprotect
-
-%D We use bit more code that needed because we want to limit the amount of boxing.
-
-\registerctxluafile{mlib-pdf}{}
-
-%D Some code is shared between MPLIB and MPS. The following variables are also
-%D available for introspection and other purposes.
-
-\ifdefined\MPwidth \else \newdimen\MPwidth \fi
-\ifdefined\MPheight \else \newdimen\MPheight \fi
-
-\ifdefined\MPllx \else \newdimen\MPllx \fi
-\ifdefined\MPlly \else \newdimen\MPlly \fi
-\ifdefined\MPurx \else \newdimen\MPurx \fi
-\ifdefined\MPury \else \newdimen\MPury \fi
-
-\ifdefined\MPbox \else \newbox \MPbox \fi
-
-\unexpanded\def\setMPboundingbox#1#2#3#4% at some point we might pass them as base or scaled points
- {\global\MPllx #1\onebasepoint
- \global\MPlly #2\onebasepoint
- \global\MPurx #3\onebasepoint
- \global\MPury #4\onebasepoint
- \global\MPwidth \dimexpr\MPurx-\MPllx\relax
- \global\MPheight\dimexpr\MPury-\MPlly\relax}
-
-\unexpanded\def\resetMPboundingbox
- {\global\MPwidth \zeropoint
- \global\MPheight\zeropoint
- \global\MPllx \zeropoint
- \global\MPlly \zeropoint
- \global\MPurx \zeropoint
- \global\MPury \zeropoint}
-
-\let\popMPboundingbox\relax
-
-\unexpanded\def\pushMPboundingbox
- {\edef\popMPboundingbox
- {\global\MPwidth \the\MPwidth
- \global\MPheight\the\MPheight
- \global\MPllx \the\MPllx
- \global\MPlly \the\MPlly
- \global\MPurx \the\MPurx
- \global\MPury \the\MPury
- \relax}}
-
-% we need to combine these
-
-\unexpanded\def\repositionMPboxindeed
- {\setbox\MPbox\hpack\bgroup
- \kern-\MPllx
- \raise-\MPlly
- \box\MPbox
- \egroup}
-
-\unexpanded\def\repositionMPbox
- {\ifzeropt\MPllx
- \ifzeropt\MPlly
- % okay
- \else
- \repositionMPboxindeed
- \fi
- \else
- \repositionMPboxindeed
- \fi}
-
-\unexpanded\def\finalizeMPbox
- {\repositionMPbox
- \setbox\MPbox\vpack to \MPheight\bgroup
- \vfill
- \hsize\MPwidth
- \smashbox\MPbox
- \box\MPbox
- \egroup
- \wd\MPbox\MPwidth
- \ht\MPbox\MPheight}
-
-% combined
-
-\unexpanded\def\finalizeMPbox
- {\boxxoffset\MPbox-\MPllx\relax
- \boxyoffset\MPbox\dimexpr\boxyoffset\MPbox-\MPheight-\MPlly\relax
- \wd\MPbox\MPwidth
- \ht\MPbox\MPheight}
-
-% MPLIB specific:
-
-\def\MPLIBtoPDF{\clf_mpflushliteral} % expanded
-
-\unexpanded\def\startMPLIBtoPDF#1#2#3#4%
- {\meta_process_graphic_figure_start
- \dostarttagged\t!mpgraphic\empty
- \naturalhpack attr \imageattribute \plusone \bgroup
- \dousecolorparameter\s!black\forcecolorhack
- \setMPboundingbox{#1}{#2}{#3}{#4}%
- \setbox\MPbox\vpack\bgroup
- % \forgetall % already done elsewhere
- \noindent} % forces the proper cm in the backend
-
-\unexpanded\def\stopMPLIBtoPDF
- {\egroup
- \finalizeMPbox
- \box\MPbox
- \egroup
- \dostoptagged
- \meta_process_graphic_figure_stop}
-
-\def\MPLIBflushreset % This can (will) move to the Lua end.
- {\clf_mpflushreset}
-
-%D Kind of special:
-%
-% test.mp:
-%
-% beginfig(1) fill fullcircle scaled 10cm withcolor red ; endfig ;
-% beginfig(2) draw fullcircle scaled 5cm withcolor blue ; endfig ;
-% beginfig(3) draw textext("just some text") ; endfig ;
-%
-% standalone pages:
-%
-% \starttext
-% \directMPgraphic{input "test.mp" ;}
-% \stoptext
-
-\let\normalstartMPLIBtoPDF\startMPLIBtoPDF
-\let\normalstopMPLIBtoPDF \stopMPLIBtoPDF
-
-\unexpanded\def\directstartMPLIBtoPDF{\startTEXpage\normalstartMPLIBtoPDF}
-\unexpanded\def\directstopMPLIBtoPDF {\normalstopMPLIBtoPDF\stopTEXpage}
-
-\unexpanded\def\directMPgraphic
- {\dodoublegroupempty\mlib_direct_graphic}
-
-\def\mlib_direct_graphic#1#2% makes pages (todo: make boxes)
- {\meta_begin_graphic_group{#1}%
- \let\startMPLIBtoPDF\directstartMPLIBtoPDF
- \let\stopMPLIBtoPDF \directstopMPLIBtoPDF
- \meta_start_current_graphic
- \forgetall
- \edef\p_extensions{\MPinstanceparameter\s!extensions}%
- \normalexpanded{\noexpand\clf_mpgraphic
- instance {\currentMPinstance}%
- format {\currentMPformat}%
- data {#2;}%
- initializations {\meta_flush_current_initializations}%
- \ifx\p_extensions\v!yes
- extensions {\clf_getmpextensions{\currentMPinstance}}%
- \fi
- inclusions {\meta_flush_current_inclusions}%
- definitions {\meta_flush_current_definitions}%
- figure {all}%
- method {\MPinstanceparameter\c!method}%
- \relax}%
- \meta_stop_current_graphic
- \meta_end_graphic_group}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mlib-pps.lua b/Master/texmf-dist/tex/context/base/mkiv/mlib-pps.lua
index 0250df35c60..8a6f4b4f825 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mlib-pps.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/mlib-pps.lua
@@ -25,6 +25,7 @@ local setmacro = interfaces.setmacro
local texsetbox = tex.setbox
local textakebox = tex.takebox -- or: nodes.takebox
+local texrunlocal = tex.runlocal
local copy_list = node.copy_list
local flush_list = node.flush_list
local setmetatableindex = table.setmetatableindex
@@ -250,6 +251,7 @@ local function startjob(plugmode,kind,mpx)
top = {
textexts = { }, -- all boxes, optionally with a different color
texstrings = { },
+ texregimes = { },
mapstrings = { },
mapindices = { },
mapmoves = { },
@@ -499,8 +501,8 @@ implement {
arguments = { "dimen", "dimen", "dimen" },
actions = function(wd,ht,dp)
local hd = ht + dp
- setmacro("sx",wd ~= 0 and factor/wd or 0)
- setmacro("sy",hd ~= 0 and factor/hd or 0)
+ setmacro("mlib_sx",wd ~= 0 and factor/wd or 0)
+ setmacro("mlib_sy",hd ~= 0 and factor/hd or 0)
end
}
@@ -811,7 +813,13 @@ local tx_reset, tx_process do
local mp_t = nil
local function processtext()
- local mp_text = top.texstrings[mp_index]
+ local mp_text = top.texstrings[mp_index]
+ local mp_regime = top.texregimes[mp_index]
+ if mp_regime and tonumber(mp_regime) >= 0 then
+ mp_text = function()
+ context.sprint(mp_regime,top.texstrings[mp_index] or "")
+ end
+ end
if not mp_text then
report_textexts("missing text for index %a",mp_index)
elseif not mp_c then
@@ -842,14 +850,15 @@ local tx_reset, tx_process do
local madetext = nil
- function mp.mf_some_text(index,str)
+ function mp.mf_some_text(index,str,regime)
mp_target = index
mp_index = index
mp_c = nil
mp_a = nil
mp_t = nil
top.texstrings[mp_index] = str
- tex.runtoks("mptexttoks")
+ top.texregimes[mp_index] = regime or -1
+ texrunlocal("mptexttoks")
local box = textakebox("mptextbox")
top.textexts[mp_target] = box
mp.triplet(bp*box.width,bp*box.height,bp*box.depth)
@@ -857,7 +866,7 @@ local tx_reset, tx_process do
end
function mp.mf_made_text(index)
- mp.mf_some_text(index,madetext)
+ mp.mf_some_text(index,madetext,catcodes.numbers.ctxcatcodes) -- btex/etex ..
end
-- a label can be anything, also something mp doesn't like in strings
@@ -899,7 +908,7 @@ local tx_reset, tx_process do
mp.triplet(top.mapmoves[index])
end
- function mp.mf_map_text(index,str)
+ function mp.mf_map_text(index,str,regime)
local map = top.mapindices[tonumber(str)]
if type(map) == "table" then
local text = map.text
@@ -912,14 +921,16 @@ local tx_reset, tx_process do
-- the image text
if overload then
top.texstrings[mp_index] = map.template or map.label or "error"
- tex.runtoks("mptexttoks")
+ top.texregimes[mp_index] = regime or -1
+ texrunlocal("mptexttoks")
local box = textakebox("mptextbox") or new_hlist()
width = bp * box.width
where = overload.where
end
-- the real text
top.texstrings[mp_index] = overload and overload.text or text or "error"
- tex.runtoks("mptexttoks")
+ top.texregimes[mp_index] = regime or -1
+ texrunlocal("mptexttoks")
local box = textakebox("mptextbox") or new_hlist()
local twd = bp * box.width
local tht = bp * box.height
@@ -953,8 +964,8 @@ local tx_reset, tx_process do
-- instance in a macro definition (rawtextext (pass back string)) ... of course one
-- should use textext so this is just a catch. When not in lmtx it's never immediate.
- local reported = false
- local awayswrap = CONTEXTLMTXMODE <= 1
+ local reported = false
+ local alwayswrap = false -- CONTEXTLMTXMODE <= 1 -- was always nil due to typo
function metapost.maketext(s,mode)
if not reported then
@@ -1036,7 +1047,7 @@ local tx_reset, tx_process do
local mp_hash = prescript.tx_cache
local box
if mp_hash == "no" then
- tex.runtoks("mptexttoks")
+ texrunlocal("mptexttoks")
box = textakebox("mptextbox")
else
local cache = data.texhash
@@ -1069,7 +1080,7 @@ local tx_reset, tx_process do
if box then
box = copy_list(box)
else
- tex.runtoks("mptexttoks")
+ texrunlocal("mptexttoks")
box = textakebox("mptextbox")
cache[mp_hash] = box
end
@@ -1152,7 +1163,7 @@ local gt_reset, gt_process do
if not graphics[index] then
mp_index = index
mp_str = str
- tex.runtoks("mpgraphictexttoks")
+ texrunlocal("mpgraphictexttoks")
end
end
@@ -1573,7 +1584,7 @@ local ot_reset, ot_process do
mp_index = index
mp_kind = kind
mp_str = str
- tex.runtoks("mpoutlinetoks")
+ texrunlocal("mpoutlinetoks")
end
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mlib-pps.mkiv b/Master/texmf-dist/tex/context/base/mkiv/mlib-pps.mkiv
index 05113058511..74d6ae142d0 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mlib-pps.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/mlib-pps.mkiv
@@ -86,7 +86,7 @@
\unexpanded\def\MPLIBfigure#1#2%
{\setbox\scratchbox\hpack{\externalfigure[#1][\c!mask=#2]}%
\clf_mpsetsxsy\wd\scratchbox\ht\scratchbox\zeropoint
- \vpack to \zeropoint{\vss\hpack to \zeropoint{\fastsxsy{\sx}{\sy}{\box\scratchbox}\hss}}}
+ \vpack to \zeropoint{\vss\hpack to \zeropoint{\fastsxsy{\mlib_sx}{\mlib_sy}{\box\scratchbox}\hss}}}
% horrible (we could inline scale and matrix code):
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mlib-run.lua b/Master/texmf-dist/tex/context/base/mkiv/mlib-run.lua
index 07fa6a19198..602d6f36c0d 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mlib-run.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/mlib-run.lua
@@ -34,14 +34,11 @@ local find, striplines = string.find, utilities.strings.striplines
local concat, insert, remove = table.concat, table.insert, table.remove
local emptystring = string.is_empty
-local P = lpeg.P
local trace_graphics = false trackers.register("metapost.graphics", function(v) trace_graphics = v end)
local trace_tracingall = false trackers.register("metapost.tracingall", function(v) trace_tracingall = v end)
-local trace_terminal = false trackers.register("metapost.terminal", function(v) trace_terminal = v end)
local report_metapost = logs.reporter("metapost")
-local report_terminal = logs.reporter("metapost","terminal")
local texerrormessage = logs.texerrormessage
local starttiming = statistics.starttiming
@@ -60,9 +57,9 @@ metapost.exectime = metapost.exectime or { } -- hack
metapost.nofruns = 0
local mpxformats = { }
-local mpxterminals = { }
local nofformats = 0
local mpxpreambles = { }
+local mpxterminals = { }
local mpxextradata = { }
-- The flatten hack is needed because the library currently barks on \n\n and the
@@ -112,225 +109,6 @@ function metapost.resetlastlog()
metapost.lastlog = ""
end
------ mpbasepath = lpeg.instringchecker(lpeg.append { "/metapost/context/", "/metapost/base/" })
-local mpbasepath = lpeg.instringchecker(P("/metapost/") * (P("context") + P("base")) * P("/"))
-
--- mplib has no real io interface so we have a different mechanism than
--- tex (as soon as we have more control, we will use the normal code)
---
--- for some reason mp sometimes calls this function twice which is inefficient
--- but we cannot catch this
-
-local realtimelogging do
-
- local finders = { }
- mplib.finders = finders -- also used in meta-lua.lua
-
- local new_instance = mplib.new
-
- local function validftype(ftype)
- if ftype == "mp" then
- return "mp"
- else
- return nil
- end
- end
-
- finders.file = function(specification,name,mode,ftype)
- return resolvers.findfile(name,validftype(ftype))
- end
-
- -- this will be redone in lmtx
-
- local function i_finder(name,mode,ftype) -- fake message for mpost.map and metafun.mpvi
- local specification = url.hashed(name)
- local finder = finders[specification.scheme] or finders.file
- local found = finder(specification,name,mode,validftype(ftype))
- return found
- end
-
- local function o_finder(name,mode,ftype)
- return name
- end
-
- o_finder = sandbox.register(o_finder,sandbox.filehandlerone,"mplib output finder")
-
- local function finder(name,mode,ftype)
- return (mode == "w" and o_finder or i_finder)(name,mode,validftype(ftype))
- end
-
- local report_logger = logs.reporter("metapost log")
- local report_error = logs.reporter("metapost error")
-
- local l, nl, dl = { }, 0, false
- local t, nt, dt = { }, 0, false
- local e, ne, de = { }, 0, false
-
- local function logger(target,str)
- if target == 1 then
- -- log
- elseif target == 2 or target == 3 then
- -- term
- if str == "\n" then
- realtimelogging = true
- if nl > 0 then
- report_logger(concat(l,"",1,nl))
- nl, dl = 0, false
- elseif not dl then
- report_logger("")
- dl = true
- end
- else
- nl = nl + 1
- l[nl] = str
- end
- elseif target == 4 then
- report_error(str)
- end
- end
-
- -- experiment, todo: per instance, just a push / pop ?
-
- local findtexfile = resolvers.findtexfile
- local opentexfile = resolvers.opentexfile
- local splitlines = string.splitlines
-
- local function writetoterminal(terminaldata,maxterm,d)
- local t = type(d)
- local n = 0
- if t == "string" then
- d = splitlines(d)
- n = #d
- for i=1,#d do
- maxterm = maxterm + 1
- terminaldata[maxterm] = d[i]
- end
- elseif t == "table" then
- for i=1,#d do
- local l = d[i]
- if find(l,"[\n\r]") then
- local s = splitlines(l)
- local m = #s
- for i=1,m do
- maxterm = maxterm + 1
- terminaldata[maxterm] = s[i]
- end
- n = n + m
- else
- maxterm = maxterm + 1
- terminaldata[maxterm] = d[i]
- n = 1
- end
- end
- end
- if trace_terminal then
- report_metapost("writing %i lines, in cache %s",n,maxterm)
- end
- return maxterm
- end
-
- local function readfromterminal(terminaldata,maxterm,nowterm)
- if nowterm >= maxterm then
- terminaldata[nowterm] = false
- maxterm = 0
- nowterm = 0
- if trace_terminal then
- report_metapost("resetting, maxcache %i",#terminaldata)
- end
- return maxterm, nowterm, nil
- else
- if nowterm > 0 then
- terminaldata[nowterm] = false
- end
- nowterm = nowterm + 1
- local s = terminaldata[nowterm]
- if trace_terminal then
- report_metapost("reading line %i: %s",nowterm,s)
- end
- return maxterm, nowterm, s
- end
- end
-
- local function fileopener()
-
- -- these can go into the table itself
-
- local terminaldata = { }
- local maxterm = 0
- local nowterm = 0
-
- local terminal = {
- name = "terminal",
- close = function()
- -- terminal = { }
- -- maxterm = 0
- -- nowterm = 0
- end,
- reader = function()
- local line
- maxterm, nowterm, line = readfromterminal(terminaldata,maxterm,nowterm)
- return line
- end,
- writer = function(d)
- maxterm = writetoterminal(terminaldata,maxterm,d)
- end,
- }
-
- return function(name,mode,kind)
- if name == "terminal" then
- -- report_metapost("opening terminal")
- return terminal
- elseif mode == "w" then
- local f = io.open(name,"wb")
- if f then
- -- report_metapost("opening file %a for writing",full)
- return {
- name = full,
- writer = function(s) return f:write(s) end, -- io.write(f,s)
- close = function() f:close() end,
- }
- end
- else
- local full = findtexfile(name,validftype(ftype))
- if full then
- -- report_metapost("opening file %a for reading",full)
- return opentexfile(full)
- end
- end
- end
-
- end
-
- -- end of experiment
-
- if CONTEXTLMTXMODE > 0 then
-
- function mplib.new(specification)
- local openfile = fileopener()
- specification.find_file = finder
- specification.run_logger = logger
- specification.open_file = openfile
- specification.interaction = "silent"
- specification.halt_on_error = true
- local instance = new_instance(specification)
- mpxterminals[instance] = openfile("terminal")
- return instance
- end
-
- else
-
- function mplib.new(specification)
- specification.find_file = finder
- specification.run_logger = logger
- return new_instance(specification)
- end
-
- end
-
- mplib.finder = finder
-
-end
-
local new_instance = mplib.new
local find_file = mplib.finder
@@ -340,7 +118,7 @@ function metapost.reporterror(result)
return true
elseif result.status == 0 then
return false
- elseif realtimelogging then
+ elseif mplib.realtimelogging then
return false -- we already reported
else
local t = result.term
@@ -405,7 +183,7 @@ function metapost.load(name,method)
end
end
method = method and methods[method] or "scaled"
- local mpx = new_instance {
+ local mpx, terminal = new_instance {
ini_version = true,
math_mode = method,
run_script = metapost.runscript,
@@ -414,12 +192,14 @@ function metapost.load(name,method)
extensions = 1,
-- random_seed = seed,
utf8_mode = true,
+ text_mode = true,
}
report_metapost("initializing number mode %a",method)
local result
if not mpx then
result = { status = 99, error = "out of memory"}
else
+ mpxterminals[mpx] = terminal
-- pushing permits advanced features
metapost.pushscriptrunner(mpx)
result = executempx(mpx,f_preamble(file.addsuffix(name,"mp"),seed))
@@ -557,17 +337,17 @@ function metapost.reset(mpx)
if mpxformats[mpx] then
local instance = mpxformats[mpx]
instance:finish()
- mpxterminals[instance] = nil
- mpxextradata[mpx] = nil
- mpxformats [mpx] = nil
+ mpxterminals[mpx] = nil
+ mpxextradata[mpx] = nil
+ mpxformats [mpx] = nil
end
else
for name, instance in next, mpxformats do
if instance == mpx then
mpx:finish()
+ mpxterminals[mpx] = nil
mpxextradata[mpx] = nil
mpxformats [mpx] = nil
- mpxterminals[mpx] = nil
break
end
end
@@ -881,20 +661,21 @@ do
end
+local getstatistics = mplib.getstatistics or mplib.statistics
+
function metapost.getstatistics(memonly)
if memonly then
local n, m = 0, 0
for name, mpx in next, mpxformats do
n = n + 1
- m = m + mpx:statistics().memory
+ m = m + getstatistics(mpx).memory
end
return n, m
else
local t = { }
for name, mpx in next, mpxformats do
- t[name] = mpx:statistics()
+ t[name] = getstatistics(mpx)
end
return t
end
end
-
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mlib-scn.lua b/Master/texmf-dist/tex/context/base/mkiv/mlib-scn.lua
deleted file mode 100644
index 709961543bf..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/mlib-scn.lua
+++ /dev/null
@@ -1,777 +0,0 @@
-if not modules then modules = { } end modules ['mlib-scn'] = {
- version = 1.001,
- comment = "companion to mlib-ctx.mkiv",
- author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
- copyright = "PRAGMA ADE / ConTeXt Development Team",
- license = "see context related readme files",
-}
-
--- Very experimental, for Alan and me.
-
--- for i = 1 upto 32000 : % 0.062
--- ts := 5mm / 20;
--- endfor ;
---
--- for i = 1 upto 32000 : % 0.219
--- ts := (getparameter "axis" "sy") / 20;
--- endfor ;
---
--- for i = 1 upto 32000 : % 0.266
--- ts := (getparameterx "axis" "sy") / 20;
--- endfor ;
---
--- pushparameters "axis";
--- for i = 1 upto 32000 : % 0.250
--- ts := (getparameterx "sy") / 20;
--- endfor ;
--- popparameters;
-
-local type, next, rawget, getmetatable = type, next, rawget, getmetatable
-local byte, gmatch = string.byte, string.gmatch
-local insert, remove = table.insert, table.remove
-
-local mplib = mplib
-local metapost = metapost
-
-local codes = mplib.codes()
-local types = mplib.types()
-
-table.hashed(codes)
-table.hashed(types)
-
-metapost.codes = codes
-metapost.types = types
-
-local setmetatableindex = table.setmetatableindex
-
-local scanners = mp.scan
-
-local scannext = scanners.next
-local scanexpression = scanners.expression
-local scantoken = scanners.token
-local scansymbol = scanners.symbol
-local scannumeric = scanners.numeric
-local scannumber = scanners.number
-local scaninteger = scanners.integer
-local scanboolean = scanners.boolean
-local scanstring = scanners.string
-local scanpair = scanners.pair
-local scancolor = scanners.color
-local scancmykcolor = scanners.cmykcolor
-local scantransform = scanners.transform
-local scanpath = scanners.path
-local scanpen = scanners.pen
-
-local mpprint = mp.print
-local mpnumeric = mp.numeric
-local mpstring = mp.string
-local mpquoted = mp.quoted
-local mpboolean = mp.boolean
-local mppair = mp.pair
-local mppath = mp.path
-local mptriplet = mp.triplet
-local mpquadruple = mp.quadruple
-local mptransform = mp.transform
-local mpvalue = mp.value
-
-local report = logs.reporter("metapost")
-
-local semicolon_code <const> = codes.semicolon
-local equals_code <const> = codes.equals
-local comma_code <const> = codes.comma
-local colon_code <const> = codes.colon
-local leftbrace_code <const> = codes.leftbrace
-local rightbrace_code <const> = codes.rightbrace
-local leftbracket_code <const> = codes.leftbracket
-local rightbracket_code <const> = codes.rightbracket
-local leftdelimiter_code <const> = codes.leftdelimiter
-local rightdelimiter_code <const> = codes.rightdelimiter
-local numeric_code <const> = codes.numeric
-local string_code <const> = codes.string
-local capsule_code <const> = codes.capsule
-local nullary_code <const> = codes.nullary
-local tag_code <const> = codes.tag
-local definedmacro_code <const> = codes.definedmacro
-
-local typescanners = nil
-local tokenscanners = nil
-local scanset = nil
-local scanparameters = nil
-
-scanset = function() -- can be optimized, we now read twice
- scantoken()
- if scantoken(true) == rightbrace_code then
- scantoken()
- return { }
- else
- local l = { }
- local i = 0
- while true do
- i = i + 1
- local s = scansymbol(true)
- if s == "{" then
- l[i] = scanset()
- elseif s == "[" then
- local d = { }
- scansymbol()
- while true do
- local s = scansymbol()
- if s == "]" then
- break;
- elseif s == "," then
- -- continue
- else
- local t = scantoken(true)
- if t == equals_code or t == colon_code then
- scantoken()
- end
- d[s] = tokenscanners[scantoken(true)]()
- end
- end
- l[i] = d
- else
- local e = scanexpression(true)
- l[i] = (typescanners[e] or scanexpression)()
- end
- if scantoken() == rightbrace_code then
- break
- else
- -- whatever
- end
- end
- return l
- end
-end
-
-local function scan_pair () return scanpair (true) end
-local function scan_color () return scancolor (true) end
-local function scan_cmykcolor() return scancmykcolor(true) end
-local function scan_transform() return scantransform(true) end
-
-tokenscanners = {
- [leftbrace_code] = scanset,
- [numeric_code] = scannumeric,
- [string_code] = scanstring,
- [nullary_code] = scanboolean, -- todo
-}
-
-typescanners = {
- [types.known] = scannumeric,
- [types.numeric] = scannumeric,
- [types.string] = scanstring,
- [types.boolean] = scanboolean,
- [types.pair] = scan_pair,
- [types.color] = scan_color,
- [types.cmykcolor] = scan_cmykcolor,
- [types.transform] = scan_transform,
- [types.path] = scanpath,
- [types.pen] = scanpen,
-}
-
-table.setmetatableindex(tokenscanners,function()
- local e = scanexpression(true)
- return typescanners[e] or scanexpression
-end)
-
--- a key like 'color' has code 'declare'
-
-local function scanparameters(fenced)
- local data = { }
- local close = "]"
- if not fenced then
- close = ";"
- elseif scansymbol(true) == "[" then
- scansymbol()
- else
- return data
- end
- while true do
- -- local s = scansymbol()
- local s = scansymbol(false,false)
- if s == close then
- break;
- elseif s == "," then
- -- continue
- else
- local t = scantoken(true)
- if t == equals_code or t == colon_code then
- -- optional equal or :
- scantoken()
- end
- local kind = scantoken(true)
- if kind == leftdelimiter_code or kind == tag_code or kind == capsule_code then
- kind = scanexpression(true)
- data[s] = (typescanners[kind] or scanexpression)()
- elseif kind == leftbracket_code then
- data[s] = get_parameters(true)
- else
- data[s] = tokenscanners[kind]()
- end
- end
- end
- return data
-end
-
-local namespaces = { }
-local presets = { }
-local passed = { }
-
-local function get_parameters(nested)
- local data = { }
- if nested or scansymbol(true) == "[" then
- scansymbol()
- else
- return data
- end
- while true do
- local s = scansymbol(false,false)
- if s == "]" then
- break;
- elseif s == "," then
- -- continue
- else
- local t = scantoken(true)
- if t == equals_code or t == colon_code then
- -- optional equal or :
- scantoken()
- end
- local kind = scantoken(true)
- if kind == leftdelimiter_code or kind == tag_code or kind == capsule_code then
- kind = scanexpression(true)
- data[s] = (typescanners[kind] or scanexpression)()
- elseif kind == leftbracket_code then
- data[s] = get_parameters(true)
- else
- data[s] = tokenscanners[kind]()
- end
- end
- end
- return data
-end
-
-local function getparameters()
- local namespace = scanstring()
- -- same as below
- local parameters = get_parameters()
- local presets = presets[namespace]
- local passed = passed[namespace]
- if passed then
- if presets then
- setmetatableindex(passed,presets)
- end
- setmetatableindex(parameters,passed)
- elseif presets then
- setmetatableindex(parameters,presets)
- end
- namespaces[namespace] = parameters
- --
-end
-
-local function applyparameters()
- local saved = namespaces
- local namespace = scanstring()
- local action = scanstring() -- before we scan the parameters
- -- same as above
- local parameters = get_parameters()
- local presets = presets[namespace]
- local passed = passed[namespace]
- if passed then
- if presets then
- setmetatableindex(passed,presets)
- end
- setmetatableindex(parameters,passed)
- elseif presets then
- setmetatableindex(parameters,presets)
- end
- namespaces[namespace] = parameters
- -- till here
- mpprint(action)
- namespaces = saved
-end
-
-local function presetparameters()
- local namespace = scanstring()
- local parent = nil
- local t = scantoken(true)
- if t == string_code then
- parent = presets[scanstring()]
- end
- local p = get_parameters()
- if parent then
- setmetatableindex(p,parent)
- end
- presets[namespace] = p
-end
-
-local function collectnames()
- local l = { } -- can be reused but then we can't nest
- local n = 0
- while true do
- local t = scantoken(true)
- -- (1) not really needed
- if t == numeric_code then
- n = n + 1 l[n] = scaninteger(1)
- elseif t == string_code then
- n = n + 1 l[n] = scanstring(1)
- elseif t == nullary_code then
- n = n + 1 l[n] = scanboolean(1)
- elseif t == leftdelimiter_code or t == tag_code or t == capsule_code then
- t = scanexpression(true)
- n = n + 1 l[n] = (typescanners[t] or scanexpression)()
- else
- break
- end
- end
- return l, n
-end
-
-local function get(v)
- local t = type(v)
- if t == "number" then
- return mpnumeric(v)
- elseif t == "boolean" then
- return mpboolean(v)
- elseif t == "string" then
- return mpquoted(v)
- elseif t == "table" then
- local n = #v
- if type(v[1]) == "table" then
- return mppath(v) -- cycle ?
- elseif n == 2 then
- return mppair(v)
- elseif n == 3 then
- return mptriplet(v)
- elseif n == 4 then
- return mpquadruple(v)
- elseif n == 6 then
- return mptransform(v)
- end
- end
- return mpnumeric(0)
-end
-
-local stack = { }
-
-local function pushparameters()
- local l, n = collectnames()
- insert(stack,namespaces)
- for i=1,n do
- local n = namespaces[l[i]]
- if type(n) == "table" then
- namespaces = n
- else
- break
- end
- end
-end
-
-local function popparameters()
- local n = remove(stack)
- if n then
- namespaces = n
- else
- report("stack error")
- end
-end
-
--- todo:
-
-local function getparameter()
- local list, n = collectnames()
- local v = namespaces
- for i=1,n do
- local l = list[i]
- local vl = v[l]
- if vl == nil then
- if type(l) == "number" then
- vl = v[1]
- if vl == nil then
- return mpnumeric(0)
- end
- else
- return mpnumeric(0)
- end
- end
- v = vl
- end
- if v == nil then
- return mpnumeric(0)
- else
- return get(v)
- end
-end
-
-local function hasparameter()
- local list, n = collectnames()
- local v = namespaces
- for i=1,n do
- local l = list[i]
- local vl = rawget(v,l)
- if vl == nil then
- if type(l) == "number" then
- vl = rawget(v,1)
- if vl == nil then
- return mpboolean(false)
- end
- else
- return mpboolean(false)
- end
- end
- v = vl
- end
- if v == nil then
- return mpboolean(false)
- else
- return mpboolean(true)
- end
-end
-
-local function hasoption()
- local list, n = collectnames()
- if n > 1 then
- local v = namespaces
- if n > 2 then
- for i=1,n-1 do
- local l = list[i]
- local vl = v[l]
- if vl == nil then
- return mpboolean(false)
- end
- v = vl
- end
- else
- v = v[list[1]]
- end
- if type(v) == "string" then
- -- no caching .. slow anyway
- local o = list[n]
- if v == o then
- return mpboolean(true)
- end
- for vv in gmatch(v,"[^%s,]+") do
- for oo in gmatch(o,"[^%s,]+") do
- if vv == oo then
- return mpboolean(true)
- end
- end
- end
- end
- end
- return mpboolean(false)
-end
-
-local function getparameterdefault()
- local list, n = collectnames()
- local v = namespaces
- if n == 1 then
- local l = list[1]
- local vl = v[l]
- if vl == nil then
- -- maybe backtrack
- local top = stack[#stack]
- if top then
- vl = top[l]
- end
- end
- if vl == nil then
- return mpnumeric(0)
- else
- return get(vl)
- end
- else
- for i=1,n-1 do
- local l = list[i]
- local vl = v[l]
- if vl == nil then
- if type(l) == "number" then
- vl = v[1]
- if vl == nil then
- return get(list[n])
- end
- else
- local last = list[n]
- if last == "*" then
- -- so, only when not pushed
- local m = getmetatable(namespaces[list[1]])
- if n then
- m = m.__index -- can also be a _m_
- end
- if m then
- local v = m
- for i=2,n-1 do
- local l = list[i]
- local vl = v[l]
- if vl == nil then
- return mpnumeric(0)
- end
- v = vl
- end
- if v == nil then
- return mpnumeric(0)
- else
- return get(v)
- end
- end
- return mpnumeric(0)
- else
- return get(last)
- end
- end
- end
- v = vl
- end
- if v == nil then
- return get(list[n])
- else
- return get(v)
- end
- end
-end
-
-local function getparametercount()
- local list, n = collectnames()
- local v = namespaces
- for i=1,n do
- v = v[list[i]]
- if not v then
- break
- end
- end
- return mpnumeric(type(v) == "table" and #v or 0)
-end
-
-local function getmaxparametercount()
- local list, n = collectnames()
- local v = namespaces
- for i=1,n do
- v = v[list[i]]
- if not v then
- break
- end
- end
- local n = 0
- if type(v) == "table" then
- local v1 = v[1]
- if type(v1) == "table" then
- n = #v1
- for i=2,#v do
- local vi = v[i]
- if type(vi) == "table" then
- local vn = #vi
- if vn > n then
- n = vn
- end
- else
- break;
- end
- end
- end
-
- end
- return mpnumeric(n)
-end
-
-local validconnectors = {
- [".."] = true,
- ["..."] = true,
- ["--"] = true,
-}
-
-local function getparameterpath()
- local list, n = collectnames()
- local close = list[n]
- if type(close) == "boolean" then
- n = n - 1
- else
- close = false
- end
- local connector = list[n]
- if type(connector) == "string" and validconnectors[connector] then
- n = n - 1
- else
- connector = "--"
- end
- local v = namespaces
- for i=1,n do
- v = v[list[i]]
- if not v then
- break
- end
- end
- if type(v) == "table" then
- return mppath(v,connector,close)
- else
- return mppair(0,0)
- end
-end
-
-local function getparameterpen()
- local list, n = collectnames()
- local v = namespaces
- for i=1,n do
- v = v[list[i]]
- if not v then
- break
- end
- end
- if type(v) == "table" then
- return mppath(v,"..",true)
- else
- return mppair(0,0)
- end
-end
-
-local function getparametertext()
- local list, n = collectnames()
- local strut = list[n]
- if type(strut) == "boolean" then
- n = n - 1
- else
- strut = false
- end
- local v = namespaces
- for i=1,n do
- v = v[list[i]]
- if not v then
- break
- end
- end
- if type(v) == "string" then
- return mpquoted("\\strut " .. v)
- else
- return mpquoted("")
- end
-end
-
--- local function getparameteroption()
--- local list, n = collectnames()
--- local last = list[n]
--- if type(last) == "string" then
--- n = n - 1
--- else
--- return false
--- end
--- local v = namespaces
--- for i=1,n do
--- v = v[list[i]]
--- if not v then
--- break
--- end
--- end
--- if type(v) == "string" and v ~= "" then
--- for s in gmatch(v,"[^ ,]+") do
--- if s == last then
--- return true
--- end
--- end
--- end
--- return false
--- end
-
-function metapost.scanparameters()
--- scantoken() -- we scan the semicolon
- return get_parameters()
-end
-
-metapost.registerscript("getparameters", getparameters)
-metapost.registerscript("applyparameters", applyparameters)
-metapost.registerscript("presetparameters", presetparameters)
-metapost.registerscript("hasparameter", hasparameter)
-metapost.registerscript("hasoption", hasoption)
-metapost.registerscript("getparameter", getparameter)
-metapost.registerscript("getparameterdefault", getparameterdefault)
-metapost.registerscript("getparametercount", getparametercount)
-metapost.registerscript("getmaxparametercount",getmaxparametercount)
-metapost.registerscript("getparameterpath", getparameterpath)
-metapost.registerscript("getparameterpen", getparameterpen)
-metapost.registerscript("getparametertext", getparametertext)
---------.registerscript("getparameteroption", getparameteroption)
-metapost.registerscript("pushparameters", pushparameters)
-metapost.registerscript("popparameters", popparameters)
-
-function metapost.getparameter(list)
- local n = #list
- local v = namespaces
- for i=1,n do
- local l = list[i]
- local vl = v[l]
- if vl == nil then
- return
- end
- v = vl
- end
- return v
-end
-
-function metapost.getparameterset(namespace)
- return namespace and namespaces[namespace] or namespaces
-end
-
-function metapost.setparameterset(namespace,t)
- namespaces[namespace] = t
-end
-
--- goodies
-
-metapost.registerscript("definecolor", function()
- scantoken() -- we scan the semicolon
- local s = get_parameters()
- attributes.colors.defineprocesscolordirect(s)
-end)
-
--- tex scanners
-
-local scanners = tokens.scanners
-local scanhash = scanners.hash
-local scanstring = scanners.string
-local scanvalue = scanners.value
-local scaninteger = scanners.integer
-local scanboolean = scanners.boolean
-local scanfloat = scanners.float
-local scandimension = scanners.dimension
-
-local definitions = { }
-
-local bpfactor <const> = number.dimenfactors.bp
-local comma <const> = byte(",")
-local close <const> = byte("]")
-
-local scanrest = function() return scanvalue(comma,close) or "" end
-local scandimension = function() return scandimension() * bpfactor end
-
-local scanners = {
- ["integer"] = scaninteger,
- ["number"] = scanfloat,
- ["numeric"] = scanfloat,
- ["boolean"] = scanboolean,
- ["string"] = scanrest,
- ["dimension"] = scandimension,
-}
-
-interfaces.implement {
- name = "lmt_parameters_define",
- arguments = "string",
- actions = function(namespace)
- local d = scanhash()
- for k, v in next, d do
- d[k] = scanners[v] or scanrest
- end
- definitions[namespace] = d
- end,
-}
-
-interfaces.implement {
- name = "lmt_parameters_preset",
- arguments = "string",
- actions = function(namespace)
- passed[namespace] = scanhash(definitions[namespace])
- end,
-}
-
-interfaces.implement {
- name = "lmt_parameters_reset",
- arguments = "string",
- actions = function(namespace)
- passed[namespace] = nil
- end,
-}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mlib-svg.lua b/Master/texmf-dist/tex/context/base/mkiv/mlib-svg.lua
deleted file mode 100644
index 3d15840a7b6..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/mlib-svg.lua
+++ /dev/null
@@ -1,3268 +0,0 @@
-if not modules then modules = { } end modules ['mlib-svg'] = {
- version = 1.001,
- comment = "companion to mlib-ctx.mkiv",
- author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
- copyright = "PRAGMA ADE / ConTeXt Development Team",
- license = "see context related readme files",
-}
-
--- Just a few notes:
---
--- There is no real need to boost performance here .. we can always make a fast
--- variant when really needed. I will also do some of the todo's when I run into
--- proper fonts. I need to optimize this a bit but will do that once I'm satisfied
--- with the outcome and don't need more hooks and plugs. At some point I will
--- optimize the MetaPost part because now we probably have more image wrapping
--- than needed.
---
--- As usual with these standards, things like a path can be very compact while the
--- rest is very verbose which defeats the point. This is a first attempt. There will
--- be a converter to MP as well as directly to PDF. This module was made for one of
--- the dangerous curves talks at the 2019 CTX meeting. I will do the font when I
--- need it (not that hard).
---
--- The fact that in the more recent versions of SVG the older text related elements
--- are depricated and not even supposed to be supported, combined with the fact that
--- the text element assumes css styling, demonstrates that there is not so much as a
--- standard. It basically means that whatever technology dominates at some point
--- (probably combined with some libraries that at that point exist) determine what
--- is standard. Anyway, it probably also means that these formats are not that
--- suitable for long term archival purposes. So don't take the next implementation
--- too serious. So in the end we now have (1) attributes for properties (which is
--- nice and clean and what attributes are for, (2) a style attribute that needs to
--- be parsed, (3) classes that map to styles and (4) element related styles, plus a
--- kind of inheritance (given the limited number of elements sticking to only <g> as
--- wrapper would have made much sense. Anyway, we need to deal with it. With all
--- these style things going on, one can wonder where it will end. Basically svg
--- became just a html element that way and less clean too. The same is true for
--- tspan, which means that text itself is nested xml.
---
--- We can do a direct conversion to PDF but then we also loose the abstraction which
--- in the future will be used, and for fonts we need to spawn out to TeX anyway, so
--- the little overhead of calling MetaPost is okay I guess. Also, we want to
--- overload labels, share fonts with the main document, etc. and are not aiming at a
--- general purpose SVG converter. For going to PDF one can just use InkScape.
---
--- Written with Anne Clark on speakers as distraction.
---
--- Todo when I run into an example (but ony when needed and reasonable):
---
--- var(color,color)
--- --color<decimal>
--- currentColor : when i run into an example
--- a bit more shading
--- clip = [ auto | rect(llx,lly,urx,ury) ] (in svg)
--- xlink url ... whatever
--- masks
--- opacity per group (i need to add that to metafun first, inefficient pdf but
--- maybe filldraw can help here)
---
--- Maybe in metafun:
---
--- penciled n -> withpen pencircle scaled n
--- applied (...) -> transformed bymatrix (...)
--- withopacity n -> withtransparency (1,n)
-
--- When testing mbo files:
---
--- empty paths
--- missing control points
--- funny fontnames like abcdefverdana etc
--- paths representing glyphs but also with style specs
--- all kind of attributes
--- very weird and inefficient shading
-
--- One can run into pretty crazy images, like lines that are fills being clipped
--- to some width. That's the danger of hiding yourself behind an interface I guess.
-
-local rawget, rawset, type, tonumber, tostring, next, setmetatable = rawget, rawset, type, tonumber, tostring, next, setmetatable
-
-local P, S, R, C, Ct, Cs, Cc, Cp, Cg, Cf, Carg = lpeg.P, lpeg.S, lpeg.R, lpeg.C, lpeg.Ct, lpeg.Cs, lpeg.Cc, lpeg.Cp, lpeg.Cg, lpeg.Cf, lpeg.Carg
-
-local lpegmatch, lpegpatterns = lpeg.match, lpeg.patterns
-local sqrt = math.sqrt
-local concat, setmetatableindex, sortedhash = table.concat, table.setmetatableindex, table.sortedhash
-local gmatch, gsub, find, match, rep = string.gmatch, string.gsub, string.find, string.match, string.rep
-local formatters, fullstrip = string.formatters, string.fullstrip
-local utfsplit, utfbyte = utf.split, utf.byte
-
-local xmlconvert, xmlcollected, xmlcount, xmlfirst, xmlroot = xml.convert, xml.collected, xml.count, xml.first, xml.root
-local xmltext, xmltextonly = xml.text, xml.textonly
-local css = xml.css or { } -- testing
-
-local function xmlinheritattributes(c,pa)
- local at = c.at
- local dt = c.dt
- if at and dt then
- if pa then
- setmetatableindex(at,pa)
- end
- for i=1,#dt do
- local dti = dt[i]
- if type(dti) == "table" then
- xmlinheritattributes(dti,at)
- end
- end
- else
- -- comment of so
- end
-end
-
-xml.inheritattributes = xmlinheritattributes
-
--- Maybe some day helpers will move to the metapost.svg namespace!
-
-metapost = metapost or { }
-local metapost = metapost
-local context = context
-
-local report = logs.reporter("metapost","svg")
-
-local trace = false trackers.register("metapost.svg", function(v) trace = v end)
-local trace_text = false trackers.register("metapost.svg.text", function(v) trace_text = v end)
-local trace_path = false trackers.register("metapost.svg.path", function(v) trace_path = v end)
-local trace_result = false trackers.register("metapost.svg.result", function(v) trace_result = v end)
-
-local pathtracer = {
- ["stroke"] = "darkred",
- ["stroke-opacity"] = ".5",
- ["stroke-width"] = ".5",
- ["fill"] = "darkgray",
- ["fill-opacity"] = ".75",
-}
-
--- This is just an experiment. Todo: reset hash etc. Also implement
--- an option handler.
-
-local svghash = false do
-
- local svglast = 0
- local svglist = false
-
- local function checkhash(t,k)
- local n = svglast + 1
- svglast = n
- svglist[n] = k
- t[k] = n
- return n
- end
-
- function metapost.startsvghashing()
- svglast = 0
- svglist = { }
- svghash = setmetatableindex(checkhash)
- end
-
- function metapost.stopsvghashing()
- svglast = 0
- svglist = false
- svghash = false
- end
-
- interfaces.implement {
- name = "svghashed",
- arguments = "integer",
- actions = function(n)
- local t = svglist and svglist[n]
- if t then
- context(t)
- end
- end
- }
-
-end
-
--- We have quite some closures because otherwise we run into the local variable
--- limitations. It doesn't always look pretty now, sorry. I'll clean up this mess
--- some day (the usual nth iteration of code).
---
--- Most of the conversion is rather trivial code till I ran into a file with arcs. A
--- bit of searching lead to the a2c javascript function but it has some puzzling
--- thingies (like sin and cos definitions that look like leftovers and possible
--- division by zero). Anyway, we can if needed optimize it a bit more. Here does it
--- come from:
-
--- http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes
--- https://github.com/adobe-webplatform/Snap.svg/blob/b242f49e6798ac297a3dad0dfb03c0893e394464/src/path.js
-
-local a2c do
-
- local pi, sin, cos, tan, asin, abs = math.pi, math.sin, math.cos, math.tan, math.asin, math.abs
-
- local d120 = (pi * 120) / 180
- local pi2 = 2 * pi
-
- a2c = function(x1, y1, rx, ry, angle, large, sweep, x2, y2, f1, f2, cx, cy)
-
- if (rx == 0 or ry == 0 ) or (x1 == x2 and y1 == y2) then
- return { x1, y1, x2, y2, x2, y2 }
- end
-
- local recursive = f1
- local rad = pi / 180 * angle
- local res = nil
- local cosrad = cos(-rad) -- local cosrad = cosd(angle)
- local sinrad = sin(-rad) -- local sinrad = sind(angle)
-
- if not recursive then
-
- x1, y1 = x1 * cosrad - y1 * sinrad, x1 * sinrad + y1 * cosrad
- x2, y2 = x2 * cosrad - y2 * sinrad, x2 * sinrad + y2 * cosrad
-
- local x = (x1 - x2) / 2
- local y = (y1 - y2) / 2
- local xx = x * x
- local yy = y * y
- local h = xx / (rx * rx) + yy / (ry * ry)
-
- if h > 1 then
- h = sqrt(h)
- rx = h * rx
- ry = h * ry
- end
-
- local rx2 = rx * rx
- local ry2 = ry * ry
- local ry2xx = ry2 * xx
- local rx2yy = rx2 * yy
- local total = rx2yy + ry2xx -- otherwise overflow
-
- local k = total == 0 and 0 or sqrt(abs((rx2 * ry2 - rx2yy - ry2xx) / total))
-
- if large == sweep then
- k = -k
- end
-
- cx = k * rx * y / ry + (x1 + x2) / 2
- cy = k * -ry * x / rx + (y1 + y2) / 2
-
- f1 = (y1 - cy) / ry -- otherwise crash on a tiny eps
- f2 = (y2 - cy) / ry -- otherwise crash on a tiny eps
-
- f1 = asin((f1 < -1.0 and -1.0) or (f1 > 1.0 and 1.0) or f1)
- f2 = asin((f2 < -1.0 and -1.0) or (f2 > 1.0 and 1.0) or f2)
-
- if x1 < cx then f1 = pi - f1 end
- if x2 < cx then f2 = pi - f2 end
-
- if f1 < 0 then f1 = pi2 + f1 end
- if f2 < 0 then f2 = pi2 + f2 end
-
- if sweep ~= 0 and f1 > f2 then f1 = f1 - pi2 end
- if sweep == 0 and f2 > f1 then f2 = f2 - pi2 end
-
- end
-
- if abs(f2 - f1) > d120 then
- local f2old = f2
- local x2old = x2
- local y2old = y2
- f2 = f1 + d120 * ((sweep ~= 0 and f2 > f1) and 1 or -1)
- x2 = cx + rx * cos(f2)
- y2 = cy + ry * sin(f2)
- res = a2c(x2, y2, rx, ry, angle, 0, sweep, x2old, y2old, f2, f2old, cx, cy)
- end
-
- local c1 = cos(f1)
- local s1 = sin(f1)
- local c2 = cos(f2)
- local s2 = sin(f2)
-
- local t = tan((f2 - f1) / 4)
- local hx = 4 * rx * t / 3
- local hy = 4 * ry * t / 3
-
- local r = { x1 - hx * s1, y1 + hy * c1, x2 + hx * s2, y2 - hy * c2, x2, y2, unpack(res or { }) }
-
- if not recursive then -- we can also check for sin/cos being 0/1
- cosrad = cos(rad)
- sinrad = sin(rad)
- -- cosrad = cosd(angle)
- -- sinrad = sind(angle)
- for i0=1,#r,2 do
- local i1 = i0 + 1
- local x = r[i0]
- local y = r[i1]
- r[i0] = x * cosrad - y * sinrad
- r[i1] = x * sinrad + y * cosrad
- end
- end
-
- return r
- end
-
-end
-
--- We share some patterns.
-
-local p_digit = lpegpatterns.digit
-local p_hexdigit = lpegpatterns.hexdigit
-local p_space = lpegpatterns.whitespace
-
-local factors = {
- ["pt"] = 1.25,
- ["mm"] = 3.543307,
- ["cm"] = 35.43307,
- ["px"] = 1,
- ["pc"] = 15,
- ["in"] = 90,
- ["em"] = 12 * 1.25,
- ["ex"] = 8 * 1.25,
-}
-
-local percentage_r = 1/100
-local percentage_x = percentage_r
-local percentage_y = percentage_r
-
--- incredible: we can find .123.456 => 0.123 0.456 ...
-
-local p_command_x = C(S("Hh"))
-local p_command_y = C(S("Vv"))
-local p_command_xy = C(S("CcLlMmQqSsTt"))
-local p_command_a = C(S("Aa"))
-local p_command = C(S("Zz"))
-
-local p_optseparator = S("\t\n\r ,")^0
-local p_separator = S("\t\n\r ,")^1
-local p_number = (S("+-")^0 * (p_digit^0 * P(".") * p_digit^1 + p_digit^1 * P(".") + p_digit^1))
- * (P("e") * S("+-")^0 * p_digit^1)^-1
-
-local function convert (n) n = tonumber(n) return n end
-local function convert_r (n,u) n = tonumber(n) if u == true then return percentage_r * n elseif u then return u * n else return n end end
-local function convert_x (n,u) n = tonumber(n) if u == true then return percentage_x * n elseif u then return u * n else return n end end
-local function convert_y (n,u) n = tonumber(n) if u == true then return percentage_y * n elseif u then return u * n else return n end end
-local function convert_vx(n,u) n = tonumber(n) if u == true then return percentage_x * n elseif u then return u * n else return n end end
-local function convert_vy(n,u) n = - tonumber(n) if u == true then return percentage_y * n elseif u then return u * n else return n end end
-
-local p_unit = (P("p") * S("txc") + P("e") * S("xm") + S("mc") * P("m") + P("in")) / factors
-local p_percent = P("%") * Cc(true)
-
-local c_number_n = C(p_number)
-local c_number_u = C(p_number) * (p_unit + p_percent)^-1
-
-local p_number_n = c_number_n / convert
-local p_number_x = c_number_u / convert_x
-local p_number_vx = c_number_u / convert_vx
-local p_number_y = c_number_u / convert_y
-local p_number_vy = c_number_u / convert_vy
-local p_number_r = c_number_u / convert_r
-
-local function asnumber (s) return s and lpegmatch(p_number, s) or 0 end
-local function asnumber_r (s) return s and lpegmatch(p_number_r, s) or 0 end
-local function asnumber_x (s) return s and lpegmatch(p_number_x, s) or 0 end
-local function asnumber_y (s) return s and lpegmatch(p_number_y, s) or 0 end
-local function asnumber_vx(s) return s and lpegmatch(p_number_vx,s) or 0 end
-local function asnumber_vy(s) return s and lpegmatch(p_number_vy,s) or 0 end
-
-local p_number_vx_t = Ct { (p_number_vx + p_separator)^1 }
-local p_number_vy_t = Ct { (p_number_vy + p_separator)^1 }
-
-local zerotable = { 0 }
-
-local function asnumber_vx_t(s) return s and lpegmatch(p_number_vx_t,s) or zerotable end
-local function asnumber_vy_t(s) return s and lpegmatch(p_number_vy_t,s) or zerotable end
-
-local p_numbersep = p_number_n + p_separator
-local p_numbers = p_optseparator * P("(") * p_numbersep^0 * p_optseparator * P(")")
-local p_fournumbers = p_numbersep^4
-local p_path = Ct ( (
- p_command_xy * (p_optseparator * p_number_vx *
- p_optseparator * p_number_vy )^1
- + p_command_x * (p_optseparator * p_number_vx )^1
- + p_command_y * (p_optseparator * p_number_vy )^1
- + p_command_a * (p_optseparator * p_number_vx *
- p_optseparator * p_number_vy *
- p_optseparator * p_number_r *
- p_optseparator * p_number_n * -- flags
- p_optseparator * p_number_n * -- flags
- p_optseparator * p_number_vx *
- p_optseparator * p_number_vy )^1
- + p_command
- + p_separator
-)^1 )
-
--- We can actually use the svg color definitions from the tex end but maybe a user
--- doesn't want those replace the normal definitions.
---
--- local hexhash = setmetatableindex(function(t,k) local v = lpegmatch(p_hexcolor, k) t[k] = v return v end) -- per file
--- local hexhash3 = setmetatableindex(function(t,k) local v = lpegmatch(p_hexcolor3,k) t[k] = v return v end) -- per file
---
--- local function hexcolor (c) return hexhash [c] end -- directly do hexhash [c]
--- local function hexcolor3(c) return hexhash3[c] end -- directly do hexhash3[c]
-
-local colormap = false
-
-local function prepared(t)
- if type(t) == "table" then
- local mapping = t.mapping or { }
- local mapper = t.mapper
- local colormap = setmetatableindex(mapping)
- if mapper then
- setmetatableindex(colormap,function(t,k)
- local v = mapper(k)
- t[k] = v or k
- return v
- end)
- end
- return colormap
- else
- return false
- end
-end
-
-local colormaps = setmetatableindex(function(t,k)
- local v = false
- if type(k) == "string" then
- v = prepared(table.load(k)) -- todo: same path as svg file
- elseif type(k) == "table" then
- v = prepared(k)
- k = k.name or k
- end
- t[k] = v
- return v
-end)
-
-function metapost.svgcolorremapper(colormap)
- return colormaps[colormap]
-end
-
--- todo: cache colors per image / remapper
-
-local colorcomponents, withcolor, thecolor do
-
- local svgcolors = {
- aliceblue = 0xF0F8FF, antiquewhite = 0xFAEBD7, aqua = 0x00FFFF, aquamarine = 0x7FFFD4,
- azure = 0xF0FFFF, beige = 0xF5F5DC, bisque = 0xFFE4C4, black = 0x000000,
- blanchedalmond = 0xFFEBCD, blue = 0x0000FF, blueviolet = 0x8A2BE2, brown = 0xA52A2A,
- burlywood = 0xDEB887, cadetblue = 0x5F9EA0, hartreuse = 0x7FFF00, chocolate = 0xD2691E,
- coral = 0xFF7F50, cornflowerblue = 0x6495ED, cornsilk = 0xFFF8DC, crimson = 0xDC143C,
- cyan = 0x00FFFF, darkblue = 0x00008B, darkcyan = 0x008B8B, darkgoldenrod = 0xB8860B,
- darkgray = 0xA9A9A9, darkgreen = 0x006400, darkgrey = 0xA9A9A9, darkkhaki = 0xBDB76B,
- darkmagenta = 0x8B008B, darkolivegreen = 0x556B2F, darkorange = 0xFF8C00, darkorchid = 0x9932CC,
- darkred = 0x8B0000, darksalmon = 0xE9967A, darkseagreen = 0x8FBC8F, darkslateblue = 0x483D8B,
- darkslategray = 0x2F4F4F, darkslategrey = 0x2F4F4F, darkturquoise = 0x00CED1, darkviolet = 0x9400D3,
- deeppink = 0xFF1493, deepskyblue = 0x00BFFF, dimgray = 0x696969, dimgrey = 0x696969,
- dodgerblue = 0x1E90FF, firebrick = 0xB22222, floralwhite = 0xFFFAF0, forestgreen = 0x228B22,
- fuchsia = 0xFF00FF, gainsboro = 0xDCDCDC, ghostwhite = 0xF8F8FF, gold = 0xFFD700,
- goldenrod = 0xDAA520, gray = 0x808080, green = 0x008000, greenyellow = 0xADFF2F,
- grey = 0x808080, honeydew = 0xF0FFF0, hotpink = 0xFF69B4, indianred = 0xCD5C5C,
- indigo = 0x4B0082, ivory = 0xFFFFF0, khaki = 0xF0E68C, lavender = 0xE6E6FA,
- lavenderblush = 0xFFF0F5, lawngreen = 0x7CFC00, lemonchiffon = 0xFFFACD, lightblue = 0xADD8E6,
- lightcoral = 0xF08080, lightcyan = 0xE0FFFF, lightgoldenrodyellow = 0xFAFAD2, lightgray = 0xD3D3D3,
- lightgreen = 0x90EE90, lightgrey = 0xD3D3D3, lightpink = 0xFFB6C1, lightsalmon = 0xFFA07A,
- lightseagreen = 0x20B2AA, lightskyblue = 0x87CEFA, lightslategray = 0x778899, lightslategrey = 0x778899,
- lightsteelblue = 0xB0C4DE, lightyellow = 0xFFFFE0, lime = 0x00FF00, limegreen = 0x32CD32,
- linen = 0xFAF0E6, magenta = 0xFF00FF, maroon = 0x800000, mediumaquamarine = 0x66CDAA,
- mediumblue = 0x0000CD, mediumorchid = 0xBA55D3, mediumpurple = 0x9370DB, mediumseagreen = 0x3CB371,
- mediumslateblue = 0x7B68EE, mediumspringgreen = 0x00FA9A, mediumturquoise = 0x48D1CC, mediumvioletred = 0xC71585,
- midnightblue = 0x191970, mintcream = 0xF5FFFA, mistyrose = 0xFFE4E1, moccasin = 0xFFE4B5,
- navajowhite = 0xFFDEAD, navy = 0x000080, oldlace = 0xFDF5E6, olive = 0x808000,
- olivedrab = 0x6B8E23, orange = 0xFFA500, orangered = 0xFF4500, orchid = 0xDA70D6,
- palegoldenrod = 0xEEE8AA, palegreen = 0x98FB98, paleturquoise = 0xAFEEEE, palevioletred = 0xDB7093,
- papayawhip = 0xFFEFD5, peachpuff = 0xFFDAB9, peru = 0xCD853F, pink = 0xFFC0CB,
- plum = 0xDDA0DD, powderblue = 0xB0E0E6, purple = 0x800080, red = 0xFF0000,
- rosybrown = 0xBC8F8F, royalblue = 0x4169E1, saddlebrown = 0x8B4513, salmon = 0xFA8072,
- sandybrown = 0xF4A460, seagreen = 0x2E8B57, seashell = 0xFFF5EE, sienna = 0xA0522D,
- silver = 0xC0C0C0, skyblue = 0x87CEEB, slateblue = 0x6A5ACD, slategray = 0x708090,
- slategrey = 0x708090, snow = 0xFFFAFA, springgreen = 0x00FF7F, steelblue = 0x4682B4,
- tan = 0xD2B48C, teal = 0x008080, thistle = 0xD8BFD8, tomato = 0xFF6347,
- turquoise = 0x40E0D0, violet = 0xEE82EE, wheat = 0xF5DEB3, white = 0xFFFFFF,
- whitesmoke = 0xF5F5F5, yellow = 0xFFFF00, yellowgreen = 0x9ACD32,
- }
-
- local f_rgb = formatters['withcolor svgcolor(%.3N,%.3N,%.3N)']
- local f_cmyk = formatters['withcolor svgcmyk(%.3N,%.3N,%.3N,%.3N)']
- local f_gray = formatters['withcolor svggray(%.3N)']
- local f_rgba = formatters['withcolor svgcolor(%.3N,%.3N,%.3N) withtransparency (1,%.3N)']
- local f_graya = formatters['withcolor svggray(%.3N) withtransparency (1,%.3N)']
- local f_name = formatters['withcolor "%s"']
- local f_svgcolor = formatters['svgcolor(%.3N,%.3N,%.3N)']
- local f_svgcmyk = formatters['svgcmyk(%.3N,%.3N,%.3N,%.3N)']
- local f_svggray = formatters['svggray(%.3N)']
- local f_svgname = formatters['"%s"']
-
- local extract = bit32.extract
-
- local triplets = setmetatableindex(function(t,k)
- -- we delay building all these strings
- local v = svgcolors[k]
- if v then
- v = { extract(v,16,8)/255, extract(v,8,8)/255, extract(v,0,8)/255 }
- else
- v = false
- end
- t[k] = v
- return v
- end)
-
- local p_fraction = C(p_number) * C("%")^-1 / function(a,b) return tonumber(a) / (b and 100 or 255) end
- local p_angle = C(p_number) * P("deg")^0 / function(a) return tonumber(a) end
- local p_percent = C(p_number) * P("%") / function(a) return tonumber(a) / 100 end
- local p_absolute = C(p_number) / tonumber
-
- local p_left = P("(")
- local p_right = P(")")
- local p_a = P("a")^-1
- local p_h_a_color = p_left
- * p_angle
- * p_separator * p_percent
- * p_separator * p_percent
- * p_separator^0 * p_absolute^0
- * p_right
-
- local colors = attributes.colors
- local colorvalues = colors.values
- local colorindex = attributes.list[attributes.private('color')]
- local hsvtorgb = colors.hsvtorgb
- local hwbtorgb = colors.hwbtorgb
- local forcedmodel = colors.forcedmodel
-
- local p_splitcolor =
- P("#") * C(p_hexdigit*p_hexdigit)^1 / function(r,g,b)
- return "rgb",
- tonumber(r or 0, 16) / 255 or 0,
- tonumber(g or 0, 16) / 255 or 0,
- tonumber(b or 0, 16) / 255 or 0
- end
- +
- P("rgb") * p_a
- * p_left * (p_fraction + p_separator)^-3 * (p_absolute + p_separator)^0 * p_right / function(r,g,b,a)
- return "rgb", r or 0, g or 0, b or 0, a or false
- end
- + P("cmyk")
- * p_left * (p_absolute + p_separator)^0 * p_right / function(c,m,y,k)
- return "cmyk", c or 0, m or 0, y or 0, k or 0
- end
- + P("hsl") * p_a
- * p_h_a_color / function(h,s,l,a)
- local r, g, b = hsvtorgb(h,s,l,a)
- return "rgb", r or 0, g or 0, b or 0, a or false
- end
- + P("hwb") * p_a
- * p_h_a_color / function(h,w,b,a)
- local r, g, b = hwbtorgb(h,w,b)
- return "rgb", r or 0, g or 0, b or 0, a or false
- end
-
- function metapost.svgsplitcolor(color)
- if type(color) == "string" then
- local what, s1, s2, s3, s4 = lpegmatch(p_splitcolor,color)
- if not what then
- local t = triplets[color]
- if t then
- what, s1, s2, s3 = "rgb", t[1], t[2], t[3]
- end
- end
- return what, s1, s2, s3, s4
- else
- return "gray", 0, false
- end
- end
-
-
- local function registeredcolor(name)
- local color = colorindex[name]
- if color then
- local v = colorvalues[color]
- local t = forcedmodel(v[1])
- if t == 2 then
- return "gray", v[2]
- elseif t == 3 then
- return "rgb", v[3], v[4], v[5]
- elseif t == 4 then
- return "cmyk", v[6], v[7], v[8], v[9]
- else
- --
- end
- end
- end
-
- -- we can have a fast check for #000000
-
- local function validcolor(color)
- if colormap then
- local c = colormap[color]
- local t = type(c)
- if t == "table" then
- local what = t[1]
- if what == "rgb" then
- return
- what,
- tonumber(t[2]) or 0,
- tonumber(t[3]) or 0,
- tonumber(t[4]) or 0,
- tonumber(t[4]) or false
- elseif what == "cmyk" then
- return
- what,
- tonumber(t[2]) or 0,
- tonumber(t[3]) or 0,
- tonumber(t[4]) or 0,
- tonumber(t[5]) or 0
- elseif what == "gray" then
- return
- what,
- tonumber(t[2]) or 0,
- tonumber(t[3]) or false
- end
- elseif t == "string" then
- color = c
- end
- end
- local what, s1, s2, s3, s4 = registeredcolor(color)
- if what then
- return what, s1, s2, s3, s4
- end
- what, s1, s2, s3, s4 = lpegmatch(p_splitcolor,color)
- if not what then
- local t = triplets[color]
- if t then
- s1, s3, s3 = t[1], t[2], t[3]
- what = "rgb"
- end
- end
- return what, s1, s2, s3, s4
- end
-
- colorcomponents = function(color)
- local what, s1, s2, s3, s4 = validcolor(color)
- return s1, s2, s3, s4 -- so 4 means cmyk
- end
-
- withcolor = function(color)
- local what, s1, s2, s3, s4 = validcolor(color)
- -- print(color,what, s1, s2, s3, s4)
- if what == "rgb" then
- if s4 then
- if s1 == s2 and s1 == s3 then
- return f_graya(s1,s4)
- else
- return f_rgba(s1,s2,s3,s4)
- end
- else
- if s1 == s2 and s1 == s3 then
- return f_gray(s1)
- else
- return f_rgb(s1,s2,s3)
- end
- end
- elseif what == "cmyk" then
- return f_cmyk(s1,s2,s3,s4)
- elseif what == "gray" then
- if s2 then
- return f_graya(s1,s2)
- else
- return f_gray(s1)
- end
- end
- return f_name(color)
- end
-
- thecolor = function(color)
- local what, s1, s2, s3, s4 = validcolor(color)
- if what == "rgb" then
- if s4 then
- if s1 == s2 and s1 == s3 then
- return f_svggraya(s1,s4)
- else
- return f_svgrgba(s1,s2,s3,s4)
- end
- else
- if s1 == s2 and s1 == s3 then
- return f_svggray(s1)
- else
- return f_svgrgb(s1,s2,s3)
- end
- end
- elseif what == "cmyk" then
- return f_cmyk(s1,s2,s3,s4)
- elseif what == "gray" then
- if s2 then
- return f_svggraya(s1,s2)
- else
- return f_svggray(s1)
- end
- end
- return f_svgname(color)
- end
-
-end
-
--- actually we can loop faster because we can go to the last one
-
-local grabpath, grablist do
-
- local f_moveto = formatters['(%N,%N)']
- local f_curveto_z = formatters['controls(%N,%N)and(%N,%N)..(%N,%N)']
- local f_curveto_n = formatters['..controls(%N,%N)and(%N,%N)..(%N,%N)']
- local f_lineto_z = formatters['(%N,%N)']
- local f_lineto_n = formatters['--(%N,%N)']
-
- local m = { __index = function() return 0 end }
-
- grabpath = function(str)
- local p = lpegmatch(p_path,str) or { }
- local np = #p
- local all = { entries = np, closed = false, curve = false }
- if np == 0 then
- return all
- end
- setmetatable(p,m)
- local t = { } -- no real saving here if we share
- local n = 0
- local a = 0
- local i = 0
- local last = "M"
- local prev = last
- local kind = "L"
- local x, y = 0, 0
- local x1, y1 = 0, 0
- local x2, y2 = 0, 0
- local rx, ry = 0, 0
- local ar, al = 0, 0
- local as, ac = 0, nil
- local mx, my = 0, 0
- while i < np do
- i = i + 1
- local pi = p[i]
- if type(pi) ~= "number" then
- last = pi
- i = i + 1
- pi = p[i]
- end
- -- most often
- if last == "c" then
- x1 = x + pi
- i = i + 1 ; y1 = y + p[i]
- i = i + 1 ; x2 = x + p[i]
- i = i + 1 ; y2 = y + p[i]
- i = i + 1 ; x = x + p[i]
- i = i + 1 ; y = y + p[i]
- goto curveto
- elseif last == "l" then
- x = x + pi
- i = i + 1 ; y = y + p[i]
- goto lineto
- elseif last == "h" then
- x = x + pi
- goto lineto
- elseif last == "v" then
- y = y + pi
- goto lineto
- elseif last == "a" then
- x1 = x
- y1 = y
- rx = pi
- i = i + 1 ; ry = p[i]
- i = i + 1 ; ar = p[i]
- i = i + 1 ; al = p[i]
- i = i + 1 ; as = p[i]
- i = i + 1 ; x = x + p[i]
- i = i + 1 ; y = y + p[i]
- goto arc
- elseif last == "s" then
- if prev == "C" then
- x1 = 2 * x - x2
- y1 = 2 * y - y2
- else
- x1 = x
- y1 = y
- end
- x2 = x + pi
- i = i + 1 ; y2 = y + p[i]
- i = i + 1 ; x = x + p[i]
- i = i + 1 ; y = y + p[i]
- goto curveto
- elseif last == "m" then
- if n > 0 then
- a = a + 1 ; all[a] = concat(t,"",1,n) ; n = 0
- end
- x = x + pi
- i = i + 1 ; y = y + p[i]
- goto moveto
- elseif last == "z" then
- goto close
- -- less frequent
- elseif last == "C" then
- x1 = pi
- i = i + 1 ; y1 = p[i]
- i = i + 1 ; x2 = p[i]
- i = i + 1 ; y2 = p[i]
- i = i + 1 ; x = p[i]
- i = i + 1 ; y = p[i]
- goto curveto
- elseif last == "L" then
- x = pi
- i = i + 1 ; y = p[i]
- goto lineto
- elseif last == "H" then
- x = pi
- goto lineto
- elseif last == "V" then
- y = pi
- goto lineto
- elseif last == "A" then
- x1 = x
- y1 = y
- rx = pi
- i = i + 1 ; ry = p[i]
- i = i + 1 ; ar = p[i]
- i = i + 1 ; al = p[i]
- i = i + 1 ; as = p[i]
- i = i + 1 ; x = p[i]
- i = i + 1 ; y = p[i]
- goto arc
- elseif last == "S" then
- if prev == "C" then
- x1 = 2 * x - x2
- y1 = 2 * y - y2
- else
- x1 = x
- y1 = y
- end
- x2 = pi
- i = i + 1 ; y2 = p[i]
- i = i + 1 ; x = p[i]
- i = i + 1 ; y = p[i]
- goto curveto
- elseif last == "M" then
- if n > 0 then
- a = a + 1 ; all[a] = concat(t,"",1,n) ; n = 0
- end
- x = pi ;
- i = i + 1 ; y = p[i]
- goto moveto
- elseif last == "Z" then
- goto close
- -- very seldom
- elseif last == "q" then
- x1 = x + pi
- i = i + 1 ; y1 = y + p[i]
- i = i + 1 ; x2 = x + p[i]
- i = i + 1 ; y2 = y + p[i]
- goto quadratic
- elseif last == "t" then
- if prev == "C" then
- x1 = 2 * x - x1
- y1 = 2 * y - y1
- else
- x1 = x
- y1 = y
- end
- x2 = x + pi
- i = i + 1 ; y2 = y + p[i]
- goto quadratic
- elseif last == "Q" then
- x1 = pi
- i = i + 1 ; y1 = p[i]
- i = i + 1 ; x2 = p[i]
- i = i + 1 ; y2 = p[i]
- goto quadratic
- elseif last == "T" then
- if prev == "C" then
- x1 = 2 * x - x1
- y1 = 2 * y - y1
- else
- x1 = x
- y1 = y
- end
- x2 = pi
- i = i + 1 ; y2 = p[i]
- goto quadratic
- else
- goto continue
- end
- ::moveto::
- n = n + 1 ; t[n] = f_moveto(x,y)
- last = last == "M" and "L" or "l"
- prev = "M"
- mx = x
- my = y
- goto continue
- ::lineto::
- n = n + 1 ; t[n] = (n > 0 and f_lineto_n or f_lineto_z)(x,y)
- prev = "L"
- goto continue
- ::curveto::
- n = n + 1 ; t[n] = (n > 0 and f_curveto_n or f_curveto_z)(x1,y1,x2,y2,x,y)
- prev = "C"
- goto continue
- ::arc::
- ac = a2c(x1,y1,rx,ry,ar,al,as,x,y)
- for i=1,#ac,6 do
- n = n + 1 ; t[n] = (n > 0 and f_curveto_n or f_curveto_z)(
- ac[i],ac[i+1],ac[i+2],ac[i+3],ac[i+4],ac[i+5]
- )
- end
- prev = "A"
- goto continue
- ::quadratic::
- n = n + 1 ; t[n] = (n > 0 and f_curveto_n or f_curveto_z)(
- x + 2/3 * (x1-x ), y + 2/3 * (y1-y ),
- x2 + 2/3 * (x1-x2), y2 + 2/3 * (y1-y2),
- x2, y2
- )
- x = x2
- y = y2
- prev = "C"
- goto continue
- ::close::
- -- n = n + 1 ; t[n] = prev == "C" and "..cycle" or "--cycle"
- n = n + 1 ; t[n] = "--cycle"
- if n > 0 then
- a = a + 1 ; all[a] = concat(t,"",1,n) ; n = 0
- end
- if i == np then
- break
- else
- i = i - 1
- end
- kind = prev
- prev = "Z"
- -- this is kind of undocumented: a close also moves back
- x = mx
- y = my
- ::continue::
- end
- if n > 0 then
- a = a + 1 ; all[a] = concat(t,"",1,n) ; n = 0
- end
- if prev == "Z" then
- all.closed = true
- end
- all.curve = (kind == "C" or kind == "A")
- return all, p
- end
-
- -- this is a bit tricky as what are points for a mark ... the next can be simplified
- -- a lot
-
- grablist = function(p)
- local np = #p
- if np == 0 then
- return nil
- end
- local t = { }
- local n = 0
- local a = 0
- local i = 0
- local last = "M"
- local prev = last
- local kind = "L"
- local x, y = 0, 0
- local x1, y1 = 0, 0
- local x2, y2 = 0, 0
- local rx, ry = 0, 0
- local ar, al = 0, 0
- local as, ac = 0, nil
- local mx, my = 0, 0
- while i < np do
- i = i + 1
- local pi = p[i]
- if type(pi) ~= "number" then
- last = pi
- i = i + 1
- pi = p[i]
- end
- -- most often
- if last == "c" then
- x1 = x + pi
- i = i + 1 ; y1 = y + p[i]
- i = i + 1 ; x2 = x + p[i]
- i = i + 1 ; y2 = y + p[i]
- i = i + 1 ; x = x + p[i]
- i = i + 1 ; y = y + p[i]
- goto curveto
- elseif last == "l" then
- x = x + pi
- i = i + 1 ; y = y + p[i]
- goto lineto
- elseif last == "h" then
- x = x + pi
- goto lineto
- elseif last == "v" then
- y = y + pi
- goto lineto
- elseif last == "a" then
- x1 = x
- y1 = y
- rx = pi
- i = i + 1 ; ry = p[i]
- i = i + 1 ; ar = p[i]
- i = i + 1 ; al = p[i]
- i = i + 1 ; as = p[i]
- i = i + 1 ; x = x + p[i]
- i = i + 1 ; y = y + p[i]
- goto arc
- elseif last == "s" then
- if prev == "C" then
- x1 = 2 * x - x2
- y1 = 2 * y - y2
- else
- x1 = x
- y1 = y
- end
- x2 = x + pi
- i = i + 1 ; y2 = y + p[i]
- i = i + 1 ; x = x + p[i]
- i = i + 1 ; y = y + p[i]
- goto curveto
- elseif last == "m" then
- x = x + pi
- i = i + 1 ; y = y + p[i]
- goto moveto
- elseif last == "z" then
- goto close
- -- less frequent
- elseif last == "C" then
- x1 = pi
- i = i + 1 ; y1 = p[i]
- i = i + 1 ; x2 = p[i]
- i = i + 1 ; y2 = p[i]
- i = i + 1 ; x = p[i]
- i = i + 1 ; y = p[i]
- goto curveto
- elseif last == "L" then
- x = pi
- i = i + 1 ; y = p[i]
- goto lineto
- elseif last == "H" then
- x = pi
- goto lineto
- elseif last == "V" then
- y = pi
- goto lineto
- elseif last == "A" then
- x1 = x
- y1 = y
- rx = pi
- i = i + 1 ; ry = p[i]
- i = i + 1 ; ar = p[i]
- i = i + 1 ; al = p[i]
- i = i + 1 ; as = p[i]
- i = i + 1 ; x = p[i]
- i = i + 1 ; y = p[i]
- goto arc
- elseif last == "S" then
- if prev == "C" then
- x1 = 2 * x - x2
- y1 = 2 * y - y2
- else
- x1 = x
- y1 = y
- end
- x2 = pi
- i = i + 1 ; y2 = p[i]
- i = i + 1 ; x = p[i]
- i = i + 1 ; y = p[i]
- goto curveto
- elseif last == "M" then
- x = pi ;
- i = i + 1 ; y = p[i]
- goto moveto
- elseif last == "Z" then
- goto close
- -- very seldom
- elseif last == "q" then
- x1 = x + pi
- i = i + 1 ; y1 = y + p[i]
- i = i + 1 ; x2 = x + p[i]
- i = i + 1 ; y2 = y + p[i]
- goto quadratic
- elseif last == "t" then
- if prev == "C" then
- x1 = 2 * x - x1
- y1 = 2 * y - y1
- else
- x1 = x
- y1 = y
- end
- x2 = x + pi
- i = i + 1 ; y2 = y + p[i]
- goto quadratic
- elseif last == "Q" then
- x1 = pi
- i = i + 1 ; y1 = p[i]
- i = i + 1 ; x2 = p[i]
- i = i + 1 ; y2 = p[i]
- goto quadratic
- elseif last == "T" then
- if prev == "C" then
- x1 = 2 * x - x1
- y1 = 2 * y - y1
- else
- x1 = x
- y1 = y
- end
- x2 = pi
- i = i + 1 ; y2 = p[i]
- goto quadratic
- else
- goto continue
- end
- ::moveto::
- n = n + 1 ; t[n] = x
- n = n + 1 ; t[n] = y
- last = last == "M" and "L" or "l"
- prev = "M"
- mx = x
- my = y
- goto continue
- ::lineto::
- n = n + 1 ; t[n] = x
- n = n + 1 ; t[n] = y
- prev = "L"
- goto continue
- ::curveto::
- n = n + 1 ; t[n] = x
- n = n + 1 ; t[n] = y
- prev = "C"
- goto continue
- ::arc::
- ac = a2c(x1,y1,rx,ry,ar,al,as,x,y)
- for i=1,#ac,6 do
- n = n + 1 ; t[n] = ac[i+4]
- n = n + 1 ; t[n] = ac[i+5]
- end
- prev = "A"
- goto continue
- ::quadratic::
- n = n + 1 ; t[n] = x2
- n = n + 1 ; t[n] = y2
- x = x2
- y = y2
- prev = "C"
- goto continue
- ::close::
- n = n + 1 ; t[n] = mx
- n = n + 1 ; t[n] = my
- if i == np then
- break
- end
- kind = prev
- prev = "Z"
- x = mx
- y = my
- ::continue::
- end
- return t
- end
-
-end
-
--- todo: viewbox helper
-
-local s_wrapped_start = "draw image ("
-local f_wrapped_stop = formatters[") shifted (0,%N) scaled %N ;"]
-
-local handletransform, handleviewbox do
-
- local sind = math.sind
-
- --todo: better lpeg
-
- local f_rotatedaround = formatters[" rotatedaround((%N,%N),%N)"]
- local f_rotated = formatters[" rotated(%N)"]
- local f_shifted = formatters[" shifted(%N,%N)"]
- local f_slanted_x = formatters[" xslanted(%N)"]
- local f_slanted_y = formatters[" yslanted(%N)"]
- local f_scaled = formatters[" scaled(%N)"]
- local f_xyscaled = formatters[" xyscaled(%N,%N)"]
- local f_matrix = formatters[" transformed bymatrix(%N,%N,%N,%N,%N,%N)"]
-
- local s_transform_start = "draw image ( "
- local f_transform_stop = formatters[")%s ;"]
-
- local function rotate(r,x,y)
- if x then
- return r and f_rotatedaround(x,-(y or x),-r)
- elseif r then
- return f_rotated(-r)
- else
- return ""
- end
- end
-
- local function translate(x,y)
- if y then
- return f_shifted(x,-y)
- elseif x then
- return f_shifted(x,0)
- else
- return ""
- end
- end
-
- local function scale(x,y)
- if y then
- return f_xyscaled(x,y)
- elseif x then
- return f_scaled(x)
- else
- return ""
- end
- end
-
- local function skewx(x)
- if x then
- return f_slanted_x(sind(-x))
- else
- return ""
- end
- end
-
- local function skewy(y)
- if y then
- return f_slanted_y(sind(-y))
- else
- return ""
- end
- end
-
- local function matrix(rx,sx,sy,ry,tx,ty)
- return f_matrix(rx or 1, sx or 0, sy or 0, ry or 1, tx or 0, - (ty or 0))
- end
-
- -- How to deal with units here? Anyway, order seems to matter.
-
- local p_transform = Cf ( Ct("") * (
- lpegpatterns.whitespace^0 * Cg(
- C("translate") * (p_numbers / translate) -- maybe xy
- + C("scale") * (p_numbers / scale)
- + C("rotate") * (p_numbers / rotate)
- + C("matrix") * (p_numbers / matrix)
- + C("skewX") * (p_numbers / skewx)
- + C("skewY") * (p_numbers / skewy)
- )
- )^1, rawset)
-
- handletransform = function(at)
- local t = at.transform
- if t then
- local e = lpegmatch(p_transform,t)
- if e then
- e = concat({
- e.rotate or "",
- e.skewX or "",
- e.skewY or "",
- e.scale or "",
- e.translate or "",
- e.matrix or "",
- }, " ")
- return s_transform_start, f_transform_stop(e), t
- end
- end
- end
-
- handleviewbox = function(v)
- if v then
- local x, y, w, h = lpegmatch(p_fournumbers,v)
- if h then
- return x, y, w, h
- end
- end
- end
-
-end
-
-local dashed do
-
- -- actually commas are mandate but we're tolerant
-
- local f_dashed_n = formatters[" dashed dashpattern (%s ) "]
- local f_dashed_y = formatters[" dashed dashpattern (%s ) shifted (%N,0) "]
-
- local p_number = p_optseparator/"" * p_number_r
- local p_on = Cc(" on ") * p_number
- local p_off = Cc(" off ") * p_number
- local p_dashed = Cs((p_on * p_off^-1)^1)
-
- dashed = function(s,o)
- if not find(s,",") then
- -- a bit of a hack:
- s = s .. " " .. s
- end
- return (o and f_dashed_y or f_dashed_n)(lpegmatch(p_dashed,s),o)
- end
-
-end
-
-do
-
- local handlers = { }
- local process = false
- local root = false
- local result = false
- local r = false
- local definitions = false
- local classstyles = false
- local tagstyles = false
-
- local tags = {
- ["a"] = true,
- -- ["altgGlyph"] = true,
- -- ["altgGlyphDef"] = true,
- -- ["altgGlyphItem"] = true,
- -- ["animate"] = true,
- -- ["animateColor"] = true,
- -- ["animateMotion"] = true,
- -- ["animateTransform"] = true,
- ["circle"] = true,
- ["clipPath"] = true,
- -- ["color-profile"] = true,
- -- ["cursor"] = true,
- ["defs"] = true,
- -- ["desc"] = true,
- ["ellipse"] = true,
- -- ["filter"] = true,
- -- ["font"] = true,
- -- ["font-face"] = true,
- -- ["font-face-format"] = true,
- -- ["font-face-name"] = true,
- -- ["font-face-src"] = true,
- -- ["font-face-uri"] = true,
- -- ["foreignObject"] = true,
- ["g"] = true,
- -- ["glyph"] = true,
- -- ["glyphRef"] = true,
- -- ["hkern"] = true,
- ["image"] = true,
- ["line"] = true,
- ["linearGradient"] = true,
- ["marker"] = true,
- -- ["mask"] = true,
- -- ["metadata"] = true,
- -- ["missing-glyph"] = true,
- -- ["mpath"] = true,
- ["path"] = true,
- -- ["pattern"] = true,
- ["polygon"] = true,
- ["polyline"] = true,
- ["radialGradient"] = true,
- ["rect"] = true,
- -- ["script"] = true,
- -- ["set"] = true,
- ["stop"] = true,
- ["style"] = true,
- ["svg"] = true,
- -- ["switch"] = true,
- ["symbol"] = true,
- ["text"] = true,
- -- ["textPath"] = true,
- -- ["title"] = true,
- ["tspan"] = true,
- ["use"] = true,
- -- ["view"] = true,
- -- ["vkern"] = true,
- }
-
- local function handlechains(c)
- if tags[c.tg] then
- local at = c.at
- local dt = c.dt
- if at and dt then
- -- at["inkscape:connector-curvature"] = nil -- cleare entry and might prevent table growth
- local estyle = rawget(at,"style")
- if estyle and estyle ~= "" then
- for k, v in gmatch(estyle,"%s*([^:]+):%s*([^;]+);?") do
- at[k] = v
- end
- end
- local eclass = rawget(at,"class")
- if eclass and eclass ~= "" then
- for c in gmatch(eclass,"[^ ]+") do
- local s = classstyles[c]
- if s then
- for k, v in next, s do
- at[k] = v
- end
- end
- end
- end
- local tstyle = tagstyles[tag]
- if tstyle then
- for k, v in next, tstyle do
- at[k] = v
- end
- end
- if trace_path and pathtracer then
- for k, v in next, pathtracer do
- at[k] = v
- end
- end
- for i=1,#dt do
- local dti = dt[i]
- if type(dti) == "table" then
- handlechains(dti)
- end
- end
- end
- end
- end
-
- local handlestyle do
-
- -- It can also be CDATA but that is probably dealt with because we only
- -- check for style entries and ignore the rest. But maybe we also need
- -- to check a style at the outer level?
-
- local p_key = C((R("az","AZ","09","__","--")^1))
- local p_spec = P("{") * C((1-P("}"))^1) * P("}")
- local p_valid = Carg(1) * P(".") * p_key + Carg(2) * p_key
- local p_grab = ((p_valid * p_space^0 * p_spec / rawset) + p_space^1 + P(1))^1
-
- local fontspecification = css.fontspecification
-
- handlestyle = function(c)
- local s = xmltext(c)
- lpegmatch(p_grab,s,1,classstyles,tagstyles)
- for k, v in next, classstyles do
- local t = { }
- for k, v in gmatch(v,"%s*([^:]+):%s*([^;]+);?") do
- if k == "font" then
- local s = fontspecification(v)
- for k, v in next, s do
- t["font-"..k] = v
- end
- else
- t[k] = v
- end
- end
- classstyles[k] = t
- end
- for k, v in next, tagstyles do
- local t = { }
- for k, v in gmatch(v,"%s*([^:]+):%s*([^;]+);?") do
- if k == "font" then
- local s = fontspecification(v)
- for k, v in next, s do
- t["font-"..k] = v
- end
- else
- t[k] = v
- end
- end
- tagstyles[k] = t
- end
- end
-
- function handlers.style()
- -- ignore
- end
-
- end
-
- -- We can have root in definitions and then do a metatable lookup but use
- -- is not used that often I guess.
-
- local function locate(id)
- local res = definitions[id]
- if res then
- return res
- end
- local ref = gsub(id,"^url%(#(.-)%)$","%1")
- local ref = gsub(ref,"^#","")
- -- we can make a fast id lookup
- local res = xmlfirst(root,"**[@id='"..ref.."']")
- if res then
- definitions[id] = res
- end
- return res
- end
-
- -- also locate
-
- local function handleclippath(at)
- local clippath = at["clip-path"]
-
- if not clippath then
- return
- end
-
- local spec = definitions[clippath] or locate(clippath)
-
- -- do we really need thsi crap
- if not spec then
- local index = match(clippath,"(%d+)")
- if index then
- spec = xmlfirst(root,"clipPath["..tostring(tonumber(index) or 0).."]")
- end
- end
- -- so far for the crap
-
- if not spec then
- report("unknown clip %a",clippath)
- return
- elseif spec.tg ~= "clipPath" then
- report("bad clip %a",clippath)
- return
- end
-
- ::again::
- for c in xmlcollected(spec,"/(path|use|g)") do
- local tg = c.tg
- if tg == "use" then
- local ca = c.at
- local id = ca["xlink:href"]
- if id then
- spec = locate(id)
- if spec then
- local sa = spec.at
- setmetatableindex(sa,ca)
- if spec.tg == "path" then
- local d = sa.d
- if d then
- local p = grabpath(d)
- p.evenodd = sa["clip-rule"] == "evenodd"
- p.close = true
- return p, clippath
- else
- return
- end
- else
- goto again
- end
- end
- end
- -- break
- elseif tg == "path" then
- local ca = c.at
- local d = ca.d
- if d then
- local p = grabpath(d)
- p.evenodd = ca["clip-rule"] == "evenodd"
- p.close = true
- return p, clippath
- else
- return
- end
- else
- -- inherit?
- end
- end
- end
-
- local s_shade_linear = ' withshademethod "linear" '
- local s_shade_circular = ' withshademethod "circular" '
- local f_shade_step = formatters['withshadestep ( withshadefraction %N withshadecolors(%s,%s) )']
- local f_shade_one = formatters['withprescript "sh_center_a=%N %N"']
- local f_shade_two = formatters['withprescript "sh_center_b=%N %N"']
-
- local f_color = formatters['withcolor "%s"']
- local f_opacity = formatters['withtransparency (1,%N)']
- local f_pen = formatters['withpen pencircle scaled %N']
-
- -- todo: gradient unfinished
- -- todo: opacity but first we need groups in mp
-
- local function gradient(id)
- local spec = definitions[id] -- no locate !
- if spec then
- local kind = spec.tg
- local shade = nil
- local n = 1
- local a = spec.at
- if kind == "linearGradient" then
- shade = { s_shade_linear }
- --
- local x1 = rawget(a,"x1")
- local y1 = rawget(a,"y1")
- local x2 = rawget(a,"x2")
- local y2 = rawget(a,"y2")
- if x1 and y1 then
- n = n + 1 ; shade[n] = f_shade_one(asnumber_vx(x1),asnumber_vy(y1))
- end
- if x2 and y2 then
- n = n + 1 ; shade[n] = f_shade_one(asnumber_vx(x2),asnumber_vy(y2))
- end
- --
- elseif kind == "radialGradient" then
- shade = { s_shade_circular }
- --
- local cx = rawget(a,"cx") -- x center
- local cy = rawget(a,"cy") -- y center
- local r = rawget(a,"r" ) -- radius
- local fx = rawget(a,"fx") -- focal points
- local fy = rawget(a,"fy") -- focal points
- --
- if cx and cy then
- -- todo
- end
- if r then
- -- todo
- end
- if fx and fy then
- -- todo
- end
- else
- report("unknown gradient %a",id)
- return
- end
- -- local gu = a.gradientUnits
- -- local gt = a.gradientTransform
- -- local sm = a.spreadMethod
- local colora, colorb
- -- startcolor ?
- for c in xmlcollected(spec,"/stop") do
- local a = c.at
- local offset = rawget(a,"offset")
- local colorb = rawget(a,"stop-color")
- local opacity = rawget(a,"stop-opacity")
- if colorb then
- colorb = thecolor(colorb)
- end
- if not colora then
- colora = colorb
- end
- -- what if no percentage
-
- local fraction = offset and asnumber_r(offset)
- if not fraction then
- -- offset = tonumber(offset)
- -- for now
- fraction = xmlcount(spec,"/stop")/100
- end
-
- if colora and colorb and color_a ~= "" and color_b ~= "" then
- n = n + 1 ; shade[n] = f_shade_step(fraction,colora,colorb)
- end
-
- colora = colorb
- end
- return concat(shade," ")
- end
- end
-
- local function drawproperties(stroke,at,opacity)
- local p = at["stroke-width"]
- if p then
- p = f_pen(asnumber_r(p))
- end
- local d = at["stroke-dasharray"]
- if d == "none" then
- d = nil
- elseif d then
- local o = at["stroke-dashoffset"]
- if o and o ~= "none" then
- o = asnumber_r(o)
- else
- o = false
- end
- d = dashed(d,o)
- end
- local c = withcolor(stroke)
- local o = at["stroke-opacity"] or (opacity and at["opacity"])
- if o == "none" then
- o = nil
- elseif o then
- o = asnumber_r(o)
- if o and o ~= 1 then
- o = f_opacity(o)
- else
- o = nil
- end
- end
- return p, d, c, o
- end
-
- local s_opacity_start = "draw image ("
- local f_opacity_stop = formatters["setgroup currentpicture to boundingbox currentpicture withtransparency (1,%N)) ;"]
-
- local function sharedopacity(at)
- local o = at["opacity"]
- if o and o ~= "none" then
- o = asnumber_r(o)
- if o and o ~= 1 then
- return s_opacity_start, f_opacity_stop(o)
- end
- end
- end
-
- local function fillproperties(fill,at,opacity)
- local c = c ~= "none" and (gradient(fill) or withcolor(fill)) or nil
- local o = at["fill-opacity"] or (opacity and at["opacity"])
- if o and o ~= "none" then
- o = asnumber_r(o)
- if o == 1 then
- return c
- elseif o then
- return c, f_opacity(o), o == 0
- end
- end
- return c
- end
-
- -- todo: clip = [ auto | rect(llx,lly,urx,ury) ]
-
- local s_offset_start = "draw image ( "
- local f_offset_stop = formatters[") shifted (%N,%N) ;"]
- local s_rotation_start = "draw image ( "
- local f_rotation_stop = formatters[") rotatedaround((0,0),-angle((%N,%N))) ;"]
- local f_rotation_angle = formatters[") rotatedaround((0,0),-%N) ;"]
-
- local function offset(at)
- local x = asnumber_vx(rawget(at,"x"))
- local y = asnumber_vy(rawget(at,"y"))
- if x ~= 0 or y ~= 0 then
- return s_offset_start, f_offset_stop(x,y)
- end
- end
-
- local s_viewport_start = "draw image ("
- local s_viewport_stop = ") ;"
- local f_viewport_shift = formatters["currentpicture := currentpicture shifted (%03N,%03N);"]
- local f_viewport_scale = formatters["currentpicture := currentpicture xysized (%03N,%03N);"]
- local f_viewport_clip = formatters["clip currentpicture to (unitsquare xyscaled (%03N,%03N));"]
-
- local function viewport(x,y,w,h,noclip,scale)
- r = r + 1 ; result[r] = s_viewport_start
- return function()
- local okay = w ~= 0 and h ~= 0
- if okay and scale then
- r = r + 1 ; result[r] = f_viewport_scale(w,h)
- end
- if x ~= 0 or y ~= 0 then
- r = r + 1 ; result[r] = f_viewport_shift(-x,y)
- end
- if okay and not noclip then
- r = r + 1 ; result[r] = f_viewport_clip(w,-h)
- end
-
- r = r + 1 ; result[r] = s_viewport_stop
- end
- end
-
- -- maybe forget about defs and just always locate (and then backtrack
- -- over <g> if needed)
-
- function handlers.defs(c)
- for c in xmlcollected(c,"/*") do
- local a = c.at
- if a then
- local id = rawget(a,"id")
- if id then
- definitions["#" .. id ] = c
- definitions["url(#" .. id .. ")"] = c
- end
- end
- end
- end
-
- function handlers.symbol(c)
- if uselevel == 0 then
- local id = rawget(c.at,"id")
- if id then
- definitions["#" .. id ] = c
- definitions["url(#" .. id .. ")"] = c
- end
- else
- handlers.g(c)
- end
- end
-
- local uselevel = 0
-
- function handlers.use(c)
- local at = c.at
- local id = rawget(at,"href") or rawget(at,"xlink:href") -- better a rawget
- local res = locate(id)
- if res then
- -- width height ?
- uselevel = uselevel + 1
- local boffset, eoffset = offset(at)
- local btransform, etransform, transform = handletransform(at)
-
- if boffset then
- r = r + 1 result[r] = boffset
- end
-
- -- local clippath = at.clippath
-
- if btransform then
- r = r + 1 result[r] = btransform
- end
-
- local _transform = transform
- local _clippath = clippath
- at["transform"] = false
- -- at["clip-path"] = false
-
- process(res,"/*")
-
- at["transform"] = _transform
- -- at["clip-path"] = _clippath
-
- if etransform then
- r = r + 1 ; result[r] = etransform
- end
-
- if eoffset then
- r = r + 1 result[r] = eoffset
- end
-
- uselevel = uselevel - 1
- else
- report("use: unknown definition %a",id)
- end
- end
-
- local f_no_draw = formatters['nodraw (%s)']
- local f_do_draw = formatters['draw (%s)']
- local f_no_fill_c = formatters['nofill (%s..cycle)']
- local f_do_fill_c = formatters['fill (%s..cycle)']
- local f_eo_fill_c = formatters['eofill (%s..cycle)']
- local f_no_fill_l = formatters['nofill (%s--cycle)']
- local f_do_fill_l = formatters['fill (%s--cycle)']
- local f_eo_fill_l = formatters['eofill (%s--cycle)']
- local f_do_fill = f_do_fill_c
- local f_eo_fill = f_eo_fill_c
- local f_no_fill = f_no_fill_c
- local s_clip_start = 'draw image ('
- local f_clip_stop_c = formatters[') ; clip currentpicture to (%s..cycle) ;']
- local f_clip_stop_l = formatters[') ; clip currentpicture to (%s--cycle) ;']
- local f_clip_stop = f_clip_stop_c
- local f_eoclip_stop_c = formatters[') ; eoclip currentpicture to (%s..cycle) ;']
- local f_eoclip_stop_l = formatters[') ; eoclip currentpicture to (%s--cycle) ;']
- local f_eoclip_stop = f_eoclip_stop_c
-
- -- could be shared and then beginobject | endobject
-
- local function flushobject(object,at,c,o)
- local btransform, etransform = handletransform(at)
- local cpath = handleclippath(at)
-
- if cpath then
- r = r + 1 ; result[r] = s_clip_start
- end
-
- if btransform then
- r = r + 1 ; result[r] = btransform
- end
-
- r = r + 1 ; result[r] = f_do_draw(object)
-
- if c then
- r = r + 1 ; result[r] = c
- end
-
- if o then
- r = r + 1 ; result[r] = o
- end
-
- if etransform then
- r = r + 1 ; result[r] = etransform
- end
-
- r = r + 1 ; result[r] = ";"
-
- if cpath then
- local f_done = cpath.evenodd
- if cpath.curve then
- f_done = f_done and f_eoclip_stop_c or f_clip_stop_c
- else
- f_done = f_done and f_eoclip_stop_l or f_clip_stop_l
- end
- r = r + 1 ; result[r] = f_done(cpath[1])
- end
- end
-
- do
-
- local flush
-
- local f_linecap = formatters["interim linecap := %s ;"]
- local f_linejoin = formatters["interim linejoin := %s ;"]
- local f_miterlimit = formatters["interim miterlimit := %s ;"]
-
- local s_begingroup = "begingroup;"
- local s_endgroup = "endgroup;"
-
- local linecaps = { butt = "butt", square = "squared", round = "rounded" }
- local linejoins = { miter = "mitered", bevel = "beveled", round = "rounded" }
-
- local function startlineproperties(at)
- local cap = at["stroke-linecap"]
- local join = at["stroke-linejoin"]
- local limit = at["stroke-miterlimit"]
- cap = cap and linecaps [cap]
- join = join and linejoins[join]
- limit = limit and asnumber_r(limit)
- if cap or join or limit then
- r = r + 1 ; result[r] = s_begingroup
- if cap then
- r = r + 1 ; result[r] = f_linecap(cap)
- end
- if join then
- r = r + 1 ; result[r] = f_linejoin(join)
- end
- if limit then
- r = r + 1 ; result[r] = f_miterlimit(limit)
- end
- return function()
- at["stroke-linecap"] = false
- at["stroke-linejoin"] = false
- at["stroke-miterlimit"] = false
- r = r + 1 ; result[r] = s_endgroup
- at["stroke-linecap"] = cap
- at["stroke-linejoin"] = join
- at["stroke-miterlimit"] = limit
- end
- end
- end
-
- -- markers are a quite rediculous thing .. let's assume simple usage for now
-
- function handlers.marker()
- -- todo: is just a def too
- end
-
- -- kind of local svg ... so make a generic one
- --
- -- todo: combine more (offset+scale+rotation)
-
- local function makemarker(where,c,x1,y1,x2,y2,x3,y3)
- local at = c.at
- local refx = rawget(at,"refX")
- local refy = rawget(at,"refY")
- local width = rawget(at,"markerWidth")
- local height = rawget(at,"markerHeight")
- local view = rawget(at,"viewBox")
- local orient = rawget(at,"orient")
- -- local ratio = rawget(at,"preserveAspectRatio")
- local units = at["markerUnits"]
- local height = at["markerHeight"]
- local angx = 0
- local angy = 0
- local angle = 0
-
- if where == "beg" then
- if orient == "auto" then -- unchecked
- -- no angle
- angx = x2 - x3
- angy = y2 - y3
- elseif orient == "auto-start-reverse" then -- checked
- -- points to start
- angx = x3 - x2
- angy = y3 - y2
- elseif orient then -- unchecked
- angle = asnumber_r(orient)
- end
- elseif where == "end" then
- if orient == "auto" then -- unchecked
- -- no angle ?
- angx = x1 - x2
- angy = y1 - y2
- elseif orient == "auto-start-reverse" then -- unchecked
- -- points to end
- angx = x2 - x1
- angy = y2 - y1
- elseif orient then -- unchecked
- angle = asnumber_r(orient)
- end
- elseif orient then -- unchecked
- angle = asnumber_r(orient)
- end
-
- -- what wins: viewbox or w/h
-
- refx = asnumber_x(refx)
- refy = asnumber_y(refy)
-
- width = width and asnumber_x(width) or 3 -- defaults
- height = height and asnumber_y(height) or 3 -- defaults
-
- local x = 0
- local y = 0
- local w = width
- local h = height
-
- -- kind of like the main svg
-
- r = r + 1 ; result[r] = s_offset_start
-
- local wrapupviewport
--- todo : better viewbox code
- local xpct, ypct, rpct
- if view then
- x, y, w, h = handleviewbox(view)
- end
-
- if width ~= 0 then
- w = width
- end
- if height ~= 0 then
- h = height
- end
-
- if h then
- xpct = percentage_x
- ypct = percentage_y
- rpct = percentage_r
- percentage_x = w / 100
- percentage_y = h / 100
- percentage_r = (sqrt(w^2 + h^2) / sqrt(2)) / 100
- wrapupviewport = viewport(x,y,w,h,true,true) -- no clip
- end
-
- -- we can combine a lot here:
-
- local hasref = refx ~= 0 or refy ~= 0
- local hasrot = angx ~= 0 or angy ~= 0 or angle ~= 0
-
- local btransform, etransform, transform = handletransform(at)
-
- if btransform then
- r = r + 1 ; result[r] = btransform
- end
-
- if hasrot then
- r = r + 1 ; result[r] = s_rotation_start
- end
-
- if hasref then
- r = r + 1 ; result[r] = s_offset_start
- end
-
- local _transform = transform
- at["transform"] = false
-
- handlers.g(c)
-
- at["transform"] = _transform
-
- if hasref then
- r = r + 1 ; result[r] = f_offset_stop(-refx,refy)
- end
-
- if hasrot then
- if angle ~= 0 then
- r = r + 1 ; result[r] = f_rotation_angle(angle)
- else
- r = r + 1 ; result[r] = f_rotation_stop(angx,angy)
- end
- end
-
- if etransform then
- r = r + 1 ; result[r] = etransform
- end
-
- if h then
- percentage_x = xpct
- percentage_y = ypct
- percentage_r = rpct
- if wrapupviewport then
- wrapupviewport()
- end
- end
- r = r + 1 ; result[r] = f_offset_stop(x2,y2)
-
- end
-
- local function addmarkers(list,begmarker,midmarker,endmarker)
- local n = #list
- if n > 3 then
- if begmarker then
- local m = locate(begmarker)
- if m then
- makemarker("beg",m,false,false,list[1],list[2],list[3],list[4])
- end
- end
- if midmarker then
- local m = locate(midmarker)
- if m then
- for i=3,n-2,2 do
- makemarker("mid",m,list[i-2],list[i-1],list[i],list[i+1],list[i+2],list[i+3])
- end
- end
- end
- if endmarker then
- local m = locate(endmarker)
- if m then
- makemarker("end",m,list[n-3],list[n-2],list[n-1],list[n],false,false)
- end
- end
- else
- -- no line
- end
- end
-
- local function flush(shape,dofill,at,list,begmarker,midmarker,endmarker)
-
- local fill = dofill and (at["fill"] or "black")
- local stroke = at["stroke"] or "none"
-
- local btransform, etransform = handletransform(at)
- local cpath = handleclippath(at)
-
- if cpath then
- r = r + 1 ; result[r] = s_clip_start
- end
-
- local has_stroke = stroke and stroke ~= "none"
- local has_fill = fill and fill ~= "none"
-
- local bopacity, eopacity
- if has_stroke and has_fill then
- bopacity, eopacity = sharedopacity(at)
- end
-
- if bopacity then
- r = r + 1 ; result[r] = bopacity
- end
-
- if has_fill then
- local color, opacity = fillproperties(fill,at,not has_stroke)
- local f_xx_fill = at["fill-rule"] == "evenodd" and f_eo_fill or f_do_fill
- if btransform then
- r = r + 1 ; result[r] = btransform
- end
- r = r + 1 result[r] = f_xx_fill(shape)
- if color then
- r = r + 1 ; result[r] = color
- end
- if opacity then
- r = r + 1 ; result[r] = opacity
- end
- r = r + 1 ; result[r] = etransform or ";"
- end
-
- if has_stroke then
- local wrapup = startlineproperties(at)
- local pen, dashing, color, opacity = drawproperties(stroke,at,not has_fill)
- if btransform then
- r = r + 1 ; result[r] = btransform
- end
- r = r + 1 ; result[r] = f_do_draw(shape)
- if pen then
- r = r + 1 ; result[r] = pen
- end
- if dashing then
- r = r + 1 ; result[r] = dashing
- end
- if color then
- r = r + 1 ; result[r] = color
- end
- if opacity then
- r = r + 1 ; result[r] = opacity
- end
- r = r + 1 ; result[r] = etransform or ";"
- --
- if list then
- addmarkers(list,begmarker,midmarker,endmarker)
- end
- --
- if wrapup then
- wrapup()
- end
- end
-
- if eopacity then
- r = r + 1 ; result[r] = eopacity
- end
-
- if cpath then
- r = r + 1 ; result[r] = (cpath.evenodd and f_eoclip_stop or f_clip_stop)(cpath[1])
- end
-
- end
-
- local f_rectangle = formatters['unitsquare xyscaled (%N,%N) shifted (%N,%N)']
- local f_rounded = formatters['roundedsquarexy(%N,%N,%N,%N) shifted (%N,%N)']
- local f_line = formatters['((%N,%N)--(%N,%N))']
- local f_ellipse = formatters['(fullcircle xyscaled (%N,%N) shifted (%N,%N))']
- local f_circle = formatters['(fullcircle scaled %N shifted (%N,%N))']
-
- function handlers.line(c)
- local at = c.at
- local x1 = rawget(at,"x1")
- local y1 = rawget(at,"y1")
- local x2 = rawget(at,"x2")
- local y2 = rawget(at,"y2")
-
- x1 = x1 and asnumber_vx(x1) or 0
- y1 = y1 and asnumber_vy(y1) or 0
- x2 = x2 and asnumber_vx(x2) or 0
- y2 = y2 and asnumber_vy(y2) or 0
-
- flush(f_line(x1,y1,x2,y2),false,at)
- end
-
- function handlers.rect(c)
- local at = c.at
- local width = rawget(at,"width")
- local height = rawget(at,"height")
- local x = rawget(at,"x")
- local y = rawget(at,"y")
- local rx = rawget(at,"rx")
- local ry = rawget(at,"ry")
-
- width = width and asnumber_x(width) or 0
- height = height and asnumber_y(height) or 0
- x = x and asnumber_vx(x) or 0
- y = y and asnumber_vy(y) or 0
-
- y = y - height
-
- if rx then rx = asnumber(rx) end
- if ry then ry = asnumber(ry) end
-
- if rx or ry then
- if not rx then rx = ry end
- if not ry then ry = rx end
- flush(f_rounded(width,height,rx,ry,x,y),true,at)
- else
- flush(f_rectangle(width,height,x,y),true,at)
- end
- end
-
- function handlers.ellipse(c)
- local at = c.at
- local cx = rawget(at,"cx")
- local cy = rawget(at,"cy")
- local rx = rawget(at,"rx")
- local ry = rawget(at,"ry")
-
- cx = cx and asnumber_vx(cx) or 0
- cy = cy and asnumber_vy(cy) or 0
- rx = rx and asnumber_r (rx) or 0
- ry = ry and asnumber_r (ry) or 0
-
- flush(f_ellipse(2*rx,2*ry,cx,cy),true,at)
- end
-
- function handlers.circle(c)
- local at = c.at
- local cx = rawget(at,"cx")
- local cy = rawget(at,"cy")
- local r = rawget(at,"r")
-
- cx = cx and asnumber_vx(cx) or 0
- cy = cy and asnumber_vy(cy) or 0
- r = r and asnumber_r (r) or 0
-
- flush(f_circle(2*r,cx,cy),true,at)
- end
-
- local f_lineto_z = formatters['(%N,%N)']
- local f_lineto_n = formatters['--(%N,%N)']
-
- local p_pair = p_optseparator * p_number_vx * p_optseparator * p_number_vy
- local p_open = Cc("(")
- local p_close = Carg(1) * P(true) / function(s) return s end
- local p_polyline = Cs(p_open * (p_pair / f_lineto_z) * (p_pair / f_lineto_n)^0 * p_close)
- local p_polypair = Ct(p_pair^0)
-
- local function poly(c,final)
- local at = c.at
- local points = rawget(at,"points")
- if points then
- local path = lpegmatch(p_polyline,points,1,final)
- local list = nil
- local begmarker = rawget(at,"marker-start")
- local midmarker = rawget(at,"marker-mid")
- local endmarker = rawget(at,"marker-end")
- if begmarker or midmarker or endmarker then
- list = lpegmatch(p_polypair,points)
- end
- flush(path,true,at,list,begmarker,midmarker,endmarker)
- end
- end
-
- function handlers.polyline(c) poly(c, ")") end
- function handlers.polygon (c) poly(c,"--cycle)") end
-
- local s_image_start = "draw image ("
- local s_image_stop = ") ;"
-
- function handlers.path(c)
- local at = c.at
- local d = rawget(at,"d")
- if d then
- local shape, l = grabpath(d)
- local fill = at["fill"] or "black"
- local stroke = at["stroke"] or "none"
- local n = #shape
-
- local btransform, etransform = handletransform(at)
- local cpath = handleclippath(at)
-
- if cpath then
- r = r + 1 ; result[r] = s_clip_start
- end
-
- -- todo: image (nicer for transform too)
-
- if fill and fill ~= "none" then
- local color, opacity = fillproperties(fill,at)
- local f_xx_fill = at["fill-rule"] == "evenodd"
- if shape.closed then
- f_xx_fill = f_xx_fill and f_eo_fill or f_do_fill
- elseif shape.curve then
- f_xx_fill = f_xx_fill and f_eo_fill_c or f_do_fill_c
- else
- f_xx_fill = f_xx_fill and f_eo_fill_l or f_do_fill_l
- end
- if n == 1 then
- if btransform then
- r = r + 1 ; result[r] = btransform
- end
- r = r + 1 result[r] = f_xx_fill(shape[1])
- if color then
- r = r + 1 ; result[r] = color
- end
- if opacity then
- r = r + 1 ; result[r] = opacity
- end
- r = r + 1 ; result[r] = etransform or ";"
- else
- r = r + 1 ; result[r] = btransform or s_image_start
- for i=1,n do
- if i == n then
- r = r + 1 ; result[r] = f_xx_fill(shape[i])
- if color then
- r = r + 1 ; result[r] = color
- end
- if opacity then
- r = r + 1 ; result[r] = opacity
- end
- else
- r = r + 1 ; result[r] = f_no_fill(shape[i])
- end
- r = r + 1 ; result[r] = ";"
- end
- r = r + 1 ; result[r] = etransform or s_image_stop
- end
- end
-
- if stroke and stroke ~= "none" then
- local begmarker = rawget(at,"marker-start")
- local midmarker = rawget(at,"marker-mid")
- local endmarker = rawget(at,"marker-end")
- if begmarker or midmarker or endmarker then
- list = grablist(l)
- end
- local wrapup = startlineproperties(at)
- local pen, dashing, color, opacity = drawproperties(stroke,at)
- if n == 1 and not list then
- if btransform then
- r = r + 1 ; result[r] = btransform
- end
- r = r + 1 result[r] = f_do_draw(shape[1])
- if pen then
- r = r + 1 ; result[r] = pen
- end
- if dashing then
- r = r + 1 ; result[r] = dashing
- end
- if color then
- r = r + 1 ; result[r] = color
- end
- if opacity then
- r = r + 1 ; result[r] = opacity
- end
- r = r + 1 result[r] = etransform or ";"
- else
- r = r + 1 result[r] = btransform or "draw image ("
- for i=1,n do
- r = r + 1 result[r] = f_do_draw(shape[i])
- if pen then
- r = r + 1 ; result[r] = pen
- end
- if dashing then
- r = r + 1 ; result[r] = dashing
- end
- if color then
- r = r + 1 ; result[r] = color
- end
- if opacity then
- r = r + 1 ; result[r] = opacity
- end
- r = r + 1 ; result[r] = ";"
- end
- if list then
- addmarkers(list,begmarker,midmarker,endmarker)
- end
- r = r + 1 ; result[r] = etransform or ") ;"
- end
- if wrapup then
- wrapup()
- end
- end
-
- if cpath then
- r = r + 1 ; result[r] = f_clip_stop(cpath[1])
- end
-
- end
- end
-
- end
-
- -- kind of special
-
- do
-
- -- some day:
- --
- -- specification = identifiers.jpg(data."string")
- -- specification.data = data
- -- inclusion takes from data
- -- specification.data = false
-
- local f_image = formatters[ [[figure("%s") xysized (%N,%N) shifted (%N,%N)]] ]
-
- local nofimages = 0
-
- function handlers.image(c)
- local at = c.at
- local im = rawget(at,"xlink:href")
- if im then
- local kind, data = match(im,"^data:image/([a-z]+);base64,(.*)$")
- if kind == "png" then
- -- ok
- elseif kind == "jpeg" then
- kind = "jpg"
- else
- kind = false
- end
- if kind and data then
- local w = rawget(at,"width")
- local h = rawget(at,"height")
- local x = rawget(at,"x")
- local y = rawget(at,"y")
- w = w and asnumber_x(w)
- h = h and asnumber_y(h)
- x = x and asnumber_vx(x) or 0
- y = y and asnumber_vy(y) or 0
- nofimages = nofimages + 1
- local name = "temp-svg-image-" .. nofimages .. "." .. kind
- local data = mime.decode("base64")(data)
- io.savedata(name,data)
- if not w or not h then
- local info = graphics.identifiers[kind](data,"string")
- if info then
- -- todo: keep aspect ratio attribute
- local xsize = info.xsize
- local ysize = info.ysize
- if not w then
- if not h then
- w = xsize
- h = ysize
- else
- w = (h / ysize) * xsize
- end
- else
- h = (w / xsize) * ysize
- end
- end
- end
- -- safeguard:
- if not w then w = h or 1 end
- if not h then h = w or 1 end
- luatex.registertempfile(name)
- -- done:
- flushobject(f_image(name,w,h,x,y - h),at)
- else
- -- nothing done
- end
- end
- end
-
- end
-
- -- these transform: g a text svg symbol
-
- do
-
- function handlers.a(c)
- process(c,"/*")
- end
-
- function handlers.g(c) -- much like flushobject so better split and share
- local at = c.at
-
- local btransform, etransform, transform = handletransform(at)
- local cpath, clippath = handleclippath(at)
-
- if cpath then
- r = r + 1 ; result[r] = s_clip_start
- end
-
- if btransform then
- r= r + 1 result[r] = btransform
- end
-
- local _transform = transform
- local _clippath = clippath
- at["transform"] = false
- at["clip-path"] = false
-
- process(c,"/*")
-
- at["transform"] = _transform
- at["clip-path"] = _clippath
-
- if etransform then
- r = r + 1 ; result[r] = etransform
- end
-
- if cpath then
- local f_done = cpath.evenodd
- if cpath.curve then
- f_done = f_done and f_eoclip_stop_c or f_clip_stop_c
- else
- f_done = f_done and f_eoclip_stop_l or f_clip_stop_l
- end
- r = r + 1 ; result[r] = f_done(cpath[1])
- end
- end
-
- -- this will never really work out
- --
- -- todo: register text in lua in mapping with id, then draw mapping unless overloaded
- -- using lmt_svglabel with family,style,weight,size,id passed
-
- -- nested tspans are messy: they can have displacements but in inkscape we also
- -- see x and y (inner and outer element)
-
- -- The size is a bit of an issue. I assume that the specified size relates to the
- -- designsize but we want to be able to use other fonts.
-
- do
-
- local f_styled = formatters["\\svgstyled{%s}{%s}{%s}{%s}"]
- local f_colored = formatters["\\svgcolored{%.3N}{%.3N}{%.3N}{"]
- local f_placed = formatters["\\svgplaced{%.3N}{%.3N}{}{"]
- local f_poschar = formatters["\\svgposchar{%.3N}{%.3N}{%s}"]
- local f_char = formatters["\\svgchar{%s}"]
-
- local f_scaled = formatters["\\svgscaled{%N}{%s}{%s}{%s}"]
- local f_normal = formatters["\\svgnormal{%s}{%s}{%s}"]
- local f_hashed = formatters["\\svghashed{%s}"]
-
- -- We move to the outer (x,y) and when we have an inner offset we
- -- (need to) compensate for that outer offset.
-
- -- local f_text_scaled_svg = formatters['(svgtext("%s") scaled %N shifted (%N,%N))']
- -- local f_text_normal_svg = formatters['(svgtext("%s") shifted (%N,%N))']
- -- local f_text_simple_svg = formatters['svgtext("%s")']
-
- local anchors = {
- ["start"] = "drt",
- ["end"] = "dflt",
- ["middle"] = "d",
- }
-
- local f_text_normal_svg = formatters['(textext.%s("%s") shifted (%N,%N))']
- local f_text_simple_svg = formatters['textext.%s("%s")']
-
- -- or just maptext
-
- local f_mapped_normal_svg = formatters['(svgtext("%s") shifted (%N,%N))']
- local f_mapped_simple_svg = formatters['svgtext("%s")']
-
- local cssfamily = css.family
- local cssstyle = css.style
- local cssweight = css.weight
- local csssize = css.size
-
- local usedfonts = setmetatableindex(function(t,k)
- local v = setmetatableindex("table")
- t[k] = v
- return v
- end)
-
- local p_texescape = lpegpatterns.texescape
-
- -- For now as I need it for my (some 1500) test files.
-
- local function checkedfamily(name)
- if find(name,"^.-verdana.-$") then
- name = "verdana"
- end
- return name
- end
-
- -- todo: only escape some chars and handle space
-
- local defaultsize = 10
-
- local function collect(t,c,x,y,size,scale,family,tx,ty)
- local at = c.at
- local ax = rawget(at,"x")
- local ay = rawget(at,"y")
- local dx = rawget(at,"dx")
- local dy = rawget(at,"dy")
- local v_fill = at["fill"]
- local v_family = at["font-family"]
- local v_style = at["font-style"]
- local v_weight = at["font-weight"]
- local v_size = at["font-size"]
- --
- ax = ax and asnumber_vx(ax) or x
- ay = ay and asnumber_vy(ay) or y
- dx = dx and asnumber_vx(dx) or 0
- dy = dy and asnumber_vy(dy) or 0
- --
- if v_family then v_family = cssfamily(v_family) end
- if v_style then v_style = cssstyle (v_style) end
- if v_weight then v_weight = cssweight(v_weight) end
- if v_size then v_size = csssize (v_size,factors) end
- --
- ax = ax - x
- ay = ay - y
- --
- local elayered = ax ~= 0 or ay ~= 0 or false
- local eplaced = dx ~= 0 or dy ~= 0 or false
-
- local usedsize, usedscaled
-
- if elayered then
- -- we're now at the outer level again so we need to scale
- -- back to the outer level values
- t[#t+1] = formatters["\\svgsetlayer{%0N}{%0N}{"](ax,-ay)
- usedsize = v_size or defaultsize
- usedscale = usedsize / defaultsize
- else
- -- we're nested so we can be scaled
- usedsize = v_size or size
- usedscale = (usedsize / defaultsize) / scale
- end
- --
- -- print("element ",c.tg)
- -- print(" layered ",elayered)
- -- print(" font size ",v_size)
- -- print(" parent size ",size)
- -- print(" parent scale",scale)
- -- print(" used size ",usedsize)
- -- print(" used scale ",usedscale)
- --
- if eplaced then
- t[#t+1] = f_placed(dx,dy)
- end
- --
- if not v_family then v_family = family end
- if not v_weight then v_weight = "normal" end
- if not v_style then v_style = "normal" end
- --
- if v_family then
- v_family = fonts.names.cleanname(v_family)
- v_family = checkedfamily(v_family)
- end
- --
- usedfonts[v_family][v_weight][v_style] = true
- --
--- if usedscale == 1 then
--- t[#t+1] = f_normal( v_family,v_weight,v_style)
--- else
- t[#t+1] = f_scaled(usedscale,v_family,v_weight,v_style)
--- end
- t[#t+1] = "{"
- --
- local ecolored = v_fill and v_fill ~= "" or false
- if ecolored then
- -- todo cmyk
- local r, g, b = colorcomponents(v_fill)
- if r and g and b then
- t[#t+1] = f_colored(r,g,b)
- else
- ecolored = false
- end
- end
- --
- local dt = c.dt
- local nt = #dt
- for i=1,nt do
- local di = dt[i]
- if type(di) == "table" then
- -- can be a tspan (should we pass dx too)
- collect(t,di,x,y,usedsize,usedscale,v_family)
- else
- if i == 1 then
- di = gsub(di,"^%s+","")
- end
- if i == nt then
- di = gsub(di,"%s+$","")
- end
- local chars = utfsplit(di)
- if svghash then
- di = f_hashed(svghash[di])
- elseif tx then
- for i=1,#chars do
- chars[i] = f_poschar(
- (tx[i] or 0) - x,
- (ty[i] or 0) - y,
- utfbyte(chars[i])
- )
- end
- di = "{" .. concat(chars) .. "}"
- else
- -- this needs to be texescaped ! and even quotes and newlines
- -- or we could register it but that's a bit tricky as we nest
- -- and don't know what we can expect here
- -- di = lpegmatch(p_texescape,di) or di
- for i=1,#chars do
- chars[i] = f_char(utfbyte(chars[i]))
- end
- di = concat(chars)
- end
- t[#t+1] = di
- end
- end
- --
- if ecolored then
- t[#t+1] = "}"
- end
- --
- t[#t+1] = "}"
- --
- if eplaced then
- t[#t+1] = "}"
- end
- if elayered then
- t[#t+1] = "}"
- end
- --
- return t
- end
-
- local s_startlayer = "\\svgstartlayer "
- local s_stoplayer = "\\svgstoplayer "
-
- function handlers.text(c)
- local only = fullstrip(xmltextonly(c))
- -- if metapost.processing() then
- local at = c.at
- local x = rawget(at,"x")
- local y = rawget(at,"y")
-
- local tx = asnumber_vx_t(x)
- local ty = asnumber_vy_t(y)
-
- x = tx[1] or 0 -- catch bad x/y spec
- y = ty[1] or 0 -- catch bad x/y spec
-
- local v_fill = at["fill"]
- if not v_fill or v_fill == "none" then
- v_fill = "black"
- end
- local color, opacity, invisible = fillproperties(v_fill,at)
- local anchor = anchors[at["text-anchor"] or "start"] or "drt"
- local r = metapost.remappedtext(only)
- if r then
- if x == 0 and y == 0 then
- only = f_mapped_simple_svg(r.index)
- else
- only = f_mapped_normal_svg(r.index,x,y)
- end
- flushobject(only,at,color,opacity)
- if trace_text then
- report("text: %s",only)
- end
- elseif not invisible then -- can be an option
- local scale = 1
- local textid = 0
- local result = { }
- local nx = #tx
- local ny = #ty
- --
- result[#result+1] = s_startlayer
- if nx > 1 or ny > 1 then
- concat(collect(result,c,x,y,defaultsize,1,"serif",tx,ty))
- else
- concat(collect(result,c,x,y,defaultsize,1,"serif"))
- end
- result[#result+1] = s_stoplayer
- result = concat(result)
- if x == 0 and y == 0 then
- result = f_text_simple_svg(anchor,result)
- else
- result = f_text_normal_svg(anchor,result,x,y)
- end
- flushobject(result,at,color,opacity)
- if trace_text then
- report("text: %s",result)
- end
- elseif trace_text then
- report("invisible text: %s",only)
- end
- -- elseif trace_text then
- -- report("ignored text: %s",only)
- -- end
- end
-
- function metapost.reportsvgfonts()
- for family, weights in sortedhash(usedfonts) do
- for weight, styles in sortedhash(weights) do
- for style in sortedhash(styles) do
- report("used font: %s-%s-%s",family,weight,style)
- end
- end
- end
- end
-
- statistics.register("used svg fonts",function()
- if next(usedfonts) then
- -- also in log file
- logs.startfilelogging(report,"used svg fonts")
- local t = { }
- for family, weights in sortedhash(usedfonts) do
- for weight, styles in sortedhash(weights) do
- for style in sortedhash(styles) do
- report("%s-%s-%s",family,weight,style)
- t[#t+1] = formatters["%s-%s-%s"](family,weight,style)
- end
- end
- end
- logs.stopfilelogging()
- return concat(t," ")
- end
- end)
-
- end
-
- function handlers.svg(c,x,y,w,h,noclip,notransform,normalize)
- local at = c.at
-
- local wrapupviewport
- local bhacked
- local ehacked
- local wd = w
- -- local ex, em
- local xpct, ypct, rpct
-
- local btransform, etransform, transform = handletransform(at)
-
- if trace then
- report("view: %s, xpct %N, ypct %N","before",percentage_x,percentage_y)
- end
-
- local viewbox = at.viewBox
-
- if viewbox then
- x, y, w, h = handleviewbox(viewbox)
- if trace then
- report("viewbox: x %N, y %N, width %N, height %N",x,y,w,h)
- end
- end
- if not w or not h or w == 0 or h == 0 then
- noclip = true
- end
- if h then
- --
- -- em = factors["em"]
- -- ex = factors["ex"]
- -- factors["em"] = em
- -- factors["ex"] = ex
- --
- xpct = percentage_x
- ypct = percentage_y
- rpct = percentage_r
- percentage_x = w / 100
- percentage_y = h / 100
- percentage_r = (sqrt(w^2 + h^2) / sqrt(2)) / 100
- if trace then
- report("view: %s, xpct %N, ypct %N","inside",percentage_x,percentage_y)
- end
- wrapupviewport = viewport(x,y,w,h,noclip)
- end
- -- todo: combine transform and offset here
-
- -- some fonts need this (bad transforms + viewbox)
- if v and normalize and w and wd and w ~= wd and w > 0 and wd > 0 then
- bhacked = s_wrapped_start
- ehacked = f_wrapped_stop(y or 0,wd/w)
- end
- if btransform then
- r = r + 1 ; result[r] = btransform
- end
- if bhacked then
- r = r + 1 ; result[r] = bhacked
- end
- local boffset, eoffset = offset(at)
- if boffset then
- r = r + 1 result[r] = boffset
- end
-
- at["transform"] = false
- at["viewBox"] = false
-
- process(c,"/*")
-
- at["transform"] = transform
- at["viewBox"] = viewbox
-
- if eoffset then
- r = r + 1 result[r] = eoffset
- end
- if ehacked then
- r = r + 1 ; result[r] = ehacked
- end
- if etransform then
- r = r + 1 ; result[r] = etransform
- end
- if h then
- --
- -- factors["em"] = em
- -- factors["ex"] = ex
- --
- percentage_x = xpct
- percentage_y = ypct
- percentage_r = rpct
- if wrapupviewport then
- wrapupviewport()
- end
- end
- if trace then
- report("view: %s, xpct %N, ypct %N","after",percentage_x,percentage_y)
- end
- end
-
- end
-
- process = function(x,p)
- for c in xmlcollected(x,p) do
- local tg = c.tg
- local h = handlers[c.tg]
- if h then
- h(c)
- end
- end
- end
-
- -- For huge inefficient files there can be lots of garbage to collect so
- -- maybe we should run the collector when a file is larger than say 50K.
-
- function metapost.svgtomp(specification,pattern,notransform,normalize)
- local mps = ""
- local svg = specification.data
- if type(svg) == "string" then
- svg = xmlconvert(svg)
- end
- if svg then
- local c = xmlfirst(svg,pattern or "/svg")
- if c then
- root = svg
- result = { }
- r = 0
- definitions = { }
- tagstyles = { }
- classstyles = { }
- colormap = specification.colormap
- for s in xmlcollected(c,"style") do -- can also be in a def, so let's play safe
- handlestyle(c)
- end
- handlechains(c)
- xmlinheritattributes(c) -- put this in handlechains
- handlers.svg (
- c,
- specification.x,
- specification.y,
- specification.width,
- specification.height,
- specification.noclip,
- notransform,
- normalize,
- specification.remap
- )
- if trace_result then
- report("result graphic:\n %\n t",result)
- end
- mps = concat(result," ")
- root = false
- result = false
- r = false
- definitions = false
- tagstyles = false
- classstyles = false
- colormap = false
- else
- report("missing svg root element")
- end
- else
- report("bad svg blob")
- end
- return mps
- end
-
-end
-
--- These helpers might move to their own module .. some day ... also they will become
--- a bit more efficient, because we now go to mp and back which is kind of redundant,
--- but for now it will do.
-
-do
-
- local bpfactor = number.dimenfactors.bp
-
- function metapost.includesvgfile(filename,offset) -- offset in sp
- if lfs.isfile(filename) then
- context.startMPcode("doublefun")
- context('draw lmt_svg [ filename = "%s", offset = %N ] ;',filename,(offset or 0)*bpfactor)
- context.stopMPcode()
- end
- end
-
- function metapost.includesvgbuffer(name,offset) -- offset in sp
- context.startMPcode("doublefun")
- context('draw lmt_svg [ buffer = "%s", offset = %N ] ;',name or "",(offset or 0)*bpfactor)
- context.stopMPcode()
- end
-
- interfaces.implement {
- name = "includesvgfile",
- actions = metapost.includesvgfile,
- arguments = { "string", "dimension" },
- }
-
- interfaces.implement {
- name = "includesvgbuffer",
- actions = metapost.includesvgbuffer,
- arguments = { "string", "dimension" },
- }
-
- function metapost.showsvgpage(data)
- local dd = data.data
- if not dd then
- local fn = data.filename
- dd = fn and table.load(fn)
- end
- if type(dd) == "table" then
- local comment = data.comment
- local offset = data.pageoffset
- local index = data.index
- local first = math.max(index or 1,1)
- local last = math.min(index or #dd,#dd)
- for i=first,last do
- local d = setmetatableindex( {
- data = dd[i],
- comment = comment and i or false,
- pageoffset = offset or nil,
- }, data)
- metapost.showsvgpage(d)
- end
- elseif data.method == "code" then
- context.startMPcode(doublefun)
- context(metapost.svgtomp(data))
- context.stopMPcode()
- else
- context.startMPpage { instance = "doublefun", offset = data.pageoffset or nil }
- context(metapost.svgtomp(data))
- local comment = data.comment
- if comment then
- context("draw boundingbox currentpicture withcolor .6red ;")
- context('draw textext.bot("\\strut\\tttf %s") ysized (10pt) shifted center bottomboundary currentpicture ;',comment)
- end
- context.stopMPpage()
- end
- end
-
- function metapost.typesvgpage(data)
- local dd = data.data
- if not dd then
- local fn = data.filename
- dd = fn and table.load(fn)
- end
- if type(dd) == "table" then
- local index = data.index
- if index and index > 0 and index <= #dd then
- data = dd[index]
- else
- data = nil
- end
- end
- if type(data) == "string" and data ~= "" then
- buffers.assign("svgpage",data)
- context.typebuffer ({ "svgpage" }, { option = "XML", strip = "yes" })
- end
- end
-
- function metapost.svgtopdf(data,...)
- local mps = metapost.svgtomp(data,...)
- if mps then
- -- todo: special instance, only basics needed
- local pdf = metapost.simple("metafun",mps,true,false,"svg")
- if pdf then
- return pdf
- else
- -- message
- end
- else
- -- message
- end
- end
-
-end
-
-do
-
- local runner = sandbox.registerrunner {
- name = "otfsvg2pdf",
- program = "context",
- template = "--batchmode --purgeall --runs=2 %filename%",
- reporter = report_svg,
- }
-
- -- By using an independent pdf file instead of pdf streams we can use resources and still
- -- cache. This is the old method updated. Maybe a future version will just do this runtime
- -- but for now this is the most efficient method.
-
- local decompress = gzip.decompress
- local compress = gzip.compress
-
- function metapost.svgshapestopdf(svgshapes,pdftarget,report_svg)
- local texname = "temp-otf-svg-to-pdf.tex"
- local pdfname = "temp-otf-svg-to-pdf.pdf"
- local tucname = "temp-otf-svg-to-pdf.tuc"
- local nofshapes = #svgshapes
- local pdfpages = { filename = pdftarget }
- local pdfpage = 0
- local t = { }
- local n = 0
- --
- os.remove(texname)
- os.remove(pdfname)
- os.remove(tucname)
- --
- if report_svg then
- report_svg("processing %i svg containers",nofshapes)
- statistics.starttiming(pdfpages)
- end
- --
- -- can be option:
- --
- -- n = n + 1 ; t[n] = "\\nopdfcompression"
- --
- n = n + 1 ; t[n] = "\\starttext"
- n = n + 1 ; t[n] = "\\setupMPpage[alternative=offset,instance=doublefun]"
- --
- for i=1,nofshapes do
- local entry = svgshapes[i]
- local data = entry.data
- if decompress then
- data = decompress(data) or data
- end
- local specification = {
- data = xmlconvert(data),
- x = 0,
- y = 1000,
- width = 1000,
- height = 1000,
- noclip = true,
- }
- for index=entry.first,entry.last do
- if not pdfpages[index] then
- pdfpage = pdfpage + 1
- pdfpages[index] = pdfpage
- local pattern = "/svg[@id='glyph" .. index .. "']"
- n = n + 1 ; t[n] = "\\startMPpage"
- n = n + 1 ; t[n] = metapost.svgtomp(specification,pattern,true,true) or ""
- n = n + 1 ; t[n] = "\\stopMPpage"
- end
- end
- end
- n = n + 1 ; t[n] = "\\stoptext"
- io.savedata(texname,concat(t,"\n"))
- runner { filename = texname }
- os.remove(pdftarget)
- file.copy(pdfname,pdftarget)
- if report_svg then
- statistics.stoptiming(pdfpages)
- report_svg("svg conversion time %s",statistics.elapsedseconds(pdfpages))
- end
- os.remove(texname)
- os.remove(pdfname)
- os.remove(tucname)
- return pdfpages
- end
-
- function metapost.svgshapestomp(svgshapes,report_svg)
- local nofshapes = #svgshapes
- local mpshapes = { }
- if report_svg then
- report_svg("processing %i svg containers",nofshapes)
- statistics.starttiming(mpshapes)
- end
- for i=1,nofshapes do
- local entry = svgshapes[i]
- local data = entry.data
- if decompress then
- data = decompress(data) or data
- end
- local specification = {
- data = xmlconvert(data),
- x = 0,
- y = 1000,
- width = 1000,
- height = 1000,
- noclip = true,
- }
- for index=entry.first,entry.last do
- if not mpshapes[index] then
- local pattern = "/svg[@id='glyph" .. index .. "']"
- local mpcode = metapost.svgtomp(specification,pattern,true,true) or ""
- if mpcode ~= "" and compress then
- mpcode = compress(mpcode) or mpcode
- end
- mpshapes[index] = mpcode
- end
- end
- end
- if report_svg then
- statistics.stoptiming(mpshapes)
- report_svg("svg conversion time %s",statistics.elapsedseconds(mpshapes))
- end
- return mpshapes
- end
-
- function metapost.svgglyphtomp(fontname,unicode)
- if fontname and unicode then
- local id = fonts.definers.internal { name = fontname }
- if id then
- local tfmdata = fonts.hashes.identifiers[id]
- if tfmdata then
- local properties = tfmdata.properties
- local svg = properties.svg
- local hash = svg and svg.hash
- local timestamp = svg and svg.timestamp
- if hash then
- local svgfile = containers.read(fonts.handlers.otf.svgcache,hash)
- local svgshapes = svgfile and svgfile.svgshapes
- if svgshapes then
- if type(unicode) == "string" then
- unicode = utfbyte(unicode)
- end
- local chardata = tfmdata.characters[unicode]
- local index = chardata and chardata.index
- if index then
- for i=1,#svgshapes do
- local entry = svgshapes[i]
- if index >= entry.first and index <= entry.last then
- local data = entry.data
- if data then
- local root = xml.convert(gzip.decompress(data) or data)
- return metapost.svgtomp (
- {
- data = root,
- x = 0,
- y = 1000,
- width = 1000,
- height = 1000,
- noclip = true,
- },
- "/svg[@id='glyph" .. index .. "']",
- true,
- true
- )
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
-
-end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mtx-context-arrange.tex b/Master/texmf-dist/tex/context/base/mkiv/mtx-context-arrange.tex
index e970ac450cd..ab638dde6f7 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mtx-context-arrange.tex
+++ b/Master/texmf-dist/tex/context/base/mkiv/mtx-context-arrange.tex
@@ -35,7 +35,7 @@
\doifdocumentargument {paperoffset} {
\definepapersize
- [offset=\getdocumentargument{paperoffset}]
+ [offset=\getdocumentargumentdefault{paperoffset}{0pt}]
}
\doifdocumentargumentelse {noduplex} {
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mtx-context-compare.tex b/Master/texmf-dist/tex/context/base/mkiv/mtx-context-compare.tex
index ffa744013f5..c940270c8ab 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mtx-context-compare.tex
+++ b/Master/texmf-dist/tex/context/base/mkiv/mtx-context-compare.tex
@@ -24,17 +24,17 @@
\starttext
\starttexdefinition unexpanded ShowBoth #1#2#3
- \startTEXpage
+ \startTEXpage[width=21cm]
\startoverlay
- {\externalfigure[#1][page=#3]}
- {\externalfigure[#2][page=#3]}
+ {\externalfigure[#1][page=#3,width=21cm]}
+ {\externalfigure[#2][page=#3,width=21cm]}
\stopoverlay
\stopTEXpage
\stoptexdefinition
\starttexdefinition unexpanded ShowPage #1#2
- \startTEXpage
- \externalfigure[#1][page=#2]
+ \startTEXpage[width=21cm]
+ \externalfigure[#1][page=#2,width=21cm]
\stopTEXpage
\stoptexdefinition
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mtx-context-meaning.tex b/Master/texmf-dist/tex/context/base/mkiv/mtx-context-meaning.tex
index 88b81ef041e..2ec66780eb5 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mtx-context-meaning.tex
+++ b/Master/texmf-dist/tex/context/base/mkiv/mtx-context-meaning.tex
@@ -31,19 +31,31 @@
\setupbodyfont
[dejavu]
-\def\showmeaning#1%
+\unexpanded\def\ShowMeaning#1%
{\ctxlua{logs.pushtarget("both")}%
\writestatus{meaning}{\strippedcsname#1}%
\writestring{}%
\writestring{\expandafter\meaning\begincsname#1\endcsname}%
\ctxlua{logs.poptarget()}}
+\unexpanded\def\ShowTokens#1%
+ {\ctxlua{logs.pushtarget("both")}%
+ \writestatus{tokens}{\strippedcsname#1}%
+ \writestring{}%
+ \ifcase\contextlmtxmode
+ \writestring{only supported in lmtx}%
+ \else
+ \expandafter\showluatokens\begincsname#1\endcsname
+ \fi
+ \ctxlua{logs.poptarget()}}
+
\starttext
\usemodule[setups-macros]
\startluacode
local h = tex.hashtokens()
+ local t = environment.arguments.tokens
local function showmeaning(str)
local h = interfaces.macros.collect(str)
@@ -54,7 +66,11 @@
local hi = h[i]
context.type(hi)
context.par()
- context.showmeaning(hi)
+ if t then
+ context.ShowTokens(hi)
+ else
+ context.ShowMeaning(hi)
+ end
end
context.page()
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mtx-context-select.tex b/Master/texmf-dist/tex/context/base/mkiv/mtx-context-select.tex
index 2f63f595513..61f58d61f0a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mtx-context-select.tex
+++ b/Master/texmf-dist/tex/context/base/mkiv/mtx-context-select.tex
@@ -1,5 +1,3 @@
-% engine=luatex
-
%D \module
%D [ file=mtx-context-select,
%D version=2008.11.10, % about that time i started playing with this
@@ -31,11 +29,11 @@
\input mtx-context-common.tex
\setuppapersize
- [\getdocumentargumentdefault{paperformat_from}{A4}]
- [\getdocumentargumentdefault{paperformat_to}{A4}]
+ [\getdocumentargumentdefault{paperformat_paper}{A4}]
+ [\getdocumentargumentdefault{paperformat_print}{A4}]
\setuppaper
- [offset=\getdocumentargumentdefault{paperformat_to}{0pt}]
+ [offset=\getdocumentargumentdefault{paperoffset}{0pt}]
\setuplayout
[width=middle,
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mtx-context-timing.tex b/Master/texmf-dist/tex/context/base/mkiv/mtx-context-timing.tex
index c545c768f97..db0d4c28322 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mtx-context-timing.tex
+++ b/Master/texmf-dist/tex/context/base/mkiv/mtx-context-timing.tex
@@ -19,14 +19,27 @@
\enablemode[no-timing] \usemodule[timing]
+\usemodule[article-basic]
+
\setuplayout
- [topspace=1cm,
- bottomspace=.5cm,
- header=0pt,
- width=middle,
- height=middle,
+ [tight]
+ [footer=15pt,
style=\tt]
+\setuplayout
+ [tight]
+
+\setupbodyfont
+ [10pt]
+
+% \setuplayout
+% [topspace=1cm,
+% bottomspace=.5cm,
+% header=0pt,
+% width=middle,
+% height=middle,
+% style=\tt]
+
\setupfootertexts
[\getdocumentfilename{1}-luatex-progress.lut \emdash\ \pagenumber]
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mult-aux.mkiv b/Master/texmf-dist/tex/context/base/mkiv/mult-aux.mkiv
index 99d252c6b67..d7921bcc290 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mult-aux.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/mult-aux.mkiv
@@ -186,28 +186,28 @@
%D and that only the high level setup commands are used with language specific
%D interfaces.
-% \unexpanded\def\mult_interfaces_let #1#2{\expandafter\let \csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname}
-% \unexpanded\def\mult_interfaces_lete#1#2{\expandafter\let \csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname\empty}
-% \unexpanded\def\mult_interfaces_def #1#2{\expandafter\def \csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname}
-% \unexpanded\def\mult_interfaces_edef#1#2{\expandafter\edef\csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname}
-% \unexpanded\def\mult_interfaces_gdef#1#2{\expandafter\gdef\csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname}
-% \unexpanded\def\mult_interfaces_xdef#1#2{\expandafter\xdef\csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname}
+% \protected\def\mult_interfaces_let #1#2{\expandafter\let \csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname}
+% \protected\def\mult_interfaces_lete#1#2{\expandafter\let \csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname\empty}
+% \protected\def\mult_interfaces_def #1#2{\expandafter\def \csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname}
+% \protected\def\mult_interfaces_edef#1#2{\expandafter\edef\csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname}
+% \protected\def\mult_interfaces_gdef#1#2{\expandafter\gdef\csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname}
+% \protected\def\mult_interfaces_xdef#1#2{\expandafter\xdef\csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname}
% \startinterface english
- \unexpanded\def\mult_interfaces_let #1#2{\expandafter \let\csname#1#2\endcsname}
- \unexpanded\def\mult_interfaces_lete#1#2{\expandafter \let\csname#1#2\endcsname\empty}
- \unexpanded\def\mult_interfaces_def #1#2{\expandafter \def\csname#1#2\endcsname}
- \unexpanded\def\mult_interfaces_edef#1#2{\expandafter\edef\csname#1#2\endcsname}
- \unexpanded\def\mult_interfaces_gdef#1#2{\expandafter\gdef\csname#1#2\endcsname}
- \unexpanded\def\mult_interfaces_xdef#1#2{\expandafter\xdef\csname#1#2\endcsname}
+ \protected\def\mult_interfaces_let #1#2{\expandafter \let\csname#1#2\endcsname}
+ \protected\def\mult_interfaces_lete#1#2{\expandafter \let\csname#1#2\endcsname\empty}
+ \protected\def\mult_interfaces_def #1#2{\expandafter \def\csname#1#2\endcsname}
+ \protected\def\mult_interfaces_edef#1#2{\expandafter\edef\csname#1#2\endcsname}
+ \protected\def\mult_interfaces_gdef#1#2{\expandafter\gdef\csname#1#2\endcsname}
+ \protected\def\mult_interfaces_xdef#1#2{\expandafter\xdef\csname#1#2\endcsname}
% \stopinterface
%D Do, we only interface the assignment definition:
-\unexpanded\def\mult_interfaces_adef#1#2{\expandafter\def \csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname}
+\protected\def\mult_interfaces_adef#1#2{\expandafter\def \csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname}
\startinterface english
- \unexpanded\def\mult_interfaces_adef#1#2{\expandafter \def\csname#1#2\endcsname}
+ \protected\def\mult_interfaces_adef#1#2{\expandafter \def\csname#1#2\endcsname}
\stopinterface
% the commented detokenized variant that backtracks ... needs testing usage first
@@ -226,7 +226,7 @@
\def\mult_interfaces_detokenize{\expandafter\expandafter\expandafter\detokenize\expandafter\expandafter\expandafter}
-\unexpanded\def\mult_interfaces_install_parameter_handler#1#2#3#4#5#6#7#8#9% inlining \csname*\endcsname is more efficient (#3 and #6 only)
+\protected\def\mult_interfaces_install_parameter_handler#1#2#3#4#5#6#7#8#9% inlining \csname*\endcsname is more efficient (#3 and #6 only)
{\ifx#2\relax\let#2\empty\fi % it is hardly faster but produces less expansion tracing
\def#3##1{\csname\ifcsname#1#2:##1\endcsname#1#2:##1\else\expandafter#5\csname#1#2:\s!parent\endcsname{##1}\fi\endcsname}%
\def#4##1##2{\ifcsname##1:##2\endcsname##1:##2\else\expandafter#5\csname##1:\s!parent\endcsname{##2}\fi}%
@@ -238,7 +238,7 @@
\def#8##1{\begincsname#1#2:##1\endcsname}
\def#9##1##2{\expandafter\let\expandafter##1\csname\ifcsname#1#2:##2\endcsname#1#2:##2\else\expandafter#5\csname#1#2:\s!parent\endcsname{##2}\fi\endcsname}}
-\unexpanded\def\installparameterhandler#1#2%
+\protected\def\installparameterhandler#1#2%
{\normalexpanded
{\mult_interfaces_install_parameter_handler
{\noexpand#1}% \??aa
@@ -251,18 +251,18 @@
\expandafter\noexpand\csname direct#2parameter\endcsname
\expandafter\noexpand\csname letfrom#2parameter\endcsname}} % strict#2parameter is gone
-\unexpanded\def\mult_interfaces_install_root_parameter_handler#1#2#3%
+\protected\def\mult_interfaces_install_root_parameter_handler#1#2#3%
{\def#2##1{\detokenize\expandafter\expandafter\expandafter{\csname#1:##1\endcsname}}% always root
\def#3##1{\begincsname#1:##1\endcsname}}
-\unexpanded\def\installrootparameterhandler#1#2%
+\protected\def\installrootparameterhandler#1#2%
{\normalexpanded
{\mult_interfaces_install_root_parameter_handler
{\noexpand#1}% \??aa
\expandafter\noexpand\csname detokenizedroot#2parameter\endcsname
\expandafter\noexpand\csname root#2parameter\endcsname}}
-\unexpanded\def\mult_interfaces_install_parameter_hash_handler#1#2#3#4#5#6#7#8#9%
+\protected\def\mult_interfaces_install_parameter_hash_handler#1#2#3#4#5#6#7#8#9%
{\ifx#2\relax\let#2\empty\fi
\def#3##1{#1#4{#1#2}{##1}:}% leading #1 was missing .. is this one used?
\def#4##1##2{\ifcsname##1:##2\endcsname##1\else\expandafter#5\csname##1:\s!parent\endcsname{##2}\fi}%
@@ -271,9 +271,9 @@
\def#6{#1#2:}%
\def#7##1{#1##1:}%
\def#8{\ifx#2\empty\else\ifcsname#1#2:\s!parent\endcsname\else\expandafter\let\csname#1#2:\s!parent\endcsname#1\fi\fi}%
- \unexpanded\def#9##1{\expandafter\edef\csname#1##1:\s!parent\endcsname{#1#2}}}
+ \protected\def#9##1{\expandafter\edef\csname#1##1:\s!parent\endcsname{#1#2}}}
-\unexpanded\def\installparameterhashhandler#1#2%
+\protected\def\installparameterhashhandler#1#2%
{\expandafter\let\csname#2namespace\endcsname#1%
\normalexpanded
{\mult_interfaces_install_parameter_hash_handler
@@ -291,23 +291,23 @@
% todo: inline the def/let
-% \unexpanded\def\mult_interfaces_install_parameter_set_handler#1#2#3#4#5#6%
+% \protected\def\mult_interfaces_install_parameter_set_handler#1#2#3#4#5#6%
% {\ifx#2\relax\let#2\empty\fi
-% \unexpanded\def#3{\mult_interfaces_def {#1#2:}}% ##1 {##2} (braces are mandate)
-% \unexpanded\def#4{\mult_interfaces_edef{#1#2:}}% ##1 {##2} (braces are mandate)
-% \unexpanded\def#5{\mult_interfaces_let {#1#2:}}% ##1 ##2
-% \unexpanded\def#6{\mult_interfaces_lete{#1#2:}}}% ##1
+% \protected\def#3{\mult_interfaces_def {#1#2:}}% ##1 {##2} (braces are mandate)
+% \protected\def#4{\mult_interfaces_edef{#1#2:}}% ##1 {##2} (braces are mandate)
+% \protected\def#5{\mult_interfaces_let {#1#2:}}% ##1 ##2
+% \protected\def#6{\mult_interfaces_lete{#1#2:}}}% ##1
%
% \startinterface english
- \unexpanded\def\mult_interfaces_install_parameter_set_handler#1#2#3#4#5#6%
+ \protected\def\mult_interfaces_install_parameter_set_handler#1#2#3#4#5#6%
{\ifx#2\relax\let#2\empty\fi
- \unexpanded\def#3##1{\expandafter \def\csname#1#2:##1\endcsname}% ##1 {##2} (braces are mandate)
- \unexpanded\def#4##1{\expandafter\edef\csname#1#2:##1\endcsname}% ##1 {##2} (braces are mandate)
- \unexpanded\def#5##1{\expandafter \let\csname#1#2:##1\endcsname}% ##1 ##2
- \unexpanded\def#6##1{\expandafter \let\csname#1#2:##1\endcsname\empty}}% ##1
+ \protected\def#3##1{\expandafter \def\csname#1#2:##1\endcsname}% ##1 {##2} (braces are mandate)
+ \protected\def#4##1{\expandafter\edef\csname#1#2:##1\endcsname}% ##1 {##2} (braces are mandate)
+ \protected\def#5##1{\expandafter \let\csname#1#2:##1\endcsname}% ##1 ##2
+ \protected\def#6##1{\expandafter \let\csname#1#2:##1\endcsname\empty}}% ##1
% \stopinterface
-\unexpanded\def\installparametersethandler#1#2%
+\protected\def\installparametersethandler#1#2%
{\normalexpanded
{\mult_interfaces_install_parameter_set_handler
{\noexpand#1}% \??aa
@@ -323,20 +323,20 @@
\let\currentstyleparameter\empty
\let\currentcolorparameter\empty
-\unexpanded\def\mult_interfaces_install_style_and_color_handler#1#2#3#4%
- {\unexpanded\def#2##1##2% style color
+\protected\def\mult_interfaces_install_style_and_color_handler#1#2#3#4%
+ {\protected\def#2##1##2% style color
{\edef\currentstyleparameter{#1{##1}}% this name is public (can also set color e.g. in underline)
\ifx\currentstyleparameter\empty\else\dousecurrentstyleparameter\fi
\edef\currentcolorparameter{#1{##2}}% this name is public (so we do this after the style switch)
\ifx\currentcolorparameter\empty\else\dousecurrentcolorparameter\fi}%
- \unexpanded\def#3##1% style
+ \protected\def#3##1% style
{\edef\currentstyleparameter{#1{##1}}% this name is public
\ifx\currentstyleparameter\empty\else\dousecurrentstyleparameter\fi}%
- \unexpanded\def#4##1% color
+ \protected\def#4##1% color
{\edef\currentcolorparameter{#1{##1}}% this name is public
\ifx\currentcolorparameter\empty\else\dousecurrentcolorparameter\fi}}
-\unexpanded\def\installstyleandcolorhandler#1#2%
+\protected\def\installstyleandcolorhandler#1#2%
{\normalexpanded
{\mult_interfaces_install_style_and_color_handler
\expandafter\noexpand\csname #2parameter\endcsname
@@ -360,12 +360,12 @@
\def\getparentchain #1#2{\begincsname#1#2:\s!chain\endcsname}
\def\getcurrentparentchain#1#2{\begincsname#1#2:\s!chain\endcsname}
-% \unexpanded\def\mult_interfaces_install_define_handler#1#2#3#4#5#6#7#8#9% why is \expanded still needed in clones
+% \protected\def\mult_interfaces_install_define_handler#1#2#3#4#5#6#7#8#9% why is \expanded still needed in clones
% {\ifx#4\relax\let#4\empty\fi % see \defineregister
-% \unexpanded\def#2{\dotripleempty#5}%
+% \protected\def#2{\dotripleempty#5}%
% \newtoks#6%
% \newtoks#7%
-% \unexpanded\def#5[##1][##2][##3]% [child][parent][settings] | [child][settings] | [child][parent] | [child]
+% \protected\def#5[##1][##2][##3]% [child][parent][settings] | [child][settings] | [child][parent] | [child]
% {\let#9#4%
% \edef#4{##1}%
% \ifthirdargument
@@ -398,12 +398,12 @@
% \the#7%
% \let#4#9}}
-\unexpanded\def\mult_interfaces_install_define_handler#1#2#3#4#5#6#7#8#9% why is \expanded still needed in clones
+\protected\def\mult_interfaces_install_define_handler#1#2#3#4#5#6#7#8#9% why is \expanded still needed in clones
{\ifx#4\relax\let#4\empty\fi % see \defineregister
- \unexpanded\def#2{\dotripleempty#5}%
+ \protected\def#2{\dotripleempty#5}%
\newtoks#6%
\newtoks#7%
- \unexpanded\def#5[##1][##2][##3]% [child][parent][settings] | [child][settings] | [child][parent] | [child]
+ \protected\def#5[##1][##2][##3]% [child][parent][settings] | [child][settings] | [child][parent] | [child]
{\let#9#4%
\edef#4{##1}%
\ifthirdargument
@@ -435,7 +435,7 @@
\the#7%
\let#4#9}}
-\unexpanded\def\installdefinehandler#1#2#3%
+\protected\def\installdefinehandler#1#2#3%
{\normalexpanded
{\mult_interfaces_install_define_handler
{\noexpand#1}% \??aa
@@ -448,13 +448,13 @@
\expandafter\noexpand\csname current#2parent\endcsname
\expandafter\noexpand\csname saved_defined_#2\endcsname}}
-\unexpanded\def\mult_interfaces_install_setup_handler#1#2#3#4#5#6#7#8#9%
+\protected\def\mult_interfaces_install_setup_handler#1#2#3#4#5#6#7#8#9%
{\ifx#3\relax\let#3\empty\fi
- \unexpanded\def#2{\dodoubleempty#4}%
- \unexpanded\def#6{\mult_interfaces_get_parameters{#1#3:}}% no every ! don't change it
+ \protected\def#2{\dodoubleempty#4}%
+ \protected\def#6{\mult_interfaces_get_parameters{#1#3:}}% no every ! don't change it
\newtoks#5%
\newtoks#8%
- \unexpanded\def#4[##1][##2]% maybe helper
+ \protected\def#4[##1][##2]% maybe helper
{\let#7#3%
\ifsecondargument
\def#9####1% we will have a simple one as well
@@ -470,7 +470,7 @@
\let#3#7%
\the#8}}
-\unexpanded\def\installsetuphandler#1#2%
+\protected\def\installsetuphandler#1#2%
{\normalexpanded
{\mult_interfaces_install_setup_handler
{\noexpand#1}% \??aa
@@ -488,18 +488,18 @@
\let\doingrootsetnamed \plusthree % \setuplayout[name]
\let\doingrootsetroot \plusfour % \setuplayout
-\unexpanded\def\mult_interfaces_install_switch_setup_handler_a#1#2#3#4#5%
+\protected\def\mult_interfaces_install_switch_setup_handler_a#1#2#3#4#5%
{\ifx#3\relax\let#3\empty\fi
- \unexpanded\def#2{\dodoubleempty#4}%
- \unexpanded\def#5{\mult_interfaces_get_parameters{#1#3:}}}
+ \protected\def#2{\dodoubleempty#4}%
+ \protected\def#5{\mult_interfaces_get_parameters{#1#3:}}}
-% \unexpanded\def\mult_interfaces_install_switch_setup_handler_b#1#2#3#4#5#6#7#8#9%
+% \protected\def\mult_interfaces_install_switch_setup_handler_b#1#2#3#4#5#6#7#8#9%
% {\newtoks#5%
% \newconstant#2%
% \newtoks#8%
% \newtoks#9%
% \ifx#6\relax\let#6\empty\fi
-% \unexpanded\def#4[##1][##2]% maybe helper
+% \protected\def#4[##1][##2]% maybe helper
% {\ifsecondargument % no commalist here
% % \setuplayout[whatever][key=value]
% \let#7#3%
@@ -542,13 +542,13 @@
% #2\zerocount % mode is always zero at the end
% \the#9}}
-\unexpanded\def\mult_interfaces_install_switch_setup_handler_b#1#2#3#4#5#6#7#8#9%
+\protected\def\mult_interfaces_install_switch_setup_handler_b#1#2#3#4#5#6#7#8#9%
{\newtoks#5%
\newconstant#2%
\newtoks#8%
\newtoks#9%
\ifx#6\relax\let#6\empty\fi
- \unexpanded\def#4[##1][##2]% maybe helper
+ \protected\def#4[##1][##2]% maybe helper
{\ifsecondargument % no commalist here
% \setuplayout[whatever][key=value]
\let#7#3%
@@ -590,7 +590,7 @@
#2\zerocount % mode is always zero at the end
\the#9}}
-\unexpanded\def\installswitchsetuphandler#1#2%
+\protected\def\installswitchsetuphandler#1#2%
{\normalexpanded
{\mult_interfaces_install_switch_setup_handler_a
{\noexpand#1}% \??aa
@@ -609,10 +609,10 @@
\expandafter\noexpand\csname everyswitch#2\endcsname
\expandafter\noexpand\csname everysetup#2root\endcsname}}
-\unexpanded\def\mult_interfaces_install_auto_setup_handler#1#2#3#4#5#6#7#8#9%
+\protected\def\mult_interfaces_install_auto_setup_handler#1#2#3#4#5#6#7#8#9%
{\ifx#3\relax\let#3\empty\fi
- \unexpanded\def#2{\dotripleempty#4}%
- \unexpanded\def#6{\mult_interfaces_get_parameters{#1#3:}}%
+ \protected\def#2{\dotripleempty#4}%
+ \protected\def#6{\mult_interfaces_get_parameters{#1#3:}}%
\newtoks#5%
\def#4[##1][##2][##3]%
{\let#8#3%
@@ -637,7 +637,7 @@
\fi\fi
\let#3#8}}
-\unexpanded\def\installautosetuphandler#1#2%
+\protected\def\installautosetuphandler#1#2%
{\normalexpanded
{\mult_interfaces_install_auto_setup_handler
{\noexpand#1}% \??aa
@@ -650,40 +650,40 @@
\expandafter\noexpand\csname saved_setup_current#2\endcsname
\expandafter\noexpand\csname nested_setup_current#2\endcsname}}
-\unexpanded\def\installbasicparameterhandler#1#2%
+\protected\def\installbasicparameterhandler#1#2%
{\installparameterhandler {#1}{#2}%
\installparameterhashhandler{#1}{#2}%
\installparametersethandler {#1}{#2}%
\installrootparameterhandler{#1}{#2}}
-\unexpanded\def\installbasicautosetuphandler#1#2#3% \??self name \??parent (can be \??self)
+\protected\def\installbasicautosetuphandler#1#2#3% \??self name \??parent (can be \??self)
{\installbasicparameterhandler{#1}{#2}%
\installautosetuphandler {#1}{#2}}
-\unexpanded\def\installstylisticautosetuphandler#1#2#3% \??self name \??parent (can be \??self)
+\protected\def\installstylisticautosetuphandler#1#2#3% \??self name \??parent (can be \??self)
{\installbasicparameterhandler{#1}{#2}%
\installautosetuphandler {#1}{#2}%
\installstyleandcolorhandler {#1}{#2}}
-\unexpanded\def\installcommandhandler#1#2#3% \??self name \??parent (can be \??self)
+\protected\def\installcommandhandler#1#2#3% \??self name \??parent (can be \??self)
{\installbasicparameterhandler{#1}{#2}%
\installdefinehandler {#1}{#2}{#3}%
\installsetuphandler {#1}{#2}%
\installstyleandcolorhandler {#1}{#2}}
-\unexpanded\def\installswitchcommandhandler#1#2#3% \??self name \??parent (can be \??self)
+\protected\def\installswitchcommandhandler#1#2#3% \??self name \??parent (can be \??self)
{\installbasicparameterhandler{#1}{#2}%
\installdefinehandler {#1}{#2}{#3}%
\installswitchsetuphandler {#1}{#2}%
\installstyleandcolorhandler {#1}{#2}}
-\unexpanded\def\installautocommandhandler#1#2#3% automatically defined cloned setups
+\protected\def\installautocommandhandler#1#2#3% automatically defines cloned setups
{\installbasicparameterhandler{#1}{#2}%
\installdefinehandler {#1}{#2}{#3}%
\installautosetuphandler {#1}{#2}%
\installstyleandcolorhandler {#1}{#2}}
-\unexpanded\def\installsimplecommandhandler#1#2#3% no define (experiment) - use \check*parent when defining
+\protected\def\installsimplecommandhandler#1#2#3% no define (experiment) - use \check*parent when defining
{\installbasicparameterhandler{#1}{#2}%
\installsetuphandler {#1}{#2}%
\installstyleandcolorhandler {#1}{#2}}
@@ -699,14 +699,14 @@
%D We don't need colons for such simple cases.
-\unexpanded\def\mult_interfaces_install_direct_parameter_handler#1#2#3#4#5%
+\protected\def\mult_interfaces_install_direct_parameter_handler#1#2#3#4#5%
%%{\def#3##1{\csname\ifcsname#1##1\endcsname#1##1\else\s!empty\fi\endcsname}%
{\def#3##1{\begincsname#1##1\endcsname}%
\def#4##1{\detokenize\expandafter\expandafter\expandafter{\csname#1##1\endcsname}}%
% \def#4##1{\mult_interfaces_detokenize{\csname\ifcsname#1#2:##1\endcsname#1#2:##1\else\expandafter#5\csname#1#2:\s!parent\endcsname{##1}\fi\endcsname}}%
\def#5##1{\begincsname#1##1\endcsname}}
-\unexpanded\def\installdirectparameterhandler#1#2%
+\protected\def\installdirectparameterhandler#1#2%
{\normalexpanded
{\mult_interfaces_install_direct_parameter_handler
{\noexpand#1}%
@@ -715,13 +715,13 @@
\expandafter\noexpand\csname detokenized#2parameter\endcsname
\expandafter\noexpand\csname direct#2parameter\endcsname}}
-\unexpanded\def\mult_interfaces_install_direct_setup_handler#1#2#3#4#5%
- {\unexpanded\def#2{\dosingleempty#3}%
+\protected\def\mult_interfaces_install_direct_setup_handler#1#2#3#4#5%
+ {\protected\def#2{\dosingleempty#3}%
\newtoks#5%
\def#3[##1]{\mult_interfaces_get_parameters#1[##1]\the#5}%
\def#4{\mult_interfaces_get_parameters#1}}
-\unexpanded\def\installdirectsetuphandler#1#2%
+\protected\def\installdirectsetuphandler#1#2%
{\normalexpanded
{\mult_interfaces_install_direct_setup_handler
{\noexpand#1}% \??aa
@@ -730,21 +730,21 @@
\expandafter\noexpand\csname setupcurrent#2\endcsname % no \every (we use 'current' for consistency)
\expandafter\noexpand\csname everysetup#2\endcsname}}
-% \unexpanded\def\mult_interfaces_install_direct_parameter_set_handler#1#2#3#4#5%
-% {\unexpanded\def#2{\mult_interfaces_def #1}%
-% \unexpanded\def#3{\mult_interfaces_edef#1}%
-% \unexpanded\def#4{\mult_interfaces_let #1}%
-% \unexpanded\def#5{\mult_interfaces_let #1\empty}}%
+% \protected\def\mult_interfaces_install_direct_parameter_set_handler#1#2#3#4#5%
+% {\protected\def#2{\mult_interfaces_def #1}%
+% \protected\def#3{\mult_interfaces_edef#1}%
+% \protected\def#4{\mult_interfaces_let #1}%
+% \protected\def#5{\mult_interfaces_let #1\empty}}%
% \startinterface english
- \unexpanded\def\mult_interfaces_install_direct_parameter_set_handler#1#2#3#4#5%
- {\unexpanded\def#2##1{\expandafter \def\csname#1##1\endcsname}%
- \unexpanded\def#3##1{\expandafter\edef\csname#1##1\endcsname}%
- \unexpanded\def#4##1{\expandafter \let\csname#1##1\endcsname}%
- \unexpanded\def#5##1{\expandafter \let\csname#1##1\endcsname\empty}}%
+ \protected\def\mult_interfaces_install_direct_parameter_set_handler#1#2#3#4#5%
+ {\protected\def#2##1{\expandafter \def\csname#1##1\endcsname}%
+ \protected\def#3##1{\expandafter\edef\csname#1##1\endcsname}%
+ \protected\def#4##1{\expandafter \let\csname#1##1\endcsname}%
+ \protected\def#5##1{\expandafter \let\csname#1##1\endcsname\empty}}%
% \stopinterface
-\unexpanded\def\installdirectparametersethandler#1#2%
+\protected\def\installdirectparametersethandler#1#2%
{\normalexpanded
{\mult_interfaces_install_direct_parameter_set_handler
{\noexpand#1}% \??aa
@@ -755,13 +755,13 @@
\let\installdirectstyleandcolorhandler\installstyleandcolorhandler
-\unexpanded\def\installdirectcommandhandler#1#2%
+\protected\def\installdirectcommandhandler#1#2%
{\installdirectparameterhandler {#1}{#2}%
\installdirectsetuphandler {#1}{#2}%
\installdirectparametersethandler {#1}{#2}%
\installdirectstyleandcolorhandler{#1}{#2}}
-\unexpanded\def\installsetuponlycommandhandler#1#2%
+\protected\def\installsetuponlycommandhandler#1#2%
{\installdirectparameterhandler{#1}{#2}%
\installdirectsetuphandler {#1}{#2}%
}% maybe \installdirectparametersethandler {#1}{#2}%
@@ -789,15 +789,15 @@
% yes:\twoparameter{alpha}\par
% yes:\twoparameter{beta}\par
-\unexpanded\def\relateparameterhandlers#1#2#3#4% {from} {instance} {to} {instance}
+\protected\def\relateparameterhandlers#1#2#3#4% {from} {instance} {to} {instance}
{\expandafter\edef\csname\csname#1namespace\endcsname#2:\s!parent\endcsname{\csname#3namespace\endcsname#4}}
-\unexpanded\def\relateparameterhandlersbyns#1#2#3#4% {from} {instance} {to} {instance}
+\protected\def\relateparameterhandlersbyns#1#2#3#4% {from} {instance} {to} {instance}
{\expandafter\edef\csname#1#2:\s!parent\endcsname{#3#4}}
%D Here is another experiment:
-\unexpanded\def\installactionhandler#1%
+\protected\def\installactionhandler#1%
{\normalexpanded
{\mult_interfaces_install_action_handler
{#1}%
@@ -805,9 +805,9 @@
\expandafter\noexpand\csname setupcurrent#1\endcsname
\expandafter\noexpand\csname #1_action\endcsname}}
-% \unexpanded\def\mult_interfaces_install_action_handler#1#2#3#4%
-% {\unexpanded\expandafter\def\csname#1\endcsname{\dodoubleempty#4}%
-% \unexpanded\def#4[##1][##2]%
+% \protected\def\mult_interfaces_install_action_handler#1#2#3#4%
+% {\protected\expandafter\def\csname#1\endcsname{\dodoubleempty#4}%
+% \protected\def#4[##1][##2]%
% {\begingroup
% \ifsecondargument
% \edef#2{##1}%
@@ -823,9 +823,9 @@
% \directsetup{handler:action:#1}%
% \endgroup}}
-\unexpanded\def\mult_interfaces_install_action_handler#1#2#3#4%
- {\unexpanded\expandafter\def\csname#1\endcsname{\dodoubleempty#4}%
- \unexpanded\def#4[##1][##2]%
+\protected\def\mult_interfaces_install_action_handler#1#2#3#4%
+ {\protected\expandafter\def\csname#1\endcsname{\dodoubleempty#4}%
+ \protected\def#4[##1][##2]%
{\begingroup
\ifsecondargument
\edef#2{##1}%
@@ -846,7 +846,7 @@
% First we had, in tune with the regular system variables:
%
% \starttyping
-% \unexpanded\def\installnamespace#1{\setvalue{????#1}{@@@@#1}}
+% \protected\def\installnamespace#1{\setvalue{????#1}{@@@@#1}}
% \stoptyping
%
% The following variant is nicer and in principle faster but that gets unnoticed
@@ -880,7 +880,7 @@
\def\v_interfaces_prefix_template
{\number\c_mult_interfaces_n_of_namespaces>}
-\unexpanded\def\installnamespace#1% for modules and users
+\protected\def\installnamespace#1% for modules and users
{\ifcsname ????#1\endcsname
\writestatus\m!system{duplicate user namespace '#1'}\wait
\else
@@ -888,7 +888,7 @@
\expandafter\edef\csname ????#1\endcsname{\v_interfaces_prefix_template}%
\fi}
-\unexpanded\def\installcorenamespace#1%
+\protected\def\installcorenamespace#1%
{\ifcsname ??#1\endcsname
\writestatus\m!system{duplicate core namespace '#1'}\wait
\else
@@ -913,16 +913,16 @@
\letvalue\??dummy\empty
- \def\dummyparameter #1{\begincsname\??dummy#1\endcsname}
- \def\directdummyparameter #1{\begincsname\??dummy#1\endcsname}
-\unexpanded\def\setdummyparameter #1{\expandafter\def\csname\??dummy#1\endcsname}
-\unexpanded\def\setexpandeddummyparameter#1{\expandafter\edef\csname\??dummy#1\endcsname}
-\unexpanded\def\letdummyparameter #1{\expandafter\let\csname\??dummy#1\endcsname}
+ \def\dummyparameter #1{\begincsname\??dummy#1\endcsname}
+ \def\directdummyparameter #1{\begincsname\??dummy#1\endcsname}
+\protected\def\setdummyparameter #1{\expandafter\def\csname\??dummy#1\endcsname}
+\protected\def\setexpandeddummyparameter#1{\expandafter\edef\csname\??dummy#1\endcsname}
+\protected\def\letdummyparameter #1{\expandafter\let\csname\??dummy#1\endcsname}
-% \unexpanded\def\getdummyparameters
+% \protected\def\getdummyparameters
% {\mult_interfaces_get_parameters\??dummy}
-\unexpanded\def\getdummyparameters[#1%
+\protected\def\getdummyparameters[#1%
{\if\noexpand#1]%
\expandafter\gobbleoneargument
\else
@@ -977,7 +977,7 @@
%
% This is a user (module) command:
-\unexpanded\def\definenamespace
+\protected\def\definenamespace
{\dodoubleargument\mult_interfaces_define_name_space}
\def\mult_interfaces_define_name_space[#1][#2]% namespace settings
@@ -992,7 +992,7 @@
%D \showparentchain{@@am}{left}
%D \stoptyping
-\unexpanded\def\showparentchain#1#2%
+\protected\def\showparentchain#1#2%
{\writestatus\m!system{chain: [ \mult_interfaces_show_parent_chain{#1#2}]}}
% \def\mult_interfaces_show_parent_chain#1%
@@ -1010,7 +1010,7 @@
%D Another helper (needs to be applied):
-\unexpanded\def\doifelsecommandhandler#1#2% namespace name
+\protected\def\doifelsecommandhandler#1#2% namespace name
{\ifcsname#1#2:\s!parent\endcsname
\expandafter\firstoftwoarguments
\else
@@ -1019,14 +1019,14 @@
\let\doifcommandhandlerelse\doifelsecommandhandler
-\unexpanded\def\doifcommandhandler#1#2% namespace name
+\protected\def\doifcommandhandler#1#2% namespace name
{\ifcsname#1#2:\s!parent\endcsname
\expandafter\firstofoneargument
\else
\expandafter\gobbleoneargument
\fi}
-\unexpanded\def\doifnotcommandhandler#1#2% namespace name
+\protected\def\doifnotcommandhandler#1#2% namespace name
{\ifcsname#1#2:\s!parent\endcsname
\expandafter\gobbleoneargument
\else
@@ -1077,7 +1077,7 @@
\def\s!double{double}
\def\s!triple{triple}
-% \unexpanded\def\syst_helpers_double_empty#1#2#3%
+% \protected\def\syst_helpers_double_empty#1#2#3%
% {\syst_helpers_argument_reset
% \doifelsenextoptional
% {\syst_helpers_double_empty_one_yes_mult#2#3}%
@@ -1105,17 +1105,17 @@
% \def\syst_helpers_double_empty_one_spaced_mult#1#2{#1[{#2}] }
% \def\syst_helpers_double_empty_one_normal_mult#1#2{#1[{#2}]}
%
-% \unexpanded\def\mult_interfaces_install_setup_handler#1#2#3#4#5#6#7#8%
+% \protected\def\mult_interfaces_install_setup_handler#1#2#3#4#5#6#7#8%
% {\ifx#3\relax\let#3\empty\fi
-% \unexpanded\def#5{\mult_interfaces_get_parameters{#1#3:}}% no every ! don't change it
+% \protected\def#5{\mult_interfaces_get_parameters{#1#3:}}% no every ! don't change it
% \newtoks#4%
% \newtoks#7%
% \edef\m_mult_interface_setup{\csstring#2_}%
-% \unexpanded\edef#2{\syst_helpers_double_empty
+% \protected\edef#2{\syst_helpers_double_empty
% \csname\m_mult_interface_setup\s!simple\endcsname
% \csname\m_mult_interface_setup\s!single\endcsname
% \csname\m_mult_interface_setup\s!double\endcsname}%
-% \unexpanded\expandafter\def\csname\m_mult_interface_setup\s!double\endcsname[##1][##2]%
+% \protected\expandafter\def\csname\m_mult_interface_setup\s!double\endcsname[##1][##2]%
% {\let#6#3%
% \def#8####1% we will have a simple one as well
% {\edef#3{####1}%
@@ -1124,21 +1124,21 @@
% \processcommalist[##1]#8%
% \let#3#6%
% \the#7}%
-% \unexpanded\expandafter\def\csname\m_mult_interface_setup\s!single\endcsname[##1]%
+% \protected\expandafter\def\csname\m_mult_interface_setup\s!single\endcsname[##1]%
% {\let#6#3%
% \let#3\empty
% \mult_interfaces_get_parameters{#1:}[##1]%
% \the#4%
% \let#3#6%
% \the#7}%
-% \unexpanded\expandafter\def\csname\m_mult_interface_setup\s!simple\endcsname%
+% \protected\expandafter\def\csname\m_mult_interface_setup\s!simple\endcsname%
% {\let#6#3%
% \let#3\empty
% \the#4%
% \let#3#6%
% \the#7}}
-% \unexpanded\def\installsetuphandler#1#2%
+% \protected\def\installsetuphandler#1#2%
% {\normalexpanded
% {\mult_interfaces_install_setup_handler
% {\noexpand#1}% \??aa
@@ -1150,7 +1150,7 @@
% \expandafter\noexpand\csname everysetup#2root\endcsname
% \expandafter\noexpand\csname nested_setup_current#2\endcsname}}
%
-% \unexpanded\def\syst_helpers_triple_empty#1#2#3#4%
+% \protected\def\syst_helpers_triple_empty#1#2#3#4%
% {\syst_helpers_argument_reset
% \doifelsenextoptional
% {\syst_helpers_triple_empty_one_yes_mult#2#3#4}%
@@ -1196,17 +1196,17 @@
% \def\syst_helpers_triple_empty_three_spaced_mult#1#2#3{#1[{#2}][{#3}] }
% \def\syst_helpers_triple_empty_three_normal_mult#1#2#3{#1[{#2}][{#3}]}
%
-% \unexpanded\def\mult_interfaces_install_auto_setup_handler#1#2#3#4#5#6#7#8%
+% \protected\def\mult_interfaces_install_auto_setup_handler#1#2#3#4#5#6#7#8%
% {\ifx#3\relax\let#3\empty\fi
-% \unexpanded\def#5{\mult_interfaces_get_parameters{#1#3:}}%
+% \protected\def#5{\mult_interfaces_get_parameters{#1#3:}}%
% \newtoks#4%
% \edef\m_mult_interface_setup{\csstring#2_}%
-% \unexpanded\edef#2{\syst_helpers_triple_empty
+% \protected\edef#2{\syst_helpers_triple_empty
% \csname\m_mult_interface_setup\s!simple\endcsname
% \csname\m_mult_interface_setup\s!single\endcsname
% \csname\m_mult_interface_setup\s!double\endcsname
% \csname\m_mult_interface_setup\s!triple\endcsname}%
-% \unexpanded\expandafter\def\csname\m_mult_interface_setup\s!triple\endcsname[##1][##2][##3]%
+% \protected\expandafter\def\csname\m_mult_interface_setup\s!triple\endcsname[##1][##2][##3]%
% {\let#7#3%
% \def#8####1%
% {\edef#3{####1}%
@@ -1215,7 +1215,7 @@
% \the#4}%
% \processcommalist[##1]#8%
% \let#3#7}%
-% \unexpanded\expandafter\def\csname\m_mult_interface_setup\s!double\endcsname[##1][##2]%
+% \protected\expandafter\def\csname\m_mult_interface_setup\s!double\endcsname[##1][##2]%
% {\let#7#3%
% \def#8####1%
% {\edef#3{####1}%
@@ -1224,19 +1224,19 @@
% \the#4}%
% \processcommalist[##1]#8%
% \let#3#7}%
-% \unexpanded\expandafter\def\csname\m_mult_interface_setup\s!single\endcsname[##1]%
+% \protected\expandafter\def\csname\m_mult_interface_setup\s!single\endcsname[##1]%
% {\let#7#3%
% \let#3\empty
% \mult_interfaces_get_parameters{#1:}[##1]%
% \the#4%
% \let#3#7}%
-% \unexpanded\expandafter\def\csname\m_mult_interface_setup\s!simple\endcsname%
+% \protected\expandafter\def\csname\m_mult_interface_setup\s!simple\endcsname%
% {\let#7#3%
% \let#3\empty
% \the#4%
% \let#3#7}}
%
-% \unexpanded\def\installautosetuphandler#1#2%
+% \protected\def\installautosetuphandler#1#2%
% {\normalexpanded
% {\mult_interfaces_install_auto_setup_handler
% {\noexpand#1}% \??aa
@@ -1266,30 +1266,30 @@
\let\c_mult_set\relax
-\unexpanded\def\mult_interfaces_install_definition_set#1#2#3#4#5#6#7%
+\protected\def\mult_interfaces_install_definition_set#1#2#3#4#5#6#7%
{\newcount#3%
\let#6\empty
- \unexpanded\def#2%
+ \protected\def#2%
{\expandafter\let\expandafter\c_mult_set\csname #1_t_#6\endcsname
\ifx\c_mult_set\relax
\expandafter\newtoks\c_mult_set
\expandafter\let\csname #1_t_#6\endcsname\c_mult_set
\fi}
- \unexpanded\def#4##1%
+ \protected\def#4##1%
{\pushmacro#6%
\advance#3\plusone
\edef#6{##1}%
\unprotect}%
- \unexpanded\def#5%
+ \protected\def#5%
{\protect
\advance#3\minusone
\popmacro#6}%
- \unexpanded\def#7##1%
+ \protected\def#7##1%
{\edef#6{##1}%
#2%
\the\c_mult_set\relax}}
-\unexpanded\def\installdefinitionset#1#2%
+\protected\def\installdefinitionset#1#2%
{\normalexpanded
{\mult_interfaces_install_definition_set
{\noexpand#1}% \??aa
@@ -1300,13 +1300,13 @@
\expandafter\noexpand\csname current#2\endcsname
\expandafter\noexpand\csname use#2\endcsname}}
-\unexpanded\def\mult_interfaces_install_definition_set_member#1#2#3#4#5#6#7#8#9% no everysetups etc
+\protected\def\mult_interfaces_install_definition_set_member#1#2#3#4#5#6#7#8#9% no everysetups etc
{\let#5#2%
- \unexpanded\def#2%
+ \protected\def#2%
{\ifcase#4\relax\expandafter#5\else\expandafter#6\fi}%
- \unexpanded\def#6%
+ \protected\def#6%
{\dodoubleempty#7}%
- \unexpanded\def#7[##1][##2]%
+ \protected\def#7[##1][##2]%
{\ifsecondargument
%#3\c_mult_set\expandafter{\the\c_mult_set#9[##1][##2]}%
#3\toksapp\c_mult_set{#9[##1][##2]}%
@@ -1315,7 +1315,7 @@
#3\toksapp\c_mult_set{#8[##1]}%
\fi\fi}}
-\unexpanded\def\installdefinitionsetmember#1#2#3#4%
+\protected\def\installdefinitionsetmember#1#2#3#4%
{\normalexpanded
{\mult_interfaces_install_definition_set_member
{\noexpand#3}% \??aa
@@ -1330,13 +1330,13 @@
%D Another experiment:
-\unexpanded\def\mult_interfaces_install_parent_injector#1#2#3#4%
- {\unexpanded\def#4##1%
+\protected\def\mult_interfaces_install_parent_injector#1#2#3#4%
+ {\protected\def#4##1%
{\ifx#3\empty
\expandafter\def\csname#1#2:\s!parent\endcsname{#1##1}%
\fi}}
-\unexpanded\def\installparentinjector#1#2%
+\protected\def\installparentinjector#1#2%
{\normalexpanded{\mult_interfaces_install_parent_injector
{\noexpand#1}%
\expandafter\noexpand\csname current#2\endcsname
@@ -1346,7 +1346,7 @@
% Faster but not used that much to make a dent in performance. But, because it's
% cleaner anyway and also gives less tracing, we apply it a few times.
-\unexpanded\def\syst_helpers_install_macro_stack#1#2#3%
+\protected\def\syst_helpers_install_macro_stack#1#2#3%
{\xdef\m_syst_helpers_push_macro{\csstring#1}%
\ifcsname#3\m_syst_helpers_push_macro\endcsname\else
\expandafter\newcount\csname#3\m_syst_helpers_push_macro\endcsname
@@ -1362,23 +1362,23 @@
\noexpand\csname\m_syst_helpers_push_macro\noexpand\the\csname#3\m_syst_helpers_push_macro\endcsname\endcsname}%
\fi}
-\unexpanded\def\installmacrostack #1{\syst_helpers_install_macro_stack#1\let \??localpushedmacro }
-\unexpanded\def\installglobalmacrostack#1{\syst_helpers_install_macro_stack#1\glet\??globalpushedmacro}
+\protected\def\installmacrostack #1{\syst_helpers_install_macro_stack#1\let \??localpushedmacro }
+\protected\def\installglobalmacrostack#1{\syst_helpers_install_macro_stack#1\glet\??globalpushedmacro}
% \unprotect
%
% \installcorenamespace {test} \installcommandhandler \??test {test} \??test
-% \unexpanded\def\TestMeA[#1]%
+% \protected\def\TestMeA[#1]%
% {\edef\currenttest{#1}
% \edef\p_before{\testparameter\c!before}%
% \ifx\p_before\empty \relax \else \relax \fi}
-% \unexpanded\def\TestMeB[#1]%
+% \protected\def\TestMeB[#1]%
% {\edef\currenttest{#1}
% \doifelsenothing{\testparameter\c!before}\relax\relax}
-% \unexpanded\def\TestMeC[#1]%
+% \protected\def\TestMeC[#1]%
% {\edef\currenttest{#1}
% \expandafter\expandafter\expandafter\ifx\testparameter\c!before\empty \relax \else \relax \fi}
-% \unexpanded\def\TestMeD[#1]%
+% \protected\def\TestMeD[#1]%
% {\edef\currenttest{#1}
% \doubleexpandafter\ifx\testparameter\c!before\empty \relax \else \relax \fi}
%
@@ -1396,7 +1396,7 @@
% only gain a few milliseconds:
%
% \starttyping
-% \unexpanded\def\foo#1{[foo:#1]}
+% \protected\def\foo#1{[foo:#1]}
%
% \installcommalistprocessor {foo} \foo
% \installcommalistprocessorcommand \processfoolist \foo
@@ -1413,7 +1413,7 @@
% \processfoolist[{x,y,z}]\par
% \processcommalist[{x,y,z}]\foo\blank
%
-% \unexpanded\def\foo#1{}
+% \protected\def\foo#1{}
%
% \testfeatureonce{400000}{\processfoolist [fixed,middle,bar]} \elapsedtime\quad
%%\testfeatureonce{400000}{\commalistprocessor{foo}[fixed,middle,bar]} \elapsedtime\quad
@@ -1434,46 +1434,46 @@
\installcorenamespace{commalistprocessorpickup}
\installcorenamespace{commalistprocessorfinish}
-\unexpanded\def\installcommalistprocessor#1#2% 8 macro names overhead
+\protected\def\installcommalistprocessor#1#2% 8 macro names overhead
{\let\nexttoken\relax
- \unexpanded\expandafter\edef\csname\??commalistprocessor#1\endcsname[%
+ \protected\expandafter\edef\csname\??commalistprocessor#1\endcsname[%
{\futurelet\nexttoken\csname\??commalistprocessorcheck#1\endcsname}%
- \unexpanded\expandafter\edef\csname\??commalistprocessorcheck#1\endcsname
+ \protected\expandafter\edef\csname\??commalistprocessorcheck#1\endcsname
{\noexpand\ifx\nexttoken]%
\noexpand\expandafter\noexpand\gobblethreearguments
\noexpand\else
\noexpand\expandafter\csname\??commalistprocessorwrap#1\endcsname
\noexpand\fi
\relax}% this one preserved the next {}
- \unexpanded\expandafter\edef\csname\??commalistprocessorwrap#1\endcsname##1]%
+ \protected\expandafter\edef\csname\??commalistprocessorwrap#1\endcsname##1]%
{\csname\??commalistprocessorfirst#1\endcsname##1,]\relax}%
- \unexpanded\expandafter\edef\csname\??commalistprocessorfirst#1\endcsname##1% picks up \relax
+ \protected\expandafter\edef\csname\??commalistprocessorfirst#1\endcsname##1% picks up \relax
{\csname\??commalistprocessornext#1\endcsname}%
- \unexpanded\expandafter\edef\csname\??commalistprocessornext#1\endcsname
+ \protected\expandafter\edef\csname\??commalistprocessornext#1\endcsname
{\noexpand\ifx\nexttoken\noexpand\blankspace
\noexpand\expandafter\csname\??commalistprocessorspace#1\endcsname
\noexpand\else
\noexpand\expandafter\csname\??commalistprocessorfinish#1\endcsname
\noexpand\fi}%
- \unexpanded\expandafter\edef\csname\??commalistprocessorfinish#1\endcsname
+ \protected\expandafter\edef\csname\??commalistprocessorfinish#1\endcsname
{\noexpand\ifx\nexttoken]%
\noexpand\expandafter\noexpand\gobbleoneargument
\noexpand\else
\noexpand\expandafter\csname\??commalistprocessoraction#1\endcsname
\noexpand\fi}%
- \unexpanded\expandafter\edef\csname\??commalistprocessoraction#1\endcsname##1,%
+ \protected\expandafter\edef\csname\??commalistprocessoraction#1\endcsname##1,%
{\noexpand#2{##1}%
\futurelet\nexttoken\csname\??commalistprocessornext#1\endcsname}%
\let\next\:%
- \unexpanded\edef \:{\csname\??commalistprocessorspace#1\endcsname}%
- \unexpanded\expandafter\edef\: {\futurelet\nexttoken\csname\??commalistprocessornext#1\endcsname}%
+ \protected\edef \:{\csname\??commalistprocessorspace#1\endcsname}%
+ \protected\expandafter\edef\: {\futurelet\nexttoken\csname\??commalistprocessornext#1\endcsname}%
\let\:\next}
-\unexpanded\def\installcommalistprocessorcommand#1#2% \processor \action
+\protected\def\installcommalistprocessorcommand#1#2% \processor \action
{\edef\p_name{\csstring#2}%
\installcommalistprocessor\p_name{#2}%
\expandafter\let\expandafter#1\csname\??commalistprocessor\p_name\endcsname}
-\unexpanded\def\commalistprocessor#1{\csname\??commalistprocessor#1\endcsname}
+\protected\def\commalistprocessor#1{\csname\??commalistprocessor#1\endcsname}
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mult-aux.mkxl b/Master/texmf-dist/tex/context/base/mkiv/mult-aux.mkxl
deleted file mode 100644
index 3fed8c26e68..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/mult-aux.mkxl
+++ /dev/null
@@ -1,1170 +0,0 @@
-%D \module
-%D [ file=mult-aux,
-%D version=2010.08.2,
-%D title=\CONTEXT\ Multilingual Macros,
-%D subtitle=Helpers,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-%D A generalization of \MKIV-like inheritance. Just something to play with
-%D (interface might change). The code here evolved in an email exchange between me
-%D and Wolgang Schuster.
-
-\writestatus{loading}{ConTeXt Multilingual Macros / Helpers}
-
-\registerctxluafile{mult-aux}{}
-
-\unprotect
-
-\edef\??empty{\Uchar25} \letvalue{\Uchar25}\empty % hex 19
-
-% \edef\s!parent{\Uchar29} % inlining  is ugly, a tiny bit faster, but neglectable on a run
-
-%D \starttyping
-%D \unprotect
-%D \def\????aa{@@@@aa}
-%D
-%D \installparameterhandler \????aa {whatever}
-%D \installsetuphandler \????aa {whatever}
-%D \installdefinehandler \????aa {whatever} \????aa % #3 == defaultroot
-%D \installfontandcolorhandler\????aa {whatever}
-%D
-%D % \installcommandhandler \????aa {whatever} \????aa
-%D \protect
-%D
-%D % \whateverparameter \c!test
-%D % \whateverparameterhash \c!test
-%D % \namedwhateverparameter \mycurrentwhatever \c!test
-%D % \usewhateverstyleandcolor \c!style \c!color
-%D % \everydefinewhatever (sets \currentwhatever)
-%D % \everypresetwhatever (can be used to reset parameters as we can redefine)
-%D % \everysetupwhatever (sets \currentwhatever)
-%D
-%D \starttext
-%D \definewhatever[first] \definewhatever[second][first]
-%D test: \def\currentwhatever{first} \whateverparameter{method} \par
-%D \setupwhatever [method=unset] test: \def\currentwhatever{first} \whateverparameter{method} \par
-%D \setupwhatever[first] [method=first] test: \def\currentwhatever{first} \whateverparameter{method} \par
-%D test: \def\currentwhatever{second} \whateverparameter{method} \par
-%D \setupwhatever[second][method=second] test: \def\currentwhatever{second} \whateverparameter{method} \par
-%D \stoptext
-%D \stoptyping
-
-% problem: every* could clash
-%
-% There can be less {} in the following definitions if we assume \??aa and \c!somecs
-%
-% todo: \def\detokenized...parameter#1{\detokenize\expandafter\expandafter\expandafter{\csname#1#2\endcsname}} % always root
-%
-% it might be more efficient to do this at the lua and
-%
-% watch the push/pop and predefinition of current .. this is needed for nested
-% definitions and overloaded defines using the predefined one
-
-% todo: add (relaxed) postsetup and postdefine hooks, just after the everys
-
-%D Start of experimental code: especially tables can have many assignments and
-%D although most time is spent in the typesetting anyway, we can squeeze out a
-%D little bit. Of course having 500 rows of 50 columns each with some setting does
-%D not happen that often. One should keep in mind that in the average document
-%D having some 500 assignments is no exception but there we're talking of
-%D neglectable runtime for them. Of course in the definitions below there is no real
-%D gain, only in the generated \setup* commands. Another situation with many
-%D assignments is \XML\ where we can pass attributes and normally don't do testing
-%D of them making sense.
-%
-% \testfeatureonce{100000}{\getparameters[bla][a=111,b=222,c=333]}% 1.669s
-% \testfeatureonce{100000}{\mult_interfaces_get_parameters{bla} [a=111,b=222,c=333]}% 1.529s
-% \testfeatureonce{100000}{\def\m_mult_interfaces_namespace{bla}\mult_interfaces_get_parameters_indeed[a=111,b=222,c=333]}% 1.466s
-
-\let\m_mult_interfaces_namespace\empty
-
-\def\mult_interfaces_get_parameters#1[#2%
- {\if\noexpand#2]%
- \expandafter\gobbleoneargument
- \else
- \def\m_mult_interfaces_namespace{#1}%
- \expandafter\mult_interfaces_get_parameters_indeed
- \fi#2}
-
-\def\mult_interfaces_get_parameters_indeed#1]% namespace already set
- {\mult_interfaces_get_parameters_item#1,],^^^^0004}
-
-\def\mult_interfaces_get_parameters_item#1,#2% #2 takes space before ,
- {\if,#1,% dirty trick for testing #1=empty
- \expandafter\mult_interfaces_get_parameters_item
- \orelse\if]#1%
- \expandafter\gobbleoneargument
- \else
- \mult_interfaces_get_parameters_assign#1==\empty^^^^0004%
- % \expandafter\mult_interfaces_get_parameters_item % saves skipping when at end
- \fi#2}
-
-\def\mult_interfaces_get_parameters_error#1#2% #3%
- {\mult_interfaces_get_parameters_error_indeed{#1}{#2}%
- \gobbleoneargument}
-
-\def\mult_interfaces_get_parameters_error_indeed#1#2%
- {\showassignerror{#2}{\the\inputlineno\space(#1)}}
-
-\def\mult_interfaces_get_parameters_assign#1=#2=#3#4^^^^0004%
- {\ifx\empty#1\empty
- \expandafter\mult_interfaces_get_parameters_error
- \orelse\ifx#3\empty
- \expandafter\mult_interfaces_get_parameters_error
- \else
- \expandafter\mult_interfaces_adef % assignment def
- \fi
- \m_mult_interfaces_namespace{#1}{#2}%
- \doubleexpandafter\mult_interfaces_get_parameters_item}
-
-\startinterface english
-
- % some 10% faster
-
- \let\mult_interfaces_get_parameters_error\undefined
-
- \def\mult_interfaces_get_parameters_error_one#1\csname#2#3\endcsname#4%
- {\mult_interfaces_get_parameters_error_indeed{#2}{#3}\iftrue}
-
- \def\mult_interfaces_get_parameters_error_two#1\csname#2#3\endcsname#4%
- {\mult_interfaces_get_parameters_error_indeed{#2}{#3}}
-
- \def\mult_interfaces_get_parameters_assign#1=#2=#3#4^^^^0004%
- {\ifx\empty#1\empty
- \mult_interfaces_get_parameters_error_one
- \orelse\ifx#3\empty
- \mult_interfaces_get_parameters_error_two
- \else
- \expandafter\def\csname\m_mult_interfaces_namespace#1\endcsname{#2}%
- \fi
- \doubleexpandafter\mult_interfaces_get_parameters_item}
-
-\stopinterface
-
-\newif\ifassignment
-
-\def\mult_check_for_assignment_indeed#1=#2#3^^^^0004%
- {\if#2^^^^0003\assignmentfalse\else\assignmenttrue\fi}
-
-\def\mult_check_for_assignment_indeed_begin_#1=#2#3^^^^0004%
- {\if#2^^^^0003}
-
-\def\mult_check_for_assignment#1%
- {\expandafter\mult_check_for_assignment_indeed\detokenize{#1}=^^^^0003^^^^0003^^^^0004}
-
-% End of experimental code.
-
-%D This can give wrong results when we pass e.g. \type{\c!format}, so either we need
-%D to use the \type {\k!} ones, but these are not defined in the english interface
-%D so from now on we assume that the low level ones are used with the symbolic names
-%D and that only the high level setup commands are used with language specific
-%D interfaces.
-
-% \unexpanded\def\mult_interfaces_let #1#2{\expandafter\let \csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname}
-% \unexpanded\def\mult_interfaces_lete#1#2{\expandafter\let \csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname\empty}
-% \unexpanded\def\mult_interfaces_def #1#2{\expandafter\def \csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname}
-% \unexpanded\def\mult_interfaces_edef#1#2{\expandafter\edef\csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname}
-% \unexpanded\def\mult_interfaces_gdef#1#2{\expandafter\gdef\csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname}
-% \unexpanded\def\mult_interfaces_xdef#1#2{\expandafter\xdef\csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname}
-
-% \startinterface english
- \unexpanded\def\mult_interfaces_let #1#2{\expandafter \let\csname#1#2\endcsname}
- \unexpanded\def\mult_interfaces_lete#1#2{\expandafter \let\csname#1#2\endcsname\empty}
- \unexpanded\def\mult_interfaces_def #1#2{\expandafter \def\csname#1#2\endcsname}
- \unexpanded\def\mult_interfaces_edef#1#2{\expandafter\edef\csname#1#2\endcsname}
- \unexpanded\def\mult_interfaces_gdef#1#2{\expandafter\gdef\csname#1#2\endcsname}
- \unexpanded\def\mult_interfaces_xdef#1#2{\expandafter\xdef\csname#1#2\endcsname}
-% \stopinterface
-
-%D Do, we only interface the assignment definition:
-
-\unexpanded\def\mult_interfaces_adef#1#2{\expandafter\def \csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname}
-
-\startinterface english
- \unexpanded\def\mult_interfaces_adef#1#2{\expandafter \def\csname#1#2\endcsname}
-\stopinterface
-
-% the commented detokenized variant that backtracks ... needs testing usage first
-%
-% \let\whatever\relax
-%
-% \definetest[oeps][bagger=\whatever]
-%
-% \def\currenttest{oeps} \edef\hans{\detokenizedtestparameter{bagger}}\meaning\hans\par
-% \def\currenttest{oeps} \edef\hans{\detokenizedtestparameter{reggab}}\meaning\hans\par
-%
-% slower: \def#3##1{\csname\ifcsname#1#2:##1\endcsname\expandafter\csstring\lastnamedcs\else\expandafter#5\csname#1#2:\s!parent\endcsname{##1}\fi\endcsname}%
-
-%D pre-expansion can be a bit faster but handly any effect on a normal run so let's
-%D go for saving some memory
-
-\def\mult_interfaces_detokenize{\expandafter\expandafter\expandafter\detokenize\expandafter\expandafter\expandafter}
-
-\unexpanded\def\mult_interfaces_install_parameter_handler#1#2#3#4#5#6#7#8#9% inlining \csname*\endcsname is more efficient (#3 and #6 only)
- {\ifx#2\relax\let#2\empty\fi % it is hardly faster but produces less expansion tracing
- \def#3##1{\csname\ifcsname#1#2:##1\endcsname#1#2:##1\else\expandafter#5\csname#1#2:\s!parent\endcsname{##1}\fi\endcsname}%
- \def#4##1##2{\ifcsname##1:##2\endcsname##1:##2\else\expandafter#5\csname##1:\s!parent\endcsname{##2}\fi}%
- %\def#5##1##2{\ifx##1\relax\??empty\else#4{##1}{##2}\fi}% is {} needed around ##1 ?
- %\def#5##1##2{\ifx##1\relax\??empty\else#4##1{##2}\fi}% is {} needed around ##1 ?
- \def#5##1##2{\ifx##1\relax^^^^0019\else#4##1{##2}\fi}% is {} needed around ##1 ?
- \def#6##1##2{\csname\ifcsname#1##1:##2\endcsname#1##1:##2\else\expandafter#5\csname#1##1:\s!parent\endcsname{##2}\fi\endcsname}%
- \def#7##1{\detokenize\expandafter\expandafter\expandafter{\csname#1#2:##1\endcsname}}% always root, no backtrack
- \def#8##1{\begincsname#1#2:##1\endcsname}
- \def#9##1##2{\expandafter\let\expandafter##1\csname\ifcsname#1#2:##2\endcsname#1#2:##2\else\expandafter#5\csname#1#2:\s!parent\endcsname{##2}\fi\endcsname}}
-
-\unexpanded\def\installparameterhandler#1#2%
- {\normalexpanded
- {\mult_interfaces_install_parameter_handler
- {\noexpand#1}% \??aa
- \expandafter\noexpand\csname current#2\endcsname
- \expandafter\noexpand\csname #2parameter\endcsname
- \expandafter\noexpand\csname do#2parameter\endcsname % or : #2_parameter
- \expandafter\noexpand\csname do#2parentparameter\endcsname % or : #2_parent_parameter
- \expandafter\noexpand\csname named#2parameter\endcsname
- \expandafter\noexpand\csname detokenized#2parameter\endcsname
- \expandafter\noexpand\csname direct#2parameter\endcsname
- \expandafter\noexpand\csname letfrom#2parameter\endcsname}} % strict#2parameter is gone
-
-\unexpanded\def\mult_interfaces_install_root_parameter_handler#1#2#3%
- {\def#2##1{\detokenize\expandafter\expandafter\expandafter{\csname#1:##1\endcsname}}% always root
- \def#3##1{\begincsname#1:##1\endcsname}}
-
-\unexpanded\def\installrootparameterhandler#1#2%
- {\normalexpanded
- {\mult_interfaces_install_root_parameter_handler
- {\noexpand#1}% \??aa
- \expandafter\noexpand\csname detokenizedroot#2parameter\endcsname
- \expandafter\noexpand\csname root#2parameter\endcsname}}
-
-\unexpanded\def\mult_interfaces_install_parameter_hash_handler#1#2#3#4#5#6#7#8#9%
- {\ifx#2\relax\let#2\empty\fi
- \def#3##1{#1#4{#1#2}{##1}:}% leading #1 was missing .. is this one used?
- \def#4##1##2{\ifcsname##1:##2\endcsname##1\else\expandafter#5\csname##1:\s!parent\endcsname{##2}\fi}%
- %\def#5##1##2{\ifx##1\relax\else#4{##1}{##2}\fi}%
- \def#5##1##2{\ifx##1\relax\else#4##1{##2}\fi}%
- \def#6{#1#2:}%
- \def#7##1{#1##1:}%
- \def#8{\ifx#2\empty\orelse\ifcsname#1#2:\s!parent\endcsname\else\expandafter\let\csname#1#2:\s!parent\endcsname#1\fi}%
- \unexpanded\def#9##1{\expandafter\edef\csname#1##1:\s!parent\endcsname{#1#2}}}
-
-\unexpanded\def\installparameterhashhandler#1#2%
- {\expandafter\let\csname#2namespace\endcsname#1%
- \normalexpanded
- {\mult_interfaces_install_parameter_hash_handler
- {\noexpand#1}% \??aa
- \expandafter\noexpand\csname current#2\endcsname
- \expandafter\noexpand\csname #2parameterhash\endcsname
- \expandafter\noexpand\csname do#2parameterhash\endcsname % or : #2_parameter_hash
- \expandafter\noexpand\csname do#2parentparameterhash\endcsname % or : #2_parent_parameter_hash
- \expandafter\noexpand\csname current#2hash\endcsname
- \expandafter\noexpand\csname named#2hash\endcsname
- \expandafter\noexpand\csname check#2parent\endcsname
- \expandafter\noexpand\csname chaintocurrent#2\endcsname}}
-
-%D In \MKIV\ we can probably use the english variant for all other languages too.
-
-% todo: inline the def/let
-
-% \unexpanded\def\mult_interfaces_install_parameter_set_handler#1#2#3#4#5#6%
-% {\ifx#2\relax\let#2\empty\fi
-% \unexpanded\def#3{\mult_interfaces_def {#1#2:}}% ##1 {##2} (braces are mandate)
-% \unexpanded\def#4{\mult_interfaces_edef{#1#2:}}% ##1 {##2} (braces are mandate)
-% \unexpanded\def#5{\mult_interfaces_let {#1#2:}}% ##1 ##2
-% \unexpanded\def#6{\mult_interfaces_lete{#1#2:}}}% ##1
-%
-% \startinterface english
- \unexpanded\def\mult_interfaces_install_parameter_set_handler#1#2#3#4#5#6%
- {\ifx#2\relax\let#2\empty\fi
- \unexpanded\def#3##1{\expandafter \def\csname#1#2:##1\endcsname}% ##1 {##2} (braces are mandate)
- \unexpanded\def#4##1{\expandafter\edef\csname#1#2:##1\endcsname}% ##1 {##2} (braces are mandate)
- \unexpanded\def#5##1{\expandafter \let\csname#1#2:##1\endcsname}% ##1 ##2
- \unexpanded\def#6##1{\expandafter \let\csname#1#2:##1\endcsname\empty}}% ##1
-% \stopinterface
-
-\unexpanded\def\installparametersethandler#1#2%
- {\normalexpanded
- {\mult_interfaces_install_parameter_set_handler
- {\noexpand#1}% \??aa
- \expandafter\noexpand\csname current#2\endcsname
- \expandafter\noexpand\csname set#2parameter\endcsname
- \expandafter\noexpand\csname setexpanded#2parameter\endcsname
- \expandafter\noexpand\csname let#2parameter\endcsname
- \expandafter\noexpand\csname reset#2parameter\endcsname}}
-
-\let\dousecurrentstyleparameter\relax
-\let\dousecurrentcolorparameter\relax
-
-\let\currentstyleparameter\empty
-\let\currentcolorparameter\empty
-
-\unexpanded\def\mult_interfaces_install_style_and_color_handler#1#2#3#4%
- {\unexpanded\def#2##1##2% style color
- {\edef\currentstyleparameter{#1{##1}}% this name is public (can also set color e.g. in underline)
- \ifx\currentstyleparameter\empty\else\dousecurrentstyleparameter\fi
- \edef\currentcolorparameter{#1{##2}}% this name is public (so we do this after the style switch)
- \ifx\currentcolorparameter\empty\else\dousecurrentcolorparameter\fi}%
- \unexpanded\def#3##1% style
- {\edef\currentstyleparameter{#1{##1}}% this name is public
- \ifx\currentstyleparameter\empty\else\dousecurrentstyleparameter\fi}%
- \unexpanded\def#4##1% color
- {\edef\currentcolorparameter{#1{##1}}% this name is public
- \ifx\currentcolorparameter\empty\else\dousecurrentcolorparameter\fi}}
-
-\unexpanded\def\installstyleandcolorhandler#1#2%
- {\normalexpanded
- {\mult_interfaces_install_style_and_color_handler
- \expandafter\noexpand\csname #2parameter\endcsname
- \expandafter\noexpand\csname use#2styleandcolor\endcsname % maybe an alias use#2styleandcolorparameters
- \expandafter\noexpand\csname use#2styleparameter\endcsname
- \expandafter\noexpand\csname use#2colorparameter\endcsname}}
-
-\let\definehandlerparent\empty
-
-% \def\mult_check_for_parent#1#2#3#4%
-% {\ifcsname#1#4:\s!parent\endcsname \else \ifx#4\empty \else
-% \writestatus\m!system{error: invalid parent #4 for #3, #4 defined too (best check it)}%
-% \expandafter\edef\csname#1#4:\s!parent\endcsname{#2}%
-% \fi \fi}
-
-\def\mult_check_for_parent#1#2#3#4%
- {\ifcsname#1#4:\s!parent\endcsname\orelse\ifx#4\empty\else
- \writestatus\m!system{error: invalid parent #4 for #3, #4 defined too (best check it)}%
- \expandafter\edef\csname#1#4:\s!parent\endcsname{#2}%
- \fi}
-
-%def\mult_interfaces_chain#1#2{\ifcsname#1#2:\s!chain\endcsname\csname#1#2:\s!chain\endcsname\space\fi}
-%def\getparentchain #1#2{\ifcsname#1#2:\s!chain\endcsname\csname#1#2:\s!chain\endcsname\fi}
-%def\getcurrentparentchain#1#2{\ifcsname#1#2:\s!chain\endcsname\csname#1#2:\s!chain\endcsname\fi}
-
-\def\mult_interfaces_chain#1#2{\ifcsname#1#2:\s!chain\endcsname\lastnamedcs\space\fi}
-\def\getparentchain #1#2{\begincsname#1#2:\s!chain\endcsname}
-\def\getcurrentparentchain#1#2{\begincsname#1#2:\s!chain\endcsname}
-
-\unexpanded\def\mult_interfaces_install_define_handler#1#2#3#4#5#6#7#8#9% why is \expanded still needed in clones
- {\ifx#4\relax\let#4\empty\fi % see \defineregister
- \unexpanded\def#2{\dotripleempty#5}%
- \newtoks#6%
- \newtoks#7%
- \unexpanded\def#5[##1][##2][##3]% [child][parent][settings] | [child][settings] | [child][parent] | [child]
- {\let#9#4%
- \edef#4{##1}%
- \ifthirdargument
- \the#6% predefine
- \edef#8{##2}%
- \mult_check_for_parent{#1}{#3}#4#8%
- \expandafter\edef\csname#1#4:\s!chain\endcsname{\mult_interfaces_chain#1{##2}##1}%
- \expandafter\edef\csname#1#4:\s!parent\endcsname{#1##2}%
- \mult_interfaces_get_parameters{#1#4:}[##3]%
- \orelse\ifsecondargument
- \the#6% predefine
- \ifcondition\expandafter\mult_check_for_assignment_indeed_begin_\detokenize{##2}=^^^^0003^^^^0003^^^^0004%
- \edef#8{##2}%
- \mult_check_for_parent{#1}{#3}#4#8%
- \expandafter\edef\csname#1#4:\s!chain\endcsname{\mult_interfaces_chain#1{##2}##1}%
- \expandafter\edef\csname#1#4:\s!parent\endcsname{#1##2}%
- \else
- \let#8\empty
- \expandafter\edef\csname#1#4:\s!chain\endcsname{##1}%
- \expandafter\edef\csname#1#4:\s!parent\endcsname{#3}%
- \mult_interfaces_get_parameters{#1#4:}[##2]%
- \fi
- \else
- \the#6% predefine
- \let#8\empty
- \expandafter\edef\csname#1#4:\s!chain\endcsname{##1}%
- \expandafter\edef\csname#1#4:\s!parent\endcsname{#3}%
- \fi
- \the#7%
- \let#4#9}}
-
-\unexpanded\def\installdefinehandler#1#2#3%
- {\normalexpanded
- {\mult_interfaces_install_define_handler
- {\noexpand#1}% \??aa
- \expandafter\noexpand\csname define#2\endcsname
- {\noexpand#3}% root
- \expandafter\noexpand\csname current#2\endcsname
- \expandafter\noexpand\csname define_#2\endcsname % semi-public
- \expandafter\noexpand\csname everypreset#2\endcsname
- \expandafter\noexpand\csname everydefine#2\endcsname
- \expandafter\noexpand\csname current#2parent\endcsname
- \expandafter\noexpand\csname saved_defined_#2\endcsname}}
-
-\unexpanded\def\mult_interfaces_install_setup_handler#1#2#3#4#5#6#7#8#9%
- {\ifx#3\relax\let#3\empty\fi
- \unexpanded\def#2{\dodoubleempty#4}%
- \unexpanded\def#6{\mult_interfaces_get_parameters{#1#3:}}% no every ! don't change it
- \newtoks#5%
- \newtoks#8%
- \unexpanded\def#4[##1][##2]% maybe helper
- {\let#7#3%
- \ifsecondargument
- \def#9####1% we will have a simple one as well
- {\edef#3{####1}%
- \mult_interfaces_get_parameters{#1#3:}[##2]%
- \the#5}%
- \processcommalist[##1]#9%
- \else
- \let#3\empty
- \mult_interfaces_get_parameters{#1:}[##1]%
- \the#5%
- \fi
- \let#3#7%
- \the#8}}
-
-\unexpanded\def\installsetuphandler#1#2%
- {\normalexpanded
- {\mult_interfaces_install_setup_handler
- {\noexpand#1}% \??aa
- \expandafter\noexpand\csname setup#2\endcsname
- \expandafter\noexpand\csname current#2\endcsname
- \expandafter\noexpand\csname setup_#2\endcsname % semi-public
- \expandafter\noexpand\csname everysetup#2\endcsname
- \expandafter\noexpand\csname setupcurrent#2\endcsname
- \expandafter\noexpand\csname saved_setup_current#2\endcsname
- \expandafter\noexpand\csname everysetup#2root\endcsname
- \expandafter\noexpand\csname nested_setup_current#2\endcsname}}
-
-\let\doingrootsetupnamed\plusone % \setuplayout[name][key=value]
-\let\doingrootsetuproot \plustwo % \setuplayout [key=value]
-\let\doingrootsetnamed \plusthree % \setuplayout[name]
-\let\doingrootsetroot \plusfour % \setuplayout
-
-\unexpanded\def\mult_interfaces_install_switch_setup_handler_a#1#2#3#4#5%
- {\ifx#3\relax\let#3\empty\fi
- \unexpanded\def#2{\dodoubleempty#4}%
- \unexpanded\def#5{\mult_interfaces_get_parameters{#1#3:}}}
-
-\unexpanded\def\mult_interfaces_install_switch_setup_handler_b#1#2#3#4#5#6#7#8#9%
- {\newtoks#5%
- \newconstant#2%
- \newtoks#8%
- \newtoks#9%
- \ifx#6\relax\let#6\empty\fi
- \unexpanded\def#4[##1][##2]% maybe helper
- {\ifsecondargument % no commalist here
- % \setuplayout[whatever][key=value]
- \let#7#3%
- \let#6#3%
- \edef#3{##1}%
- #2\doingrootsetupnamed
- \mult_interfaces_get_parameters{#1#3:}[##2]%
- \the#5%
- \ifx#3#6\the#8\fi % only switchsetups if previous == current
- \let#3#7%
- \orelse\iffirstargument
- % \mult_check_for_assignment{##1}%
- \ifcondition\expandafter\mult_check_for_assignment_indeed_begin_\detokenize{##1}=^^^^0003^^^^0003^^^^0004%
- % \setuplayout[whatever]
- \let#6#3% % previous becomes current
- \edef#3{##1}% this will catch reset so one needs to test for it
- #2\doingrootsetnamed
- \the#5% % we can check for previous vs current
- \the#8% switchsetups
- \else
- % \setuplayout[key=value]
- \let#7#3%
- \let#6#3%
- \let#3\empty
- #2\doingrootsetuproot
- \mult_interfaces_get_parameters{#1:}[##1]%
- \the#5%
- \the#8% switchsetups
- \let#3#7%
- \fi
- \else
- % \setuplayout
- \let#6#3% % previous becomes current
- \let#3\empty % current becomes empty
- #2\doingrootsetroot
- \the#5%
- \the#8% switchsetups
- \fi
- #2\zerocount % mode is always zero at the end
- \the#9}}
-
-\unexpanded\def\installswitchsetuphandler#1#2%
- {\normalexpanded
- {\mult_interfaces_install_switch_setup_handler_a
- {\noexpand#1}% \??aa
- \expandafter\noexpand\csname setup#2\endcsname
- \expandafter\noexpand\csname current#2\endcsname
- \expandafter\noexpand\csname setup_#2\endcsname % semi-public
- \expandafter\noexpand\csname setupcurrent#2\endcsname
- \mult_interfaces_install_switch_setup_handler_b
- {\noexpand#1}% \??aa
- \expandafter\noexpand\csname #2setupmode\endcsname
- \expandafter\noexpand\csname current#2\endcsname
- \expandafter\noexpand\csname setup_#2\endcsname % semi-public
- \expandafter\noexpand\csname everysetup#2\endcsname
- \expandafter\noexpand\csname previous#2\endcsname
- \expandafter\noexpand\csname saved_setup_current#2\endcsname
- \expandafter\noexpand\csname everyswitch#2\endcsname
- \expandafter\noexpand\csname everysetup#2root\endcsname}}
-
-\unexpanded\def\mult_interfaces_install_auto_setup_handler#1#2#3#4#5#6#7#8#9%
- {\ifx#3\relax\let#3\empty\fi
- \unexpanded\def#2{\dotripleempty#4}%
- \unexpanded\def#6{\mult_interfaces_get_parameters{#1#3:}}%
- \newtoks#5%
- \def#4[##1][##2][##3]%
- {\let#8#3%
- \ifthirdargument
- \def#9####1%
- {\edef#3{####1}%
- \expandafter\def\csname#1#3:\s!parent\endcsname{#1##2}%
- \mult_interfaces_get_parameters{#1#3:}[##3]% always sets parent
- \the#5}%
- \processcommalist[##1]#9%
- \orelse\ifsecondargument
- \def#9####1%
- {\edef#3{####1}%
- #7% checks parent and sets if needed
- \mult_interfaces_get_parameters{#1#3:}[##2]%
- \the#5}%
- \processcommalist[##1]#9%
- \else
- \let#3\empty
- \mult_interfaces_get_parameters{#1:}[##1]%
- \the#5%
- \fi
- \let#3#8}}
-
-\unexpanded\def\installautosetuphandler#1#2%
- {\normalexpanded
- {\mult_interfaces_install_auto_setup_handler
- {\noexpand#1}% \??aa
- \expandafter\noexpand\csname setup#2\endcsname
- \expandafter\noexpand\csname current#2\endcsname
- \expandafter\noexpand\csname setup_#2\endcsname % semi-public
- \expandafter\noexpand\csname everysetup#2\endcsname
- \expandafter\noexpand\csname setupcurrent#2\endcsname
- \expandafter\noexpand\csname check#2parent\endcsname
- \expandafter\noexpand\csname saved_setup_current#2\endcsname
- \expandafter\noexpand\csname nested_setup_current#2\endcsname}}
-
-\unexpanded\def\installbasicparameterhandler#1#2%
- {\installparameterhandler {#1}{#2}%
- \installparameterhashhandler{#1}{#2}%
- \installparametersethandler {#1}{#2}%
- \installrootparameterhandler{#1}{#2}}
-
-\unexpanded\def\installbasicautosetuphandler#1#2#3% \??self name \??parent (can be \??self)
- {\installbasicparameterhandler{#1}{#2}%
- \installautosetuphandler {#1}{#2}}
-
-\unexpanded\def\installstylisticautosetuphandler#1#2#3% \??self name \??parent (can be \??self)
- {\installbasicparameterhandler{#1}{#2}%
- \installautosetuphandler {#1}{#2}%
- \installstyleandcolorhandler {#1}{#2}}
-
-\unexpanded\def\installcommandhandler#1#2#3% \??self name \??parent (can be \??self)
- {\installbasicparameterhandler{#1}{#2}%
- \installdefinehandler {#1}{#2}{#3}%
- \installsetuphandler {#1}{#2}%
- \installstyleandcolorhandler {#1}{#2}}
-
-\unexpanded\def\installswitchcommandhandler#1#2#3% \??self name \??parent (can be \??self)
- {\installbasicparameterhandler{#1}{#2}%
- \installdefinehandler {#1}{#2}{#3}%
- \installswitchsetuphandler {#1}{#2}%
- \installstyleandcolorhandler {#1}{#2}}
-
-\unexpanded\def\installautocommandhandler#1#2#3% automatically defined cloned setups
- {\installbasicparameterhandler{#1}{#2}%
- \installdefinehandler {#1}{#2}{#3}%
- \installautosetuphandler {#1}{#2}%
- \installstyleandcolorhandler {#1}{#2}}
-
-\unexpanded\def\installsimplecommandhandler#1#2#3% no define (experiment) - use \check*parent when defining
- {\installbasicparameterhandler{#1}{#2}%
- \installsetuphandler {#1}{#2}%
- \installstyleandcolorhandler {#1}{#2}}
-
-%D Many mechanisms have some kind of inheritance in place, and these are the
-%D speed||critical ones. Therefore there is no reason to stick to \type {\@@xxkey}
-%D for the sake of performance. For this reason we also provide a direct variant.
-%D This permits a more consistent treatment of namespaces. A \type
-%D {\whateverparameter} call is three times slower and a \type
-%D {\directwhateverparameter} call two times but for some 100K expansions we only
-%D loose some .1 second which is neglectable given the small amount of expansions in
-%D real runs.
-
-%D We don't need colons for such simple cases.
-
-\unexpanded\def\mult_interfaces_install_direct_parameter_handler#1#2#3#4#5%
-%%{\def#3##1{\csname\ifcsname#1##1\endcsname#1##1\else\s!empty\fi\endcsname}%
- {\def#3##1{\begincsname#1##1\endcsname}%
- \def#4##1{\detokenize\expandafter\expandafter\expandafter{\csname#1##1\endcsname}}%
- % \def#4##1{\mult_interfaces_detokenize{\csname\ifcsname#1#2:##1\endcsname#1#2:##1\else\expandafter#5\csname#1#2:\s!parent\endcsname{##1}\fi\endcsname}}%
- \def#5##1{\begincsname#1##1\endcsname}}
-
-\unexpanded\def\installdirectparameterhandler#1#2%
- {\normalexpanded
- {\mult_interfaces_install_direct_parameter_handler
- {\noexpand#1}%
- \expandafter\noexpand\csname current#2\endcsname
- \expandafter\noexpand\csname #2parameter\endcsname
- \expandafter\noexpand\csname detokenized#2parameter\endcsname
- \expandafter\noexpand\csname direct#2parameter\endcsname}}
-
-\unexpanded\def\mult_interfaces_install_direct_setup_handler#1#2#3#4#5%
- {\unexpanded\def#2{\dosingleempty#3}%
- \newtoks#5%
- \def#3[##1]{\mult_interfaces_get_parameters#1[##1]\the#5}%
- \def#4{\mult_interfaces_get_parameters#1}}
-
-\unexpanded\def\installdirectsetuphandler#1#2%
- {\normalexpanded
- {\mult_interfaces_install_direct_setup_handler
- {\noexpand#1}% \??aa
- \expandafter\noexpand\csname setup#2\endcsname
- \expandafter\noexpand\csname setup_#2\endcsname % semi-public
- \expandafter\noexpand\csname setupcurrent#2\endcsname % no \every (we use 'current' for consistency)
- \expandafter\noexpand\csname everysetup#2\endcsname}}
-
-% \unexpanded\def\mult_interfaces_install_direct_parameter_set_handler#1#2#3#4#5%
-% {\unexpanded\def#2{\mult_interfaces_def #1}%
-% \unexpanded\def#3{\mult_interfaces_edef#1}%
-% \unexpanded\def#4{\mult_interfaces_let #1}%
-% \unexpanded\def#5{\mult_interfaces_let #1\empty}}%
-
-% \startinterface english
- \unexpanded\def\mult_interfaces_install_direct_parameter_set_handler#1#2#3#4#5%
- {\unexpanded\def#2##1{\expandafter \def\csname#1##1\endcsname}%
- \unexpanded\def#3##1{\expandafter\edef\csname#1##1\endcsname}%
- \unexpanded\def#4##1{\expandafter \let\csname#1##1\endcsname}%
- \unexpanded\def#5##1{\expandafter \let\csname#1##1\endcsname\empty}}%
-% \stopinterface
-
-\unexpanded\def\installdirectparametersethandler#1#2%
- {\normalexpanded
- {\mult_interfaces_install_direct_parameter_set_handler
- {\noexpand#1}% \??aa
- \expandafter\noexpand\csname set#2parameter\endcsname
- \expandafter\noexpand\csname setexpanded#2parameter\endcsname
- \expandafter\noexpand\csname let#2parameter\endcsname
- \expandafter\noexpand\csname reset#2parameter\endcsname}}
-
-\let\installdirectstyleandcolorhandler\installstyleandcolorhandler
-
-\unexpanded\def\installdirectcommandhandler#1#2%
- {\installdirectparameterhandler {#1}{#2}%
- \installdirectsetuphandler {#1}{#2}%
- \installdirectparametersethandler {#1}{#2}%
- \installdirectstyleandcolorhandler{#1}{#2}}
-
-\unexpanded\def\installsetuponlycommandhandler#1#2%
- {\installdirectparameterhandler{#1}{#2}%
- \installdirectsetuphandler {#1}{#2}%
- }% maybe \installdirectparametersethandler {#1}{#2}%
-
-% Experiment:
-
-% \installcorenamespace {one}
-% \installcorenamespace {two}
-%
-% \installcommandhandler \??one {one} \??one
-% \installcommandhandler \??two {two} \??two
-%
-% \defineone[test] \setupone[test][alpha=first]
-% \definetwo[test] \setuptwo[test][beta=second]
-%
-% \protect
-%
-% \def\currentone{test}
-% \def\currenttwo{test}
-%
-% \relateparameterhandlers {two} {test} {one} {test}
-%
-% yes:\oneparameter{alpha}\par
-% nop:\oneparameter{beta}\par
-% yes:\twoparameter{alpha}\par
-% yes:\twoparameter{beta}\par
-
-\unexpanded\def\relateparameterhandlers#1#2#3#4% {from} {instance} {to} {instance}
- {\expandafter\edef\csname\csname#1namespace\endcsname#2:\s!parent\endcsname{\csname#3namespace\endcsname#4}}
-
-\unexpanded\def\relateparameterhandlersbyns#1#2#3#4% {from} {instance} {to} {instance}
- {\expandafter\edef\csname#1#2:\s!parent\endcsname{#3#4}}
-
-%D Here is another experiment:
-
-\unexpanded\def\installactionhandler#1%
- {\normalexpanded
- {\mult_interfaces_install_action_handler
- {#1}%
- \expandafter\noexpand\csname current#1\endcsname
- \expandafter\noexpand\csname setupcurrent#1\endcsname
- \expandafter\noexpand\csname #1_action\endcsname}}
-
-% \unexpanded\def\mult_interfaces_install_action_handler#1#2#3#4%
-% {\unexpanded\expandafter\def\csname#1\endcsname{\dodoubleempty#4}%
-% \unexpanded\def#4[##1][##2]%
-% {\begingroup
-% \ifsecondargument
-% \edef#2{##1}%
-% #3[##2]%
-% \else\iffirstargument
-% \doifelseassignment{##1}
-% {\let#2\empty
-% #3[##1]}%
-% {\edef#2{##1}}%
-% \else
-% \let#2\empty
-% \fi\fi
-% \directsetup{handler:action:#1}%
-% \endgroup}}
-
-\unexpanded\def\mult_interfaces_install_action_handler#1#2#3#4%
- {\unexpanded\expandafter\def\csname#1\endcsname{\dodoubleempty#4}%
- \unexpanded\def#4[##1][##2]%
- {\begingroup
- \ifsecondargument
- \edef#2{##1}%
- #3[##2]%
- \orelse\iffirstargument
- \ifcondition\expandafter\mult_check_for_assignment_indeed_begin_\detokenize{##1}=^^^^0003^^^^0003^^^^0004%
- \edef#2{##1}%
- \else
- \let#2\empty
- #3[##1]%
- \fi
- \else
- \let#2\empty
- \fi
- \directsetup{handler:action:#1}%
- \endgroup}}
-
-% First we had, in tune with the regular system variables:
-%
-% \starttyping
-% \unexpanded\def\installnamespace#1{\setvalue{????#1}{@@@@#1}}
-% \stoptyping
-%
-% The following variant is nicer and in principle faster but that gets unnoticed
-% unless lots of expansion happens. Also, we can use long tags but the internal
-% expansion will be relatively small (and unlikely more than 4 characters). For
-% instance, \??xx used to expand to @@xx but now becomes for instance 123::. This
-% is one character more but in quite some cases we had : after such a tag in the
-% old situation. In the new situation we create more namespaces and don't need that
-% : any more, so we end up with on the average the same amount of tokens and
-% definitely less when we consider cases like \??xx:\c!align: which now is just
-% \??somealign and therefore has length 5 now (instead of 4+1+5+1=10).
-%
-% Eventualy we will have a verbose \blablanamespace and the difference between core
-% and regular can go ... after all, \xxxparameter can already clash between the two
-% prefix groups .. if users use this mechanism a lot they should use verbose names
-% anyway (the old two character names were mostly an optimization as they also
-% expanded to these characters).
-
-% todo: register namespaces at lua end for logging and reverse resolve
-% todo: move this to syst-ini so that we can use it real early
-
-\newcount\c_mult_interfaces_n_of_namespaces
-
-%def\v_interfaces_prefix_template{\number \c_mult_interfaces_n_of_namespaces>}
-%def\v_interfaces_prefix_template{\characters\c_mult_interfaces_n_of_namespaces>}
-
-%def\v_interfaces_prefix_template % consistently %03i>
-% {\ifnum\c_mult_interfaces_n_of_namespaces<\plusten00\else\ifnum\c_mult_interfaces_n_of_namespaces<\plushundred0\fi\fi
-% \number\c_mult_interfaces_n_of_namespaces>}
-
-\def\v_interfaces_prefix_template
- {\number\c_mult_interfaces_n_of_namespaces>}
-
-\unexpanded\def\installnamespace#1% for modules and users
- {\ifcsname ????#1\endcsname
- \writestatus\m!system{duplicate user namespace '#1'}\wait
- \else
- \global\advance\c_mult_interfaces_n_of_namespaces\plusone
- \expandafter\edef\csname ????#1\endcsname{\v_interfaces_prefix_template}%
- \fi}
-
-\unexpanded\def\installcorenamespace#1%
- {\ifcsname ??#1\endcsname
- \writestatus\m!system{duplicate core namespace '#1'}\wait
- \else
- \global\advance\c_mult_interfaces_n_of_namespaces\plusone
- \expandafter\edef\csname ??#1\endcsname{\v_interfaces_prefix_template}%
- \clf_registernamespace\c_mult_interfaces_n_of_namespaces{#1}%
- \fi}
-
-\def\mult_interfaces_get_parameters_error_indeed#1#2%
- {\clf_showassignerror{#1}{#2}\inputlineno}
-
-% We install two core namespaces here, as we want nice error messages. Maybe
-% we will reserve the first 9.
-
-\installcorenamespace{fontinstanceready}
-\installcorenamespace{fontinstancebasic}
-\installcorenamespace{fontinstanceclass}
-
-%D The next one is handy for local assignments.
-
-\installcorenamespace{dummy}
-
-\letvalue\??dummy\empty
-
- \def\dummyparameter #1{\begincsname\??dummy#1\endcsname}
- \def\directdummyparameter #1{\begincsname\??dummy#1\endcsname}
-\unexpanded\def\setdummyparameter #1{\expandafter\def\csname\??dummy#1\endcsname}
-\unexpanded\def\setexpandeddummyparameter#1{\expandafter\edef\csname\??dummy#1\endcsname}
-\unexpanded\def\letdummyparameter #1{\expandafter\let\csname\??dummy#1\endcsname}
-
-% \unexpanded\def\getdummyparameters
-% {\mult_interfaces_get_parameters\??dummy}
-
-\unexpanded\def\getdummyparameters[#1%
- {\if\noexpand#1]%
- \expandafter\gobbleoneargument
- \else
- \let\m_mult_interfaces_namespace\??dummy
- \expandafter\mult_interfaces_get_parameters_indeed
- \fi#1}
-
-\mult_interfaces_install_style_and_color_handler
- \directdummyparameter
- \usedummystyleandcolor
- \usedummystyleparameter
- \usedummycolorparameter
-
-% Maybe a \definecorenamespace[name][directparameter,directsetup][parent] but we
-% don't gain much. Actually we might just inline all definitions.
-
-% \enabletrackers[interfaces.namespaces,context.flush]
-%
-% \definenamespace
-% [xy]
-% [type=module,
-% comment=test module,
-% version=1,
-% name=test,
-% style=yes,
-% command=yes,
-% setup=list,
-% set=yes,
-% parent=xy]
-%
-% \unprotect
-% \getparameters
-% [\????xy]
-% [text=]
-% \protect
-%
-% \definetest[one]
-%
-% \starttext
-%
-% “\testparameter{text}”
-%
-% \setuptest[text=foo]
-%
-% “\testparameter{text}”
-%
-% \setuptest[one][text=bar]
-%
-% “\testparameter{text}”
-%
-% \stoptext
-%
-% This is a user (module) command:
-
-\unexpanded\def\definenamespace
- {\dodoubleargument\mult_interfaces_define_name_space}
-
-\def\mult_interfaces_define_name_space[#1][#2]% namespace settings
- {\clf_definenamespace{#1}{#2}}
-
-\def\listnamespaces
- {\clf_listnamespaces}
-
-%D Helper:
-%D
-%D \starttyping
-%D \showparentchain{@@am}{left}
-%D \stoptyping
-
-\unexpanded\def\showparentchain#1#2%
- {\writestatus\m!system{chain: [ \mult_interfaces_show_parent_chain{#1#2}]}}
-
-% \def\mult_interfaces_show_parent_chain#1%
-% {#1 => %
-% \ifcsname#1:\s!parent\endcsname
-% \expandafter\mult_interfaces_show_parent_chain\csname#1:\s!parent\endcsname
-% \fi}
-
-\def\mult_interfaces_show_parent_chain#1%
- {#1 => %
- \ifcsname#1:\s!parent\endcsname
- %\expandafter\mult_interfaces_show_parent_chain\csname#1:\s!parent\endcsname
- \expandafter\mult_interfaces_show_parent_chain\lastnamedcs
- \fi}
-
-%D Another helper (needs to be applied):
-
-\unexpanded\def\doifelsecommandhandler#1#2% namespace name
- {\ifcsname#1#2:\s!parent\endcsname
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\let\doifcommandhandlerelse\doifelsecommandhandler
-
-\unexpanded\def\doifcommandhandler#1#2% namespace name
- {\ifcsname#1#2:\s!parent\endcsname
- \expandafter\firstofoneargument
- \else
- \expandafter\gobbleoneargument
- \fi}
-
-\unexpanded\def\doifnotcommandhandler#1#2% namespace name
- {\ifcsname#1#2:\s!parent\endcsname
- \expandafter\gobbleoneargument
- \else
- \expandafter\firstofoneargument
- \fi}
-
-\let\doifcommandhandlerelse\doifelsecommandhandler
-
-% another set of (fast) helpers (grep for usage):
-
-\def\expandnamespaceparameter#1#2#3% \??xx \getp \c!xx \v!yy
- {\csname#1\ifcsname#1\expandafter\expandafter\expandafter\mult_aux_expand_namespace_parameter#2#3}
-
-\def\mult_aux_expand_namespace_parameter#1#2% \cs \v!yy
- {#1\endcsname#1\else#2\fi\endcsname}
-
-\def\expandnamespacemacro#1#2#3% \??xx \some_edefed_cs \c!yy
- {\csname#1\ifcsname#1#2\endcsname#2\else#3\fi\endcsname}
-
-\def\expandnamespacevalue#1#2% \??xx {...} \c!yy == optimized \expandcheckedcsname
- {\csname#1\ifcsname#1\normalexpanded{\noexpand\syst_helpers_expand_checked_value{#2}}}
-
-\def\syst_helpers_expand_checked_value#1#2%
- {#1\endcsname#1\else#2\fi\endcsname}
-
-%D Conventions:
-%D
-%D \starttyping
-%D \newcount \c_class_whatever
-%D \newconditional \c_class_whatever
-%D \newconstant \c_class_whatever
-%D \newdimen \d_class_whatever
-%D \newskip \s_class_whatever
-%D \newmuskip \s_class_whatever
-%D \newbox \b_class_whatever
-%D \newtoks \t_class_whatever
-%D
-%D \edef\p_class_whatever{\classparameter\c!whatever}
-%D \edef\m_class_whatever{whatever}
-%D \stoptyping
-
-% experiment: in principle this is faster but not that noticeable as we don't do that
-% many assignments and mechanism that do are also slow; the advantage is mostly nicer
-% in tracing
-
-\def\s!simple{simple}
-\def\s!single{single}
-\def\s!double{double}
-\def\s!triple{triple}
-
-\let\c_mult_set\relax
-
-\unexpanded\def\mult_interfaces_install_definition_set#1#2#3#4#5#6#7%
- {\newcount#3%
- \let#6\empty
- \unexpanded\def#2%
- {\expandafter\let\expandafter\c_mult_set\csname #1_t_#6\endcsname
- \ifx\c_mult_set\relax
- \expandafter\newtoks\c_mult_set
- \expandafter\let\csname #1_t_#6\endcsname\c_mult_set
- \fi}
- \unexpanded\def#4##1%
- {\pushmacro#6%
- \advance#3\plusone
- \edef#6{##1}%
- \unprotect}%
- \unexpanded\def#5%
- {\protect
- \advance#3\minusone
- \popmacro#6}%
- \unexpanded\def#7##1%
- {\edef#6{##1}%
- #2%
- \the\c_mult_set\relax}}
-
-\unexpanded\def\installdefinitionset#1#2%
- {\normalexpanded
- {\mult_interfaces_install_definition_set
- {\noexpand#1}% \??aa
- \expandafter\noexpand\csname set_#2_toks\endcsname
- \expandafter\noexpand\csname #2_nesting_depth\endcsname
- \expandafter\noexpand\csname push#2\endcsname
- \expandafter\noexpand\csname pop#2\endcsname
- \expandafter\noexpand\csname current#2\endcsname
- \expandafter\noexpand\csname use#2\endcsname}}
-
-\unexpanded\def\mult_interfaces_install_definition_set_member#1#2#3#4#5#6#7#8#9% no everysetups etc
- {\let#5#2%
- \unexpanded\def#2%
- {\ifcase#4\relax\expandafter#5\else\expandafter#6\fi}%
- \unexpanded\def#6%
- {\dodoubleempty#7}%
- \unexpanded\def#7[##1][##2]%
- {\ifsecondargument
- %#3\c_mult_set\expandafter{\the\c_mult_set#9[##1][##2]}%
- #3\toksapp\c_mult_set{#9[##1][##2]}%
- \orelse\iffirstargument
- %#3\c_mult_set\expandafter{\the\c_mult_set#8[##1]}%
- #3\toksapp\c_mult_set{#8[##1]}%
- \fi}}
-
-\unexpanded\def\installdefinitionsetmember#1#2#3#4%
- {\normalexpanded
- {\mult_interfaces_install_definition_set_member
- {\noexpand#3}% \??aa
- \expandafter\noexpand\csname setup#4\endcsname
- \expandafter\noexpand\csname set_#2_toks\endcsname
- \expandafter\noexpand\csname #2_nesting_depth\endcsname
- \expandafter\noexpand\csname normal_setup_#4\endcsname
- \expandafter\noexpand\csname delayed_setup_#4\endcsname
- \expandafter\noexpand\csname do_delayed_setup_#4\endcsname
- \expandafter\noexpand\csname setup#4_\s!single\endcsname
- \expandafter\noexpand\csname setup#4_\s!double\endcsname}}
-
-%D Another experiment:
-
-\unexpanded\def\mult_interfaces_install_parent_injector#1#2#3#4%
- {\unexpanded\def#4##1%
- {\ifx#3\empty
- \expandafter\def\csname#1#2:\s!parent\endcsname{#1##1}%
- \fi}}
-
-\unexpanded\def\installparentinjector#1#2%
- {\normalexpanded{\mult_interfaces_install_parent_injector
- {\noexpand#1}%
- \expandafter\noexpand\csname current#2\endcsname
- \expandafter\noexpand\csname current#2parent\endcsname
- \expandafter\noexpand\csname inject#2parent\endcsname}}
-
-% Faster but not used that much to make a dent in performance. But, because it's
-% cleaner anyway and also gives less tracing, we apply it a few times.
-
-\unexpanded\def\syst_helpers_install_macro_stack#1#2#3%
- {\xdef\m_syst_helpers_push_macro{\csstring#1}%
- \ifcsname#3\m_syst_helpers_push_macro\endcsname\else
- \expandafter\newcount\csname#3\m_syst_helpers_push_macro\endcsname
- \expandafter\edef\csname push_macro_\m_syst_helpers_push_macro\endcsname
- {\noexpand\expandafter\glet
- \noexpand\csname\m_syst_helpers_push_macro\noexpand\the\csname#3\m_syst_helpers_push_macro\endcsname\endcsname
- \noexpand#1%
- \global\advance\csname#3\m_syst_helpers_push_macro\endcsname\plusone}%
- \expandafter\edef\csname pop_macro_\m_syst_helpers_push_macro\endcsname
- {\global\advance\csname#3\m_syst_helpers_push_macro\endcsname\minusone
- \noexpand\expandafter#2%
- \noexpand\expandafter\noexpand#1%
- \noexpand\csname\m_syst_helpers_push_macro\noexpand\the\csname#3\m_syst_helpers_push_macro\endcsname\endcsname}%
- \fi}
-
-\unexpanded\def\installmacrostack #1{\syst_helpers_install_macro_stack#1\let \??localpushedmacro }
-\unexpanded\def\installglobalmacrostack#1{\syst_helpers_install_macro_stack#1\glet\??globalpushedmacro}
-
-% \unprotect
-%
-% \installcorenamespace {test} \installcommandhandler \??test {test} \??test
-% \unexpanded\def\TestMeA[#1]%
-% {\edef\currenttest{#1}
-% \edef\p_before{\testparameter\c!before}%
-% \ifx\p_before\empty \relax \else \relax \fi}
-% \unexpanded\def\TestMeB[#1]%
-% {\edef\currenttest{#1}
-% \doifelsenothing{\testparameter\c!before}\relax\relax}
-% \unexpanded\def\TestMeC[#1]%
-% {\edef\currenttest{#1}
-% \expandafter\expandafter\expandafter\ifx\testparameter\c!before\empty \relax \else \relax \fi}
-% \unexpanded\def\TestMeD[#1]%
-% {\edef\currenttest{#1}
-% \doubleexpandafter\ifx\testparameter\c!before\empty \relax \else \relax \fi}
-%
-% \protect
-%
-% \starttext
-% \definetest[foo] \definetest[bar][foo] \setuptest[bar][before=indeed]
-% \testfeatureonce{100000}{\TestMeA[bar]} A:\elapsedtime \par % 0.502
-% \testfeatureonce{100000}{\TestMeB[bar]} B:\elapsedtime \par % 0.530
-% \testfeatureonce{100000}{\TestMeC[bar]} C:\elapsedtime \par % 0.487
-% \testfeatureonce{100000}{\TestMeD[bar]} D:\elapsedtime \par % 0.493
-% \stoptext
-
-% There is no real demand for this ... even if this is two to three times as fast we
-% only gain a few milliseconds:
-%
-% \starttyping
-% \unexpanded\def\foo#1{[foo:#1]}
-%
-% \installcommalistprocessor {foo} \foo
-% \installcommalistprocessorcommand \processfoolist \foo
-%
-% \infofont
-%
-% \commalistprocessor{foo}[a,b,c,{x,y,z},d]\par
-% \processfoolist[a, b, c, {x,y,z}, d]\par
-% \processcommalist[{x,y,z}]\foo\blank
-%
-% \commalistprocessor{foo}[{x,y,z},a]\par
-% \commalistprocessor{foo}[{x,y,z}]\par
-% \processfoolist[{x,y,z},a]\par
-% \processfoolist[{x,y,z}]\par
-% \processcommalist[{x,y,z}]\foo\blank
-%
-% \unexpanded\def\foo#1{}
-%
-% \testfeatureonce{400000}{\processfoolist [fixed,middle,bar]} \elapsedtime\quad
-%%\testfeatureonce{400000}{\commalistprocessor{foo}[fixed,middle,bar]} \elapsedtime\quad
-% \testfeatureonce{400000}{\processcommalist [fixed,middle,bar]\foo} \elapsedtime\quad
-% \stoptyping
-%
-% For instance the luatex manual only has some 3000 calls. But I keep this around as one
-% never knows when we might need it.
-
-\installcorenamespace{commalistprocessor}
-\installcorenamespace{commalistprocessorwrap}
-\installcorenamespace{commalistprocessorfirst}
-\installcorenamespace{commalistprocessornext}
-\installcorenamespace{commalistprocessoraction}
-
-\unexpanded\def\installcommalistprocessor#1#2% 5 macro names overhead
- {\unexpanded\expandafter\edef\csname\??commalistprocessor#1\endcsname[%
- % {\noexpand\futureexpandis]%
- % \noexpand\gobbleoneargument
- % \csname\??commalistprocessorpickup#1\endcsname}
- %\unexpanded\expandafter\edef\csname\??commalistprocessorpickup#1\endcsname
- {\csname\??commalistprocessorwrap#1\endcsname\relax}% \relax preserves {}
- \unexpanded\expandafter\edef\csname\??commalistprocessorwrap#1\endcsname##1]%
- {\csname\??commalistprocessorfirst#1\endcsname##1,]}
- \unexpanded\expandafter\edef\csname\??commalistprocessorfirst#1\endcsname\relax
- {\csname\??commalistprocessornext#1\endcsname}%
- \unexpanded\expandafter\edef\csname\??commalistprocessornext#1\endcsname
- {\noexpand\futureexpandis]%
- \noexpand\gobbleoneargument
- \csname\??commalistprocessoraction#1\endcsname}
- \unexpanded\expandafter\edef\csname\??commalistprocessoraction#1\endcsname##1,%
- {\noexpand#2{##1}%
- \csname\??commalistprocessornext#1\endcsname}}
-
-\unexpanded\def\installcommalistprocessorcommand#1#2% \processor \action
- {\edef\p_name{\csstring#2}%
- \installcommalistprocessor\p_name{#2}%
- \expandafter\let\expandafter#1\csname\??commalistprocessor\p_name\endcsname}
-
-\unexpanded\def\commalistprocessor#1{\csname\??commalistprocessor#1\endcsname}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mult-chk.mkiv b/Master/texmf-dist/tex/context/base/mkiv/mult-chk.mkiv
index 83b82242e67..529ab2308ab 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mult-chk.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/mult-chk.mkiv
@@ -35,8 +35,8 @@
\registerctxluafile{mult-chk}{}
-\unexpanded\def\setvalidparameterkeys{\dodoubleargument\mult_checkers_set_valid_parameter_keys}
-\unexpanded\def\addvalidparameterkeys{\dodoubleargument\mult_checkers_add_valid_parameter_keys}
+\protected\def\setvalidparameterkeys{\dodoubleargument\mult_checkers_set_valid_parameter_keys}
+\protected\def\addvalidparameterkeys{\dodoubleargument\mult_checkers_add_valid_parameter_keys}
\def\mult_checkers_set_valid_parameter_keys[#1][#2]{\clf_setvalidinterfacekeys{#1}{#2}}
\def\mult_checkers_add_valid_parameter_keys[#1][#2]{\clf_addvalidinterfacekeys{#1}{#2}}
@@ -64,8 +64,8 @@
{\def\syst_helpers_get_parameters_assign{\syst_helpers_get_parameters_assign_indeed#1}% will change
\syst_helpers_process_comma_item#2,],^^^^0004}
-\unexpanded\def\disablecheckparameters{\let\getcheckedparameters\mult_checkers_get_checked_parameters_nop}
-\unexpanded\def\enablecheckparameters {\let\getcheckedparameters\mult_checkers_get_checked_parameters_yes}
+\protected\def\disablecheckparameters{\let\getcheckedparameters\mult_checkers_get_checked_parameters_nop}
+\protected\def\enablecheckparameters {\let\getcheckedparameters\mult_checkers_get_checked_parameters_yes}
\disablecheckparameters
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mult-def.lua b/Master/texmf-dist/tex/context/base/mkiv/mult-def.lua
index 1e22aaa865c..0f2ef419c17 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mult-def.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/mult-def.lua
@@ -11,16 +11,16 @@ if not modules then modules = { } end modules ['mult-def'] = {
return {
["commands"]={
- ["CAPPED"]={
- ["cs"]="KAP",
- ["de"]="KAP",
- ["en"]="CAP",
- ["fr"]="CAP",
- ["it"]="CAP",
- ["nl"]="KAP",
- ["pe"]="CAP",
- ["ro"]="KAP",
- },
+--["CAPPED"]={
+-- ["cs"]="KAP",
+-- ["de"]="KAP",
+-- ["en"]="CAP",
+-- ["fr"]="CAP",
+-- ["it"]="CAP",
+-- ["nl"]="KAP",
+-- ["pe"]="CAP",
+-- ["ro"]="KAP",
+--},
["Character"]={
["cs"]="Znak",
["de"]="Buchstabe",
@@ -75,7 +75,7 @@ return {
["cs"]="Kap",
["de"]="Kap",
["en"]="Cap",
- ["fr"]="Cap",
+ ["fr"]="PetitesCap",
["it"]="Cap",
["nl"]="Kap",
["pe"]="Cap",
@@ -85,7 +85,7 @@ return {
["cs"]="Kaps",
["de"]="Kaps",
["en"]="Caps",
- ["fr"]="Caps",
+ ["fr"]="PetitesCaps",
["it"]="Caps",
["nl"]="Kaps",
["pe"]="Caps",
@@ -145,23 +145,67 @@ return {
["cs"]="oref",
["de"]="ueber",
["en"]="about",
- ["fr"]="concernant",
+ ["fr"]="apropos",
["it"]="intorno",
["nl"]="about",
["pe"]="درمورد",
["ro"]="despre",
},
+ ["adaptfontfeature"]={
+ ["en"]="adaptfontfeature",
+ ["fr"]="adapterfonctionnalitepolice",
+ },
["adaptlayout"]={
["cs"]="prizpusobvzhled",
["de"]="passelayoutan",
["en"]="adaptlayout",
- ["fr"]="adaptedisposition",
+ ["fr"]="adaptermiseenpage",
["it"]="adattalayout",
["nl"]="paslayoutaan",
["pe"]="تنظیم‌طرح‌بندی",
["ro"]="adapteazaaspect",
},
- ["adding"]={},
+ ["addfeature"]={
+ ["en"]="addfeature",
+ ["fr"]="ajouterfonctionnalite",
+ },
+ ["alignbottom"]={
+ ["en"]="alignbottom",
+ ["fr"]="alignerbas",
+ },
+ ["aligned"]={
+ ["en"]="aligned",
+ ["fr"]="aligne",
+ },
+ ["alignedbox"]={
+ ["en"]="alignedbox",
+ ["fr"]="boitealignee",
+ },
+ ["alignedline"]={
+ ["en"]="alignedline",
+ ["fr"]="lignealignee",
+ },
+ ["alignhere"]={
+ ["en"]="alignhere",
+ ["fr"]="alignerici",
+ },
+ ["alignment"]={
+ ["en"]="alignment",
+ ["fr"]="alignement",
+ ["nl"]="uitlijnen",
+ },
+ ["alignmentcharacter"]={
+ ["en"]="alignmentcharacter",
+ ["fr"]="caracterealignement",
+ },
+ ["applytocharacters"]={
+ ["en"]="applytocharacters",
+ ["fr"]="appliquerauxcaracteres",
+ },
+ ["applytofirstcharacter"]={
+ ["en"]="applytofirstcharacter",
+ ["fr"]="appliqueraupremiercaractere",
+ },
["arg"]={
["cs"]="arg",
["de"]="arg",
@@ -176,7 +220,7 @@ return {
["cs"]="pref",
["de"]="bei",
["en"]="at",
- ["fr"]="a",
+ ["fr"]="en",
["it"]="al",
["nl"]="op",
["pe"]="در",
@@ -186,7 +230,7 @@ return {
["cs"]="atleftmargin",
["de"]="atleftmargin",
["en"]="atleftmargin",
- ["fr"]="atleftmargin",
+ ["fr"]="enmargegauche",
["it"]="atleftmargin",
["nl"]="oplinkermarge",
["pe"]="درحاشیه‌چپ",
@@ -196,7 +240,7 @@ return {
["cs"]="nastrane",
["de"]="aufseite",
["en"]="atpage",
- ["fr"]="alapage",
+ ["fr"]="enpage",
["it"]="apagina",
["nl"]="oppagina",
["pe"]="درصفحه",
@@ -206,7 +250,7 @@ return {
["cs"]="atrightmargin",
["de"]="atrightmargin",
["en"]="atrightmargin",
- ["fr"]="atrightmargin",
+ ["fr"]="enmargedroite",
["it"]="atrightmargin",
["nl"]="oprechtermarge",
["pe"]="درحاشیه‌راست",
@@ -226,7 +270,7 @@ return {
["cs"]="odsazenizleva",
["de"]="rumpfweite",
["en"]="backspace",
- ["fr"]="retourarriere",
+ ["fr"]="retourarrière",
["it"]="spaziodietro",
["nl"]="rugwit",
["pe"]="فاصله‌پشت",
@@ -236,7 +280,7 @@ return {
["cs"]="cernalinka",
["de"]="rechteck",
["en"]="blackrule",
- ["fr"]="lignenoire",
+ ["fr"]="traitepais",
["it"]="lineanera",
["nl"]="blokje",
["pe"]="خط‌سیاه",
@@ -246,7 +290,7 @@ return {
["cs"]="cernelinky",
["de"]="rechtecke",
["en"]="blackrules",
- ["fr"]="lignesnoires",
+ ["fr"]="traitsepais",
["it"]="lineenere",
["nl"]="blokjes",
["pe"]="خطهای‌سیاه",
@@ -256,7 +300,7 @@ return {
["cs"]="preskoc",
["de"]="blanko",
["en"]="blank",
- ["fr"]="vide",
+ ["fr"]="vierge",
["it"]="rigovuoto",
["nl"]="blanko",
["pe"]="خالی",
@@ -272,11 +316,15 @@ return {
["pe"]="چوبخط",
["ro"]="semncarte",
},
+ ["bottombox"]={
+ ["en"]="bottombox",
+ ["fr"]="boitebas",
+ },
["bottomdistance"]={
["cs"]="vzdalenostspodku",
["de"]="abstandunten",
["en"]="bottomdistance",
- ["fr"]="distanceinf",
+ ["fr"]="distancebas",
["it"]="distanzafondo",
["nl"]="onderafstand",
["pe"]="فاصله‌پایین",
@@ -286,27 +334,39 @@ return {
["cs"]="vyskaspodku",
["de"]="hoeheunten",
["en"]="bottomheight",
- ["fr"]="hauteurinf",
+ ["fr"]="hauteurbas",
["it"]="altezzafondo",
["nl"]="onderhoogte",
["pe"]="ارتفاع‌پایین",
["ro"]="inaltimejos",
},
+ ["bottomleftbox"]={
+ ["en"]="bottomleftbox",
+ ["fr"]="basgaucheboite",
+ },
+ ["bottomrightbox"]={
+ ["en"]="bottomrightbox",
+ ["fr"]="boitebasdroite",
+ },
["bottomspace"]={
["cs"]="bottomspace",
["de"]="bottomspace",
["en"]="bottomspace",
- ["fr"]="espaceinf",
+ ["fr"]="espacebas",
["it"]="spaziofondo",
["nl"]="bodemwit",
["pe"]="فضای‌پایین",
["ro"]="spatiujos",
},
+ ["buildtextbottomdot"]={
+ ["en"]="buildtextbottomdot",
+ ["fr"]="construirepointtextebas",
+ },
["but"]={
["cs"]="spodek",
["de"]="but",
["en"]="but",
- ["fr"]="but",
+ ["fr"]="mais",
["it"]="fondo",
["nl"]="but",
["pe"]="اما",
@@ -326,7 +386,7 @@ return {
["cs"]="bypassblocks",
["de"]="bypassblocks",
["en"]="bypassblocks",
- ["fr"]="sauteblocs",
+ ["fr"]="eviteblocs",
["it"]="saltablocchi",
["nl"]="passeerblokken",
["pe"]="عبوربلوکها",
@@ -366,7 +426,7 @@ return {
["cs"]="orez",
["de"]="ausschnitt",
["en"]="clip",
- ["fr"]="clip",
+ ["fr"]="decouper",
["it"]="clip",
["nl"]="clip",
["pe"]="گیره",
@@ -376,7 +436,7 @@ return {
["cs"]="klonujpole",
["de"]="klonierefeld",
["en"]="clonefield",
- ["fr"]="clonechamp",
+ ["fr"]="clonerchamp",
["it"]="clonacampo",
["nl"]="kloonveld",
["pe"]="میدان‌شبیه‌سازی",
@@ -426,7 +486,7 @@ return {
["cs"]="porovnejskupinubarev",
["de"]="vergleichefarbengruppe",
["en"]="comparecolorgroup",
- ["fr"]="comparegroupecouleur",
+ ["fr"]="comparergroupecouleur",
["it"]="confrontagruppocolori",
["nl"]="vergelijkkleurgroep",
["pe"]="مقایسه‌گروه‌رنگ",
@@ -436,7 +496,7 @@ return {
["cs"]="porovnejpaletu",
["de"]="vergleichepalette",
["en"]="comparepalet",
- ["fr"]="comparepalette",
+ ["fr"]="comparerpalette",
["it"]="confrontatavolozza",
["nl"]="vergelijkpalet",
["pe"]="لوح‌مقایسه",
@@ -446,7 +506,7 @@ return {
["cs"]="completepagenumber",
["de"]="completepagenumber",
["en"]="completepagenumber",
- ["fr"]="completenumeropage",
+ ["fr"]="numeropagecomplet",
["it"]="numeropaginacompleto",
["nl"]="volledigepaginanummer",
["pe"]="شماره‌صفحه‌کامل",
@@ -456,7 +516,7 @@ return {
["cs"]="completeregister",
["de"]="completeregister",
["en"]="completeregister",
- ["fr"]="completeregistre",
+ ["fr"]="registrecomplet",
["it"]="completeregister",
["nl"]="volledigregister",
["pe"]="ثبت‌کامل",
@@ -476,7 +536,7 @@ return {
["cs"]="konvertujcislo",
["de"]="konvertierezahl",
["en"]="convertnumber",
- ["fr"]="convertitnumero",
+ ["fr"]="convertirnumero",
["it"]="convertinumero",
["nl"]="converteernummer",
["pe"]="شماره‌مبدل",
@@ -486,7 +546,7 @@ return {
["cs"]="kopirujpole",
["de"]="kopierefeld",
["en"]="copyfield",
- ["fr"]="copitchamp",
+ ["fr"]="copierchamp",
["it"]="copiacampo",
["nl"]="copieerveld",
["pe"]="میدان‌کپی",
@@ -496,7 +556,7 @@ return {
["cs"]="korekcebilehomista",
["de"]="korrigierezwischenraum",
["en"]="correctwhitespace",
- ["fr"]="corrigeespaceblanc",
+ ["fr"]="corrigerespaceblanc",
["it"]="correggispaziobianco",
["nl"]="corrigeerwitruimte",
["pe"]="فضای‌سفیدصحیح",
@@ -526,7 +586,7 @@ return {
["cs"]="parovastrana",
["de"]="doppelseite",
["en"]="couplepage",
- ["fr"]="pagedouble",
+ ["fr"]="couplepage",
["it"]="accoppiapagina",
["nl"]="koppelpagina",
["pe"]="صفحه‌زوج",
@@ -576,7 +636,7 @@ return {
["cs"]="aktualnicislonadpisu",
["de"]="heutigeskopfnummer",
["en"]="currentheadnumber",
- ["fr"]="numerotetecourant",
+ ["fr"]="numerotetecourante",
["it"]="numerotestacorrente",
["nl"]="huidigekopnummer",
["pe"]="شماره‌سرجاری",
@@ -586,7 +646,7 @@ return {
["cs"]="cutspace",
["de"]="cutspace",
["en"]="cutspace",
- ["fr"]="cutspace",
+ ["fr"]="espacecoupe",
["it"]="cutspace",
["nl"]="snijwit",
["pe"]="فضای‌برش",
@@ -626,7 +686,7 @@ return {
["cs"]="definuj",
["de"]="definieren",
["en"]="define",
- ["fr"]="definit",
+ ["fr"]="définir",
["it"]="definisci",
["nl"]="definieer",
["pe"]="تعریف",
@@ -636,7 +696,7 @@ return {
["cs"]="definujakcent",
["de"]="definiereakzent",
["en"]="defineaccent",
- ["fr"]="definitaccent",
+ ["fr"]="définiraccent",
["it"]="definisciaccento",
["nl"]="definieeraccent",
["pe"]="تعریف‌لهجه",
@@ -646,7 +706,7 @@ return {
["cs"]="definujpreskok",
["de"]="definiereblanko",
["en"]="defineblank",
- ["fr"]="definitvide",
+ ["fr"]="définirvierge",
["it"]="definiscirigovuoto",
["nl"]="definieerblanko",
["pe"]="تعریف‌خالی",
@@ -656,7 +716,7 @@ return {
["cs"]="definujblok",
["de"]="definiereblock",
["en"]="defineblock",
- ["fr"]="definitbloc",
+ ["fr"]="définirbloc",
["it"]="definisciblocco",
["nl"]="definieerblok",
["pe"]="تعریف‌بلوک",
@@ -666,7 +726,7 @@ return {
["cs"]="definujzakladnifont",
["de"]="definierefliesstext",
["en"]="definebodyfont",
- ["fr"]="definitpolicecorps",
+ ["fr"]="définirpolicedecorps",
["it"]="definiscifontdeltesto",
["nl"]="definieerkorps",
["pe"]="تعریف‌قلم‌متن",
@@ -676,17 +736,21 @@ return {
["cs"]="definujprostredizakladnihofontu",
["de"]="definierefliesstextumgebung",
["en"]="definebodyfontenvironment",
- ["fr"]="definitenvironnementpolicecorps",
+ ["fr"]="définirenvironnementpolicedecorps",
["it"]="definisciambientefontdeltesto",
["nl"]="definieerkorpsomgeving",
["pe"]="تعریف‌محیط‌قلم‌بدنه",
["ro"]="definestemediulfonttext",
},
+ ["definebodyfontswitch"]={
+ ["en"]="definebodyfontswitch",
+ ["fr"]="définircommutateurpolicedecorps",
+ },
["definebuffer"]={
["cs"]="definujbuffer",
["de"]="definierepuffer",
["en"]="definebuffer",
- ["fr"]="definitbuffer",
+ ["fr"]="définirtampon",
["it"]="definiscibuffer",
["nl"]="definieerbuffer",
["pe"]="تعریف‌بافر",
@@ -696,17 +760,25 @@ return {
["cs"]="definujznak",
["de"]="definierezeichen",
["en"]="definecharacter",
- ["fr"]="definicaractere",
+ ["fr"]="définircaractere",
["it"]="definiscicarattere",
["nl"]="definieerkarakter",
["pe"]="تعریف‌حرف",
["ro"]="definestecaracter",
},
+ ["definecharacterkerning"]={
+ ["en"]="definecharacterkerning",
+ ["fr"]="définirapprochecaracteres",
+ },
+ ["definecharacterspacing"]={
+ ["en"]="definecharacterspacing",
+ ["fr"]="définirespacementcaracteres",
+ },
["definecolor"]={
["cs"]="definujbarvu",
["de"]="definierefarbe",
["en"]="definecolor",
- ["fr"]="definitcouleur",
+ ["fr"]="définircouleur",
["it"]="definiscicolore",
["nl"]="definieerkleur",
["pe"]="تعریف‌رنگ",
@@ -716,7 +788,7 @@ return {
["cs"]="definujskupinubarev",
["de"]="definierefarbengruppe",
["en"]="definecolorgroup",
- ["fr"]="definitgroupecouleur",
+ ["fr"]="définirgroupecouleur",
["it"]="definiscigruppocolori",
["nl"]="definieerkleurgroep",
["pe"]="تعریف‌گروه‌رنگ",
@@ -726,7 +798,7 @@ return {
["cs"]="definecolumnbreak",
["de"]="definecolumnbreak",
["en"]="definecolumnbreak",
- ["fr"]="definitsautdecolonne",
+ ["fr"]="définirsautdecolonne",
["it"]="definecolumnbreak",
["nl"]="definieerkolomovergang",
["pe"]="تعریف‌شکستن‌ستون",
@@ -736,7 +808,7 @@ return {
["cs"]="definecolumnset",
["de"]="definecolumnset",
["en"]="definecolumnset",
- ["fr"]="definitjeucolonne",
+ ["fr"]="définirjeucolonnes",
["it"]="definiscigruppocolonne",
["nl"]="definieerkolomgroep",
["pe"]="تعریف‌مجموعه‌ستون",
@@ -746,7 +818,7 @@ return {
["cs"]="definecombination",
["de"]="definecombination",
["en"]="definecombination",
- ["fr"]="definecombination",
+ ["fr"]="définircombinaison",
["it"]="definecombination",
["nl"]="definieercombinatie",
["pe"]="تعریف‌ترکیب",
@@ -756,7 +828,7 @@ return {
["cs"]="definujkombinovanyseznam",
["de"]="definierezusammengestellteliste",
["en"]="definecombinedlist",
- ["fr"]="definitlisteimbriquee",
+ ["fr"]="définirlistecombinee",
["it"]="definiscielencocombinato",
["nl"]="definieersamengesteldelijst",
["pe"]="تعریف‌لیست‌ترکیبی",
@@ -766,7 +838,7 @@ return {
["cs"]="definujprikaz",
["de"]="definierebefehl",
["en"]="definecommand",
- ["fr"]="definitcommande",
+ ["fr"]="définircommande",
["it"]="definiscicomando",
["nl"]="definieercommando",
["pe"]="تعریف‌فرمان",
@@ -776,7 +848,7 @@ return {
["cs"]="definujkonverzi",
["de"]="definierekonversion",
["en"]="defineconversion",
- ["fr"]="definitconversion",
+ ["fr"]="définirconversion",
["it"]="definisciconversione",
["nl"]="definieerconversie",
["pe"]="تعریف‌تبدیل",
@@ -786,27 +858,35 @@ return {
["cs"]="definujpopis",
["de"]="definierebeschreibung",
["en"]="definedescription",
- ["fr"]="definitdescription",
+ ["fr"]="définirdescription",
["it"]="definiscidescrizione",
["nl"]="doordefinieren",
["pe"]="تعریف‌شرح",
["ro"]="definestedescriere",
},
+ ["definedfont"]={
+ ["en"]="definedfont",
+ ["fr"]="policedefinie",
+ },
["defineenumeration"]={
["cs"]="definujvycet",
["de"]="definierenummerierung",
["en"]="defineenumeration",
- ["fr"]="definitenumeration",
+ ["fr"]="définirénumération",
["it"]="definiscienumerazione",
["nl"]="doornummeren",
["pe"]="تعریف‌شماره‌بندی",
["ro"]="definesteenumerare",
},
+ ["definefallbackfamily"]={
+ ["en"]="definefallbackfamily",
+ ["fr"]="définirfamillederepli",
+ },
["definefield"]={
["cs"]="definujpole",
["de"]="definierefeld",
["en"]="definefield",
- ["fr"]="definitchamp",
+ ["fr"]="définirchamp",
["it"]="definiscicampo",
["nl"]="definieerveld",
["pe"]="تعریف‌میدان",
@@ -816,7 +896,7 @@ return {
["cs"]="definujzasobnikpoli",
["de"]="definierefeldstapel",
["en"]="definefieldstack",
- ["fr"]="definitpilechamp",
+ ["fr"]="définirpilechamp",
["it"]="definiscistackcampi",
["nl"]="definieerveldstapel",
["pe"]="تعریف‌توده‌میدان",
@@ -826,17 +906,25 @@ return {
["cs"]="definujobrazeksymbol",
["de"]="definiereabbsymbol",
["en"]="definefiguresymbol",
- ["fr"]="definitsymbolefigure",
+ ["fr"]="définirfiguresymbole",
["it"]="definiscifigurasimbolo",
["nl"]="definieerfiguursymbool",
["pe"]="تعریف‌نمادشکل",
["ro"]="definestesimbolfigura",
},
+ ["definefilefallback"]={
+ ["en"]="definefilefallback",
+ ["fr"]="définirfichierderepli",
+ },
+ ["definefirstline"]={
+ ["en"]="definefirstline",
+ ["fr"]="définirpremiereligne",
+ },
["definefloat"]={
["cs"]="definujplvouciobjekt",
["de"]="definieregleitobjekt",
["en"]="definefloat",
- ["fr"]="definitflottant",
+ ["fr"]="définirflottant",
["it"]="definiscioggettomobile",
["nl"]="definieerplaatsblok",
["pe"]="تعریف‌شناور",
@@ -846,17 +934,49 @@ return {
["cs"]="definujfont",
["de"]="definiereschrift",
["en"]="definefont",
- ["fr"]="definitpolice",
+ ["fr"]="définirpolice",
["it"]="definiscifont",
["nl"]="definieerfont",
["pe"]="تعریف‌قلم",
["ro"]="definestefont",
},
+ ["definefontalternative"]={
+ ["en"]="definefontalternative",
+ ["fr"]="définirvariantepolice",
+ },
+ ["definefontfallback"]={
+ ["en"]="definefontfallback",
+ ["fr"]="définirpolicederepli",
+ },
+ ["definefontfamily"]={
+ ["en"]="definefontfamily",
+ ["fr"]="définirfamillepolice",
+ },
+ ["definefontfamilypreset"]={
+ ["en"]="definefontfamilypreset",
+ ["fr"]="définirprereglagefamillepolice",
+ },
+ ["definefontfeature"]={
+ ["en"]="definefontfeature",
+ ["fr"]="définirfonctionnalitepolice",
+ },
+ ["definefontfile"]={
+ ["en"]="definefontfile",
+ ["fr"]="définirfichierpolice",
+ },
+ ["definefontsize"]={
+ ["en"]="definefontsize",
+ ["fr"]="définirtaillepolice",
+ },
+ ["definefontsolution"]={
+ ["en"]="definefontsolution",
+ ["fr"]="définirsolutionpolice",
+ },
["definefontstyle"]={
["cs"]="definujstylfontu",
["de"]="definiereschriftstil",
["en"]="definefontstyle",
- ["fr"]="definitstylepolice",
+ ["fr"]="définirstylepolice",
["it"]="definiscistilefont",
["nl"]="definieerfontstijl",
["pe"]="تعریف‌سبک‌قلم",
@@ -866,7 +986,7 @@ return {
["cs"]="definujsynonumumfontu",
["de"]="defineschriftsynonym",
["en"]="definefontsynonym",
- ["fr"]="definitsynonymepolice",
+ ["fr"]="définirsynonymepolice",
["it"]="definiscisinonimofont",
["nl"]="definieerfontsynoniem",
["pe"]="تعریف‌مترادف‌قلم",
@@ -876,7 +996,7 @@ return {
["cs"]="definujoramovani",
["de"]="definiereumrahmt",
["en"]="defineframed",
- ["fr"]="defineframed",
+ ["fr"]="définirencadre",
["it"]="definisciincorniciato",
["nl"]="definieeromlijnd",
["pe"]="تعریف‌قالبی",
@@ -886,17 +1006,21 @@ return {
["cs"]="definujoramovanytext",
["de"]="definiereumrahmtertext",
["en"]="defineframedtext",
- ["fr"]="defineframedtext",
+ ["fr"]="définirtexteencadre",
["it"]="definiscitestoincorniciato",
["nl"]="definieerkadertekst",
["pe"]="تعریف‌متن‌قالبی",
["ro"]="definestetextinconjurat",
},
+ ["definefrozenfont"]={
+ ["en"]="definefrozenfont",
+ ["fr"]="définirpolicegelee",
+ },
["definehbox"]={
["cs"]="definujhbox",
["de"]="definierehbox",
["en"]="definehbox",
- ["fr"]="definithbox",
+ ["fr"]="définirhbox",
["it"]="definiscihbox",
["nl"]="definieerhbox",
["pe"]="تعریف‌جعبه‌‌افقی",
@@ -906,21 +1030,26 @@ return {
["cs"]="definujnadpis",
["de"]="definiereueberschrift",
["en"]="definehead",
- ["fr"]="definittete",
+ ["fr"]="définirtete",
["it"]="definiscitesta",
["nl"]="definieerkop",
["pe"]="تعریف‌سر",
["ro"]="definesteantet",
},
+ ["definehyphenationfeatures"]={
+ ["en"]="definehyphenationfeatures",
+ ["fr"]="définirfonctionnalitescesure",
+ },
["defineindentedtext"]={
["en"]="defineindentedtext",
+ ["fr"]="définirtexteindente",
["nl"]="definieeringesprongentext",
},
["defineinmargin"]={
["cs"]="defineinmargin",
["de"]="defineinmargin",
["en"]="defineinmargin",
- ["fr"]="definitdansmarge",
+ ["fr"]="définirdansmarge",
["it"]="defineinmargin",
["nl"]="definieerinmarge",
["pe"]="تعریف‌درون‌حاشیه",
@@ -930,7 +1059,7 @@ return {
["cs"]="definujinterakcnimenu",
["de"]="definiereinteraktionsmenue",
["en"]="defineinteractionmenu",
- ["fr"]="definitmenuinteraction",
+ ["fr"]="définirmenuinteraction",
["it"]="definiscimenuinterazione",
["nl"]="definieerinteractiemenu",
["pe"]="تعریف‌منوی‌پانل",
@@ -940,17 +1069,21 @@ return {
["cs"]="defineitemgroup",
["de"]="defineitemgroup",
["en"]="defineitemgroup",
- ["fr"]="defineitemgroup",
+ ["fr"]="définirgroupedéléments",
["it"]="defineitemgroup",
["nl"]="definieeritemgroep",
["pe"]="تعریف‌گروه‌آیتم",
["ro"]="defineitemgroup",
},
+ ["defineitems"]={
+ ["en"]="defineitems",
+ ["fr"]="définiréléments",
+ },
["definelabel"]={
["cs"]="definujpopisek",
["de"]="definierelabel",
["en"]="definelabel",
- ["fr"]="definitetiquette",
+ ["fr"]="définiretiquette",
["it"]="definiscietichetta",
["nl"]="doorlabelen",
["pe"]="تعریف‌برچسب",
@@ -960,7 +1093,7 @@ return {
["cs"]="definelayer",
["de"]="definelayer",
["en"]="definelayer",
- ["fr"]="definitcalque",
+ ["fr"]="définircalque",
["it"]="definelayer",
["nl"]="definieerlayer",
["pe"]="تعریف‌لایه",
@@ -970,17 +1103,21 @@ return {
["cs"]="definelayout",
["de"]="definelayout",
["en"]="definelayout",
- ["fr"]="definitdisposition",
+ ["fr"]="définirmiseenpage",
["it"]="definiscilayout",
["nl"]="definieerlayout",
["pe"]="تعریف‌طرح‌بندی",
["ro"]="definelayout",
},
+ ["definelinenote"]={
+ ["en"]="definelinenote",
+ ["fr"]="définirnotedeligne",
+ },
["definelist"]={
["cs"]="definujseznam",
["de"]="definiereliste",
["en"]="definelist",
- ["fr"]="definitliste",
+ ["fr"]="définirliste",
["it"]="definiscielenco",
["nl"]="definieerlijst",
["pe"]="تعریف‌لیست",
@@ -990,7 +1127,7 @@ return {
["cs"]="definujlogo",
["de"]="definierelogo",
["en"]="definelogo",
- ["fr"]="definitlogo",
+ ["fr"]="définirlogo",
["it"]="definiscilogo",
["nl"]="definieerbeeldmerk",
["pe"]="تعریف‌آرم",
@@ -1000,7 +1137,7 @@ return {
["cs"]="definujhlavnipole",
["de"]="definierehauptfeld",
["en"]="definemainfield",
- ["fr"]="definitchampprincipal",
+ ["fr"]="définirchampprincipal",
["it"]="definiscicampoprincipale",
["nl"]="definieerhoofdveld",
["pe"]="تعریف‌میدان‌اصلی",
@@ -1010,7 +1147,7 @@ return {
["cs"]="definujupravu",
["de"]="definiereumbruch",
["en"]="definemakeup",
- ["fr"]="definitmakeup",
+ ["fr"]="définircomposition",
["it"]="definiscimakeup",
["nl"]="definieeropmaak",
["pe"]="تعریف‌آرایش",
@@ -1020,7 +1157,7 @@ return {
["cs"]="definujznaceni",
["de"]="definierebeschriftung",
["en"]="definemarking",
- ["fr"]="definitmarquage",
+ ["fr"]="définirmarquage",
["it"]="definiscimarcatura",
["nl"]="definieermarkering",
["pe"]="تعریف‌نشانه‌گذاری",
@@ -1030,17 +1167,29 @@ return {
["cs"]="definemathalignment",
["de"]="definemathalignment",
["en"]="definemathalignment",
- ["fr"]="definemathalignment",
+ ["fr"]="définiralignementmath",
["it"]="definemathalignment",
["nl"]="definieerwiskundeuitlijnen",
["pe"]="تعریف‌تنظیم‌ریاضی",
["ro"]="definemathalignment",
},
+ ["definemode"]={
+ ["en"]="definemode",
+ ["fr"]="définirmode",
+ },
+ ["definenamedcolor"]={
+ ["en"]="definenamedcolor",
+ ["fr"]="définircouleurnommee",
+ },
+ ["definenote"]={
+ ["en"]="definenote",
+ ["fr"]="définirnote",
+ },
["defineoutput"]={
["cs"]="definujvystup",
["de"]="defineoutput",
["en"]="defineoutput",
- ["fr"]="definitsortie",
+ ["fr"]="définirsortie",
["it"]="definiscioutput",
["nl"]="definieeruitvoer",
["pe"]="تعریف‌خروجی",
@@ -1050,7 +1199,7 @@ return {
["cs"]="definujprekryv",
["de"]="definiereoverlay",
["en"]="defineoverlay",
- ["fr"]="definitrevetement",
+ ["fr"]="définirsuperposition",
["it"]="definiscisovrapposizione",
["nl"]="definieeroverlay",
["pe"]="تعریف‌پوشش",
@@ -1060,7 +1209,7 @@ return {
["cs"]="definepagebreak",
["de"]="definepagebreak",
["en"]="definepagebreak",
- ["fr"]="definitsautdepage",
+ ["fr"]="définirsautdepage",
["it"]="definepagebreak",
["nl"]="definieerpaginaovergang",
["pe"]="تعریف‌شکست‌صفحه",
@@ -1070,7 +1219,7 @@ return {
["cs"]="definujpaletu",
["de"]="definierepalette",
["en"]="definepalet",
- ["fr"]="definitpalette",
+ ["fr"]="définirpalette",
["it"]="definiscitavolozza",
["nl"]="definieerpalet",
["pe"]="تعریف‌لوح",
@@ -1080,7 +1229,7 @@ return {
["cs"]="definujvelikostpapiru",
["de"]="definierepapierformat",
["en"]="definepapersize",
- ["fr"]="definittaillepapier",
+ ["fr"]="définirtaillepapier",
["it"]="definiscidimensionicarta",
["nl"]="definieerpapierformaat",
["pe"]="تعریف‌اندازه‌برگ",
@@ -1090,17 +1239,21 @@ return {
["cs"]="definujodstavce",
["de"]="definiereabsaetze",
["en"]="defineparagraphs",
- ["fr"]="definitparagraphes",
+ ["fr"]="définirparagraphes",
["it"]="definiscicapoversi",
["nl"]="definieeralineas",
["pe"]="تعریف‌پاراگرافها",
["ro"]="definesteparagraf",
},
+ ["defineperiodkerning"]={
+ ["en"]="defineperiodkerning",
+ ["fr"]="reglerapprochepoint",
+ },
["defineplacement"]={
["cs"]="defineplacement",
["de"]="defineplacement",
["en"]="defineplacement",
- ["fr"]="defineplacement",
+ ["fr"]="définirplacement",
["it"]="defineplacement",
["nl"]="definieerplaats",
["pe"]="تعریف‌جانشانی",
@@ -1110,7 +1263,7 @@ return {
["cs"]="definujprofil",
["de"]="definiereprofil",
["en"]="defineprofile",
- ["fr"]="definitprofil",
+ ["fr"]="définirprofil",
["it"]="definisciprofilo",
["nl"]="definieerprofiel",
["pe"]="تعریف‌پروفایل",
@@ -1120,7 +1273,7 @@ return {
["cs"]="definujprogram",
["de"]="definiereprogramme",
["en"]="defineprogram",
- ["fr"]="definitprogramme",
+ ["fr"]="définirprogramme",
["it"]="definisciprogramma",
["nl"]="definieerprogramma",
["pe"]="تعریف‌برنامه",
@@ -1130,7 +1283,7 @@ return {
["cs"]="definerawfont",
["de"]="definerawfont",
["en"]="definerawfont",
- ["fr"]="definitpolicebrute",
+ ["fr"]="définirpolicebrute",
["it"]="definiscifontgrezzo",
["nl"]="definerawfont",
["pe"]="تعریف‌قلم‌خام",
@@ -1140,7 +1293,7 @@ return {
["cs"]="definujodkaz",
["de"]="definierereferenz",
["en"]="definereference",
- ["fr"]="definitreference",
+ ["fr"]="définirreference",
["it"]="definisciriferimento",
["nl"]="definieerreferentie",
["pe"]="تعریف‌مرجع",
@@ -1150,7 +1303,7 @@ return {
["cs"]="definujformatodkazu",
["de"]="definierereferenzformat",
["en"]="definereferenceformat",
- ["fr"]="definitformatreference",
+ ["fr"]="définirformatrereference",
["it"]="definisciformatoriferimento",
["nl"]="definieerreferentieformaat",
["pe"]="تعریف‌شمایل‌مرجع",
@@ -1160,7 +1313,7 @@ return {
["cs"]="definujseznamodkazu",
["de"]="definierereferenzliste",
["en"]="definereferencelist",
- ["fr"]="definitlistereference",
+ ["fr"]="définirlistereference",
["it"]="definiscilistariferimenti",
["nl"]="definieerreferentielijst",
["pe"]="تعریف‌لیست‌مرجع",
@@ -1170,7 +1323,7 @@ return {
["cs"]="definujrejstrik",
["de"]="definiereregister",
["en"]="defineregister",
- ["fr"]="definitregistre",
+ ["fr"]="définirregistre",
["it"]="definisciregistro",
["nl"]="definieerregister",
["pe"]="تعریف‌ثبت",
@@ -1180,7 +1333,7 @@ return {
["cs"]="definerule",
["de"]="definerule",
["en"]="definerule",
- ["fr"]="definitregle",
+ ["fr"]="définirtrait",
["it"]="definiscilinea",
["nl"]="definieerlijn",
["pe"]="تعریف‌خط‌حائل",
@@ -1190,7 +1343,7 @@ return {
["cs"]="definujsekci",
["de"]="definiereabschnitt",
["en"]="definesection",
- ["fr"]="definitsection",
+ ["fr"]="définirsection",
["it"]="definiscisezione",
["nl"]="definieersectie",
["pe"]="تعریف‌بخش",
@@ -1200,7 +1353,7 @@ return {
["cs"]="definujbloksekce",
["de"]="definiereabschnittsblock",
["en"]="definesectionblock",
- ["fr"]="definitblocsection",
+ ["fr"]="définirblocsection",
["it"]="definiscibloccosezione",
["nl"]="definieersectieblok",
["pe"]="تعریف‌بلوک‌بخش",
@@ -1210,7 +1363,7 @@ return {
["cs"]="definujtrideni",
["de"]="definieresortieren",
["en"]="definesorting",
- ["fr"]="definittri",
+ ["fr"]="définirtri",
["it"]="definisciordinamento",
["nl"]="definieersorteren",
["pe"]="تعریف‌ترتیب",
@@ -1220,7 +1373,7 @@ return {
["cs"]="definujstartstop",
["de"]="definierestartstop",
["en"]="definestartstop",
- ["fr"]="definitdemarrestoppe",
+ ["fr"]="définirdébutfin",
["it"]="definisciiniziatermina",
["nl"]="definieerstartstop",
["pe"]="تعریف‌شروع‌پایان",
@@ -1230,7 +1383,7 @@ return {
["cs"]="definujstyl",
["de"]="definierestil",
["en"]="definestyle",
- ["fr"]="definitstyle",
+ ["fr"]="définirstyle",
["it"]="definiscistile",
["nl"]="definieerletter",
["pe"]="تعریف‌سبک",
@@ -1240,7 +1393,7 @@ return {
["cs"]="definujpodpole",
["de"]="definieresubfeld",
["en"]="definesubfield",
- ["fr"]="definitsouschamp",
+ ["fr"]="définirsouschamp",
["it"]="definiscisottocampo",
["nl"]="definieersubveld",
["pe"]="تعریف‌زیرمیدان",
@@ -1250,7 +1403,7 @@ return {
["cs"]="definujsymbol",
["de"]="definieresymbol",
["en"]="definesymbol",
- ["fr"]="definitsymbole",
+ ["fr"]="définirsymbole",
["it"]="definiscisimbolo",
["nl"]="definieersymbool",
["pe"]="تعریف‌نماد",
@@ -1260,7 +1413,7 @@ return {
["cs"]="definujsynonyma",
["de"]="definieresynonyme",
["en"]="definesynonyms",
- ["fr"]="definitsynonymes",
+ ["fr"]="définirsynonymes",
["it"]="definiscisinonimi",
["nl"]="definieersynoniemen",
["pe"]="تعریف‌مترادفها",
@@ -1270,7 +1423,7 @@ return {
["cs"]="definujsablonutabulky",
["de"]="definieretabellenvorlage",
["en"]="definetabletemplate",
- ["fr"]="definittrametableau",
+ ["fr"]="définirgabarittable",
["it"]="definiscimodellotabella",
["nl"]="definieertabelvorm",
["pe"]="تعریف‌الگوی‌جدول",
@@ -1280,7 +1433,7 @@ return {
["cs"]="definujtabelaci",
["de"]="definieretabulator",
["en"]="definetabulate",
- ["fr"]="definittabulation",
+ ["fr"]="définirtabulation",
["it"]="definiscitabulato",
["nl"]="definieertabulatie",
["pe"]="تعریف‌جدول‌بندی",
@@ -1290,7 +1443,7 @@ return {
["cs"]="definujtext",
["de"]="definieretext",
["en"]="definetext",
- ["fr"]="definittexte",
+ ["fr"]="définirtexte",
["it"]="definiscitesto",
["nl"]="definieertekst",
["pe"]="تعریف‌متن",
@@ -1298,13 +1451,18 @@ return {
},
["definetextbackground"]={
["en"]="definetextbackground",
+ ["fr"]="définirtextearriereplan",
["nl"]="definieertekstachtergrond",
},
+ ["definetextnote"]={
+ ["en"]="definetextnote",
+ ["fr"]="définirnotetexte",
+ },
["definetextposition"]={
["cs"]="definetextposition",
["de"]="definetextposition",
["en"]="definetextposition",
- ["fr"]="definitpositiontexte",
+ ["fr"]="définirpositiontexte",
["it"]="definisciposizionetesto",
["nl"]="definieertekstpositie",
["pe"]="تعریف‌مکان‌متن",
@@ -1314,7 +1472,7 @@ return {
["cs"]="definetextvariable",
["de"]="definetextvariable",
["en"]="definetextvariable",
- ["fr"]="definitvariabletexte",
+ ["fr"]="définirvariabletexte",
["it"]="definiscivariabiletesto",
["nl"]="definieertekstvariabele",
["pe"]="تعریف‌متغیرمتن",
@@ -1324,7 +1482,7 @@ return {
["cs"]="definetype",
["de"]="definetype",
["en"]="definetype",
- ["fr"]="definittype",
+ ["fr"]="définirtranscrire",
["it"]="definiscitype",
["nl"]="definieertype",
["pe"]="تعریف‌تایپ",
@@ -1334,7 +1492,7 @@ return {
["cs"]="definujopis",
["de"]="definieretippen",
["en"]="definetyping",
- ["fr"]="definitdactylo",
+ ["fr"]="définirtranscription",
["it"]="definiscityping",
["nl"]="definieertypen",
["pe"]="تعریف‌تایپ‌کردن",
@@ -1344,17 +1502,21 @@ return {
["cs"]="definujverzi",
["de"]="definiereversion",
["en"]="defineversion",
- ["fr"]="definitversion",
+ ["fr"]="définirversion",
["it"]="definisciversion",
["nl"]="definieerversie",
["pe"]="تعریف‌نسخه",
["ro"]="definesteversiune",
},
+ ["depthspanningtext"]={
+ ["en"]="depthspanningtext",
+ ["fr"]="jambagetextecouvrant",
+ },
["determineheadnumber"]={
["cs"]="stanovcislonadpisu",
["de"]="bestimmekopfnummer",
["en"]="determineheadnumber",
- ["fr"]="determinenumerotete",
+ ["fr"]="determinernumerotete",
["it"]="determinanumerotesta",
["nl"]="bepaalkopnummer",
["pe"]="تعیین‌شماره‌سر",
@@ -1364,7 +1526,7 @@ return {
["cs"]="stanovcharakteristickuseznamu",
["de"]="bestimmelistencharakeristika",
["en"]="determinelistcharacteristics",
- ["fr"]="determinecaracteristiqueliste",
+ ["fr"]="determinercaracteristiquesliste",
["it"]="determinacarattersticheelenco",
["nl"]="bepaallijstkenmerken",
["pe"]="تعیین‌مشخصات‌لیست",
@@ -1374,7 +1536,7 @@ return {
["cs"]="urcicharakteristikurejstriku",
["de"]="bestimmeregistercharakteristika",
["en"]="determineregistercharacteristics",
- ["fr"]="determinecaracteristiquesregistre",
+ ["fr"]="determinercaracteristiquesregistre",
["it"]="determinacaratteristicheregistro",
["nl"]="bepaalregisterkenmerken",
["pe"]="تعیین‌مشخصات‌ثبت",
@@ -1394,12 +1556,20 @@ return {
["cs"]="zablokujinterakcnimenu",
["de"]="inaktiviereinteraktionsmenue",
["en"]="disableinteractionmenu",
- ["fr"]="inhibemenuinteraction",
+ ["fr"]="desactivermenuinteraction",
["it"]="disabilitamenuinterazione",
["nl"]="blokkeerinteractiemenu",
["pe"]="ازکارانداختن‌منوی‌پانل",
["ro"]="dezactiveazameniuinteractiune",
},
+ ["disablemode"]={
+ ["en"]="disablemode",
+ ["fr"]="desactivermode",
+ },
+ ["doaddfeature"]={
+ ["en"]="doaddfeature",
+ ["fr"]="faireajouterfonctionnalite",
+ },
["domicile"]={
["cs"]="bydliste",
["de"]="wohnort",
@@ -1410,11 +1580,15 @@ return {
["pe"]="مسکن",
["ro"]="domiciliu",
},
+ ["dontconvertfont"]={
+ ["en"]="dontconvertfont",
+ ["fr"]="nepasconvertirpolice",
+ },
["donttest"]={
["cs"]="zadnytest",
["de"]="keintest",
["en"]="donttest",
- ["fr"]="sanstest",
+ ["fr"]="sanstester",
["it"]="notest",
["nl"]="geentest",
["pe"]="امتحان‌نکن",
@@ -1440,21 +1614,29 @@ return {
["pe"]="عرض‌لبه",
["ro"]="latimecolturi",
},
+ ["emphasisboldface"]={
+ ["en"]="emphasisboldface",
+ ["fr"]="policegrasaccentue",
+ },
["emptylines"]={
["cs"]="emptylines",
["de"]="emptylines",
["en"]="emptylines",
- ["fr"]="emptylines",
+ ["fr"]="lignesvide",
["it"]="emptylines",
["nl"]="legeregels",
["pe"]="خطها‌خالی",
["ro"]="emptylines",
},
+ ["enablemode"]={
+ ["en"]="enablemode",
+ ["fr"]="activermode",
+ },
["environment"]={
["cs"]="prostredi",
["de"]="umgebung",
["en"]="environment",
- ["fr"]="environement",
+ ["fr"]="environnement",
["it"]="ambiente",
["nl"]="omgeving",
["pe"]="محیط",
@@ -1480,6 +1662,14 @@ return {
["pe"]="حقیقت",
["ro"]="fact",
},
+ ["fastswitchtobodyfont"]={
+ ["en"]="fastswitchtobodyfont",
+ ["fr"]="passerrapideapolicedecorps",
+ },
+ ["feature"]={
+ ["en"]="feature",
+ ["fr"]="fonctionnalite",
+ },
["field"]={
["cs"]="pole",
["de"]="feld",
@@ -1504,7 +1694,7 @@ return {
["cs"]="vyplnovepole",
["de"]="ausfuellfeld",
["en"]="fillinfield",
- ["fr"]="remplitchamp",
+ ["fr"]="champarenseigner",
["it"]="camporiempimento",
["nl"]="invulveld",
["pe"]="درج‌درمیدان",
@@ -1514,7 +1704,7 @@ return {
["cs"]="vyplnovyradek",
["de"]="gefuelltezeile",
["en"]="fillinline",
- ["fr"]="remplitligne",
+ ["fr"]="lignearenseigner",
["it"]="rigariempimento",
["nl"]="invulregel",
["pe"]="درج‌درخط",
@@ -1524,7 +1714,7 @@ return {
["cs"]="vyplnovelinky",
["de"]="gefuelltesrechteck",
["en"]="fillinrules",
- ["fr"]="remplitlignesreglees",
+ ["fr"]="traitsarenseigner",
["it"]="lineeriempimento",
["nl"]="invullijnen",
["pe"]="درج‌درخطها",
@@ -1534,22 +1724,30 @@ return {
["cs"]="vyplnenytext",
["de"]="ausfuelltext",
["en"]="fillintext",
- ["fr"]="remplittexte",
+ ["fr"]="textearenseigner",
["it"]="testoriempimento",
["nl"]="invultekst",
["pe"]="درج‌درمتن",
["ro"]="textumplere",
},
+ ["firstcharacter"]={
+ ["en"]="firstcharacter",
+ ["fr"]="premiercaractere",
+ },
["fitfield"]={
["cs"]="prizpusobivepole",
["de"]="passendfeld",
["en"]="fitfield",
- ["fr"]="ajustechamp",
+ ["fr"]="adapterchamp",
["it"]="adattacampo",
["nl"]="passendveld",
["pe"]="پرکردن‌میدان",
["ro"]="potrivestecamp",
},
+ ["fittopbaselinegrid"]={
+ ["en"]="fittopbaselinegrid",
+ ["fr"]="adaptergrillehautlignedebase",
+ },
["fixedspace"]={
["cs"]="tvrdamezera",
["de"]="festesspatium",
@@ -1570,11 +1768,15 @@ return {
["pe"]="فضاهای‌ثابت",
["ro"]="spatiifixate",
},
+ ["flushnotes"]={
+ ["en"]="flushnotes",
+ ["fr"]="vidernotes",
+ },
["followprofile"]={
["cs"]="dodrzujprofil",
["de"]="folgeprofil",
["en"]="followprofile",
- ["fr"]="suivantprofil",
+ ["fr"]="suivreprofile",
["it"]="seguiprofilo",
["nl"]="volgprofiel",
["pe"]="پیروی‌پروفایل",
@@ -1584,7 +1786,7 @@ return {
["cs"]="dodrzujverziprofilu",
["de"]="folgeprofilversion",
["en"]="followprofileversion",
- ["fr"]="suivantversionprofil",
+ ["fr"]="suivreversionprofil",
["it"]="seguiversioneprofilo",
["nl"]="volgprofielversie",
["pe"]="پیروی‌نسخه‌پروفایل",
@@ -1594,7 +1796,7 @@ return {
["cs"]="dodrzujverzi",
["de"]="folgeversion",
["en"]="followversion",
- ["fr"]="suivantversion",
+ ["fr"]="suivreversion",
["it"]="seguiversione",
["nl"]="volgversie",
["pe"]="پیروی‌نسخه",
@@ -1624,7 +1826,7 @@ return {
["cs"]="poznamkapodcarou",
["de"]="fussnote",
["en"]="footnote",
- ["fr"]="notepdp",
+ ["fr"]="notebdp",
["it"]="notapdp",
["nl"]="voetnoot",
["pe"]="پانوشت",
@@ -1634,7 +1836,7 @@ return {
["cs"]="footnotetext",
["de"]="footnotetext",
["en"]="footnotetext",
- ["fr"]="textenotepdp",
+ ["fr"]="textenotebdp",
["it"]="testonotapdp",
["nl"]="voetnoottekst",
["pe"]="متن‌پانوشت",
@@ -1644,12 +1846,16 @@ return {
["cs"]="forceblocks",
["de"]="forceblocks",
["en"]="forceblocks",
- ["fr"]="forceblocs",
+ ["fr"]="forcerblocs",
["it"]="forzablocchi",
["nl"]="forceerblokken",
["pe"]="اجباربلوکها",
["ro"]="forteazablocuri",
},
+ ["forcecharacterstripping"]={
+ ["en"]="forcecharacterstripping",
+ ["fr"]="forcerdemontagecaracteres",
+ },
["formulanumber"]={
["cs"]="cislorovnice",
["de"]="formelnummer",
@@ -1674,7 +1880,7 @@ return {
["cs"]="oramovani",
["de"]="umrahmt",
["en"]="framed",
- ["fr"]="framed",
+ ["fr"]="encadre",
["it"]="incorniciato",
["nl"]="omlijnd",
["pe"]="قالبی",
@@ -1690,21 +1896,29 @@ return {
["pe"]="از",
["ro"]="din",
},
+ ["fromlinenote"]={
+ ["en"]="fromlinenote",
+ ["fr"]="denotedeligne",
+ },
["getbuffer"]={
["cs"]="ziskejbuffer",
["de"]="holepuffer",
["en"]="getbuffer",
- ["fr"]="prendbuffer",
+ ["fr"]="obtenirtampon",
["it"]="prendibuffer",
["nl"]="haalbuffer",
["pe"]="دریافت‌بافر",
["ro"]="adubuffer",
},
+ ["getfirstcharacter"]={
+ ["en"]="getfirstcharacter",
+ ["fr"]="obtenirpremiercaractere",
+ },
["getmarking"]={
["cs"]="ziskejznaceni",
["de"]="holebeschriftung",
["en"]="getmarking",
- ["fr"]="obtientmarquage",
+ ["fr"]="obtenirmarquage",
["it"]="prendimarcatura",
["nl"]="haalmarkering",
["pe"]="دریافت‌نشانه",
@@ -1714,17 +1928,29 @@ return {
["cs"]="getnumber",
["de"]="getnumber",
["en"]="getnumber",
- ["fr"]="getnumber",
+ ["fr"]="obtenirnumero",
["it"]="getnumber",
["nl"]="haalnummer",
["pe"]="دریافت‌شماره",
["ro"]="getnumber",
},
+ ["globaldisablemode"]={
+ ["en"]="globaldisablemode",
+ ["fr"]="desactivermodeglobal",
+ },
+ ["globalenablemode"]={
+ ["en"]="globalenablemode",
+ ["fr"]="activermodeglobal",
+ },
+ ["globalpreventmode"]={
+ ["en"]="globalpreventmode",
+ ["fr"]="empechermodeglobal",
+ },
["godown"]={
["cs"]="jdidolu",
["de"]="nachunten",
["en"]="godown",
- ["fr"]="vaenbas",
+ ["fr"]="allerenbas",
["it"]="vaigiu",
["nl"]="omlaag",
["pe"]="بروپایین",
@@ -1734,7 +1960,7 @@ return {
["cs"]="jdina",
["de"]="zu",
["en"]="goto",
- ["fr"]="va",
+ ["fr"]="allera",
["it"]="vaia",
["nl"]="naar",
["pe"]="بروبه",
@@ -1744,7 +1970,7 @@ return {
["cs"]="jdinabox",
["de"]="zurbox",
["en"]="gotobox",
- ["fr"]="vaalaboite",
+ ["fr"]="alleraboite",
["it"]="vaiabox",
["nl"]="naarbox",
["pe"]="بروبه‌جعبه",
@@ -1754,7 +1980,7 @@ return {
["cs"]="jdinastranu",
["de"]="zurseite",
["en"]="gotopage",
- ["fr"]="vaalapage",
+ ["fr"]="allerapage",
["it"]="vaiapagina",
["nl"]="naarpagina",
["pe"]="بروبه‌صفحه",
@@ -1794,7 +2020,7 @@ return {
["cs"]="vlasovalinka",
["de"]="haarlinie",
["en"]="hairline",
- ["fr"]="ligneh",
+ ["fr"]="ligneavectrait",
["it"]="capello",
["nl"]="haarlijn",
["pe"]="خط‌مو",
@@ -1804,7 +2030,7 @@ return {
["cs"]="nadpis",
["de"]="kopf",
["en"]="head",
- ["fr"]="tete",
+ ["fr"]="tête",
["it"]="testa",
["nl"]="kop",
["pe"]="سر",
@@ -1814,7 +2040,7 @@ return {
["cs"]="vzdalenostzahlavi",
["de"]="kopfzeilenabstand",
["en"]="headerdistance",
- ["fr"]="distanceentete",
+ ["fr"]="distanceentête",
["it"]="distanzaintestazione",
["nl"]="hoofdafstand",
["pe"]="فاصله‌سربرگ",
@@ -1824,7 +2050,7 @@ return {
["cs"]="vyskazahlavi",
["de"]="kopfzeilenhoehe",
["en"]="headerheight",
- ["fr"]="hauteurentete",
+ ["fr"]="hauteurentête",
["it"]="altezzaintestazione",
["nl"]="hoofdhoogte",
["pe"]="ارتفاع‌سربرگ",
@@ -1854,7 +2080,7 @@ return {
["cs"]="headsym",
["de"]="headsym",
["en"]="headsym",
- ["fr"]="headsym",
+ ["fr"]="symtete",
["it"]="headsym",
["nl"]="kopsym",
["pe"]="نمادسر",
@@ -1870,11 +2096,15 @@ return {
["pe"]="متن‌سر",
["ro"]="texttitlu",
},
+ ["heightspanningtext"]={
+ ["en"]="heightspanningtext",
+ ["fr"]="hauteurtextecouvrant",
+ },
["hideblocks"]={
["cs"]="schovejbloky",
["de"]="verbergebloecke",
["en"]="hideblocks",
- ["fr"]="cacheblocs",
+ ["fr"]="cacherblocs",
["it"]="nascondiblocchi",
["nl"]="verbergblokken",
["pe"]="بلوکها‌پنهان",
@@ -1884,7 +2114,7 @@ return {
["cs"]="vysoky",
["de"]="hoch",
["en"]="high",
- ["fr"]="haut",
+ ["fr"]="exposant",
["it"]="ap",
["nl"]="hoog",
["pe"]="بلند",
@@ -1894,7 +2124,7 @@ return {
["cs"]="hl",
["de"]="hl",
["en"]="hl",
- ["fr"]="hl",
+ ["fr"]="lh",
["it"]="hl",
["nl"]="hl",
["pe"]="خ‌ا",
@@ -1904,7 +2134,7 @@ return {
["cs"]="immediatebetweenlist",
["de"]="immediatebetweenlist",
["en"]="immediatebetweenlist",
- ["fr"]="immediatebetweenlist",
+ ["fr"]="immediatemententreliste",
["it"]="immediatebetweenlist",
["nl"]="directtussenlijst",
["pe"]="فوری‌بین‌لیست",
@@ -1914,7 +2144,7 @@ return {
["cs"]="immediatetolist",
["de"]="immediatetolist",
["en"]="immediatetolist",
- ["fr"]="immediatetolist",
+ ["fr"]="immediatementalister",
["it"]="immediatetolist",
["nl"]="directnaarlijst",
["pe"]="فوری‌به‌لیست",
@@ -1934,7 +2164,7 @@ return {
["cs"]="zvysujicicislo",
["de"]="nummererhoehen",
["en"]="incrementnumber",
- ["fr"]="incrementenumero",
+ ["fr"]="incrementernumero",
["it"]="incrementanumero",
["nl"]="verhoognummer",
["pe"]="شماره‌افزایش",
@@ -1944,7 +2174,7 @@ return {
["cs"]="odsazovani",
["de"]="einziehen",
["en"]="indenting",
- ["fr"]="composeenalinea",
+ ["fr"]="indentation",
["it"]="rientro",
["nl"]="inspringen",
["pe"]="تورفتگی",
@@ -1954,7 +2184,7 @@ return {
["cs"]="zaramovani",
["de"]="imumriss",
["en"]="inframed",
- ["fr"]="inframed",
+ ["fr"]="dansencadre",
["it"]="circondato",
["nl"]="inlijnd",
["pe"]="درقالبی",
@@ -1964,7 +2194,7 @@ return {
["cs"]="plnezneni",
["de"]="volleswort",
["en"]="infull",
- ["fr"]="infull",
+ ["fr"]="encomplet",
["it"]="perlungo",
["nl"]="voluit",
["pe"]="درپر",
@@ -1974,7 +2204,7 @@ return {
["cs"]="ininner",
["de"]="ininner",
["en"]="ininner",
- ["fr"]="ininner",
+ ["fr"]="dansinterieur",
["it"]="ininner",
["nl"]="inbinnen",
["pe"]="درداخلی",
@@ -2014,7 +2244,7 @@ return {
["cs"]="vradku",
["de"]="inzeile",
["en"]="inline",
- ["fr"]="alaligne",
+ ["fr"]="enligne",
["it"]="inriga",
["nl"]="inregel",
["pe"]="درخط",
@@ -2034,7 +2264,7 @@ return {
["cs"]="mazaramovani",
["de"]="immaumrise",
["en"]="inmaframed",
- ["fr"]="inmframed",
+ ["fr"]="dansencadremath",
["it"]="inmaframed",
["nl"]="inwilijnd",
["pe"]="inmframed",
@@ -2044,7 +2274,7 @@ return {
["cs"]="inneredgedistance",
["de"]="inneredgedistance",
["en"]="inneredgedistance",
- ["fr"]="inneredgedistance",
+ ["fr"]="distancebordinterieur",
["it"]="inneredgedistance",
["nl"]="binnenrandafstand",
["pe"]="فاصله‌لبه‌داخلی",
@@ -2054,7 +2284,7 @@ return {
["cs"]="inneredgewidth",
["de"]="inneredgewidth",
["en"]="inneredgewidth",
- ["fr"]="inneredgewidth",
+ ["fr"]="largeurbordinterieur",
["it"]="inneredgewidth",
["nl"]="binnenrandbreedte",
["pe"]="عرض‌لبه‌داخلی",
@@ -2064,7 +2294,7 @@ return {
["cs"]="innermargindistance",
["de"]="innermargindistance",
["en"]="innermargindistance",
- ["fr"]="innermargindistance",
+ ["fr"]="distancemargeinterieure",
["it"]="innermargindistance",
["nl"]="binnenmargeafstand",
["pe"]="فاصله‌حاشیه‌داخلی",
@@ -2074,7 +2304,7 @@ return {
["cs"]="innermarginwidth",
["de"]="innermarginwidth",
["en"]="innermarginwidth",
- ["fr"]="innermarginwidth",
+ ["fr"]="largeurmargeinterieure",
["it"]="innermarginwidth",
["nl"]="binnenmargebreedte",
["pe"]="عرض‌حاشیه‌داخلی",
@@ -2094,7 +2324,7 @@ return {
["cs"]="inouter",
["de"]="inouter",
["en"]="inouter",
- ["fr"]="inouter",
+ ["fr"]="dansexterieur",
["it"]="inouter",
["nl"]="inbuiten",
["pe"]="درخارجی",
@@ -2134,7 +2364,7 @@ return {
["cs"]="instalacejazyka",
["de"]="installieresprache",
["en"]="installlanguage",
- ["fr"]="installelangue",
+ ["fr"]="installerlangue",
["it"]="installalingua",
["nl"]="installeertaal",
["pe"]="نصب‌زبان",
@@ -2174,27 +2404,35 @@ return {
["cs"]="polozka",
["de"]="pos",
["en"]="item",
- ["fr"]="element",
+ ["fr"]="élément",
["it"]="elemento",
["nl"]="som",
["pe"]="آیتم",
["ro"]="element",
},
+ ["itemgroup"]={
+ ["en"]="itemgroup",
+ ["fr"]="groupedéléments",
+ },
["items"]={
["cs"]="polozky",
["de"]="posten",
["en"]="items",
- ["fr"]="elements",
+ ["fr"]="éléments",
["it"]="elementi",
["nl"]="items",
["pe"]="آیتمها",
["ro"]="element",
},
+ ["itemtag"]={
+ ["en"]="itemtag",
+ ["fr"]="étiquettedélément",
+ },
["its"]={
["cs"]="pol",
["de"]="its",
["en"]="its",
- ["fr"]="el",
+ ["fr"]="els",
["it"]="el",
["nl"]="its",
["pe"]="its",
@@ -2204,12 +2442,16 @@ return {
["cs"]="zachovejbloky",
["de"]="behaltebloecke",
["en"]="keepblocks",
- ["fr"]="gardeblocs",
+ ["fr"]="conserverblocs",
["it"]="tieniblocchi",
["nl"]="handhaafblokken",
["pe"]="حفظ‌بلوکها",
["ro"]="pastreazablocuri",
},
+ ["kerncharacters"]={
+ ["en"]="kerncharacters",
+ ["fr"]="approchercaracteres",
+ },
["label"]={
["cs"]="poppisek",
["de"]="label",
@@ -2234,7 +2476,7 @@ return {
["cs"]="textpopisku",
["de"]="labeltext",
["en"]="labeltext",
- ["fr"]="labeltexte",
+ ["fr"]="texteetiquette",
["it"]="testoetichetta",
["nl"]="labeltekst",
["pe"]="متن‌برچسب",
@@ -2250,6 +2492,14 @@ return {
["pe"]="زبان",
["ro"]="limba",
},
+ ["languageCharacters"]={
+ ["en"]="languageCharacters",
+ ["fr"]="Caractereslangue",
+ },
+ ["languagecharacters"]={
+ ["en"]="languagecharacters",
+ ["fr"]="caractereslangue",
+ },
["leftaligned"]={
["cs"]="zarovnanovlevo",
["de"]="linksbuendig",
@@ -2260,6 +2510,10 @@ return {
["pe"]="چپ‌چین",
["ro"]="aliniatstanga",
},
+ ["leftbottombox"]={
+ ["en"]="leftbottombox",
+ ["fr"]="boitebasgauche",
+ },
["leftedgedistance"]={
["cs"]="vzdalenostlevehookraje",
["de"]="abstandlinkerrand",
@@ -2280,6 +2534,10 @@ return {
["pe"]="عرض‌لبه‌چپ",
["ro"]="latimecoltstanga",
},
+ ["leftline"]={
+ ["en"]="leftline",
+ ["fr"]="lignegauche",
+ },
["leftmargindistance"]={
["cs"]="vzdalenostlevemarginalie",
["de"]="linkemarginalafstand",
@@ -2310,6 +2568,19 @@ return {
["pe"]="پا",
["ro"]="leg",
},
+ ["linecorrection"]={
+ ["en"]="linecorrection",
+ ["fr"]="correctionligne",
+ ["nl"]="regelcorrectie",
+ },
+ ["linenote"]={
+ ["en"]="linenote",
+ ["fr"]="notedeligne",
+ },
+ ["linespanningtext"]={
+ ["en"]="linespanningtext",
+ ["fr"]="largeurtextecouvrant",
+ },
["linewidth"]={
["cs"]="tloustkacary",
["de"]="liniendicke",
@@ -2334,7 +2605,7 @@ return {
["cs"]="delkaseznamu",
["de"]="listenlaenge",
["en"]="listlength",
- ["fr"]="llongueurliste",
+ ["fr"]="longueurtexte",
["it"]="lunghezzaelenco",
["nl"]="lijstlengte",
["pe"]="طول‌لیست",
@@ -2344,7 +2615,7 @@ return {
["cs"]="listsymbol",
["de"]="listsymbol",
["en"]="listsymbol",
- ["fr"]="listesymbole",
+ ["fr"]="symboleliste",
["it"]="listsymbol",
["nl"]="lijstsymbool",
["pe"]="نمادلیست",
@@ -2360,11 +2631,24 @@ return {
["pe"]="عرض‌لیست",
["ro"]="latimelista",
},
+ ["loadfontgoodies"]={
+ ["en"]="loadfontgoodies",
+ ["fr"]="charerfriandisespolice",
+ },
+ ["localfootnotes"]={
+ ["en"]="localfootnotes",
+ ["fr"]="notesbdplocales",
+ ["nl"]="lokalevoetnoten",
+ },
+ ["localnotes"]={
+ ["en"]="localnotes",
+ ["fr"]="noteslocales",
+ },
["logfields"]={
["cs"]="zaznamovepole",
["de"]="registrierefelder",
["en"]="logfields",
- ["fr"]="logchamp",
+ ["fr"]="logchamps",
["it"]="logcampi",
["nl"]="registreervelden",
["pe"]="میدانهای‌گزارش",
@@ -2374,7 +2658,7 @@ return {
["cs"]="nivy",
["de"]="tiho",
["en"]="lohi",
- ["fr"]="baha",
+ ["fr"]="inex",
["it"]="pedap",
["nl"]="laho",
["pe"]="پابا",
@@ -2384,7 +2668,7 @@ return {
["cs"]="nizky",
["de"]="tief",
["en"]="low",
- ["fr"]="bas",
+ ["fr"]="indice",
["it"]="ped",
["nl"]="laag",
["pe"]="پایین",
@@ -2414,7 +2698,7 @@ return {
["cs"]="vyskasazby",
["de"]="satzhoehe",
["en"]="makeupheight",
- ["fr"]="hauteurmakeup",
+ ["fr"]="hauteurcomposition",
["it"]="altezzamakeup",
["nl"]="zethoogte",
["pe"]="ارتفاع‌آرایش",
@@ -2424,7 +2708,7 @@ return {
["cs"]="sirkasazby",
["de"]="satzbreite",
["en"]="makeupwidth",
- ["fr"]="largeurmakeup",
+ ["fr"]="largeurcomposition",
["it"]="ampiezzamakeup",
["nl"]="zetbreedte",
["pe"]="عرض‌آرایش",
@@ -2434,12 +2718,17 @@ return {
["cs"]="okr",
["de"]="mar",
["en"]="mar",
- ["fr"]="mar",
+ ["fr"]="rem",
["it"]="mar",
["nl"]="mar",
["pe"]="حاش",
["ro"]="mar",
},
+ ["marginblock"]={
+ ["en"]="marginblock",
+ ["fr"]="blocmarginal",
+ ["nl"]="margeblok",
+ },
["margindistance"]={
["cs"]="vzdalenostmarginalie",
["de"]="marginalafstand",
@@ -2454,7 +2743,7 @@ return {
["cs"]="marginalnilinka",
["de"]="marginallinie",
["en"]="marginrule",
- ["fr"]="margereglee",
+ ["fr"]="traitmarge",
["it"]="lineamargine",
["nl"]="kantlijn",
["pe"]="خط‌حاشیه",
@@ -2514,7 +2803,7 @@ return {
["cs"]="oznacverzi",
["de"]="beschrifteversion",
["en"]="markversion",
- ["fr"]="marquageversion",
+ ["fr"]="marquerversion",
["it"]="marcaversione",
["nl"]="markeerversie",
["pe"]="نسخه‌نشانه",
@@ -2524,7 +2813,7 @@ return {
["cs"]="matematika",
["de"]="mathematik",
["en"]="mathematics",
- ["fr"]="mathematique",
+ ["fr"]="mathematics",
["it"]="matematica",
["nl"]="wiskunde",
["pe"]="ریاضی",
@@ -2544,7 +2833,7 @@ return {
["cs"]="maoramovani",
["de"]="maumrise",
["en"]="maframed",
- ["fr"]="mframed",
+ ["fr"]="encadremath",
["it"]="maframed",
["nl"]="wilijnd",
["pe"]="mframed",
@@ -2564,7 +2853,7 @@ return {
["cs"]="zrcadlit",
["de"]="spiegeln",
["en"]="mirror",
- ["fr"]="reflete",
+ ["fr"]="refleter",
["it"]="riflessione",
["nl"]="spiegel",
["pe"]="آینه",
@@ -2584,7 +2873,7 @@ return {
["cs"]="moveformula",
["de"]="moveformula",
["en"]="moveformula",
- ["fr"]="deplaceformule",
+ ["fr"]="deplacerformule",
["it"]="spostaformula",
["nl"]="verplaatsformule",
["pe"]="انتقال‌فرمول",
@@ -2594,7 +2883,7 @@ return {
["cs"]="premistinamrizku",
["de"]="amgitterneuausrichten",
["en"]="moveongrid",
- ["fr"]="deplacesurgrille",
+ ["fr"]="deplacersurgrille",
["it"]="spostaagriglia",
["nl"]="verplaatsopgrid",
["pe"]="انتقال‌به‌توری",
@@ -2604,7 +2893,7 @@ return {
["cs"]="movesidefloat",
["de"]="movesidefloat",
["en"]="movesidefloat",
- ["fr"]="movesidefloat",
+ ["fr"]="deplacerflottantcote",
["it"]="movesidefloat",
["nl"]="verplaatszijblok",
["pe"]="انتقال‌کنار‌شناور",
@@ -2614,7 +2903,7 @@ return {
["cs"]="navigating",
["de"]="navigating",
["en"]="navigating",
- ["fr"]="navigating",
+ ["fr"]="navigation",
["it"]="navigating",
["nl"]="navigerend",
["pe"]="هدایت",
@@ -2634,7 +2923,7 @@ return {
["cs"]="zadnezahlaviaupati",
["de"]="keinekopfundfusszeilen",
["en"]="noheaderandfooterlines",
- ["fr"]="sanslignesenteteetpdp",
+ ["fr"]="sansentêtenipdp",
["it"]="nientelineintestazionepdp",
["nl"]="geenhoofdenvoetregels",
["pe"]="بدون‌خط‌سروته‌برگ",
@@ -2644,12 +2933,16 @@ return {
["cs"]="zadneodsazovani",
["de"]="nichteinziehen",
["en"]="noindenting",
- ["fr"]="sansalinea",
+ ["fr"]="sansindentation",
["it"]="nienterientro",
["nl"]="nietinspringen",
["pe"]="بدون‌تورفتگی",
["ro"]="faraaliniat",
},
+ ["noitem"]={
+ ["en"]="noitem",
+ ["fr"]="sansélément",
+ },
["nolist"]={
["cs"]="zadnyseznam",
["de"]="keineliste",
@@ -2674,7 +2967,7 @@ return {
["cs"]="zadnedalsibloky",
["de"]="keinebloeckemehr",
["en"]="nomoreblocks",
- ["fr"]="pasplusdeblocs",
+ ["fr"]="sansplusdeblocs",
["it"]="bastablocchi",
["nl"]="geenblokkenmeer",
["pe"]="بدون‌بلوکهای‌بیشتر",
@@ -2684,7 +2977,7 @@ return {
["cs"]="zadnedalsisoubory",
["de"]="keinedateienmehr",
["en"]="nomorefiles",
- ["fr"]="pasplusdefichiers",
+ ["fr"]="sansplusdefichiers",
["it"]="bastafile",
["nl"]="geenfilesmeer",
["pe"]="بدون‌فایلهای‌بیشتر",
@@ -2694,7 +2987,7 @@ return {
["cs"]="nop",
["de"]="nop",
["en"]="nop",
- ["fr"]="nop",
+ ["fr"]="san",
["it"]="nop",
["nl"]="nop",
["pe"]="منفی",
@@ -2720,11 +3013,15 @@ return {
["pe"]="یادداشت",
["ro"]="nota",
},
+ ["notesymbol"]={
+ ["en"]="notesymbol",
+ ["fr"]="symbolenote",
+ },
["notopandbottomlines"]={
["cs"]="zadnehorniadolniradky",
["de"]="keinzeilenobenundunten",
["en"]="notopandbottomlines",
- ["fr"]="sanslignessupetinf",
+ ["fr"]="sansligneshautetbas",
["it"]="nientelineecimafondo",
["nl"]="geenbovenenonderregels",
["pe"]="بدون‌خط‌بالاوپایین",
@@ -2734,7 +3031,7 @@ return {
["cs"]="nokap",
["de"]="nokap",
["en"]="nocap",
- ["fr"]="nocap",
+ ["fr"]="paspetitescaps",
["it"]="nocap",
["nl"]="nokap",
["pe"]="سرپوش‌کوچک‌نه",
@@ -2774,7 +3071,7 @@ return {
["cs"]="outeredgedistance",
["de"]="outeredgedistance",
["en"]="outeredgedistance",
- ["fr"]="outeredgedistance",
+ ["fr"]="distancebordexterieur",
["it"]="outeredgedistance",
["nl"]="buitenrandafstand",
["pe"]="فاصله‌لبه‌خارجی",
@@ -2784,7 +3081,7 @@ return {
["cs"]="outeredgewidth",
["de"]="outeredgewidth",
["en"]="outeredgewidth",
- ["fr"]="outeredgewidth",
+ ["fr"]="largeurbordexterieur",
["it"]="outeredgewidth",
["nl"]="buitenrandbreedte",
["pe"]="عرض‌لبه‌خارجی",
@@ -2794,7 +3091,7 @@ return {
["cs"]="outermargindistance",
["de"]="outermargindistance",
["en"]="outermargindistance",
- ["fr"]="outermargindistance",
+ ["fr"]="distancemargeexterieure",
["it"]="outermargindistance",
["nl"]="buitenmargeafstand",
["pe"]="فاصله‌حاشیه‌خارجی",
@@ -2804,7 +3101,7 @@ return {
["cs"]="outermarginwidth",
["de"]="outermarginwidth",
["en"]="outermarginwidth",
- ["fr"]="outermarginwidth",
+ ["fr"]="largeurmargeexterieure",
["it"]="outermarginwidth",
["nl"]="buitenmargebreedte",
["pe"]="عرض‌حاشیه‌خارجی",
@@ -2814,7 +3111,7 @@ return {
["cs"]="zhustene",
["de"]="kleinerdurchschuss",
["en"]="packed",
- ["fr"]="groupe",
+ ["fr"]="sansespaceentreitem",
["it"]="impaccato",
["nl"]="opelkaar",
["pe"]="فشرده",
@@ -2830,11 +3127,15 @@ return {
["pe"]="صفحه",
["ro"]="pagina",
},
+ ["pagebreak"]={
+ ["en"]="pagebreak",
+ ["fr"]="sautdepage",
+ },
["pagedepth"]={
["cs"]="pagedepth",
["de"]="pagedepth",
["en"]="pagedepth",
- ["fr"]="pagedepth",
+ ["fr"]="profondeurpage",
["it"]="pagedepth",
["nl"]="paginadiepte",
["pe"]="عمق‌صفحه",
@@ -2854,7 +3155,7 @@ return {
["cs"]="pageoffset",
["de"]="pageoffset",
["en"]="pageoffset",
- ["fr"]="pageoffset",
+ ["fr"]="decalagepage",
["it"]="pageoffset",
["nl"]="paginaoffset",
["pe"]="آفست‌صفحه",
@@ -2904,7 +3205,7 @@ return {
["cs"]="umistizalozky",
["de"]="platzierebookmarks",
["en"]="placebookmarks",
- ["fr"]="placemarquespages",
+ ["fr"]="placermarquepages",
["it"]="mettisegnalibro",
["nl"]="plaatsbookmarks",
["pe"]="درج‌چوب‌خط",
@@ -2914,7 +3215,7 @@ return {
["cs"]="umistikombinovanyseznam",
["de"]="platzierezusammengestellteliste",
["en"]="placecombinedlist",
- ["fr"]="placelisteinmbriquee",
+ ["fr"]="placerlistecombinee",
["it"]="mettielencocombinato",
["nl"]="plaatssamengesteldelijst",
["pe"]="درج‌لیست‌مختلط",
@@ -2924,7 +3225,7 @@ return {
["cs"]="placefloat",
["de"]="placefloat",
["en"]="placefloat",
- ["fr"]="placeflottant",
+ ["fr"]="placerflottant",
["it"]="placefloat",
["nl"]="plaatsplaatsblok",
["pe"]="درج‌شناور",
@@ -2934,7 +3235,7 @@ return {
["cs"]="umistipoznamkypodcarou",
["de"]="platzierefussnoten",
["en"]="placefootnotes",
- ["fr"]="placenotespdp",
+ ["fr"]="placernotesbdp",
["it"]="mettinotepdp",
["nl"]="plaatsvoetnoten",
["pe"]="درج‌پانوشتها",
@@ -2944,7 +3245,7 @@ return {
["cs"]="umistirovnici",
["de"]="platziereformel",
["en"]="placeformula",
- ["fr"]="placeformule",
+ ["fr"]="placerformule",
["it"]="mettiformula",
["nl"]="plaatsformule",
["pe"]="درج‌فرمول",
@@ -2954,7 +3255,7 @@ return {
["cs"]="placeheadnumber",
["de"]="placeheadnumber",
["en"]="placeheadnumber",
- ["fr"]="placenumerotete",
+ ["fr"]="placernumerotete",
["it"]="posizionanumerotesta",
["nl"]="plaatskopnummer",
["pe"]="درج‌شماره‌سر",
@@ -2964,7 +3265,7 @@ return {
["cs"]="placeheadtext",
["de"]="placeheadtext",
["en"]="placeheadtext",
- ["fr"]="placetextetete",
+ ["fr"]="placertextetete",
["it"]="posizionatestotesta",
["nl"]="plaatskoptekst",
["pe"]="درج‌متن‌سر",
@@ -2974,7 +3275,7 @@ return {
["cs"]="umistilegendu",
["de"]="platzierelegende",
["en"]="placelegend",
- ["fr"]="placelegende",
+ ["fr"]="placerlegende",
["it"]="mettilegenda",
["nl"]="plaatslegenda",
["pe"]="درج‌راهنما",
@@ -2984,7 +3285,7 @@ return {
["cs"]="umistiseznam",
["de"]="platziereliste",
["en"]="placelist",
- ["fr"]="placeliste",
+ ["fr"]="placerliste",
["it"]="mettielenco",
["nl"]="plaatslijst",
["pe"]="درج‌لیست",
@@ -2992,33 +3293,46 @@ return {
},
["placelistofsynonyms"]={
["en"]="placelistofsynonyms",
+ ["fr"]="placerlistedesynonymes",
["nl"]="plaatslijstmetsynoniemen",
},
["placelocalfootnotes"]={
["cs"]="umistilokalnipoznamkypodcarou",
["de"]="platzierelokalefussnoten",
["en"]="placelocalfootnotes",
- ["fr"]="placenotespdplocales",
+ ["fr"]="placernotesbdplocales",
["it"]="mettinotepdplocali",
["nl"]="plaatslokalevoetnoten",
["pe"]="درج‌پانوشتهای‌موضعی",
["ro"]="punenotesubsollocale",
},
+ ["placelocalnotes"]={
+ ["en"]="placelocalnotes",
+ ["fr"]="placernoteslocales",
+ },
["placelogos"]={
["cs"]="umistiloga",
["de"]="platzierelogo",
["en"]="placelogos",
- ["fr"]="placelogos",
+ ["fr"]="placerlogo",
["it"]="mettiloghi",
["nl"]="plaatsbeeldmerken",
["pe"]="درج‌آرمها",
["ro"]="punelogouri",
},
+ ["placenamedfloat"]={
+ ["en"]="placenamedfloat",
+ ["fr"]="placerflottantnomme",
+ },
+ ["placenotes"]={
+ ["en"]="placenotes",
+ ["fr"]="placernotes",
+ },
["placeongrid"]={
["cs"]="umistinamrizku",
["de"]="amgitterausrichten",
["en"]="placeongrid",
- ["fr"]="placesurgrille",
+ ["fr"]="placersurgrille",
["it"]="mettiingriglia",
["nl"]="plaatsopgrid",
["pe"]="درج‌در‌توری",
@@ -3028,7 +3342,7 @@ return {
["cs"]="umistinadsebe",
["de"]="platziereuntereinander",
["en"]="placeontopofeachother",
- ["fr"]="placelesunsaudessusdesautres",
+ ["fr"]="placerlunaudessusdelautre",
["it"]="mettiunosullaltro",
["nl"]="plaatsonderelkaar",
["pe"]="درج‌در‌بالای‌یکدیگر",
@@ -3038,7 +3352,7 @@ return {
["cs"]="placepagenumber",
["de"]="placepagenumber",
["en"]="placepagenumber",
- ["fr"]="placenumeropage",
+ ["fr"]="placernumeropage",
["it"]="mettinumeropagina",
["nl"]="plaatspaginanummer",
["pe"]="درج‌شماره‌صفحه",
@@ -3048,7 +3362,7 @@ return {
["cs"]="placerawlist",
["de"]="placerawlist",
["en"]="placerawlist",
- ["fr"]="placerawlist",
+ ["fr"]="placerlistebrute",
["it"]="placerawlist",
["nl"]="plaatsruwelijst",
["pe"]="درج‌لیست‌خام",
@@ -3058,7 +3372,7 @@ return {
["cs"]="placereferencelist",
["de"]="placereferencelist",
["en"]="placereferencelist",
- ["fr"]="placelistereference",
+ ["fr"]="placerlistereference",
["it"]="placereferencelist",
["nl"]="plaatsreferentielijst",
["pe"]="درج‌لیست‌مرجع",
@@ -3068,7 +3382,7 @@ return {
["cs"]="umistirejstrik",
["de"]="platziereregister",
["en"]="placeregister",
- ["fr"]="placeregistre",
+ ["fr"]="placerregistre",
["it"]="mettiregistro",
["nl"]="plaatsregister",
["pe"]="درج‌ثبت",
@@ -3078,7 +3392,7 @@ return {
["cs"]="placerule",
["de"]="placerule",
["en"]="placerule",
- ["fr"]="placeregle",
+ ["fr"]="placertrait",
["it"]="mettilinea",
["nl"]="plaatslijn",
["pe"]="درج‌خط",
@@ -3088,7 +3402,7 @@ return {
["cs"]="umistivedlesebe",
["de"]="platzierenebeneinander",
["en"]="placesidebyside",
- ["fr"]="placecoteacote",
+ ["fr"]="placercoteacote",
["it"]="mettifiancoafianco",
["nl"]="plaatsnaastelkaar",
["pe"]="درج‌کنار‌به‌کنار",
@@ -3098,7 +3412,7 @@ return {
["cs"]="umistipodrovnici",
["de"]="platziereunterformel",
["en"]="placesubformula",
- ["fr"]="placesousformule",
+ ["fr"]="placersousformule",
["it"]="mettisottoformula",
["nl"]="plaatssubformule",
["pe"]="درج‌زیرفرمول",
@@ -3108,7 +3422,7 @@ return {
["cs"]="placetextvariable",
["de"]="placetextvariable",
["en"]="placetextvariable",
- ["fr"]="placevariabletexte",
+ ["fr"]="placervariabletexte",
["it"]="mettivariabiletesto",
["nl"]="plaatstekstvariabele",
["pe"]="درج‌متغیرمتن",
@@ -3128,17 +3442,45 @@ return {
["cs"]="positiontext",
["de"]="positiontext",
["en"]="positiontext",
- ["fr"]="positionnetexte",
+ ["fr"]="texteposition",
["it"]="posizionatesto",
["nl"]="positioneertekst",
["pe"]="مکان‌متن",
["ro"]="pozitietext",
},
+ ["postponenotes"]={
+ ["en"]="postponenotes",
+ ["fr"]="reporternotes",
+ },
+ ["postponingnotes"]={
+ ["en"]="postponingnotes",
+ ["fr"]="reportnotes",
+ },
+ ["predefinedfont"]={
+ ["en"]="predefinedfont",
+ ["fr"]="policepredefinie",
+ },
+ ["predefinefont"]={
+ ["en"]="predefinefont",
+ ["fr"]="predéfinirpolice",
+ },
+ ["presetdocument"]={
+ ["en"]="presetdocument",
+ ["fr"]="prereglerdocument",
+ },
+ ["prettyprintbuffer"]={
+ ["en"]="prettyprintbuffer",
+ ["fr"]="imprimerjolimenttampon",
+ },
+ ["preventmode"]={
+ ["en"]="preventmode",
+ ["fr"]="empechermode",
+ },
["printpaperheight"]={
["cs"]="vyskatiskpapiru",
["de"]="printpapierhoehe",
["en"]="printpaperheight",
- ["fr"]="hauteureditionpapier",
+ ["fr"]="hauteurpapierimpression",
["it"]="altezzacartastampa",
["nl"]="printpapierhoogte",
["pe"]="چاپ‌ارتفاع‌برگ",
@@ -3148,7 +3490,7 @@ return {
["cs"]="sirkatiskpapiru",
["de"]="printpapierbreite",
["en"]="printpaperwidth",
- ["fr"]="largeureditionpapier",
+ ["fr"]="largeurpapierimpression",
["it"]="ampiezzacartastampa",
["nl"]="printpapierbreedte",
["pe"]="چاپ‌عرض‌برگ",
@@ -3158,17 +3500,21 @@ return {
["cs"]="zpracujbloky",
["de"]="bearbeitebloecke",
["en"]="processblocks",
- ["fr"]="traiteblocs",
+ ["fr"]="traiterblocs",
["it"]="elaborablocchi",
["nl"]="verwerkblokken",
["pe"]="بلوکهای‌پردازش",
["ro"]="proceseazabloc",
},
+ ["processbodyfontenvironmentlist"]={
+ ["en"]="processbodyfontenvironmentlist",
+ ["fr"]="traiterlisteenvironnementpolicedecorps",
+ },
["processpage"]={
["cs"]="zpracujstranu",
["de"]="bearbeiteseite",
["en"]="processpage",
- ["fr"]="traitepage",
+ ["fr"]="traiterpage",
["it"]="elaborapagina",
["nl"]="verwerkpagina",
["pe"]="صفحه‌پردازش",
@@ -3248,12 +3594,16 @@ return {
["cs"]="opakovat",
["de"]="wiederholen",
["en"]="redo",
- ["fr"]="refait",
+ ["fr"]="refaire",
["it"]="rifai",
["nl"]="herhaal",
["pe"]="انجام‌دوباره",
["ro"]="refa",
},
+ ["redoconvertfont"]={
+ ["en"]="redoconvertfont",
+ ["fr"]="refaireconvertirpolice",
+ },
["ref"]={
["cs"]="ref",
["de"]="ref",
@@ -3278,7 +3628,7 @@ return {
["cs"]="odkaz",
["de"]="verweis",
["en"]="referral",
- ["fr"]="recommandation",
+ ["fr"]="redirection",
["it"]="referral",
["nl"]="kenmerk",
["pe"]="رجوع",
@@ -3288,7 +3638,7 @@ return {
["cs"]="odkaznadatum",
["de"]="verweisdatum",
["en"]="referraldate",
- ["fr"]="daterecommandation",
+ ["fr"]="dateredirection",
["it"]="datareferral",
["nl"]="kenmerkdatum",
["pe"]="تاریخ‌رجوع",
@@ -3298,22 +3648,38 @@ return {
["cs"]="odkazujici",
["de"]="referieren",
["en"]="referring",
- ["fr"]="faitreference",
+ ["fr"]="fairereference",
["it"]="referring",
["nl"]="refereer",
["pe"]="مراجعه",
["ro"]="referring",
},
+ ["registerfontclass"]={
+ ["en"]="registerfontclass",
+ ["fr"]="enregistrerclassepolice",
+ },
+ ["registerhyphenationexception"]={
+ ["en"]="registerhyphenationexception",
+ ["fr"]="enregistrerexceptioncesure",
+ },
+ ["registerhyphenationpattern"]={
+ ["en"]="registerhyphenationpattern",
+ ["fr"]="enregistrermotifcesure",
+ },
["remark"]={
["cs"]="oznaceni",
["de"]="bemerkung",
["en"]="remark",
- ["fr"]="commentaire",
+ ["fr"]="remarque",
["it"]="commento",
["nl"]="toelichting",
["pe"]="توجه",
["ro"]="remarca",
},
+ ["replacefeature"]={
+ ["en"]="replacefeature",
+ ["fr"]="remplacerfonctionnalite",
+ },
["reset"]={
["cs"]="reset",
["de"]="ruecksetzten",
@@ -3324,6 +3690,50 @@ return {
["pe"]="بازنشانی",
["ro"]="reset",
},
+ ["resetandaddfeature"]={
+ ["en"]="resetandaddfeature",
+ ["fr"]="razetajouterfonctionnalite",
+ },
+ ["resetcharacteralign"]={
+ ["en"]="resetcharacteralign",
+ ["fr"]="razalignercaractere",
+ },
+ ["resetcharacterkerning"]={
+ ["en"]="resetcharacterkerning",
+ ["fr"]="razapprochecaracteres",
+ },
+ ["resetcharacterspacing"]={
+ ["en"]="resetcharacterspacing",
+ ["fr"]="razespacementcaracteres",
+ },
+ ["resetcharacterstripping"]={
+ ["en"]="resetcharacterstripping",
+ ["fr"]="razdemontagecaracteres",
+ },
+ ["resetfeature"]={
+ ["en"]="resetfeature",
+ ["fr"]="razfonctionnalite",
+ },
+ ["resetfontcolorsheme"]={
+ ["en"]="resetfontcolorsheme",
+ ["fr"]="razthemecouleurpolice",
+ },
+ ["resetfontfallback"]={
+ ["en"]="resetfontfallback",
+ ["fr"]="razpolicederepli",
+ },
+ ["resetfontsolution"]={
+ ["en"]="resetfontsolution",
+ ["fr"]="zarsolutionpolice",
+ },
+ ["resethyphenationfeatures"]={
+ ["en"]="resethyphenationfeatures",
+ ["fr"]="razfonctionnalitescesure",
+ },
+ ["resetlocalfloats"]={
+ ["en"]="resetlocalfloats",
+ ["fr"]="razflottantslocaux",
+ },
["resetmarking"]={
["cs"]="resetznaceni",
["de"]="ruecksetztenbeschriftung",
@@ -3334,6 +3744,10 @@ return {
["pe"]="بازنشانی‌نشانه‌گذاری",
["ro"]="reseteazamarcaje",
},
+ ["resetmode"]={
+ ["en"]="resetmode",
+ ["fr"]="razmode",
+ },
["resetnumber"]={
["cs"]="resetnumber",
["de"]="resetnumber",
@@ -3344,16 +3758,44 @@ return {
["pe"]="بازنشانی‌شماره",
["ro"]="resetnumber",
},
- ["resettext"]={
+ ["resetpath"]={
+ ["en"]="resetpath",
+ ["fr"]="razchemin",
+ },
+ ["resetperiodkerning"]={
+ ["en"]="resetperiodkerning",
+ ["fr"]="razapprochepoint",
+ },
+ ["resetsystemmode"]={
+ ["en"]="resetsystemmode",
+ ["fr"]="razmodesysteme",
+ },
+ ["resettextcontent"]={
["cs"]="resettextcontent",
["de"]="resettextcontent",
["en"]="resettextcontent",
- ["fr"]="resettextcontent",
+ ["fr"]="raztexte",
["it"]="resettextcontent",
["nl"]="resettekstinhoud",
["pe"]="بازنشانی‌متن",
["ro"]="resettextcontent",
},
+ ["resetvisualizers"]={
+ ["en"]="resetvisualizers",
+ ["fr"]="razvisualisateurs",
+ },
+ ["restoreglobalbodyfont"]={
+ ["en"]="restoreglobalbodyfont",
+ ["fr"]="restaurerpolicedecorpsglobale",
+ },
+ ["retestfeature"]={
+ ["en"]="retestfeature",
+ ["fr"]="retesterfonctionnalite",
+ },
+ ["revivefeature"]={
+ ["en"]="revivefeature",
+ ["fr"]="relancerfonctionnalite",
+ },
["rightaligned"]={
["cs"]="zarovnanovpravo",
["de"]="rechtsbuendig",
@@ -3364,6 +3806,10 @@ return {
["pe"]="تنظیم‌راست",
["ro"]="aliniatdreapta",
},
+ ["rightbottombox"]={
+ ["en"]="rightbottombox",
+ ["fr"]="boitebasdroite",
+ },
["rightedgedistance"]={
["cs"]="vzdalenostpravehookraje",
["de"]="abstandrechterrand",
@@ -3384,6 +3830,10 @@ return {
["pe"]="عرض‌لبه‌راست",
["ro"]="latimecoltdreapta",
},
+ ["rightline"]={
+ ["en"]="rightline",
+ ["fr"]="lignedroite",
+ },
["rightmargindistance"]={
["cs"]="vzdalenostpravemarginalie",
["de"]="rechtemarginalafstand",
@@ -3418,7 +3868,7 @@ return {
["cs"]="otocit",
["de"]="drehen",
["en"]="rotate",
- ["fr"]="oriente",
+ ["fr"]="tourner",
["it"]="ruota",
["nl"]="roteer",
["pe"]="دوران",
@@ -3426,13 +3876,14 @@ return {
},
["savebuffer"]={
["en"]="savebuffer",
+ ["fr"]="enregistrertampon",
["nl"]="bewaarbuffer",
},
["scale"]={
["cs"]="meritko",
["de"]="format",
["en"]="scale",
- ["fr"]="echelle",
+ ["fr"]="mettrealechelle",
["it"]="scala",
["nl"]="schaal",
["pe"]="مقیاس",
@@ -3452,7 +3903,7 @@ return {
["cs"]="vyberbloky",
["de"]="waehlebloeckeaus",
["en"]="selectblocks",
- ["fr"]="selectionneblocs",
+ ["fr"]="selectionnerblocs",
["it"]="selezionablocchi",
["nl"]="selecteerblokken",
["pe"]="انتخاب‌بلوکها",
@@ -3462,7 +3913,7 @@ return {
["cs"]="vyberpapir",
["de"]="waehlepapieraus",
["en"]="selectpaper",
- ["fr"]="selectionnepapier",
+ ["fr"]="selectionnerpapier",
["it"]="selezionacarta",
["nl"]="selecteerpapier",
["pe"]="انتخاب‌برگ",
@@ -3472,27 +3923,127 @@ return {
["cs"]="vyberverzi",
["de"]="waehleversionaus",
["en"]="selectversion",
- ["fr"]="selectionneversion",
+ ["fr"]="selectionnerversion",
["it"]="selezionaversione",
["nl"]="selecteerversie",
["pe"]="انتخاب‌نسخه",
["ro"]="selecteazaversiune",
},
+ ["setbigbodyfont"]={
+ ["en"]="setbigbodyfont",
+ ["fr"]="reglerpolicedecorpsimportante",
+ },
+ ["setcharacteralign"]={
+ ["en"]="setcharacteralign",
+ ["fr"]="regleralignercaractere",
+ },
+ ["setcharacteraligndetail"]={
+ ["en"]="setcharacteraligndetail",
+ ["fr"]="reglerdetailalignercaractere",
+ },
+ ["setcharactercasing"]={
+ ["en"]="setcharactercasing",
+ ["fr"]="reglercassecaracteres",
+ },
+ ["setcharactercleaning"]={
+ ["en"]="setcharactercleaning",
+ ["fr"]="reglernettoyagecaracteres",
+ },
+ ["setcharacterkerning"]={
+ ["en"]="setcharacterkerning",
+ ["fr"]="reglerapprochecaracteres",
+ },
+ ["setcharacterspacing"]={
+ ["en"]="setcharacterspacing",
+ ["fr"]="reglerespacementcaracteres",
+ },
+ ["setcharacterstripping"]={
+ ["en"]="setcharacterstripping",
+ ["fr"]="reglerdemontagecaracteres",
+ },
+ ["setcurrentfontclass"]={
+ ["en"]="setcurrentfontclass",
+ ["fr"]="reglerclassepolicecourante",
+ },
+ ["setfirstline"]={
+ ["en"]="setfirstline",
+ ["fr"]="reglerpremiereligne",
+ },
+ ["setfirstpasscharacteralign"]={
+ ["en"]="setfirstpasscharacteralign",
+ ["fr"]="regleralignercaracterepremierepasse",
+ },
+ ["setfont"]={
+ ["en"]="setfont",
+ ["fr"]="reglerpolice",
+ },
+ ["setfontcolorsheme"]={
+ ["en"]="setfontcolorsheme",
+ ["fr"]="reglerthemecouleurpolice",
+ },
+ ["setfontfeature"]={
+ ["en"]="setfontfeature",
+ ["fr"]="reglerfonctionnalitepolice",
+ },
+ ["setfontsolution"]={
+ ["en"]="setfontsolution",
+ ["fr"]="reglersolutionpolice",
+ },
+ ["setfontstrut"]={
+ ["en"]="setfontstrut",
+ ["fr"]="reglerentretoisepolice",
+ },
+ ["sethyphenationfeatures"]={
+ ["en"]="sethyphenationfeatures",
+ ["fr"]="reglerfonctionnalitescesure",
+ },
+ ["setmainbodyfont"]={
+ ["en"]="setmainbodyfont",
+ ["fr"]="reglerpolicedecorpsprincipale",
+ },
+ ["setmode"]={
+ ["en"]="setmode",
+ ["fr"]="reglermode",
+ },
+ ["setnote"]={
+ ["en"]="setnote",
+ ["fr"]="reglernote",
+ },
+ ["setnotetext"]={
+ ["en"]="setnotetext",
+ ["fr"]="reglertextenote",
+ },
["setnumber"]={
["cs"]="setnumber",
["de"]="setnumber",
["en"]="setnumber",
- ["fr"]="affectenumero",
+ ["fr"]="reglernumero",
["it"]="setnumber",
["nl"]="setnummer",
["pe"]="تعیین‌شماره",
["ro"]="setnumber",
},
+ ["setperiodkerning"]={
+ ["en"]="setperiodkerning",
+ ["fr"]="reglerapprochepoint",
+ },
+ ["setsecondpasscharacteralign"]={
+ ["en"]="setsecondpasscharacteralign",
+ ["fr"]="regleralignercaracteresecondepasse",
+ },
+ ["setsmallbodyfont"]={
+ ["en"]="setsmallbodyfont",
+ ["fr"]="reglerpolicedecorpspetite",
+ },
+ ["setsystemmode"]={
+ ["en"]="setsystemmode",
+ ["fr"]="reglermodesysteme",
+ },
["settextcontent"]={
["cs"]="settextcontent",
["de"]="settext",
["en"]="settextcontent",
- ["fr"]="settext",
+ ["fr"]="reglercontenutexte",
["it"]="settext",
["nl"]="steltekstinhoudin",
["pe"]="تعیین‌محتوای‌متن",
@@ -3502,7 +4053,7 @@ return {
["cs"]="settextvariable",
["de"]="settextvariable",
["en"]="settextvariable",
- ["fr"]="affectevariabletexte",
+ ["fr"]="reglervariabletexte",
["it"]="setvariabiletesto",
["nl"]="kentekstvariabeletoe",
["pe"]="تعیین‌متغیر‌متن",
@@ -3512,7 +4063,7 @@ return {
["cs"]="nastavzarovnani",
["de"]="stelleausrichtungein",
["en"]="setupalign",
- ["fr"]="reglealignement",
+ ["fr"]="configureraligner",
["it"]="impostaallineamento",
["nl"]="steluitlijnenin",
["pe"]="بارگذاری‌تنظیم",
@@ -3522,7 +4073,7 @@ return {
["cs"]="setupanswerarea",
["de"]="setupanswerarea",
["en"]="setupanswerarea",
- ["fr"]="setupanswerarea",
+ ["fr"]="configurerzonereponse",
["it"]="setupanswerarea",
["nl"]="stelantwoordgebiedin",
["pe"]="setupanswerarea",
@@ -3532,17 +4083,21 @@ return {
["cs"]="nastavusporadani",
["de"]="stelleanordnenein",
["en"]="setuparranging",
- ["fr"]="reglearrangement",
+ ["fr"]="configurerarrangement",
["it"]="impostaparranging",
["nl"]="stelarrangerenin",
["pe"]="بارگذاری‌ترتیب",
["ro"]="seteazaaranjareapag",
},
+ ["setupattachment"]={
+ ["en"]="setupattachment",
+ ["fr"]="configurepiecejointe",
+ },
["setupbackground"]={
["cs"]="nastavpozadi",
["de"]="stellehintergrundein",
["en"]="setupbackground",
- ["fr"]="reglearriereplan",
+ ["fr"]="configurerarriereplan",
["it"]="impostasfondo",
["nl"]="stelachtergrondin",
["pe"]="بارگذاری‌پس‌زمینه",
@@ -3552,7 +4107,7 @@ return {
["cs"]="nastavpozadi",
["de"]="stellehintergruendeein",
["en"]="setupbackgrounds",
- ["fr"]="reglearriereplans",
+ ["fr"]="configurerarriereplans",
["it"]="impostasfondi",
["nl"]="stelachtergrondenin",
["pe"]="بارگذاری‌پس‌زمینه‌ها",
@@ -3562,7 +4117,7 @@ return {
["cs"]="nastavcernelinky",
["de"]="stellerechteckein",
["en"]="setupblackrules",
- ["fr"]="reglelignesnoires",
+ ["fr"]="configurertraitsepais",
["it"]="impostalineenere",
["nl"]="stelblokjesin",
["pe"]="بارگذاری‌خطهای‌سیاه",
@@ -3572,7 +4127,7 @@ return {
["cs"]="nastavpreskok",
["de"]="stelleblankoein",
["en"]="setupblank",
- ["fr"]="definitvide",
+ ["fr"]="configurervierge",
["it"]="impostarigovuoto",
["nl"]="stelblankoin",
["pe"]="بارگذاری‌خالی",
@@ -3582,7 +4137,7 @@ return {
["cs"]="nastavblok",
["de"]="stelleblockein",
["en"]="setupblock",
- ["fr"]="reglebloc",
+ ["fr"]="configurerbloc",
["it"]="impostablocco",
["nl"]="stelblokin",
["pe"]="بارگذاری‌بلوک",
@@ -3592,7 +4147,7 @@ return {
["cs"]="nastavzakladnifont",
["de"]="stellefliesstextein",
["en"]="setupbodyfont",
- ["fr"]="reglepolicecorps",
+ ["fr"]="configurerpolicedecorps",
["it"]="impostafontdeltesto",
["nl"]="stelkorpsin",
["pe"]="بارگذاری‌قلم‌متن",
@@ -3602,7 +4157,7 @@ return {
["cs"]="nastavprostredizakladnihofontu",
["de"]="stellefliesstextumgebungein",
["en"]="setupbodyfontenvironment",
- ["fr"]="regleenvironnementpolicecorps",
+ ["fr"]="configurerenvironnementpolicedecorps",
["it"]="impostaambientefontdeltesto",
["nl"]="stelkorpsomgevingin",
["pe"]="بارگذاری‌محیط‌قلم‌متن",
@@ -3612,7 +4167,7 @@ return {
["cs"]="nastavspodek",
["de"]="stelleuntenein",
["en"]="setupbottom",
- ["fr"]="regleinf",
+ ["fr"]="configurerbas",
["it"]="impostafondo",
["nl"]="stelonderin",
["pe"]="بارگذاری‌پایین",
@@ -3622,7 +4177,7 @@ return {
["cs"]="nastavdolnitexty",
["de"]="stelletextuntenein",
["en"]="setupbottomtexts",
- ["fr"]="regletextesinf",
+ ["fr"]="configurertextesbas",
["it"]="impostatestifondo",
["nl"]="stelondertekstenin",
["pe"]="بارگذاری‌متن‌پایین",
@@ -3632,7 +4187,7 @@ return {
["cs"]="nastavbuffer",
["de"]="stellepufferein",
["en"]="setupbuffer",
- ["fr"]="reglebuffer",
+ ["fr"]="configurertampon",
["it"]="impostabuffer",
["nl"]="stelbufferin",
["pe"]="بارگذاری‌بافر",
@@ -3642,7 +4197,7 @@ return {
["cs"]="nastavtlacitka",
["de"]="stelleknopfein",
["en"]="setupbuttons",
- ["fr"]="regleboutons",
+ ["fr"]="configurerboutons",
["it"]="impostapulsanti",
["nl"]="stelbuttonsin",
["pe"]="بارگذاری‌دکمه‌ها",
@@ -3652,7 +4207,7 @@ return {
["cs"]="nastavkapitalky",
["de"]="stelleversalienein",
["en"]="setupcapitals",
- ["fr"]="reglecapitales",
+ ["fr"]="configurercapitales",
["it"]="impostamaiuscole",
["nl"]="stelkapitalenin",
["pe"]="setupcapitals",
@@ -3662,7 +4217,7 @@ return {
["cs"]="nastavpopisek",
["de"]="stellebildunterschriftein",
["en"]="setupcaption",
- ["fr"]="regleintitule",
+ ["fr"]="configurerintitule",
["it"]="impostacaption",
["nl"]="stelblokkopjein",
["pe"]="بارگذاری‌شرح",
@@ -3672,17 +4227,29 @@ return {
["cs"]="nastavpopisky",
["de"]="stellebilderunterschriftein",
["en"]="setupcaptions",
- ["fr"]="regleintitules",
+ ["fr"]="configurerintitules",
["it"]="impostacaptions",
["nl"]="stelblokkopjesin",
["pe"]="بارگذاری‌شرحها",
["ro"]="seteazalegendele",
},
+ ["setupcharacteralign"]={
+ ["en"]="setupcharacteralign",
+ ["fr"]="configureralignercaractere",
+ },
+ ["setupcharacterkerning"]={
+ ["en"]="setupcharacterkerning",
+ ["fr"]="configurerapprochecaracteres",
+ },
+ ["setupcharacterspacing"]={
+ ["en"]="setupcharacterspacing",
+ ["fr"]="configurerespacementcaracteres",
+ },
["setupclipping"]={
["cs"]="nastavorez",
["de"]="stelleausschnittein",
["en"]="setupclipping",
- ["fr"]="regleclipping",
+ ["fr"]="configurerdecoupage",
["it"]="impostaclippling",
["nl"]="stelclipin",
["pe"]="بارگذاری‌چیدن",
@@ -3692,7 +4259,7 @@ return {
["cs"]="nastavbarvu",
["de"]="stellefarbeein",
["en"]="setupcolor",
- ["fr"]="reglecouleur",
+ ["fr"]="configurercouleur",
["it"]="impostacolore",
["nl"]="stelkleurin",
["pe"]="بارگذاری‌رنگ",
@@ -3702,7 +4269,7 @@ return {
["cs"]="nastavbarvy",
["de"]="stellefarbenein",
["en"]="setupcolors",
- ["fr"]="reglecouleurs",
+ ["fr"]="configurercouleurs",
["it"]="impostacolori",
["nl"]="stelkleurenin",
["pe"]="بارگذاری‌رنگها",
@@ -3712,7 +4279,7 @@ return {
["cs"]="nastavsloupce",
["de"]="stellespaltenein",
["en"]="setupcolumns",
- ["fr"]="reglecolonnes",
+ ["fr"]="configurercolonnes",
["it"]="impostacolonne",
["nl"]="stelkolommenin",
["pe"]="بارگذاری‌ستونها",
@@ -3722,7 +4289,7 @@ return {
["cs"]="setupcolumnset",
["de"]="setupcolumnset",
["en"]="setupcolumnset",
- ["fr"]="reglejeucolonne",
+ ["fr"]="configurerjeucolonnes",
["it"]="impostagruppocolonne",
["nl"]="stelkolomgroepin",
["pe"]="بارگذاری‌مجموعه‌ستون",
@@ -3732,7 +4299,7 @@ return {
["cs"]="setupcolumnsetlines",
["de"]="setupcolumnsetlines",
["en"]="setupcolumnsetlines",
- ["fr"]="setupcolumnsetlines",
+ ["fr"]="configurerlignesjeucolonnes",
["it"]="setupcolumnsetlines",
["nl"]="stelkolomgroepregelsin",
["pe"]="بارگذاری‌خطهای‌مجموعه‌ستون",
@@ -3742,7 +4309,7 @@ return {
["cs"]="setupcolumnsetstart",
["de"]="setupcolumnsetstart",
["en"]="setupcolumnsetstart",
- ["fr"]="setupcolumnsetstart",
+ ["fr"]="configurerfinjeucolonnes",
["it"]="setupcolumnsetstart",
["nl"]="stelkolomgroepstartin",
["pe"]="بارگذاری‌شروع‌مجموعه‌ستون",
@@ -3752,7 +4319,7 @@ return {
["cs"]="nastavspojeni",
["de"]="stellekombinationein",
["en"]="setupcombinations",
- ["fr"]="reglecombinaisons",
+ ["fr"]="configurercombinaisons",
["it"]="impostacombinazioni",
["nl"]="stelcombinatiesin",
["pe"]="بارگذاری‌ترکیب‌ها",
@@ -3762,7 +4329,7 @@ return {
["cs"]="nastavkombinovanyseznam",
["de"]="stellezusammengestelltelisteein",
["en"]="setupcombinedlist",
- ["fr"]="reglelisteimbriquee",
+ ["fr"]="configurerlistecombinee",
["it"]="impostaelencocombinato",
["nl"]="stelsamengesteldelijstin",
["pe"]="بارگذاری‌لیست‌ترکیبی",
@@ -3772,45 +4339,51 @@ return {
["cs"]="nastavkomentar",
["de"]="stellekommentarein",
["en"]="setupcomment",
- ["fr"]="reglecommentaire",
+ ["fr"]="configurercommentaire",
["it"]="impostacommento",
["nl"]="stelcommentaarin",
["pe"]="بارگذاری‌توضیح",
["ro"]="seteazacomentariu",
},
+ ["setupcounter"]={
+ ["en"]="setupcounter",
+ ["fr"]="configurercompteur",
+ },
+ ["setupdescription"]={
+ ["en"]="setupdescription",
+ ["fr"]="configurerdescription",
+ ["nl"]="steldoordefinierenin",
+ },
["setupdescriptions"]={
["cs"]="nastavpopisy",
["de"]="definierebeschreibungen",
["en"]="setupdescriptions",
- ["fr"]="regledescriptions",
+ ["fr"]="configurerdescriptions",
["it"]="impostadescrizioni",
["nl"]="steldoordefinierenin",
["pe"]="بارگذاری‌شرح",
["ro"]="seteazadescriere",
},
- ["setupdescription"]={
- ["en"]="setupdescription",
- ["nl"]="steldoordefinierenin",
+ ["setupenumeration"]={
+ ["en"]="setupenumeration",
+ ["fr"]="configurerénumération",
+ ["nl"]="steldoornummerenin",
},
["setupenumerations"]={
["cs"]="nastavvycty",
["de"]="stellebeschreibungein",
["en"]="setupenumerations",
- ["fr"]="regleenumerations",
+ ["fr"]="configurerénumérations",
["it"]="impostaenumerazioni",
["nl"]="steldoornummerenin",
["pe"]="بارگذاری‌شماره‌گذاریها",
["ro"]="seteazaenumerare",
},
- ["setupenumeration"]={
- ["en"]="setupenumeration",
- ["nl"]="steldoornummerenin",
- },
["setupexternalfigures"]={
["cs"]="nastavexterniobrazy",
["de"]="stelleexterneabbildungenein",
["en"]="setupexternalfigures",
- ["fr"]="reglefiguresexternes",
+ ["fr"]="configurerfiguresexterne",
["it"]="impostafigureesterne",
["nl"]="stelexternefigurenin",
["pe"]="بارگذاری‌شکلهای‌خارجی",
@@ -3820,7 +4393,7 @@ return {
["cs"]="nastavpole",
["de"]="stellefeldein",
["en"]="setupfield",
- ["fr"]="reglechamp",
+ ["fr"]="configurerchamp",
["it"]="impostacampo",
["nl"]="stelveldin",
["pe"]="بارگذاری‌میدان",
@@ -3830,7 +4403,7 @@ return {
["cs"]="nastavvsechnapole",
["de"]="stellefelderin",
["en"]="setupfields",
- ["fr"]="reglechamps",
+ ["fr"]="configurerchamps",
["it"]="impostacampi",
["nl"]="stelveldenin",
["pe"]="بارگذاری‌میدانها",
@@ -3840,7 +4413,7 @@ return {
["cs"]="nastavvyplnoveradky",
["de"]="stellegefuelltezeileein",
["en"]="setupfillinlines",
- ["fr"]="regleremplitligne",
+ ["fr"]="configurerlignesarenseigner",
["it"]="impostarigheriempimento",
["nl"]="stelinvulregelsin",
["pe"]="بارگذاری‌پرکردن‌خطها",
@@ -3850,17 +4423,21 @@ return {
["cs"]="nastavvyplnovelinky",
["de"]="stellegefuelltesrechteckein",
["en"]="setupfillinrules",
- ["fr"]="regleremplitlignesreglees",
+ ["fr"]="configurertraitsarenseigner",
["it"]="impostalineeriempimento",
["nl"]="stelinvullijnenin",
["pe"]="بارگذاری‌درج‌درخطها",
["ro"]="seteazarigleumplere",
},
+ ["setupfirstline"]={
+ ["en"]="setupfirstline",
+ ["fr"]="configurerpremiereligne",
+ },
["setupfloat"]={
["cs"]="nastavplvouciobjekt",
["de"]="stellegleitobjektein",
["en"]="setupfloat",
- ["fr"]="regleflottant",
+ ["fr"]="configurerflottant",
["it"]="impostaoggettomobile",
["nl"]="stelplaatsblokin",
["pe"]="بارگذاری‌شناور",
@@ -3870,7 +4447,7 @@ return {
["cs"]="nastavplvouciobjekty",
["de"]="stellegleitobjekteein",
["en"]="setupfloats",
- ["fr"]="regleflottants",
+ ["fr"]="configurerflottants",
["it"]="impostaoggettimobili",
["nl"]="stelplaatsblokkenin",
["pe"]="بارگذاری‌شناورها",
@@ -3880,17 +4457,33 @@ return {
["cs"]="nastavdeleniplvoucichobjektu",
["de"]="stelleplatziegeteiltegleitobjekt",
["en"]="setupfloatsplitting",
- ["fr"]="regleseparationflottant",
+ ["fr"]="configurerpartageflottants",
["it"]="impostaspezzamentooggettomobile",
["nl"]="stelplaatsbloksplitsenin",
["pe"]="بارگذاری‌شکافتن‌شناورها",
["ro"]="seteazaimpartireafloat",
},
+ ["setupfontexpansion"]={
+ ["en"]="setupfontexpansion",
+ ["fr"]="configurerexpansionpolice",
+ },
+ ["setupfontprotrusion"]={
+ ["en"]="setupfontprotrusion",
+ ["fr"]="configurerprotrusionpolice",
+ },
+ ["setupfonts"]={
+ ["en"]="setupfonts",
+ ["fr"]="configurerpolices",
+ },
+ ["setupfontsolution"]={
+ ["en"]="setupfontsolution",
+ ["fr"]="configuresolutionpolice",
+ },
["setupfooter"]={
["cs"]="nastavupati",
["de"]="stellefusszeileein",
["en"]="setupfooter",
- ["fr"]="reglepdp",
+ ["fr"]="configurerpdp",
["it"]="impostapdp",
["nl"]="stelvoetin",
["pe"]="بارگذاری‌ته‌برگ",
@@ -3900,7 +4493,7 @@ return {
["cs"]="nastavtextyupati",
["de"]="stellefusszeilentextein",
["en"]="setupfootertexts",
- ["fr"]="regletextespdp",
+ ["fr"]="configurertextespdp",
["it"]="impostatestipdp",
["nl"]="stelvoettekstenin",
["pe"]="بارگذاری‌متن‌پانوشت",
@@ -3910,7 +4503,7 @@ return {
["cs"]="nastavdefinicipoznamekpodcarou",
["de"]="stellefussnotendefinitionein",
["en"]="setupfootnotedefinition",
- ["fr"]="definitnotepdp",
+ ["fr"]="configurerdefinitionnotebdp",
["it"]="impostadefinizionenotepdp",
["nl"]="stelvoetnootdefinitiein",
["pe"]="بارگذاری‌تعریف‌پانوشت",
@@ -3920,7 +4513,7 @@ return {
["cs"]="nastavpoznamkypodcarou",
["de"]="stellefussnotenein",
["en"]="setupfootnotes",
- ["fr"]="reglenotepdp",
+ ["fr"]="configurernotesbdp",
["it"]="impostanotepdp",
["nl"]="stelvoetnotenin",
["pe"]="بارگذاری‌پانوشتها",
@@ -3930,55 +4523,57 @@ return {
["cs"]="setupforms",
["de"]="setupforms",
["en"]="setupforms",
- ["fr"]="regleformulaires",
+ ["fr"]="configurerformulaires",
["it"]="impostaforms",
["nl"]="stelformulierenin",
["pe"]="بارگذاری‌طرح",
["ro"]="seteazaformulare",
},
+ ["setupformula"]={
+ ["en"]="setupformula",
+ ["fr"]="configurerformule",
+ ["nl"]="stelformulein",
+ },
["setupformulas"]={
["cs"]="nastavrovnice",
["de"]="stelleformelnein",
["en"]="setupformulae",
- ["fr"]="regleformules",
+ ["fr"]="configurerformules",
["it"]="impostaformule",
["nl"]="stelformulesin",
["pe"]="بارگذاری‌فرمولها",
["ro"]="seteazaformule",
},
- ["setupformula"]={
- ["en"]="setupformula",
- ["nl"]="stelformulein",
- },
["setupframed"]={
["cs"]="nastavoramovani",
["de"]="stelleumrahmtein",
["en"]="setupframed",
- ["fr"]="regleencadre",
+ ["fr"]="configurerencadre",
["it"]="impostaincorniciato",
["nl"]="stelomlijndin",
["pe"]="بارگذاری‌قالبی",
["ro"]="seteazainconjurat",
},
+ ["setupframedtext"]={
+ ["en"]="setupframedtext",
+ ["fr"]="configurertexteencadre",
+ ["nl"]="stelkadertekstin",
+ },
["setupframedtexts"]={
["cs"]="nastavoramovanetexty",
["de"]="stelleumrahmtetexteein",
["en"]="setupframedtexts",
- ["fr"]="setupframedtexts",
+ ["fr"]="configurertextesencadres",
["it"]="impostatestiincorniciati",
["nl"]="stelkadertekstenin",
["pe"]="بارگذاری‌متن‌قالبی",
["ro"]="definestetexteinconjurate",
},
- ["setupframedtext"]={
- ["en"]="setupframedtext",
- ["nl"]="stelkadertekstin",
- },
["setuphead"]={
["cs"]="nastavnadpis",
["de"]="stelleueberschriftein",
["en"]="setuphead",
- ["fr"]="regletete",
+ ["fr"]="configurertête",
["it"]="impostatesta",
["nl"]="stelkopin",
["pe"]="بارگذاری‌سر",
@@ -3988,7 +4583,7 @@ return {
["cs"]="nastavzahlavi",
["de"]="stellekopfzeileein",
["en"]="setupheader",
- ["fr"]="regleentete",
+ ["fr"]="configurerentête",
["it"]="impostainstestazione",
["nl"]="stelhoofdin",
["pe"]="بارگذاری‌سربرگ",
@@ -3998,7 +4593,7 @@ return {
["cs"]="nastavtextyzahlavi",
["de"]="stellekopfzeilentextein",
["en"]="setupheadertexts",
- ["fr"]="regletextesentete",
+ ["fr"]="configurertextesentête",
["it"]="impostatestiintestazioni",
["nl"]="stelhoofdtekstenin",
["pe"]="بارگذاری‌متن‌سربرگ",
@@ -4008,7 +4603,7 @@ return {
["cs"]="nastavcislonadpisu",
["de"]="stellekopfzahlein",
["en"]="setupheadnumber",
- ["fr"]="reglenumerotete",
+ ["fr"]="configurernumerotête",
["it"]="impostanumerotesta",
["nl"]="stelkopnummerin",
["pe"]="بارگذاری‌شماره‌سر",
@@ -4018,7 +4613,7 @@ return {
["cs"]="nastavnadpisy",
["de"]="stelleueberschriftenein",
["en"]="setupheads",
- ["fr"]="regletetes",
+ ["fr"]="configurertêtes",
["it"]="impostateste",
["nl"]="stelkoppenin",
["pe"]="بارگذاری‌سرها",
@@ -4028,17 +4623,21 @@ return {
["cs"]="nastavtexthlavicky",
["de"]="stelleueberschrifttextein",
["en"]="setupheadtext",
- ["fr"]="regletextetete",
+ ["fr"]="configurertextêtete",
["it"]="impostatestointestazioni",
["nl"]="stelkoptekstin",
["pe"]="بارگذاری‌متن‌سر",
["ro"]="seteazatexttitlu",
},
+ ["setuphyphenation"]={
+ ["en"]="setuphyphenation",
+ ["fr"]="configurercesure",
+ },
["setuphyphenmark"]={
["cs"]="nastavdelitko",
["de"]="stellebindestrichein",
["en"]="setuphyphenmark",
- ["fr"]="reglemarquagehyphenation",
+ ["fr"]="configurermarquecesure",
["it"]="impostasegnosillabazione",
["nl"]="stelkoppeltekenin",
["pe"]="بارگذاری‌نشانه‌شکستن",
@@ -4046,13 +4645,14 @@ return {
},
["setupindentedtext"]={
["en"]="setupindentedtext",
+ ["fr"]="configurertexteindente",
["nl"]="stelingesprongentextin",
},
["setupindenting"]={
["cs"]="nastavodsazovani",
["de"]="stelleeinziehenein",
["en"]="setupindenting",
- ["fr"]="reglecomposeenalinea",
+ ["fr"]="configurerindentation",
["it"]="impostarientro",
["nl"]="stelinspringenin",
["pe"]="بارگذاری‌تورفتگی",
@@ -4062,7 +4662,7 @@ return {
["cs"]="nastavmarginalie",
["de"]="stelleinmarginalieein",
["en"]="setupinmargin",
- ["fr"]="regledansmarge",
+ ["fr"]="configurerdansmarge",
["it"]="impostainmargine",
["nl"]="stelinmargein",
["pe"]="بارگذاری‌درون‌حاشیه",
@@ -4072,7 +4672,7 @@ return {
["cs"]="nastavinterakci",
["de"]="stelleinteraktionein",
["en"]="setupinteraction",
- ["fr"]="regleinteraction",
+ ["fr"]="configurerinteraction",
["it"]="impostainterazione",
["nl"]="stelinteractiein",
["pe"]="بارگذاری‌پانل",
@@ -4082,7 +4682,7 @@ return {
["cs"]="nastavinterakcnilistu",
["de"]="stelleinteraktionsbalkenein",
["en"]="setupinteractionbar",
- ["fr"]="reglebarreinteraction",
+ ["fr"]="configurerbarreinteraction",
["it"]="impostabarrainterazione",
["nl"]="stelinteractiebalkin",
["pe"]="بارگذاری‌میله‌پانل",
@@ -4092,7 +4692,7 @@ return {
["cs"]="nastavinterakcnimenu",
["de"]="stelleinteraktionsmenueein",
["en"]="setupinteractionmenu",
- ["fr"]="reglemenuinteraction",
+ ["fr"]="configurermenuinteraction",
["it"]="impostamenuinterazione",
["nl"]="stelinteractiemenuin",
["pe"]="بارگذاری‌منوی‌پانل",
@@ -4102,7 +4702,7 @@ return {
["cs"]="nastavinterakcniobrazovku",
["de"]="stelleinteraktionsbildschirmein",
["en"]="setupinteractionscreen",
- ["fr"]="regleecraninteraction",
+ ["fr"]="configurerecraninteraction",
["it"]="impostaschermointerazione",
["nl"]="stelinteractieschermin",
["pe"]="بارگذاری‌پرده‌پانل",
@@ -4112,7 +4712,7 @@ return {
["cs"]="nastavmeziradkovoumezeru",
["de"]="stellezeilenabstandein",
["en"]="setupinterlinespace",
- ["fr"]="regleespacementinterligne",
+ ["fr"]="configurerespaceinterligne",
["it"]="impostainterlinea",
["nl"]="stelinterliniein",
["pe"]="بارگذاری‌فاصله‌بین‌خط",
@@ -4122,7 +4722,7 @@ return {
["cs"]="setupitemgroup",
["de"]="setupitemgroup",
["en"]="setupitemgroup",
- ["fr"]="setupitemgroup",
+ ["fr"]="configurergroupedéléments",
["it"]="setupitemgroup",
["nl"]="stelitemgroepin",
["pe"]="بارگذاری‌گروه‌آیتم",
@@ -4132,7 +4732,7 @@ return {
["cs"]="nastavvycty",
["de"]="stelleaufzaehlungenein",
["en"]="setupitemizations",
- ["fr"]="reglegroupeselements",
+ ["fr"]="configurergroupesdéléments",
["it"]="impostaelencazioni",
["nl"]="stelopsommingenin",
["pe"]="بارگذاری‌گروههای‌آیتم",
@@ -4142,7 +4742,7 @@ return {
["cs"]="nastavpolozky",
["de"]="stellepostenein",
["en"]="setupitems",
- ["fr"]="regleelements",
+ ["fr"]="configureréléments",
["it"]="impostaelementi",
["nl"]="stelitemsin",
["pe"]="بارگذاری‌آیتمها",
@@ -4152,7 +4752,7 @@ return {
["cs"]="nastavtextpopisku",
["de"]="stellelabeltextein",
["en"]="setuplabeltext",
- ["fr"]="reglelabeltexte",
+ ["fr"]="configureretiquettetexte",
["it"]="impostatestoetichette",
["nl"]="stellabeltekstin",
["pe"]="باگذاری‌متن‌برچسب",
@@ -4162,7 +4762,7 @@ return {
["cs"]="nastavjazyk",
["de"]="stellespracheein",
["en"]="setuplanguage",
- ["fr"]="reglelangue",
+ ["fr"]="configurerlangue",
["it"]="impostalingua",
["nl"]="steltaalin",
["pe"]="بارگذاری‌زبان",
@@ -4172,7 +4772,7 @@ return {
["cs"]="nastavvzhled",
["de"]="stellelayoutein",
["en"]="setuplayout",
- ["fr"]="regledisposition",
+ ["fr"]="configurermiseenpage",
["it"]="impostalayout",
["nl"]="stellayoutin",
["pe"]="بارگذاری‌طرح‌بندی",
@@ -4182,17 +4782,21 @@ return {
["cs"]="nastavlegendu",
["de"]="stellelegendeein",
["en"]="setuplegend",
- ["fr"]="reglelegende",
+ ["fr"]="configurerlegende",
["it"]="impostalegenda",
["nl"]="stellegendain",
["pe"]="بارگذاری‌راهنما",
["ro"]="seteazalegenda",
},
+ ["setuplinenote"]={
+ ["en"]="setuplinenote",
+ ["fr"]="configurernotedeligne",
+ },
["setuplinenumbering"]={
["cs"]="nastavcislovaniradku",
["de"]="stellezeilennumerierungein",
["en"]="setuplinenumbering",
- ["fr"]="reglenumerotationligne",
+ ["fr"]="configurernumérotationligne",
["it"]="impostanumerazionerighe",
["nl"]="stelregelnummerenin",
["pe"]="بارگذاری‌شماره‌‌گذاری‌خط",
@@ -4202,7 +4806,7 @@ return {
["cs"]="nastavradky",
["de"]="stellezeilenein",
["en"]="setuplines",
- ["fr"]="reglelignes",
+ ["fr"]="configurerlignes",
["it"]="impostarighe",
["nl"]="stelregelsin",
["pe"]="بارگذاری‌خطها",
@@ -4212,7 +4816,7 @@ return {
["cs"]="nastavsirkucary",
["de"]="stellelinienbreiteein",
["en"]="setuplinewidth",
- ["fr"]="regleepaisseurligne",
+ ["fr"]="configurerepaisseurtrait",
["it"]="impostaampiezzariga",
["nl"]="stellijndiktein",
["pe"]="بارگذاری‌عرض‌خط",
@@ -4222,7 +4826,7 @@ return {
["cs"]="nastavseznam",
["de"]="stellelisteein",
["en"]="setuplist",
- ["fr"]="regleliste",
+ ["fr"]="configurerliste",
["it"]="impostaelenco",
["nl"]="stellijstin",
["pe"]="بارگذاری‌لیست",
@@ -4232,35 +4836,37 @@ return {
["cs"]="nastavupravu",
["de"]="stelleumbruchein",
["en"]="setupmakeup",
- ["fr"]="reglemakeup",
+ ["fr"]="configurercomposition",
["it"]="impostamakeup",
["nl"]="stelopmaakin",
["pe"]="بارگذاری‌آرایش",
["ro"]="seteazamakeup",
},
+ ["setupmarginblock"]={
+ ["en"]="setupmarginblock",
+ ["fr"]="configurerblocmarginal",
+ ["nl"]="stelmargeblokkenin",
+ },
["setupmarginblocks"]={
["cs"]="nastavmarginalniblok",
["de"]="stellemarginalblockein",
["en"]="setupmarginblocks",
- ["fr"]="regleblocmarge",
+ ["fr"]="configurerblocmarge",
["it"]="impostablocchimargine",
["nl"]="stelmargeblokkenin",
["pe"]="بارگذاری‌بلوکهای‌حاشیه",
["ro"]="seteazablocurimarginale",
},
- ["setupmarginblock"]={
- ["en"]="setupmarginblock",
- ["nl"]="stelmargeblokkenin",
- },
["setupmargindata"]={
["en"]="setupmargindata",
+ ["fr"]="configurerdonneesmarginales",
["nl"]="stelinmargein",
},
["setupmarginrules"]={
["cs"]="nastavmarginalnilinky",
["de"]="stellemarginallinieein",
["en"]="setupmarginrules",
- ["fr"]="reglemargereglee",
+ ["fr"]="configurertraitsmarge",
["it"]="impostalineemargine",
["nl"]="stelkantlijnin",
["pe"]="بارگذاری‌خطهای‌حاشیه",
@@ -4270,7 +4876,7 @@ return {
["cs"]="nastavznaceni",
["de"]="stellebeschriftungein",
["en"]="setupmarking",
- ["fr"]="reglemarquage",
+ ["fr"]="configurermarquage",
["it"]="impostamarcatura",
["nl"]="stelmarkeringin",
["pe"]="بارگذاری‌نشانه‌گذاری",
@@ -4280,7 +4886,7 @@ return {
["cs"]="setupmathalignment",
["de"]="setupmathalignment",
["en"]="setupmathalignment",
- ["fr"]="setupmathalignment",
+ ["fr"]="configureralignementmath",
["it"]="setupmathalignment",
["nl"]="stelwiskundeuitlijnenin",
["pe"]="بارگذاری‌تنظیم‌ریاضی",
@@ -4290,17 +4896,33 @@ return {
["cs"]="nastavzuzeni",
["de"]="stelleengerein",
["en"]="setupnarrower",
- ["fr"]="reglecompoetroite",
+ ["fr"]="configurerplusetroit",
["it"]="impostapiustretto",
["nl"]="stelsmallerin",
["pe"]="بارگذاری‌باریکتر",
["ro"]="seteazaingust",
},
+ ["setupnotation"]={
+ ["en"]="setupnotation",
+ ["fr"]="configurernotation",
+ },
+ ["setupnotations"]={
+ ["en"]="setupnotations",
+ ["fr"]="configurernotations",
+ },
+ ["setupnote"]={
+ ["en"]="setupnote",
+ ["fr"]="configurenote",
+ },
+ ["setupnotes"]={
+ ["en"]="setupnotes",
+ ["fr"]="configurenotes",
+ },
["setupnumber"]={
["cs"]="setupnumber",
["de"]="setupnumber",
["en"]="setupnumber",
- ["fr"]="reglenumero",
+ ["fr"]="configurernumero",
["it"]="impostanumerazione",
["nl"]="stelnummerin",
["pe"]="بارگذاری‌شماره",
@@ -4310,7 +4932,7 @@ return {
["cs"]="nastavcislovani",
["de"]="stellenummerierungein",
["en"]="setupnumbering",
- ["fr"]="reglenumerotation",
+ ["fr"]="configurernumérotation",
["it"]="impostanumerazione",
["nl"]="stelnummerenin",
["pe"]="بارگذاری‌شماره‌گذاری",
@@ -4320,7 +4942,7 @@ return {
["cs"]="nastavumisteniprotejsku",
["de"]="stellegegenueberplatzierenein",
["en"]="setupoppositeplacing",
- ["fr"]="regleplacementopposition",
+ ["fr"]="configurerplacementopposition",
["it"]="impostaposizionamentoopposti",
["nl"]="stelnaastplaatsenin",
["pe"]="بارگذاری‌درج‌مخالف",
@@ -4330,7 +4952,7 @@ return {
["cs"]="nastavvystup",
["de"]="stelleausgabeein",
["en"]="setupoutput",
- ["fr"]="reglesortie",
+ ["fr"]="configurersortie",
["it"]="impostaoutput",
["nl"]="steluitvoerin",
["pe"]="بارگذاری‌خروجی",
@@ -4340,7 +4962,7 @@ return {
["cs"]="nastavkomentarstrany",
["de"]="stelleseitenkommentarein",
["en"]="setuppagecomment",
- ["fr"]="reglecommentairepage",
+ ["fr"]="configurercommentairepage",
["it"]="impostacommentopagina",
["nl"]="stelpaginacommentaarin",
["pe"]="بارگذاری‌توضیح‌صفحه",
@@ -4350,7 +4972,7 @@ return {
["cs"]="nastavcislostrany",
["de"]="stelleseitennummerein",
["en"]="setuppagenumber",
- ["fr"]="reglenumeropage",
+ ["fr"]="configurernumeropage",
["it"]="impostanumeropagina",
["nl"]="stelpaginanummerin",
["pe"]="بارگذاری‌شماره‌صفحه",
@@ -4360,7 +4982,7 @@ return {
["cs"]="nastavcislovanistran",
["de"]="stelleseitennummeriernungein",
["en"]="setuppagenumbering",
- ["fr"]="reglenumerotationpage",
+ ["fr"]="configurernumérotationpage",
["it"]="impostanumerazionepagina",
["nl"]="stelpaginanummeringin",
["pe"]="بارگذاری‌شماره‌گذاری‌صفحه",
@@ -4370,7 +4992,7 @@ return {
["cs"]="nastavprechodstrany",
["de"]="stelleseitenuebergangein",
["en"]="setuppagetransitions",
- ["fr"]="regletransitionspage",
+ ["fr"]="configurertransitionpage",
["it"]="impostatransizionepagina",
["nl"]="stelpaginaovergangenin",
["pe"]="بارگذاری‌گذارصفحه",
@@ -4380,7 +5002,7 @@ return {
["cs"]="nastavpaletu",
["de"]="stellepaletteein",
["en"]="setuppalet",
- ["fr"]="reglepalette",
+ ["fr"]="configurerpalette",
["it"]="impostatavolozza",
["nl"]="stelpaletin",
["pe"]="بارگذاری‌لوح",
@@ -4390,7 +5012,7 @@ return {
["cs"]="setuppaper",
["de"]="setuppaper",
["en"]="setuppaper",
- ["fr"]="reglepapier",
+ ["fr"]="configurerpapier",
["it"]="setuppaper",
["nl"]="stelpapierin",
["pe"]="بارگذاری‌برگ",
@@ -4400,7 +5022,7 @@ return {
["cs"]="nastavvelikostpapiru",
["de"]="stellepapierformatein",
["en"]="setuppapersize",
- ["fr"]="regletaillepapier",
+ ["fr"]="configurertaillepapier",
["it"]="impostadimensionicarta",
["nl"]="stelpapierformaatin",
["pe"]="بارگذاری‌اندازه‌برگ",
@@ -4410,7 +5032,7 @@ return {
["cs"]="nastavcislovaniodstavcu",
["de"]="stelleabsatznummerierungein",
["en"]="setupparagraphnumbering",
- ["fr"]="reglenumerotationparagraphe",
+ ["fr"]="configurernumérotationparagraphe",
["it"]="impostanumerazionecapoversi",
["nl"]="stelparagraafnummerenin",
["pe"]="بارگذاری‌شماره‌گذاری‌پاراگراف",
@@ -4420,17 +5042,21 @@ return {
["cs"]="nastavodstavce",
["de"]="stelleabsaetzeein",
["en"]="setupparagraphs",
- ["fr"]="regleparagraphes",
+ ["fr"]="configurerparagraphe",
["it"]="impostacapoversi",
["nl"]="stelalineasin",
["pe"]="بارگذاری‌پاراگرافها",
["ro"]="seteazaparagrafe",
},
+ ["setupperiodkerning"]={
+ ["en"]="setupperiodkerning",
+ ["fr"]="configurerapprochepoint",
+ },
["setupplacement"]={
["cs"]="setupplacement",
["de"]="setupplacement",
["en"]="setupplacement",
- ["fr"]="setupplacement",
+ ["fr"]="configurerplacement",
["it"]="setupplacement",
["nl"]="stelplaatsin",
["pe"]="بارگذاری‌جانشانی",
@@ -4440,7 +5066,7 @@ return {
["cs"]="nastavumistovani",
["de"]="stellepositionierenein",
["en"]="setuppositioning",
- ["fr"]="reglepositionnement",
+ ["fr"]="configurerpositionnement",
["it"]="impostaposizionamento",
["nl"]="stelpositionerenin",
["pe"]="بارگذاری‌مکان‌گذاری",
@@ -4450,7 +5076,7 @@ return {
["cs"]="nastavprofily",
["de"]="stelleprofilein",
["en"]="setupprofiles",
- ["fr"]="regleprofils",
+ ["fr"]="configurerprofils",
["it"]="impostaprofili",
["nl"]="stelprofielenin",
["pe"]="بارگذاری‌پروفایلها",
@@ -4460,7 +5086,7 @@ return {
["cs"]="nastavprogramy",
["de"]="stelleprogrammein",
["en"]="setupprograms",
- ["fr"]="regleprogrammes",
+ ["fr"]="configurerprogrammes",
["it"]="impostaprogrammi",
["nl"]="stelprogrammasin",
["pe"]="بارگذاری‌برنامه‌ها",
@@ -4470,7 +5096,7 @@ return {
["cs"]="nastavpublikace",
["de"]="stellepublikationein",
["en"]="setuppublications",
- ["fr"]="reglepublications",
+ ["fr"]="configurerpublications",
["it"]="impostapubblicazioni",
["nl"]="stelpublicatiesin",
["pe"]="بارگذاری‌نشرها",
@@ -4480,7 +5106,7 @@ return {
["cs"]="nastavcitaci",
["de"]="stellezitierenein",
["en"]="setupquote",
- ["fr"]="demarreciter",
+ ["fr"]="configurerciter",
["it"]="impostamenzione",
["nl"]="stelciterenin",
["pe"]="بارگذاری‌نقل",
@@ -4490,7 +5116,7 @@ return {
["cs"]="nastavseznamodkazu",
["de"]="stellereferenzlisteein",
["en"]="setupreferencelist",
- ["fr"]="reglelistereference",
+ ["fr"]="configurerlistereference",
["it"]="impostalistariferimenti",
["nl"]="stelreferentielijstin",
["pe"]="بارگذاری‌لیست‌مرجع",
@@ -4500,7 +5126,7 @@ return {
["cs"]="nastavodkazovani",
["de"]="stellereferenzierenein",
["en"]="setupreferencing",
- ["fr"]="reglereferencage",
+ ["fr"]="configurerreferencement",
["it"]="impostariferimento",
["nl"]="stelrefererenin",
["pe"]="بارگذاری‌ارجاع",
@@ -4510,7 +5136,7 @@ return {
["cs"]="nastavrejstrik",
["de"]="stelleregisterein",
["en"]="setupregister",
- ["fr"]="regleregistre",
+ ["fr"]="configurerregistre",
["it"]="impostaregistro",
["nl"]="stelregisterin",
["pe"]="بارگذاری‌ثبت",
@@ -4520,7 +5146,7 @@ return {
["cs"]="nastavotoceni",
["de"]="stelledrehenein",
["en"]="setuprotate",
- ["fr"]="regleoriente",
+ ["fr"]="configurerrotation",
["it"]="impostarotazione",
["nl"]="stelroterenin",
["pe"]="بارگذاری‌دوران",
@@ -4530,7 +5156,7 @@ return {
["cs"]="setuprule",
["de"]="setuprule",
["en"]="setuprule",
- ["fr"]="regleregle",
+ ["fr"]="configurertrait",
["it"]="impostalinea",
["nl"]="stellijnin",
["pe"]="بارگذاری‌خط",
@@ -4540,7 +5166,7 @@ return {
["cs"]="nastavrastr",
["de"]="stellerasterein",
["en"]="setupscreens",
- ["fr"]="regleecrans",
+ ["fr"]="configurerecran",
["it"]="impostaschermi",
["nl"]="stelrastersin",
["pe"]="بارگذاری‌پرده‌ها",
@@ -4550,7 +5176,7 @@ return {
["cs"]="nastavsekci",
["de"]="stelleabschnittein",
["en"]="setupsection",
- ["fr"]="reglesection",
+ ["fr"]="configurersection",
["it"]="impostasezione",
["nl"]="stelsectiein",
["pe"]="بارگذاری‌بخش",
@@ -4560,7 +5186,7 @@ return {
["cs"]="nastavbloksekce",
["de"]="stelleabschnittsblockein",
["en"]="setupsectionblock",
- ["fr"]="regleblocsection",
+ ["fr"]="configurerblocsection",
["it"]="impostabloccosezione",
["nl"]="stelsectieblokin",
["pe"]="بارگذاری‌بلوک‌بخش",
@@ -4570,7 +5196,7 @@ return {
["cs"]="nastavtrideni",
["de"]="stellesortierenein",
["en"]="setupsorting",
- ["fr"]="regletri",
+ ["fr"]="configurertri",
["it"]="impostaordinamento",
["nl"]="stelsorterenin",
["pe"]="بارگذاری‌ترتیب",
@@ -4580,7 +5206,7 @@ return {
["cs"]="nastavradkovani",
["de"]="stellespatiumein",
["en"]="setupspacing",
- ["fr"]="regleespacement",
+ ["fr"]="configurerespacement",
["it"]="impostaspaziatura",
["nl"]="stelspatieringin",
["pe"]="بارگذاری‌فضا‌گذاری",
@@ -4590,7 +5216,7 @@ return {
["cs"]="setupstartstop",
["de"]="setupstartstop",
["en"]="setupstartstop",
- ["fr"]="regledemarrestoppe",
+ ["fr"]="configurerdébutfin",
["it"]="impostainiziatermina",
["nl"]="stelstartstopin",
["pe"]="بارگذاری‌شروع‌پایان",
@@ -4600,7 +5226,7 @@ return {
["cs"]="setupstrut",
["de"]="setupstrut",
["en"]="setupstrut",
- ["fr"]="reglestrut",
+ ["fr"]="configurerentretoise",
["it"]="impostastrut",
["nl"]="stelstrutin",
["pe"]="بارگذاری‌بست",
@@ -4610,7 +5236,7 @@ return {
["cs"]="nastavpodcislostrany",
["de"]="stelleunterseitennummerein",
["en"]="setupsubpagenumber",
- ["fr"]="reglesousnumeropage",
+ ["fr"]="configurernumerosouspage",
["it"]="impostanumerosottopagina",
["nl"]="stelsubpaginanummerin",
["pe"]="بارگذاری‌شماره‌زیرصفحه",
@@ -4620,7 +5246,7 @@ return {
["cs"]="nastavsadusymbolu",
["de"]="stellesymbolsetein",
["en"]="setupsymbolset",
- ["fr"]="reglejeusymboles",
+ ["fr"]="configurerjeusymboles",
["it"]="impostasetsimboli",
["nl"]="stelsymboolsetin",
["pe"]="بارگذاری‌مجموعه‌نماد",
@@ -4630,7 +5256,7 @@ return {
["cs"]="nastavsynchronizaci",
["de"]="stellesynchronisationein",
["en"]="setupsynchronization",
- ["fr"]="reglesynchronisation",
+ ["fr"]="configurersynchronisation",
["it"]="impostasincronizzazione",
["nl"]="stelsynchronisatiein",
["pe"]="بارگذاری‌تطابق",
@@ -4640,7 +5266,7 @@ return {
["cs"]="nastavsynchronizacnilistu",
["de"]="stellesynchronisationsbalkenein",
["en"]="setupsynchronizationbar",
- ["fr"]="reglebarresynchronisation",
+ ["fr"]="configurerbarresynchronisation",
["it"]="impostabarrasincronizzazione",
["nl"]="stelsynchronisatiebalkin",
["pe"]="بارگذاری‌میله‌تطابق",
@@ -4650,7 +5276,7 @@ return {
["cs"]="nastavsynonyma",
["de"]="stellesynonymein",
["en"]="setupsynonyms",
- ["fr"]="reglesynonymes",
+ ["fr"]="configurersynonymes",
["it"]="impostasinonimi",
["nl"]="stelsynoniemenin",
["pe"]="بارگذاری‌مترادفها",
@@ -4660,7 +5286,7 @@ return {
["cs"]="nastavsystem",
["de"]="stellesystemein",
["en"]="setupsystem",
- ["fr"]="reglesysteme",
+ ["fr"]="configurersysteme",
["it"]="impostasistema",
["nl"]="stelsysteemin",
["pe"]="بارگذاری‌سیستم",
@@ -4670,7 +5296,7 @@ return {
["cs"]="nastavtab",
["de"]="stelletabein",
["en"]="setuptab",
- ["fr"]="regletab",
+ ["fr"]="configurertab",
["it"]="impostatab",
["nl"]="steltabin",
["pe"]="بارگذاری‌تب",
@@ -4680,7 +5306,7 @@ return {
["cs"]="nastavtabulky",
["de"]="stelletabellenein",
["en"]="setuptables",
- ["fr"]="regletableaux",
+ ["fr"]="configurertables",
["it"]="impostatabelle",
["nl"]="steltabellenin",
["pe"]="بارگذاری‌جدولها",
@@ -4690,7 +5316,7 @@ return {
["cs"]="nastavtabelaci",
["de"]="stelletabulatorein",
["en"]="setuptabulate",
- ["fr"]="regletabulation",
+ ["fr"]="configurertabulation",
["it"]="impostatabulato",
["nl"]="steltabulatiein",
["pe"]="بارگذاری‌جدول‌بندی",
@@ -4700,7 +5326,7 @@ return {
["cs"]="nastavtext",
["de"]="stelletextein",
["en"]="setuptext",
- ["fr"]="regletexte",
+ ["fr"]="configurertexte",
["it"]="impostatesto",
["nl"]="steltekstin",
["pe"]="بارگذاری‌متن",
@@ -4708,13 +5334,18 @@ return {
},
["setuptextbackground"]={
["en"]="setuptextbackground",
+ ["fr"]="configurertextearriereplan",
["nl"]="steltekstachtergrondin",
},
+ ["setuptextnote"]={
+ ["en"]="setuptextnote",
+ ["fr"]="configurernotetexte",
+ },
["setuptextposition"]={
["cs"]="setuptextposition",
["de"]="setuptextposition",
["en"]="setuptextposition",
- ["fr"]="reglepositiontexte",
+ ["fr"]="configurerpositiontexte",
["it"]="impostaposizionetesto",
["nl"]="steltekstpositiein",
["pe"]="بارگذاری‌مکان‌متن",
@@ -4724,7 +5355,7 @@ return {
["cs"]="nastavtextovelinky",
["de"]="stelletextumrissein",
["en"]="setuptextrules",
- ["fr"]="reglelignesreglestexte",
+ ["fr"]="configurertextetraits",
["it"]="impostalineetesto",
["nl"]="steltekstlijnenin",
["pe"]="بارگذاری‌خطهای‌متن",
@@ -4734,7 +5365,7 @@ return {
["cs"]="nastavtexttexty",
["de"]="stelletexttexteein",
["en"]="setuptexttexts",
- ["fr"]="regletextestexte",
+ ["fr"]="configurertextestexte",
["it"]="impostatestotesti",
["nl"]="stelteksttekstenin",
["pe"]="بارگذاری‌متن‌متنها",
@@ -4744,7 +5375,7 @@ return {
["cs"]="setuptextvariable",
["de"]="setuptextvariable",
["en"]="setuptextvariable",
- ["fr"]="reglevariabletexte",
+ ["fr"]="configurervariabletexte",
["it"]="impostavariabiletesto",
["nl"]="steltekstvariabelein",
["pe"]="بارگذاری‌متغیر‌متن",
@@ -4754,7 +5385,7 @@ return {
["cs"]="nastavtenkelinky",
["de"]="stelleduennerumrissein",
["en"]="setupthinrules",
- ["fr"]="regletraitsfins",
+ ["fr"]="configurertraitsfins",
["it"]="impostalineesottili",
["nl"]="steldunnelijnenin",
["pe"]="بارگذاری‌خطها‌ی‌نازک",
@@ -4764,7 +5395,7 @@ return {
["cs"]="nastavtoleranci",
["de"]="stelletoleranzein",
["en"]="setuptolerance",
- ["fr"]="regletolerance",
+ ["fr"]="configurertolerance",
["it"]="impostatolleranza",
["nl"]="steltolerantiein",
["pe"]="بارگذاری‌بردباری",
@@ -4774,7 +5405,7 @@ return {
["cs"]="nastavhorejsek",
["de"]="stellenobenein",
["en"]="setuptop",
- ["fr"]="reglesup",
+ ["fr"]="configurerhaut",
["it"]="impostacima",
["nl"]="stelbovenin",
["pe"]="بارگذاری‌بالا",
@@ -4784,7 +5415,7 @@ return {
["cs"]="nastavhornitexty",
["de"]="stelletextobenein",
["en"]="setuptoptexts",
- ["fr"]="regletextessup",
+ ["fr"]="configurertexteshaut",
["it"]="impostatesticima",
["nl"]="stelboventekstenin",
["pe"]="بارگذاری‌متنهای‌بالا",
@@ -4794,7 +5425,7 @@ return {
["cs"]="nastavtype",
["de"]="stelletipein",
["en"]="setuptype",
- ["fr"]="regletype",
+ ["fr"]="configurertranscrire",
["it"]="impostatype",
["nl"]="steltypein",
["pe"]="بارگذاری‌تایپ",
@@ -4804,7 +5435,7 @@ return {
["cs"]="nastavopis",
["de"]="stelletippenein",
["en"]="setuptyping",
- ["fr"]="regledactylo",
+ ["fr"]="configurertranscription",
["it"]="impostatyping",
["nl"]="steltypenin",
["pe"]="بارگذاری‌تایپ‌کردن",
@@ -4814,7 +5445,7 @@ return {
["cs"]="nastavpodtrzeni",
["de"]="stelleunterstreichenein",
["en"]="setupunderbar",
- ["fr"]="reglesouslignage",
+ ["fr"]="configurersouligner",
["it"]="impostasottolinea",
["nl"]="stelonderstrepenin",
["pe"]="بارگذاری‌میله‌زیر",
@@ -4824,7 +5455,7 @@ return {
["cs"]="nastavurl",
["de"]="stelleurlein",
["en"]="setupurl",
- ["fr"]="regleurl",
+ ["fr"]="configurerurl",
["it"]="impostaurl",
["nl"]="stelurlin",
["pe"]="setupurl",
@@ -4834,7 +5465,7 @@ return {
["cs"]="nastavverze",
["de"]="stelleversionein",
["en"]="setupversions",
- ["fr"]="regleversions",
+ ["fr"]="configurerversions",
["it"]="impostaversioni",
["nl"]="stelversiesin",
["pe"]="بارگذاری‌نسخه‌ها",
@@ -4844,17 +5475,21 @@ return {
["cs"]="nastavbilamista",
["de"]="stellezwischenraumein",
["en"]="setupwhitespace",
- ["fr"]="regleespaceblanc",
+ ["fr"]="configurerespaceblanc",
["it"]="impostaspaziobianco",
["nl"]="stelwitruimtein",
["pe"]="بارگذاری‌فضای‌سفید",
["ro"]="seteazaspatiualb",
},
+ ["setvisualizerfont"]={
+ ["en"]="setvisualizerfont",
+ ["fr"]="reglervisualisateurpolice",
+ },
["showbodyfont"]={
["cs"]="ukazzakladnifont",
["de"]="zeigefliesstext",
["en"]="showbodyfont",
- ["fr"]="montrepolicecorps",
+ ["fr"]="montrerpolicedecorps",
["it"]="mostrafontdeltesto",
["nl"]="toonkorps",
["pe"]="نمایش‌قلم‌بدنه",
@@ -4864,7 +5499,7 @@ return {
["cs"]="ukazpostredizakladnihofontu",
["de"]="zeigefliesstextumgebung",
["en"]="showbodyfontenvironment",
- ["fr"]="montreenvironnementpolicecorps",
+ ["fr"]="montrerenvironnementpolicedecorps",
["it"]="mostraambientefontdeltesto",
["nl"]="toonkorpsomgeving",
["pe"]="نمایش‌محیط‌قلم‌بدنه",
@@ -4874,7 +5509,7 @@ return {
["cs"]="ukazbarvu",
["de"]="zeigefarbe",
["en"]="showcolor",
- ["fr"]="montrecouleur",
+ ["fr"]="montrercouleur",
["it"]="mostracolore",
["nl"]="toonkleur",
["pe"]="نمایش‌رنگ",
@@ -4884,17 +5519,21 @@ return {
["cs"]="ukazskupinubarev",
["de"]="zeigefarbengruppe",
["en"]="showcolorgroup",
- ["fr"]="montregroupecouleur",
+ ["fr"]="montrergroupecouleur",
["it"]="mostragruppocolori",
["nl"]="toonkleurgroep",
["pe"]="نمایش‌گروه‌رنگ",
["ro"]="afiseazagrupculoare",
},
+ ["showcounter"]={
+ ["en"]="showcounter",
+ ["fr"]="montrercompteur",
+ },
["showexternalfigures"]={
["cs"]="ukazexterniobrazy",
["de"]="zeigeexterneabbildungen",
["en"]="showexternalfigures",
- ["fr"]="montrefiguresexternes",
+ ["fr"]="montrerfiguresexternes",
["it"]="mostrafiguresterne",
["nl"]="toonexternefiguren",
["pe"]="نمایش‌شکلهای‌خارجی",
@@ -4904,17 +5543,49 @@ return {
["cs"]="ukazpole",
["de"]="zeigefelder",
["en"]="showfields",
- ["fr"]="montrechamps",
+ ["fr"]="montrerchamps",
["it"]="mostracampi",
["nl"]="toonvelden",
["pe"]="نمایش‌میدانها",
["ro"]="afiseazacampuri",
},
+ ["showfont"]={
+ ["en"]="showfont",
+ ["fr"]="montrerpolice",
+ },
+ ["showfontdata"]={
+ ["en"]="showfontdata",
+ ["fr"]="montrerdonneespolice",
+ },
+ ["showfontexpansion"]={
+ ["en"]="showfontexpansion",
+ ["fr"]="montrerexpansionpolice",
+ },
+ ["showfontitalics"]={
+ ["en"]="showfontitalics",
+ ["fr"]="montreritaliquespolice",
+ },
+ ["showfontkerns"]={
+ ["en"]="showfontkerns",
+ ["fr"]="montrerlesapproches",
+ },
+ ["showfontparameters"]={
+ ["en"]="showfontparameters",
+ ["fr"]="montrerparametrespolice",
+ },
+ ["showfontstrip"]={
+ ["en"]="showfontstrip",
+ ["fr"]="montrervisuellementpolice",
+ },
+ ["showfontstyle"]={
+ ["en"]="showfontstyle",
+ ["fr"]="montrerstylepolice",
+ },
["showframe"]={
["cs"]="ukazramecek",
["de"]="zeigerahmen",
["en"]="showframe",
- ["fr"]="montrecadre",
+ ["fr"]="montrermiseenpage",
["it"]="mostracornice",
["nl"]="toonkader",
["pe"]="نمایش‌قالب",
@@ -4924,17 +5595,25 @@ return {
["cs"]="ukazmrizku",
["de"]="zeigegitter",
["en"]="showgrid",
- ["fr"]="montregrille",
+ ["fr"]="montrergrille",
["it"]="mostragriglia",
["nl"]="toongrid",
["pe"]="نمایش‌توری",
["ro"]="afiseazagrid",
},
+ ["showhyphenationtrace"]={
+ ["en"]="showhyphenationtrace",
+ ["fr"]="montrertracecesure",
+ },
+ ["showkerning"]={
+ ["en"]="showkerning",
+ ["fr"]="montrerapproche",
+ },
["showlayout"]={
["cs"]="ukazvzhled",
["de"]="zeigelayout",
["en"]="showlayout",
- ["fr"]="montredisposition",
+ ["fr"]="montrermiseenpage",
["it"]="mostralyout",
["nl"]="toonlayout",
["pe"]="نمایش‌طرح‌بندی",
@@ -4944,17 +5623,21 @@ return {
["cs"]="ukazupravu",
["de"]="zeigeumbruch",
["en"]="showmakeup",
- ["fr"]="montremakeup",
+ ["fr"]="montrercomposition",
["it"]="mostramakeup",
["nl"]="toonopmaak",
["pe"]="نمایش‌آرایش",
["ro"]="afiseazamakeup",
},
+ ["showminimalbaseline"]={
+ ["en"]="showminimalbaseline",
+ ["fr"]="montrerlignedebase",
+ },
["showpalet"]={
["cs"]="ukazpaletu",
["de"]="zeigepalette",
["en"]="showpalet",
- ["fr"]="montrepalette",
+ ["fr"]="montrerpalette",
["it"]="mostratavolozza",
["nl"]="toonpalet",
["pe"]="نمایش‌لوح",
@@ -4964,7 +5647,7 @@ return {
["cs"]="ukazvytisk",
["de"]="zeigedruck",
["en"]="showprint",
- ["fr"]="montreedition",
+ ["fr"]="montrerimpression",
["it"]="mostrastampa",
["nl"]="toonprint",
["pe"]="نمایش‌چاپ",
@@ -4974,7 +5657,7 @@ return {
["cs"]="ukaznastaveni",
["de"]="zeigeeinstellungen",
["en"]="showsetups",
- ["fr"]="montrereglages",
+ ["fr"]="montrerconfigurations",
["it"]="mostraimpostazioni",
["nl"]="tooninstellingen",
["pe"]="نمایش‌بارگذاریها",
@@ -4984,7 +5667,7 @@ return {
["cs"]="ukazpodpery",
["de"]="zeigestruts",
["en"]="showstruts",
- ["fr"]="montrestruts",
+ ["fr"]="montrerentretoises",
["it"]="mostrastruts",
["nl"]="toonstruts",
["pe"]="نمایش‌بستها",
@@ -4994,7 +5677,7 @@ return {
["cs"]="ukazsadusymbolu",
["de"]="showsymbolset",
["en"]="showsymbolset",
- ["fr"]="montrejeusymboles",
+ ["fr"]="montrerjeusymboles",
["it"]="mostrasetsimboli",
["nl"]="toonsymboolset",
["pe"]="نمایش‌مجموعه‌علامت",
@@ -5004,7 +5687,7 @@ return {
["cs"]="kap",
["de"]="kap",
["en"]="cap",
- ["fr"]="cap",
+ ["fr"]="petitescap",
["it"]="cap",
["nl"]="kap",
["pe"]="cap",
@@ -5040,11 +5723,15 @@ return {
["pe"]="فضا",
["ro"]="spatiu",
},
+ ["specialitem"]={
+ ["en"]="specialitem",
+ ["fr"]="élémentspécial",
+ },
["splitfloat"]={
["cs"]="rozdelplvouciobjekt",
["de"]="teilegleitobjekt",
["en"]="splitfloat",
- ["fr"]="separeflottant",
+ ["fr"]="flottantpartage",
["it"]="spezzaoggettomobile",
["nl"]="splitsplaatsblok",
["pe"]="شکافتن‌شناور",
@@ -5054,21 +5741,17 @@ return {
["cs"]="startzarovnavani",
["de"]="startausrichtung",
["en"]="startalignment",
- ["fr"]="demarrealignement",
+ ["fr"]="débutalignement",
["it"]="iniziaallineamento",
["nl"]="startuitlijnen",
["pe"]="شروع‌تنظیم",
["ro"]="startaliniere",
},
- ["alignment"]={
- ["en"]="alignment",
- ["nl"]="uitlijnen",
- },
["startbackground"]={
["cs"]="startpozadi",
["de"]="starthintergrund",
["en"]="startbackground",
- ["fr"]="demarrearriereplan",
+ ["fr"]="débutarriereplan",
["it"]="iniziasfondo",
["nl"]="startachtergrond",
["pe"]="شروع‌پس‌زمینه",
@@ -5078,7 +5761,7 @@ return {
["cs"]="startkodovani",
["de"]="startkodierung",
["en"]="startcoding",
- ["fr"]="demarrecodage",
+ ["fr"]="débutcodage",
["it"]="iniziacodifica",
["nl"]="startcodering",
["pe"]="شروع‌کد",
@@ -5088,7 +5771,7 @@ return {
["cs"]="startbarva",
["de"]="startfarbe",
["en"]="startcolor",
- ["fr"]="demarrecouleur",
+ ["fr"]="débutcouleur",
["it"]="iniziacolore",
["nl"]="startkleur",
["pe"]="شروع‌رنگ",
@@ -5098,7 +5781,7 @@ return {
["cs"]="startcolumnmakeup",
["de"]="startcolumnmakeup",
["en"]="startcolumnmakeup",
- ["fr"]="startcolumnmakeup",
+ ["fr"]="débutcompositioncolonne",
["it"]="startcolumnmakeup",
["nl"]="startkolomopmaak",
["pe"]="شروع‌آرایش‌ستون",
@@ -5108,7 +5791,7 @@ return {
["cs"]="startsloupce",
["de"]="startspalten",
["en"]="startcolumns",
- ["fr"]="demarrecolonnes",
+ ["fr"]="débutcolonnes",
["it"]="iniziacolonne",
["nl"]="startkolommen",
["pe"]="شروع‌ستونها",
@@ -5118,7 +5801,7 @@ return {
["cs"]="startcolumnset",
["de"]="startcolumnset",
["en"]="startcolumnset",
- ["fr"]="demarrejeucolonne",
+ ["fr"]="débutjeucolonnes",
["it"]="iniziagruppocolonne",
["nl"]="startkolomgroep",
["pe"]="شروع‌مجموعه‌ستون",
@@ -5128,7 +5811,7 @@ return {
["cs"]="startspojeni",
["de"]="startkombination",
["en"]="startcombination",
- ["fr"]="demarrecombinaison",
+ ["fr"]="débutcombinaison",
["it"]="iniziacombinazione",
["nl"]="startcombinatie",
["pe"]="شروع‌ترکیب",
@@ -5138,7 +5821,7 @@ return {
["cs"]="startkomponenta",
["de"]="startkomponente",
["en"]="startcomponent",
- ["fr"]="demarrecomposant",
+ ["fr"]="débutcomposant",
["it"]="iniziacomponente",
["nl"]="startonderdeel",
["pe"]="شروع‌مولفه",
@@ -5148,7 +5831,7 @@ return {
["cs"]="startdokument",
["de"]="startdokument",
["en"]="startdocument",
- ["fr"]="demarredocument",
+ ["fr"]="débutdocument",
["it"]="iniziadocumento",
["nl"]="startdocument",
["pe"]="شروع‌نوشتار",
@@ -5158,7 +5841,7 @@ return {
["cs"]="startprostredi",
["de"]="startumgebung",
["en"]="startenvironment",
- ["fr"]="demarreenvironement",
+ ["fr"]="débutenvironnement",
["it"]="iniziaambiente",
["nl"]="startomgeving",
["pe"]="شروع‌محیط",
@@ -5168,7 +5851,7 @@ return {
["cs"]="startobraz",
["de"]="startabbildung",
["en"]="startfigure",
- ["fr"]="demarrefigure",
+ ["fr"]="débutfigure",
["it"]="iniziafigura",
["nl"]="startfiguur",
["pe"]="شروع‌شکل",
@@ -5176,13 +5859,14 @@ return {
},
["startframed"]={
["en"]="startframed",
+ ["fr"]="débutencadre",
["nl"]="startomlijnd",
},
["startglobal"]={
["cs"]="startglobalni",
["de"]="startglobal",
["en"]="startglobal",
- ["fr"]="demarreglobal",
+ ["fr"]="débutglobal",
["it"]="iniziaglobale",
["nl"]="startglobaal",
["pe"]="شروع‌سراسری",
@@ -5192,7 +5876,7 @@ return {
["cs"]="startradek",
["de"]="startzeile",
["en"]="startline",
- ["fr"]="demarreligne",
+ ["fr"]="débutligneref",
["it"]="iniziariga",
["nl"]="startregel",
["pe"]="شروع‌خط",
@@ -5202,21 +5886,21 @@ return {
["cs"]="startkorekceradku",
["de"]="startzeilenkorrektur",
["en"]="startlinecorrection",
- ["fr"]="demarrecorrectionligne",
+ ["fr"]="débutcorrectionligne",
["it"]="iniziacorrezioneriga",
["nl"]="startregelcorrectie",
["pe"]="شروع‌تصحیح‌خط",
["ro"]="startcorectielinie",
},
- ["linecorrection"]={
- ["en"]="linecorrection",
- ["nl"]="regelcorrectie",
+ ["startlinenote"]={
+ ["en"]="startlinenote",
+ ["fr"]="débutnotedeligne",
},
["startlinenumbering"]={
["cs"]="startcislovaniradku",
["de"]="startzeilennumerierung",
["en"]="startlinenumbering",
- ["fr"]="demarrenumerotationligne",
+ ["fr"]="débutnumérotationligne",
["it"]="inizianumerazionerighe",
["nl"]="startregelnummeren",
["pe"]="شروع‌شماره‌گذاری‌خط",
@@ -5226,7 +5910,7 @@ return {
["cs"]="startradky",
["de"]="startzeilen",
["en"]="startlines",
- ["fr"]="demarrelignes",
+ ["fr"]="débutlignes",
["it"]="iniziarighe",
["nl"]="startregels",
["pe"]="شروع‌خطها",
@@ -5236,7 +5920,7 @@ return {
["cs"]="startlokalni",
["de"]="startlokal",
["en"]="startlocal",
- ["fr"]="demarrelocal",
+ ["fr"]="débutlocal",
["it"]="inizialocale",
["nl"]="startlokaal",
["pe"]="شروع‌موضعی",
@@ -5246,21 +5930,17 @@ return {
["cs"]="startlokalnipoznamkypodcarou",
["de"]="startlokalefussnoten",
["en"]="startlocalfootnotes",
- ["fr"]="demarrenotespdplocales",
+ ["fr"]="débutnotesbdplocal",
["it"]="inizianotepdplocali",
["nl"]="startlokalevoetnoten",
["pe"]="شروع‌پانوشتهای‌موضعی",
["ro"]="startnotesubsollocale",
},
- ["localfootnotes"]={
- ["en"]="localfootnotes",
- ["nl"]="lokalevoetnoten",
- },
["startmakeup"]={
["cs"]="startuprava",
["de"]="startumbruch",
["en"]="startmakeup",
- ["fr"]="demarremakeup",
+ ["fr"]="débutcomposition",
["it"]="iniziamakeup",
["nl"]="startopmaak",
["pe"]="شروع‌آرایش",
@@ -5270,21 +5950,17 @@ return {
["cs"]="startmarginalniblok",
["de"]="startmarginalblock",
["en"]="startmarginblock",
- ["fr"]="demarreblocmarge",
+ ["fr"]="débutblocmarge",
["it"]="iniziabloccomargine",
["nl"]="startmargeblok",
["pe"]="شروع‌بلوک‌حاشیه",
["ro"]="startblocmarginal",
},
- ["marginblock"]={
- ["en"]="marginblock",
- ["nl"]="margeblok",
- },
["startmarginrule"]={
["cs"]="startmarginalnilinka",
["de"]="startmarginallinie",
["en"]="startmarginrule",
- ["fr"]="demarremargereglee",
+ ["fr"]="débuttraitmarge",
["it"]="inizialineamargine",
["nl"]="startkantlijn",
["pe"]="شروع‌خط‌حاشیه",
@@ -5294,7 +5970,7 @@ return {
["cs"]="startzuzeni",
["de"]="startenger",
["en"]="startnarrower",
- ["fr"]="demarrecompoetroite",
+ ["fr"]="débutplusetroit",
["it"]="iniziapiustretto",
["nl"]="startsmaller",
["pe"]="شروع‌باریکتر",
@@ -5304,7 +5980,7 @@ return {
["cs"]="startprotejsek",
["de"]="startgegenueber",
["en"]="startopposite",
- ["fr"]="demarreopposition",
+ ["fr"]="débutopposition",
["it"]="iniziaopposto",
["nl"]="startnaast",
["pe"]="شروع‌مخالف",
@@ -5314,17 +5990,17 @@ return {
["cs"]="startprekryv",
["de"]="startoverlay",
["en"]="startoverlay",
- ["fr"]="demarrerevetement",
+ ["fr"]="débutsuperposition",
["it"]="iniziasovrapposizione",
["nl"]="startoverlay",
["pe"]="شروع‌پوشش",
["ro"]="startoverlay",
},
- ["startoverzicht"]={
+ ["startoverview"]={
["cs"]="startprehled",
["de"]="startueberblick",
["en"]="startoverview",
- ["fr"]="demarrevuedensemble",
+ ["fr"]="débutvuedensemble",
["it"]="iniziaoverview",
["nl"]="startoverzicht",
["pe"]="شروع‌بازبینی",
@@ -5334,7 +6010,7 @@ return {
["cs"]="startzhustene",
["de"]="startkleinerdurchschuss",
["en"]="startpacked",
- ["fr"]="demarregroupe",
+ ["fr"]="débutemballage",
["it"]="iniziaimpaccato",
["nl"]="startopelkaar",
["pe"]="شروع‌فشرده",
@@ -5344,7 +6020,7 @@ return {
["cs"]="startumistovani",
["de"]="startpositionieren",
["en"]="startpositioning",
- ["fr"]="demarrepositionnement",
+ ["fr"]="débutpositionnement",
["it"]="iniziaposizionamento",
["nl"]="startpositioneren",
["pe"]="شروع‌مکان‌گذاری",
@@ -5354,7 +6030,7 @@ return {
["cs"]="startprodukt",
["de"]="startprodukt",
["en"]="startproduct",
- ["fr"]="demarreproduit",
+ ["fr"]="débutproduit",
["it"]="iniziaprodotto",
["nl"]="startprodukt",
["pe"]="شروع‌تولید",
@@ -5364,7 +6040,7 @@ return {
["cs"]="startprofil",
["de"]="startprofil",
["en"]="startprofile",
- ["fr"]="demarreprofil",
+ ["fr"]="débutprofil",
["it"]="iniziaprofilo",
["nl"]="startprofiel",
["pe"]="شروع‌پروفایل",
@@ -5374,7 +6050,7 @@ return {
["cs"]="startprojekt",
["de"]="startprojekt",
["en"]="startproject",
- ["fr"]="demarreprojet",
+ ["fr"]="débutprojet",
["it"]="iniziaprogetto",
["nl"]="startprojekt",
["pe"]="شروع‌پروژه",
@@ -5384,7 +6060,7 @@ return {
["cs"]="startcitace",
["de"]="startzitat",
["en"]="startquotation",
- ["fr"]="demarrecitation",
+ ["fr"]="débutcitation",
["it"]="iniziacitazione",
["nl"]="startcitaat",
["pe"]="شروع‌نقل‌قول",
@@ -5394,7 +6070,7 @@ return {
["cs"]="startrastr",
["de"]="startraster",
["en"]="startraster",
- ["fr"]="demarreraster",
+ ["fr"]="débutraster",
["it"]="iniziaraster",
["nl"]="startraster",
["pe"]="startraster",
@@ -5404,7 +6080,7 @@ return {
["cs"]="startsadasymbolu",
["de"]="startsymbolset",
["en"]="startsymbolset",
- ["fr"]="demarrejeusymboles",
+ ["fr"]="débutjeusymboles",
["it"]="iniziasetsimboli",
["nl"]="startsymboolset",
["pe"]="شروع‌مجموعه‌نماد",
@@ -5414,7 +6090,7 @@ return {
["cs"]="startsynchronizace",
["de"]="startsynchronisation",
["en"]="startsynchronization",
- ["fr"]="demarresynchronisation",
+ ["fr"]="débutsynchronisation",
["it"]="iniziasincronizzazione",
["nl"]="startsynchronisatie",
["pe"]="شروع‌تطابق",
@@ -5424,7 +6100,7 @@ return {
["cs"]="starttabulka",
["de"]="starttabelle",
["en"]="starttable",
- ["fr"]="demarretableau",
+ ["fr"]="débuttable",
["it"]="iniziatabella",
["nl"]="starttabel",
["pe"]="شروع‌جدول",
@@ -5434,7 +6110,7 @@ return {
["cs"]="starttabulky",
["de"]="starttabellen",
["en"]="starttables",
- ["fr"]="demarretableaux",
+ ["fr"]="débuttables",
["it"]="iniziatabelle",
["nl"]="starttabellen",
["pe"]="شروع‌جدولها",
@@ -5444,7 +6120,7 @@ return {
["cs"]="starttext",
["de"]="starttext",
["en"]="starttext",
- ["fr"]="demarretexte",
+ ["fr"]="débuttexte",
["it"]="iniziatesto",
["nl"]="starttekst",
["pe"]="شروع‌متن",
@@ -5452,17 +6128,14 @@ return {
},
["starttextbackground"]={
["en"]="starttextbackground",
+ ["fr"]="débuttextearriereplan",
["nl"]="starttekstachtergrond",
},
- ["textbackground"]={
- ["en"]="textbackground",
- ["nl"]="tekstachtergrond",
- },
["starttextrule"]={
["cs"]="starttextovalinka",
["de"]="starttextlinie",
["en"]="starttextrule",
- ["fr"]="demarreligneregleetexte",
+ ["fr"]="débuttextetrait",
["it"]="inizialineatesto",
["nl"]="starttekstlijn",
["pe"]="شروع‌خط‌متن",
@@ -5472,7 +6145,7 @@ return {
["cs"]="startnezhustene",
["de"]="startgrosserdurchschuss",
["en"]="startunpacked",
- ["fr"]="demarredegroupe",
+ ["fr"]="débutdesemballage",
["it"]="iniziaunpacked",
["nl"]="startvanelkaar",
["pe"]="شروع‌غیر‌فشرده",
@@ -5482,7 +6155,7 @@ return {
["cs"]="startverze",
["de"]="startversion",
["en"]="startversion",
- ["fr"]="demarreversion",
+ ["fr"]="débutversion",
["it"]="iniziaversione",
["nl"]="startversie",
["pe"]="شروع‌نسخه",
@@ -5492,7 +6165,7 @@ return {
["cs"]="stopzarovnavani",
["de"]="stopausrichtung",
["en"]="stopalignment",
- ["fr"]="stoppealignement",
+ ["fr"]="finalignement",
["it"]="terminaallineamento",
["nl"]="stopuitlijnen",
["pe"]="پایان‌تنظیم",
@@ -5502,7 +6175,7 @@ return {
["cs"]="stoppozadi",
["de"]="stophintergrund",
["en"]="stopbackground",
- ["fr"]="stoppearriereplan",
+ ["fr"]="finarriereplan",
["it"]="terminasfondo",
["nl"]="stopachtergrond",
["pe"]="پایان‌پس‌زمینه",
@@ -5512,7 +6185,7 @@ return {
["cs"]="stopkodovani",
["de"]="stopkodierung",
["en"]="stopcoding",
- ["fr"]="stoppecodage",
+ ["fr"]="fincodage",
["it"]="terminacodifica",
["nl"]="stopcodering",
["pe"]="پایان‌کد",
@@ -5522,7 +6195,7 @@ return {
["cs"]="stopbarva",
["de"]="stopfarbe",
["en"]="stopcolor",
- ["fr"]="stoppecouleur",
+ ["fr"]="fincouleur",
["it"]="terminacolore",
["nl"]="stopkleur",
["pe"]="پایان‌رنگ",
@@ -5532,7 +6205,7 @@ return {
["cs"]="stopcolumnmakeup",
["de"]="stopcolumnmakeup",
["en"]="stopcolumnmakeup",
- ["fr"]="stopcolumnmakeup",
+ ["fr"]="fincompositioncolonne",
["it"]="stopcolumnmakeup",
["nl"]="stopkolomopmaak",
["pe"]="پایان‌آرایش‌ستون",
@@ -5542,7 +6215,7 @@ return {
["cs"]="stopsloupce",
["de"]="stopspalten",
["en"]="stopcolumns",
- ["fr"]="stoppecolonnes",
+ ["fr"]="fincolonnes",
["it"]="terminacolonne",
["nl"]="stopkolommen",
["pe"]="پایان‌ستونها",
@@ -5552,7 +6225,7 @@ return {
["cs"]="stopcolumnset",
["de"]="stopcolumnset",
["en"]="stopcolumnset",
- ["fr"]="stoppejeucolonne",
+ ["fr"]="finjeucolonnes",
["it"]="terminagruppocolonne",
["nl"]="stopkolomgroep",
["pe"]="پایان‌مجموعه‌ستون",
@@ -5562,7 +6235,7 @@ return {
["cs"]="stopspojeni",
["de"]="stopkombination",
["en"]="stopcombination",
- ["fr"]="stoppecombinaison",
+ ["fr"]="fincombinaison",
["it"]="terminacombinazione",
["nl"]="stopcombinatie",
["pe"]="پایان‌ترکیب",
@@ -5572,7 +6245,7 @@ return {
["cs"]="stopkomponenta",
["de"]="stopkomponente",
["en"]="stopcomponent",
- ["fr"]="stoppecomposant",
+ ["fr"]="fincomposant",
["it"]="terminacomponente",
["nl"]="stoponderdeel",
["pe"]="پایان‌مولفه",
@@ -5582,7 +6255,7 @@ return {
["cs"]="stopdokument",
["de"]="stopdokument",
["en"]="stopdocument",
- ["fr"]="stoppedocument",
+ ["fr"]="findocument",
["it"]="terminadocumento",
["nl"]="stopdocument",
["pe"]="پایان‌نوشتار",
@@ -5592,7 +6265,7 @@ return {
["cs"]="stopprostredi",
["de"]="stopumgebung",
["en"]="stopenvironment",
- ["fr"]="stoppeenvironement",
+ ["fr"]="finenvironnement",
["it"]="terminaambiente",
["nl"]="stopomgeving",
["pe"]="پایان‌محیط",
@@ -5600,13 +6273,14 @@ return {
},
["stopframed"]={
["en"]="stopframed",
+ ["fr"]="finencadre",
["nl"]="stopomlijnd",
},
["stopglobal"]={
["cs"]="stopglobalni",
["de"]="stopglobal",
["en"]="stopglobal",
- ["fr"]="stoppeglobal",
+ ["fr"]="finglobal",
["it"]="terminaglobale",
["nl"]="stopglobaal",
["pe"]="پایان‌سراسری",
@@ -5616,7 +6290,7 @@ return {
["cs"]="stopradek",
["de"]="stopzeile",
["en"]="stopline",
- ["fr"]="stoppeligne",
+ ["fr"]="finligneref",
["it"]="terminariga",
["nl"]="stopregel",
["pe"]="پایان‌خط",
@@ -5626,17 +6300,21 @@ return {
["cs"]="stopkorekceradku",
["de"]="stopzeilenkorrektur",
["en"]="stoplinecorrection",
- ["fr"]="stoppecorrectionligne",
+ ["fr"]="fincorrectionligne",
["it"]="terminacorrezioneriga",
["nl"]="stopregelcorrectie",
["pe"]="پایان‌تصحیح‌خط",
["ro"]="stopcorectielinie",
},
+ ["stoplinenote"]={
+ ["en"]="stoplinenote",
+ ["fr"]="finnotedeligne",
+ },
["stoplinenumbering"]={
["cs"]="stopcislovaniradku",
["de"]="stopzeilennumerierung",
["en"]="stoplinenumbering",
- ["fr"]="stoppenumerotationligne",
+ ["fr"]="finnumérotationligne",
["it"]="terminanumerazionerighe",
["nl"]="stopregelnummeren",
["pe"]="پایان‌شماره‌گذاری‌خط",
@@ -5646,7 +6324,7 @@ return {
["cs"]="stopradky",
["de"]="stopzeilen",
["en"]="stoplines",
- ["fr"]="stoppelignes",
+ ["fr"]="finlignes",
["it"]="terminarighe",
["nl"]="stopregels",
["pe"]="پایان‌خطها",
@@ -5656,7 +6334,7 @@ return {
["cs"]="stoplokalni",
["de"]="stoplokal",
["en"]="stoplocal",
- ["fr"]="stoppelocal",
+ ["fr"]="finlocal",
["it"]="terminalocale",
["nl"]="stoplokaal",
["pe"]="پایان‌موضعی",
@@ -5666,7 +6344,7 @@ return {
["cs"]="stoplokalnipoznamkypodcarou",
["de"]="stoplokalefussnoten",
["en"]="stoplocalfootnotes",
- ["fr"]="stoppenotespdplocales",
+ ["fr"]="finnotesbdplocal",
["it"]="terminanotepdplocali",
["nl"]="stoplokalevoetnoten",
["pe"]="پایان‌پانوشتهای‌موضعی",
@@ -5676,7 +6354,7 @@ return {
["cs"]="stopuprava",
["de"]="stopumbruch",
["en"]="stopmakeup",
- ["fr"]="stoppemakeup",
+ ["fr"]="fincomposition",
["it"]="terminamakeup",
["nl"]="stopopmaak",
["pe"]="پایان‌آرایش",
@@ -5686,7 +6364,7 @@ return {
["cs"]="stopmarginalniblok",
["de"]="stopmarginalblock",
["en"]="stopmarginblock",
- ["fr"]="stoppeblocmarge",
+ ["fr"]="finblocmarge",
["it"]="terminabloccomargine",
["nl"]="stopmargeblok",
["pe"]="پایان‌بلوک‌حاشیه",
@@ -5696,7 +6374,7 @@ return {
["cs"]="stopmarginalnilinka",
["de"]="stopmarginallinie",
["en"]="stopmarginrule",
- ["fr"]="stoppemargereglee",
+ ["fr"]="fintraitmarge",
["it"]="terminalineamargine",
["nl"]="stopkantlijn",
["pe"]="پایان‌خط‌حاشیه",
@@ -5706,7 +6384,7 @@ return {
["cs"]="stopzuzeni",
["de"]="stopenger",
["en"]="stopnarrower",
- ["fr"]="stopcompoetroite",
+ ["fr"]="finplusetroit",
["it"]="terminapiustretto",
["nl"]="stopsmaller",
["pe"]="پایان‌نازکتر",
@@ -5716,7 +6394,7 @@ return {
["cs"]="stopprotejsek",
["de"]="stopgegenueber",
["en"]="stopopposite",
- ["fr"]="stoppeopposition",
+ ["fr"]="finopposition",
["it"]="terminaopposto",
["nl"]="stopnaast",
["pe"]="پایان‌مخالف",
@@ -5726,17 +6404,17 @@ return {
["cs"]="stopprekryv",
["de"]="stopoverlay",
["en"]="stopoverlay",
- ["fr"]="stopperevetement",
+ ["fr"]="finsuperposition",
["it"]="terminasovrapposizione",
["nl"]="stopoverlay",
["pe"]="پایان‌پوشش",
["ro"]="stopoverlay",
},
- ["stopoverzicht"]={
+ ["stopoverview"]={
["cs"]="stopprehled",
["de"]="stopueberblick",
["en"]="stopoverview",
- ["fr"]="stoppevuedensemble",
+ ["fr"]="finvuedensemble",
["it"]="terminaoverview",
["nl"]="stopoverzicht",
["pe"]="پایان‌بازبینی",
@@ -5746,7 +6424,7 @@ return {
["cs"]="stopzhustene",
["de"]="stopkleinerdurchschuss",
["en"]="stoppacked",
- ["fr"]="stoppegroupe",
+ ["fr"]="finemballage",
["it"]="terminaimpaccato",
["nl"]="stopopelkaar",
["pe"]="پایان‌فشرده",
@@ -5756,7 +6434,7 @@ return {
["cs"]="stopumistovani",
["de"]="stoppositionieren",
["en"]="stoppositioning",
- ["fr"]="stoppepositionnement",
+ ["fr"]="finpositionnement",
["it"]="terminaposizionamento",
["nl"]="stoppositioneren",
["pe"]="پایان‌مکان‌گذاری",
@@ -5766,7 +6444,7 @@ return {
["cs"]="stopprodukt",
["de"]="stopprodukt",
["en"]="stopproduct",
- ["fr"]="stoppeproduit",
+ ["fr"]="finproduit",
["it"]="terminaprodotto",
["nl"]="stopprodukt",
["pe"]="پایان‌تولید",
@@ -5776,7 +6454,7 @@ return {
["cs"]="stopprofil",
["de"]="stopprofil",
["en"]="stopprofile",
- ["fr"]="stoppeprofil",
+ ["fr"]="finprofil",
["it"]="terminaprofili",
["nl"]="stopprofiel",
["pe"]="پایان‌پروفایل",
@@ -5786,7 +6464,7 @@ return {
["cs"]="stopprojekt",
["de"]="stopprojekt",
["en"]="stopproject",
- ["fr"]="stoppeprojet",
+ ["fr"]="finprojet",
["it"]="terminaprogetto",
["nl"]="stopprojekt",
["pe"]="پایان‌پروژه",
@@ -5796,7 +6474,7 @@ return {
["cs"]="stopcitace",
["de"]="stopzitat",
["en"]="stopquotation",
- ["fr"]="stoppecitation",
+ ["fr"]="fincitation",
["it"]="terminacitazione",
["nl"]="stopcitaat",
["pe"]="پایان‌نقل‌قول",
@@ -5806,7 +6484,7 @@ return {
["cs"]="stoprastr",
["de"]="stopraster",
["en"]="stopraster",
- ["fr"]="stopperaster",
+ ["fr"]="finraster",
["it"]="terminaraster",
["nl"]="stopraster",
["pe"]="stopraster",
@@ -5816,7 +6494,7 @@ return {
["cs"]="stopsynchronizace",
["de"]="stopsynchronisation",
["en"]="stopsynchronization",
- ["fr"]="stoppesynchronisation",
+ ["fr"]="finsynchronisation",
["it"]="terminasincronizzazione",
["nl"]="stopsynchronisatie",
["pe"]="پایان‌تطابق",
@@ -5826,7 +6504,7 @@ return {
["cs"]="stoptabulka",
["de"]="stoptabelle",
["en"]="stoptable",
- ["fr"]="stoppetableau",
+ ["fr"]="fintable",
["it"]="terminatabella",
["nl"]="stoptabel",
["pe"]="پایان‌جدول",
@@ -5836,7 +6514,7 @@ return {
["cs"]="stoptabulky",
["de"]="stoptabellen",
["en"]="stoptables",
- ["fr"]="stoppetableaux",
+ ["fr"]="fintables",
["it"]="terminatabelle",
["nl"]="stoptabellen",
["pe"]="پایان‌جدولها",
@@ -5846,7 +6524,7 @@ return {
["cs"]="stoptext",
["de"]="stoptext",
["en"]="stoptext",
- ["fr"]="stoppetexte",
+ ["fr"]="fintexte",
["it"]="terminatesto",
["nl"]="stoptekst",
["pe"]="پایان‌متن",
@@ -5854,13 +6532,14 @@ return {
},
["stoptextbackground"]={
["en"]="stoptextbackground",
+ ["fr"]="fintextearriereplan",
["nl"]="stoptekstachtergrond",
},
["stoptextrule"]={
["cs"]="stoptextovalinka",
["de"]="stoptextlinie",
["en"]="stoptextrule",
- ["fr"]="stoppeligneregleetexte",
+ ["fr"]="fintextetrait",
["it"]="terminalineatesto",
["nl"]="stoptekstlijn",
["pe"]="پایان‌خط‌متن",
@@ -5870,7 +6549,7 @@ return {
["cs"]="stopnezhustene",
["de"]="stopgrosserdurchschuss",
["en"]="stopunpacked",
- ["fr"]="stoppedegroupe",
+ ["fr"]="findesemballage",
["it"]="terminaunpacked",
["nl"]="stopvanelkaar",
["pe"]="پایان‌غیرفشرده",
@@ -5880,7 +6559,7 @@ return {
["cs"]="stopverze",
["de"]="stopversion",
["en"]="stopversion",
- ["fr"]="stoppeversion",
+ ["fr"]="finversion",
["it"]="terminaversioni",
["nl"]="stopversie",
["pe"]="پایان‌نسخه",
@@ -5896,6 +6575,14 @@ return {
["pe"]="کشیده",
["ro"]="intins",
},
+ ["strictinspectnextcharacter"]={
+ ["en"]="strictinspectnextcharacter",
+ ["fr"]="inspecterstrictementcaracteresuivant",
+ },
+ ["stripcharacter"]={
+ ["en"]="stripcharacter",
+ ["fr"]="demontercaractere",
+ },
["subformulanumber"]={
["cs"]="cislopodrovnice",
["de"]="unterformelnummer",
@@ -5910,17 +6597,21 @@ return {
["cs"]="subpagenumber",
["de"]="subpagenumber",
["en"]="subpagenumber",
- ["fr"]="sousnumeropage",
+ ["fr"]="numerosouspage",
["it"]="subpagenumber",
["nl"]="subpaginanummer",
["pe"]="شماره‌زیرصفحه",
["ro"]="subpagenumber",
},
+ ["subtractfeature"]={
+ ["en"]="subtractfeature",
+ ["fr"]="enleverfonctionnalite",
+ },
["switchtobodyfont"]={
["cs"]="prepninazakladnifont",
["de"]="wechselezumfliesstext",
["en"]="switchtobodyfont",
- ["fr"]="changepolicecorps",
+ ["fr"]="passerapolicedecorps",
["it"]="cambiaafontdeltesto",
["nl"]="switchnaarkorps",
["pe"]="تغییربه‌قلم‌بدنه",
@@ -5930,7 +6621,7 @@ return {
["cs"]="switchtorawfont",
["de"]="switchtorawfont",
["en"]="switchtorawfont",
- ["fr"]="changepolicebrute",
+ ["fr"]="passerapolicebrute",
["it"]="passaafontgrezzo",
["nl"]="switchtorawfont",
["pe"]="تغییربه‌قلم‌خام",
@@ -5958,6 +6649,7 @@ return {
},
["symoffset"]={
["en"]="symoffset",
+ ["fr"]="decalagesym",
["nl"]="symoffset",
},
["synchronizationbar"]={
@@ -5974,7 +6666,7 @@ return {
["cs"]="synchronizovat",
["de"]="synchronisieren",
["en"]="synchronize",
- ["fr"]="synchronise",
+ ["fr"]="synchroniser",
["it"]="sincronizza",
["nl"]="synchroniseer",
["pe"]="تطابق",
@@ -5994,12 +6686,20 @@ return {
["cs"]="testcolumn",
["de"]="testcolumn",
["en"]="testcolumn",
- ["fr"]="testcolumn",
+ ["fr"]="testcolonne",
["it"]="testcolumn",
["nl"]="testkolom",
["pe"]="ستون‌امتحان",
["ro"]="testcolumn",
},
+ ["testfeature"]={
+ ["en"]="testfeature",
+ ["fr"]="testerfonctionnalite",
+ },
+ ["testfeatureonce"]={
+ ["en"]="testfeatureonce",
+ ["fr"]="testerfonctionnaliteunfois",
+ },
["testpage"]={
["cs"]="testpage",
["de"]="testpage",
@@ -6020,6 +6720,15 @@ return {
["pe"]="تک",
["ro"]="tex",
},
+ ["textbackground"]={
+ ["en"]="textbackground",
+ ["fr"]="textearriereplan",
+ ["nl"]="tekstachtergrond",
+ },
+ ["textcolor"]={
+ ["en"]="textcolor",
+ ["fr"]="textecouleura",
+ },
["textheight"]={
["cs"]="vyskatextu",
["de"]="texthoehe",
@@ -6030,6 +6739,10 @@ return {
["pe"]="ارتفاع‌متن",
["ro"]="inaltimetext",
},
+ ["textnote"]={
+ ["en"]="textnote",
+ ["fr"]="notetexte",
+ },
["textreference"]={
["cs"]="odkaznatext",
["de"]="textreferenz",
@@ -6044,7 +6757,7 @@ return {
["cs"]="textovalinka",
["de"]="textlinie",
["en"]="textrule",
- ["fr"]="ligneregleetexte",
+ ["fr"]="traittexte",
["it"]="lineatesto",
["nl"]="tekstlijn",
["pe"]="خط‌متن",
@@ -6070,6 +6783,18 @@ return {
["pe"]="عرض‌متن",
["ro"]="latimetext",
},
+ ["thefirstcharacter"]={
+ ["en"]="thefirstcharacter",
+ ["fr"]="lepremiercaractere",
+ },
+ ["thenormalizedbodyfontsize"]={
+ ["en"]="thenormalizedbodyfontsize",
+ ["fr"]="lataillenormaliseepolicedecorps",
+ },
+ ["theremainingcharacters"]={
+ ["en"]="theremainingcharacters",
+ ["fr"]="lescaracteresrestants",
+ },
["thinrule"]={
["cs"]="tenkalinka",
["de"]="duennelinie",
@@ -6090,11 +6815,15 @@ return {
["pe"]="خطهای‌نازک",
["ro"]="liniisubtiri",
},
+ ["tolinenote"]={
+ ["en"]="tolinenote",
+ ["fr"]="alanotedeligne",
+ },
["tooltip"]={
["cs"]="bublinkovanapoveda",
["de"]="tooltip",
["en"]="tooltip",
- ["fr"]="suggestion",
+ ["fr"]="infobulle",
["it"]="tooltip",
["nl"]="suggestie",
["pe"]="tooltip",
@@ -6104,7 +6833,7 @@ return {
["cs"]="vzdalenosthorejsku",
["de"]="abstandoben",
["en"]="topdistance",
- ["fr"]="distancesup",
+ ["fr"]="distancehaut",
["it"]="distanzacima",
["nl"]="bovenafstand",
["pe"]="فاصله‌بالا",
@@ -6114,7 +6843,7 @@ return {
["cs"]="vyskahorejsku",
["de"]="hoeheoben",
["en"]="topheight",
- ["fr"]="hauteursup",
+ ["fr"]="hauteurhaut",
["it"]="altezzacima",
["nl"]="bovenhoogte",
["pe"]="ارتفاع‌بالا",
@@ -6124,7 +6853,7 @@ return {
["cs"]="odsazenishora",
["de"]="kopfweite",
["en"]="topspace",
- ["fr"]="espacesup",
+ ["fr"]="espacehaut",
["it"]="spaziocima",
["nl"]="kopwit",
["pe"]="فضای‌بالا",
@@ -6164,7 +6893,7 @@ return {
["cs"]="pis",
["de"]="tip",
["en"]="typ",
- ["fr"]="typ",
+ ["fr"]="transcrireaveccesure",
["it"]="typ",
["nl"]="typ",
["pe"]="typ",
@@ -6174,7 +6903,7 @@ return {
["cs"]="opis",
["de"]="tippen",
["en"]="type",
- ["fr"]="dactylographier",
+ ["fr"]="transcrire",
["it"]="type",
["nl"]="type",
["pe"]="تایپ",
@@ -6184,27 +6913,39 @@ return {
["cs"]="typebuffer",
["de"]="tippepuffer",
["en"]="typebuffer",
- ["fr"]="tapebuffer",
+ ["fr"]="transcriretampon",
["it"]="typebuffer",
["nl"]="typebuffer",
["pe"]="تایپ‌بافر",
["ro"]="scriebuffer",
},
+ ["typedefinedbuffer"]={
+ ["en"]="typedefinedbuffer",
+ ["fr"]="transcriretampondefini",
+ },
["typefile"]={
["cs"]="opissoubor",
["de"]="tippedatei",
["en"]="typefile",
- ["fr"]="fichierdactylo",
+ ["fr"]="transcrirefichier",
["it"]="typefile",
["nl"]="typefile",
["pe"]="تایپ‌پرونده",
["ro"]="typefile",
},
+ ["typeinlinebuffer"]={
+ ["en"]="typeinlinebuffer",
+ ["fr"]="transcriretamponenligne",
+ },
+ ["typing"]={
+ ["en"]="typing",
+ ["fr"]="transcription",
+ },
["unitmeaning"]={
["cs"]="vyznam",
["de"]="bedeutung",
["en"]="unitmeaning",
- ["fr"]="sensunite",
+ ["fr"]="significationunite",
["it"]="nomeunita",
["nl"]="betekenis",
["pe"]="معنی‌واحد",
@@ -6220,11 +6961,15 @@ return {
["pe"]="ناشناس",
["ro"]="necunoscut",
},
+ ["unregisterhyphenationpattern"]={
+ ["en"]="unregisterhyphenationpattern",
+ ["fr"]="desenregistrermotifcesure",
+ },
["useJSscripts"]={
["cs"]="uzijJSscripts",
["de"]="verwendeJSscript",
["en"]="useJSscripts",
- ["fr"]="utiliseJSscripts",
+ ["fr"]="utiliserJSscript",
["it"]="usaJSscripts",
["nl"]="gebruikJSscripts",
["pe"]="useJSscripts",
@@ -6234,7 +6979,7 @@ return {
["cs"]="uzijURL",
["de"]="verwendeURL",
["en"]="useURL",
- ["fr"]="utiliseURL",
+ ["fr"]="utiliserURL",
["it"]="usaURL",
["nl"]="gebruikURL",
["pe"]="useURL",
@@ -6244,7 +6989,7 @@ return {
["cs"]="useXMLfilter",
["de"]="useXMLfilter",
["en"]="useXMLfilter",
- ["fr"]="useXMLfilter",
+ ["fr"]="utiliserfiltreXML",
["it"]="useXMLfilter",
["nl"]="gebruikXMLfilter",
["pe"]="useXMLfilter",
@@ -6254,17 +6999,25 @@ return {
["cs"]="uzijbloky",
["de"]="verwendebloecke",
["en"]="useblocks",
- ["fr"]="utiliseblocs",
+ ["fr"]="utiliserblocs",
["it"]="usablocco",
["nl"]="gebruikblokken",
["pe"]="استفاده‌بلوکها",
["ro"]="folosestebloc",
},
+ ["usebodyfont"]={
+ ["en"]="usebodyfont",
+ ["fr"]="utiliserpolicedecorps",
+ },
+ ["usebodyfontparameter"]={
+ ["en"]="usebodyfontparameter",
+ ["fr"]="utiliserparametrepolicedecorps",
+ },
["usecommands"]={
["cs"]="uzijprikazy",
["de"]="verwendebefehl",
["en"]="usecommands",
- ["fr"]="utilisecommandes",
+ ["fr"]="utilisercommandes",
["it"]="usacomandi",
["nl"]="gebruikcommandos",
["pe"]="استفاده‌فرمانها",
@@ -6274,7 +7027,7 @@ return {
["cs"]="uzijkodovani",
["de"]="benutzekodierung",
["en"]="useencoding",
- ["fr"]="utiliseencodage",
+ ["fr"]="utilisercodage",
["it"]="usacodifica",
["nl"]="usecodering",
["pe"]="استفاده‌رمزینه",
@@ -6284,7 +7037,7 @@ return {
["cs"]="uzijexternidokument",
["de"]="verwendeexteresdokument",
["en"]="useexternaldocument",
- ["fr"]="utilisedocumentexterne",
+ ["fr"]="utiliserdocumentexterne",
["it"]="usadocumentoesterno",
["nl"]="gebruikexterndocument",
["pe"]="استفاده‌نوشتارخارجی",
@@ -6294,7 +7047,7 @@ return {
["cs"]="uzijexterniobraz",
["de"]="verwendeexterneabbildung",
["en"]="useexternalfigure",
- ["fr"]="utilisefigureexterne",
+ ["fr"]="utiliserfigureexterne",
["it"]="usafiguraesterna",
["nl"]="gebruikexternfiguur",
["pe"]="استفاده‌شکل‌خارجی",
@@ -6304,7 +7057,7 @@ return {
["cs"]="uzijexternisoubor",
["de"]="verwendeexternedatei",
["en"]="useexternalfile",
- ["fr"]="utilisefichierexterne",
+ ["fr"]="utiliserfichierexterne",
["it"]="usafileesterno",
["nl"]="gebruikexternefile",
["pe"]="استفاده‌پرونده‌خارجی",
@@ -6314,7 +7067,7 @@ return {
["cs"]="uzijexternisoubory",
["de"]="verwendeexternedateien",
["en"]="useexternalfiles",
- ["fr"]="utilisefichiersexternes",
+ ["fr"]="utiliserfichiersexternes",
["it"]="usafileesterni",
["nl"]="gebruikexternefiles",
["pe"]="استفاده‌پرونده‌های‌خارجی",
@@ -6324,7 +7077,7 @@ return {
["cs"]="uzijexternizvuk",
["de"]="verwendeexternestonstueck",
["en"]="useexternalsoundtrack",
- ["fr"]="utilisepsiteaudioexterne",
+ ["fr"]="utilisersonexterne",
["it"]="usacolonnasonoraesterna",
["nl"]="gebruikexterngeluidsfragment",
["pe"]="استفاده‌قطعه‌موزیک‌خارجی",
@@ -6334,7 +7087,7 @@ return {
["cs"]="uzijmodul",
["de"]="verwendemodul",
["en"]="usemodule",
- ["fr"]="utilisemodule",
+ ["fr"]="utilisermodule",
["it"]="usamodulo",
["nl"]="gebruikmodule",
["pe"]="استفاده‌مدول",
@@ -6344,7 +7097,7 @@ return {
["cs"]="uzijmoduly",
["de"]="verwendemodule",
["en"]="usemodules",
- ["fr"]="utilisemodules",
+ ["fr"]="utilisermodules",
["it"]="usamoduli",
["nl"]="gebruikmodules",
["pe"]="استفاده‌مدولها",
@@ -6354,7 +7107,7 @@ return {
["cs"]="uzijadresar",
["de"]="benutzeverzeichnis",
["en"]="usedirectory",
- ["fr"]="utilisechemin",
+ ["fr"]="utiliserchemin",
["it"]="usacartella",
["nl"]="gebruikpad",
["pe"]="استفاده‌مسیر",
@@ -6364,7 +7117,7 @@ return {
["cs"]="uzijodkazy",
["de"]="verwendereferenzen",
["en"]="usereferences",
- ["fr"]="utilisereferences",
+ ["fr"]="utiliserreferences",
["it"]="usariferimenti",
["nl"]="gebruikreferenties",
["pe"]="استفاده‌مرجعها",
@@ -6374,7 +7127,7 @@ return {
["cs"]="uzijspeciality",
["de"]="benutzespezielles",
["en"]="usespecials",
- ["fr"]="utilisespecialites",
+ ["fr"]="utiliserspeciaux",
["it"]="usaspecialita",
["nl"]="gebruikspecials",
["pe"]="استفاده‌ویژگیها",
@@ -6384,7 +7137,7 @@ return {
["cs"]="uzijsymbol",
["de"]="verwendesymbole",
["en"]="usesymbols",
- ["fr"]="utilisesymboles",
+ ["fr"]="utilisersymboles",
["it"]="usasimboli",
["nl"]="gebruiksymbolen",
["pe"]="استفاده‌نمادها",
@@ -6394,7 +7147,7 @@ return {
["cs"]="usetypescript",
["de"]="usetypescript",
["en"]="usetypescript",
- ["fr"]="usetypescript",
+ ["fr"]="utiliserscriptdepolices",
["it"]="usetypescript",
["nl"]="gebruiktypescript",
["pe"]="استفاده‌دستخط‌تایپ",
@@ -6404,6 +7157,7 @@ return {
["cs"]="usetypescriptfile",
["de"]="usetypescriptfile",
["en"]="usetypescriptfile",
+ ["fr"]="utiliserfichierscriptdepolices",
["it"]="usetypescriptfile",
["nl"]="gebruiktypescriptfile",
["pe"]="استفاده‌پرونده‌دستخط‌تایپ",
@@ -6413,12 +7167,16 @@ return {
["cs"]="uzijurl",
["de"]="verwendeurl",
["en"]="useurl",
- ["fr"]="utiliseurl",
+ ["fr"]="utiliserurl",
["it"]="usaurl",
["nl"]="gebruikurl",
["pe"]="useurl",
["ro"]="folosesteurl",
},
+ ["verbatim"]={
+ ["en"]="verbatim",
+ ["fr"]="verbatim",
+ },
["version"]={
["cs"]="verze",
["de"]="version",
@@ -6433,7 +7191,7 @@ return {
["cs"]="vl",
["de"]="vl",
["en"]="vl",
- ["fr"]="vl",
+ ["fr"]="lv",
["it"]="vl",
["nl"]="vl",
["pe"]="خ‌ع",
@@ -6459,11 +7217,15 @@ return {
["pe"]="فضای‌سفید",
["ro"]="spatiualb",
},
+ ["widthspanningtext"]={
+ ["en"]="widthspanningtext",
+ ["fr"]="largeurtextecouvrant",
+ },
["wordright"]={
["cs"]="slovovpravo",
["de"]="wortrechts",
["en"]="wordright",
- ["fr"]="motdroit",
+ ["fr"]="ecrireadroite",
["it"]="paroladestra",
["nl"]="woordrechts",
["pe"]="کلمه‌راست",
@@ -6473,7 +7235,7 @@ return {
["cs"]="zapismeziseznam",
["de"]="schreibezwischenliste",
["en"]="writebetweenlist",
- ["fr"]="ecritentreliste",
+ ["fr"]="ecrireentreliste",
["it"]="scrividentroelenco",
["nl"]="schrijftussenlijst",
["pe"]="بنویس‌بین‌لیست",
@@ -6483,7 +7245,7 @@ return {
["cs"]="zapisdoseznamu",
["de"]="schreibezurliste",
["en"]="writetolist",
- ["fr"]="ecritdansliste",
+ ["fr"]="ecriredansliste",
["it"]="scriviinelenco",
["nl"]="schrijfnaarlijst",
["pe"]="بنویس‌در‌لیست",
@@ -6493,7 +7255,7 @@ return {
["cs"]="zapisdoseznamuodkazu",
["de"]="schreibezurreferenzliste",
["en"]="writetoreferencelist",
- ["fr"]="ecritdanslistereference",
+ ["fr"]="ecriredanslistereference",
["it"]="scriviinlistariferimenti",
["nl"]="schrijfnaarreferentielijst",
["pe"]="بنویس‌درلیست‌مرجع",
@@ -6503,7 +7265,7 @@ return {
["cs"]="zapisdorejstriku",
["de"]="schreibezumregister",
["en"]="writetoregister",
- ["fr"]="ecritregistre",
+ ["fr"]="ecriredansregistre",
["it"]="scriviinregistro",
["nl"]="schrijfnaarregister",
["pe"]="بنویس‌درثبت",
@@ -6511,10 +7273,6 @@ return {
},
},
["constants"]={
- ["fractions"]={
- ["en"]="fractions",
- ["nl"]="breuken",
- },
["action"]={
["cs"]="akce",
["de"]="aktion",
@@ -6539,7 +7297,7 @@ return {
["cs"]="po",
["de"]="nach",
["en"]="after",
- ["fr"]="apres",
+ ["fr"]="après",
["it"]="dopo",
["nl"]="na",
["pe"]="بعداز",
@@ -6549,7 +7307,7 @@ return {
["cs"]="pohlavicce",
["de"]="nachkopf",
["en"]="afterhead",
- ["fr"]="aprestete",
+ ["fr"]="aprèstête",
["it"]="dopotesta",
["nl"]="kopna",
["pe"]="بعدازسر",
@@ -6559,7 +7317,7 @@ return {
["cs"]="klavesapo",
["de"]="nachtaste",
["en"]="afterkey",
- ["fr"]="aprescle",
+ ["fr"]="aprèsclé",
["it"]="dopotasto",
["nl"]="natoets",
["pe"]="بعدازکلید",
@@ -6567,58 +7325,68 @@ return {
},
["aftersection"]={
["en"]="aftersection",
+ ["fr"]="aprèssection",
["nl"]="nasectie",
},
["align"]={
["cs"]="zarovnani",
["de"]="ausrichtung",
["en"]="align",
- ["fr"]="alignement",
+ ["fr"]="aligner",
["it"]="allinea",
["nl"]="uitlijnen",
["pe"]="تنظیم",
["ro"]="aliniere",
},
+ ["alignbottom"]={
+ ["en"]="alignbottom",
+ ["fr"]="alignerbas",
+ },
["aligncharacter"]={
["cs"]="aligncharacter",
["de"]="aligncharacter",
["en"]="aligncharacter",
- ["fr"]="caracterealigne",
+ ["fr"]="alignersurcaractere",
["it"]="allineacarattere",
["nl"]="karakteruitlijnen",
["pe"]="حرف‌تنظیم",
["ro"]="aliniazacaracter",
},
- ["alignmentleftwidth"]={
- ["en"]="alignmentleftwidth",
- },
- ["alignmentrightwidth"]={
- ["en"]="alignmentrightwidth",
- },
- ["alignmentleftsample"]={
- ["en"]="alignmentleftsample",
- },
- ["alignmentrightsample"]={
- ["en"]="alignmentrightsample",
- },
["alignmentcharacter"]={
["cs"]="alignmentcharacter",
["de"]="alignmentcharacter",
["en"]="alignmentcharacter",
- ["fr"]="alignementcaractere",
+ ["fr"]="caracterealignement",
["it"]="carattereallineamento",
["nl"]="uitlijnkarakter",
["pe"]="حرف‌تنظیم‌کردن",
["ro"]="alierecaracter",
},
+ ["alignmentleftsample"]={
+ ["en"]="alignmentleftsample",
+ ["fr"]="echantillongauchealignement",
+ },
+ ["alignmentleftwidth"]={
+ ["en"]="alignmentleftwidth",
+ ["fr"]="largeurgauchealignement",
+ },
+ ["alignmentrightsample"]={
+ ["en"]="alignmentrightsample",
+ ["fr"]="echantillondroitealignement",
+ },
+ ["alignmentrightwidth"]={
+ ["en"]="alignmentrightwidth",
+ ["fr"]="largeurdroitealignement",
+ },
["alignsymbol"]={
["en"]="alignsymbol",
+ ["fr"]="alignersursymbol",
},
["aligntitle"]={
["cs"]="zarovnejtitul",
["de"]="titelausrichten",
["en"]="aligntitle",
- ["fr"]="alignementtitre",
+ ["fr"]="alignersurtitre",
["it"]="allineatitolo",
["nl"]="titeluitlijnen",
["pe"]="عنوان‌تنظیم",
@@ -6628,22 +7396,25 @@ return {
["cs"]="alternativa",
["de"]="alternative",
["en"]="alternative",
- ["fr"]="alternative",
+ ["fr"]="variante",
["it"]="alternativa",
["nl"]="variant",
["pe"]="جایگزین",
["ro"]="alternativ",
},
- ["stylealternative"]={
- ["en"]="stylealternative",
- ["nl"]="stylevariant",
- },
["anchor"]={
["en"]="anchor",
+ ["fr"]="ancre",
["nl"]="anker",
},
+ ["anchoring"]={
+ ["en"]="anchoring",
+ ["fr"]="ancrage",
+ ["nl"]="verankering",
+ },
["andtext"]={
["en"]="andtext",
+ ["fr"]="ettexte",
},
["apa"]={
["cs"]="apa",
@@ -6657,6 +7428,7 @@ return {
},
["arguments"]={
["en"]="arguments",
+ ["fr"]="arguments",
["nl"]="argumenten",
},
["arrow"]={
@@ -6671,24 +7443,29 @@ return {
},
["artauthor"]={
["en"]="artauthor",
+ ["fr"]="artauteur",
},
["artauthoretaldisplay"]={
["en"]="artauthoretaldisplay",
+ ["fr"]="artauteuretalaffichage",
},
["artauthoretallimit"]={
["en"]="artauthoretallimit",
+ ["fr"]="artauteuretallimite",
},
["artauthoretaltext"]={
["en"]="artauthoretaltext",
+ ["fr"]="artauteuretaltexte",
},
["artoffset"]={
["en"]="artoffset",
+ ["fr"]="artdecalage",
},
["at"]={
["cs"]="u",
["de"]="bei",
["en"]="at",
- ["fr"]="a",
+ ["fr"]="en",
["it"]="ad",
["nl"]="op",
["pe"]="در",
@@ -6706,15 +7483,19 @@ return {
},
["authorconversion"]={
["en"]="authorconversion",
+ ["fr"]="auteurconversion",
},
["authoretaldisplay"]={
["en"]="authoretaldisplay",
+ ["fr"]="auteuretalaffichage",
},
["authoretallimit"]={
["en"]="authoretallimit",
+ ["fr"]="auteuretallimite",
},
["authoretaltext"]={
["en"]="authoretaltext",
+ ["fr"]="auteuretaltexte",
},
["auto"]={
["cs"]="auto",
@@ -6728,13 +7509,14 @@ return {
},
["autocase"]={
["en"]="autocase",
+ ["fr"]="autocase",
["nl"]="autocase",
},
["autofile"]={
["cs"]="autofile",
["de"]="autofile",
["en"]="autofile",
- ["fr"]="autofile",
+ ["fr"]="autofichier",
["it"]="autofile",
["nl"]="autofile",
["pe"]="پرونده‌خودکار",
@@ -6754,7 +7536,7 @@ return {
["cs"]="autohang",
["de"]="autohang",
["en"]="autohang",
- ["fr"]="autohang",
+ ["fr"]="autosuspendre",
["it"]="autohang",
["nl"]="autohang",
["pe"]="آویزان‌خودکار",
@@ -6764,7 +7546,7 @@ return {
["cs"]="autostrut",
["de"]="autostrut",
["en"]="autostrut",
- ["fr"]="autostrut",
+ ["fr"]="autoentretoise",
["it"]="autostrut",
["nl"]="autostrut",
["pe"]="بست‌خودکار",
@@ -6782,10 +7564,12 @@ return {
},
["availableheight"]={
["en"]="availableheight",
+ ["fr"]="hauteurdisponible",
["nl"]="beschikbarehoogte",
},
["availablewidth"]={
["en"]="availablewidth",
+ ["fr"]="largeurdisponible",
["nl"]="beschikbarebreedte",
},
["axis"]={
@@ -6870,13 +7654,14 @@ return {
},
["backreference"]={
["en"]="backreference",
+ ["fr"]="retroreference",
["nl"]="terugreferentie",
},
["backspace"]={
["cs"]="zpetnamezera",
["de"]="rumpfspatium",
["en"]="backspace",
- ["fr"]="retour",
+ ["fr"]="espacearrière",
["it"]="backspace",
["nl"]="rugwit",
["pe"]="فضای‌پس",
@@ -6886,7 +7671,7 @@ return {
["cs"]="rovnovaha",
["de"]="ausgleichen",
["en"]="balance",
- ["fr"]="equilibre",
+ ["fr"]="equilibrer",
["it"]="bilanciamento",
["nl"]="balanceren",
["pe"]="تعادل",
@@ -6914,13 +7699,14 @@ return {
},
["beforesection"]={
["en"]="beforesection",
+ ["fr"]="avantsection",
["nl"]="voorsectie",
},
["bet"]={
["cs"]="bet",
["de"]="bet",
["en"]="bet",
- ["fr"]="bet",
+ ["fr"]="suj",
["it"]="bet",
["nl"]="bet",
["pe"]="bet",
@@ -6928,12 +7714,13 @@ return {
},
["bidi"]={
["en"]="bidi",
+ ["fr"]="bidi",
},
["big"]={
["cs"]="velky",
["de"]="gross",
["en"]="big",
- ["fr"]="grand",
+ ["fr"]="important",
["it"]="grande",
["nl"]="groot",
["pe"]="بزرگ",
@@ -6943,7 +7730,7 @@ return {
["cs"]="prazdny",
["de"]="blanko",
["en"]="blank",
- ["fr"]="vide",
+ ["fr"]="vierge",
["it"]="rigovuoto",
["nl"]="blanko",
["pe"]="خالی",
@@ -6951,12 +7738,13 @@ return {
},
["bleedoffset"]={
["en"]="bleedoffset",
+ ["fr"]="decalagefuite",
},
["blockway"]={
["cs"]="dobloku",
["de"]="blockauf",
["en"]="blockway",
- ["fr"]="blockway",
+ ["fr"]="faconbloc",
["it"]="blockway",
["nl"]="blokwijze",
["pe"]="راه‌بلوک",
@@ -6966,7 +7754,7 @@ return {
["cs"]="zakladnifont",
["de"]="fliesstext",
["en"]="bodyfont",
- ["fr"]="policecorps",
+ ["fr"]="policedecorps",
["it"]="fonttesto",
["nl"]="korps",
["pe"]="قلم‌بدنه",
@@ -6974,24 +7762,31 @@ return {
},
["boffset"]={
["en"]="boffset",
+ ["fr"]="decalageb",
},
["boldfeatures"]={
["en"]="boldfeatures",
+ ["fr"]="fonctionnalitesgras",
},
["boldfont"]={
["en"]="boldfont",
+ ["fr"]="policegras",
},
["bolditalicfeatures"]={
["en"]="bolditalicfeatures",
+ ["fr"]="fonctionnalitesgrasitalique",
},
["bolditalicfont"]={
["en"]="bolditalicfont",
+ ["fr"]="policegrasitalique",
},
["boldslantedfeatures"]={
["en"]="boldslantedfeatures",
+ ["fr"]="fonctionnalitesgrasincline",
},
["boldslantedfont"]={
["en"]="boldslantedfont",
+ ["fr"]="policegrasincline",
},
["bookmark"]={
["cs"]="zalozka",
@@ -7007,7 +7802,7 @@ return {
["cs"]="spodek",
["de"]="unten",
["en"]="bottom",
- ["fr"]="inf",
+ ["fr"]="bas",
["it"]="fondo",
["nl"]="onder",
["pe"]="پایین",
@@ -7015,19 +7810,22 @@ return {
},
["bottomafter"]={
["en"]="bottomafter",
+ ["fr"]="basaprès",
},
["bottombefore"]={
["en"]="bottombefore",
+ ["fr"]="basavant",
},
["bottomcommand"]={
["en"]="bottomcommand",
+ ["fr"]="commandebas",
["nl"]="ondercommando",
},
["bottomdistance"]={
["cs"]="vzdalenostspodku",
["de"]="abstandunten",
["en"]="bottomdistance",
- ["fr"]="distanceinf",
+ ["fr"]="distancebas",
["it"]="distanzafondo",
["nl"]="onderafstand",
["pe"]="فاصله‌پایین",
@@ -7037,7 +7835,7 @@ return {
["cs"]="ramecekdole",
["de"]="untenrahmen",
["en"]="bottomframe",
- ["fr"]="cadreinf",
+ ["fr"]="cadrebas",
["it"]="cornicefondo",
["nl"]="onderkader",
["pe"]="قالب‌پایین",
@@ -7047,7 +7845,7 @@ return {
["cs"]="offsetspodku",
["de"]="untenoffset",
["en"]="bottomoffset",
- ["fr"]="decalageinf",
+ ["fr"]="decalagebas",
["it"]="offsetfondo",
["nl"]="onderoffset",
["pe"]="آفست‌پایین",
@@ -7057,7 +7855,7 @@ return {
["cs"]="bottomspace",
["de"]="bottomspace",
["en"]="bottomspace",
- ["fr"]="espaceinf",
+ ["fr"]="espacebas",
["it"]="spaziofondo",
["nl"]="bodemwit",
["pe"]="فضای‌پایین",
@@ -7067,7 +7865,7 @@ return {
["cs"]="statusspodku",
["de"]="untenstatus",
["en"]="bottomstate",
- ["fr"]="etatinf",
+ ["fr"]="etatbas",
["it"]="statofondo",
["nl"]="onderstatus",
["pe"]="وضعیت‌پایین",
@@ -7075,17 +7873,19 @@ return {
},
["break"]={
["en"]="break",
+ ["fr"]="saut",
["nl"]="break",
},
["buffer"]={
["en"]="buffer",
+ ["fr"]="tampon",
["nl"]="buffer",
},
["cache"]={
["cs"]="cache",
["de"]="cache",
["en"]="cache",
- ["fr"]="cache",
+ ["fr"]="memoirecache",
["it"]="cache",
["nl"]="cache",
["pe"]="میانگیر",
@@ -7103,13 +7903,14 @@ return {
},
["category"]={
["en"]="category",
+ ["fr"]="categorie",
["nl"]="categorie",
},
["ccommand"]={
["cs"]="cprikaz",
["de"]="cbefehl",
["en"]="ccommand",
- ["fr"]="ccommande",
+ ["fr"]="commandec",
["it"]="ccomando",
["nl"]="ccommando",
["pe"]="فرمان",
@@ -7117,12 +7918,15 @@ return {
},
["character"]={
["en"]="character",
+ ["fr"]="caractere",
},
["characters"]={
["en"]="characters",
+ ["fr"]="caracteres",
},
["check"]={
["en"]="check",
+ ["fr"]="verifier",
},
["click"]={
["cs"]="klik",
@@ -7158,7 +7962,7 @@ return {
["cs"]="clipoffset",
["de"]="clipoffset",
["en"]="clipoffset",
- ["fr"]="clipoffset",
+ ["fr"]="decalagedecoupe",
["it"]="clipoffset",
["nl"]="clipoffset",
["pe"]="آفست‌کلیپ",
@@ -7168,7 +7972,7 @@ return {
["cs"]="zavriakci",
["de"]="schliessenaktion",
["en"]="closeaction",
- ["fr"]="actionfermeture",
+ ["fr"]="fermeraction",
["it"]="azionechiudi",
["nl"]="sluitactie",
["pe"]="بستن‌کنش",
@@ -7178,7 +7982,7 @@ return {
["cs"]="closecommand",
["de"]="closecommand",
["en"]="closecommand",
- ["fr"]="closecommand",
+ ["fr"]="fermercommande",
["it"]="closecommand",
["nl"]="sluitcommando",
["pe"]="بستن‌فرمان",
@@ -7186,13 +7990,14 @@ return {
},
["closepage"]={
["en"]="closepage",
+ ["fr"]="fermerpage",
["nl"]="sluitpagina",
},
["closepageaction"]={
["cs"]="akcezavrenistranky",
["de"]="closepageaction",
["en"]="closepageaction",
- ["fr"]="actionfermeturepage",
+ ["fr"]="fermeractionpage",
["it"]="azionechiudipagina",
["nl"]="sluitpaginaactie",
["pe"]="بستن‌عمل‌صفحه",
@@ -7202,7 +8007,7 @@ return {
["cs"]="closesymbol",
["de"]="closesymbol",
["en"]="closesymbol",
- ["fr"]="closesymbol",
+ ["fr"]="fermersymbol",
["it"]="closesymbol",
["nl"]="sluitsymbool",
["pe"]="بستن‌نماد",
@@ -7250,6 +8055,7 @@ return {
},
["comma"]={
["en"]="comma",
+ ["fr"]="virgule",
},
["command"]={
["cs"]="prikaz",
@@ -7265,7 +8071,7 @@ return {
["cs"]="prikazpo",
["de"]="zumbefehl",
["en"]="commandafter",
- ["fr"]="commandeapres",
+ ["fr"]="commandeaprès",
["it"]="comdandodopo",
["nl"]="nacommando",
["pe"]="فرمان‌بعداز",
@@ -7293,15 +8099,19 @@ return {
},
["comment"]={
["en"]="comment",
+ ["fr"]="commentaire",
},
["commentchar"]={
["en"]="commentchar",
+ ["fr"]="caracommentaire",
},
["commentoffset"]={
["en"]="commentoffset",
+ ["fr"]="decalagecommentaire",
},
["compact"]={
["en"]="compact",
+ ["fr"]="compact",
["nl"]="compact",
},
["component"]={
@@ -7318,7 +8128,7 @@ return {
["cs"]="compoundhyphen",
["de"]="compoundhyphen",
["en"]="compoundhyphen",
- ["fr"]="compoundhyphen",
+ ["fr"]="traitdunioncompose",
["it"]="compoundhyphen",
["nl"]="koppelteken",
["pe"]="compoundhyphen",
@@ -7328,36 +8138,42 @@ return {
["cs"]="compress",
["de"]="compress",
["en"]="compress",
- ["fr"]="compress",
+ ["fr"]="reduire",
["it"]="compress",
["nl"]="comprimeren",
["pe"]="فشردن",
["ro"]="compress",
},
- ["compressseparator"]={
- ["en"]="compressseparator",
- },
["compressdistance"]={
["en"]="compressdistance",
+ ["fr"]="distancereduction",
},
["compressmethod"]={
["en"]="compressmethod",
+ ["fr"]="methodereduction",
+ },
+ ["compressseparator"]={
+ ["en"]="compressseparator",
+ ["fr"]="separateurreduction",
},
["compressstopper"]={
["en"]="compressstopper",
+ ["fr"]="stoppeurreduction",
},
["concerns"]={
["en"]="concerns",
+ ["fr"]="concerne",
["nl"]="betreft",
},
["connector"]={
["en"]="connector",
+ ["fr"]="connecteur",
},
["continue"]={
["cs"]="pokracovat",
["de"]="fortsetzen",
["en"]="continue",
- ["fr"]="continue",
+ ["fr"]="continuer",
["it"]="continua",
["nl"]="doorgaan",
["pe"]="ادامه",
@@ -7367,7 +8183,7 @@ return {
["cs"]="kontrastnibarva",
["de"]="kontrastfarbe",
["en"]="contrastcolor",
- ["fr"]="coleurcontraste",
+ ["fr"]="couleurconstrast",
["it"]="colorecontrasto",
["nl"]="contrastkleur",
["pe"]="contrastcolor",
@@ -7397,7 +8213,7 @@ return {
["cs"]="konverzesouboru",
["de"]="konvertieredatei",
["en"]="convertfile",
- ["fr"]="conversionfichier",
+ ["fr"]="convertirfichier",
["it"]="convertifile",
["nl"]="converteerfile",
["pe"]="پرونده‌تبدیل",
@@ -7405,6 +8221,7 @@ return {
},
["copies"]={
["en"]="copies",
+ ["fr"]="copies",
["nl"]="kopieen",
},
["corner"]={
@@ -7431,7 +8248,7 @@ return {
["cs"]="zpusobpropojeni",
["de"]="verkopplungsart",
["en"]="couplingway",
- ["fr"]="modecouplage",
+ ["fr"]="faconcouplage",
["it"]="modoaccoppiamento",
["nl"]="koppelwijze",
["pe"]="روش‌تزویج",
@@ -7447,14 +8264,17 @@ return {
["pe"]="criterium",
["ro"]="criteriu",
},
- ["crossreference"]={
- ["en"]="crossreference",
- },
["cropoffset"]={
["en"]="cropoffset",
+ ["fr"]="decalagerecadre",
+ },
+ ["crossreference"]={
+ ["en"]="crossreference",
+ ["fr"]="renvoi",
},
["cssfile"]={
["en"]="cssfile",
+ ["fr"]="fichiercss",
},
["current"]={
["cs"]="aktualni",
@@ -7470,7 +8290,7 @@ return {
["cs"]="cutspace",
["de"]="cutspace",
["en"]="cutspace",
- ["fr"]="cutspace",
+ ["fr"]="espacecoupe",
["it"]="cutspace",
["nl"]="snijwit",
["pe"]="فضای‌برش",
@@ -7498,9 +8318,11 @@ return {
},
["database"]={
["en"]="database",
+ ["fr"]="basededonnees",
},
["dataset"]={
["en"]="dataset",
+ ["fr"]="jeudedonnees",
},
["date"]={
["cs"]="datum",
@@ -7512,15 +8334,11 @@ return {
["pe"]="تاریخ",
["ro"]="data",
},
- ["time"]={
- ["en"]="time",
- ["nl"]="tijd",
- },
["deepnumbercommand"]={
["cs"]="deepnumbercommand",
["de"]="deepnumbercommand",
["en"]="deepnumbercommand",
- ["fr"]="deepnumbercommand",
+ ["fr"]="commandeprofondenumero",
["it"]="deepnumbercommand",
["nl"]="diepnummercommando",
["pe"]="فرمان‌شماره‌عمیق",
@@ -7530,12 +8348,16 @@ return {
["cs"]="deeptextcommand",
["de"]="deeptextcommand",
["en"]="deeptextcommand",
- ["fr"]="deeptextcommand",
+ ["fr"]="commandeprofondetexte",
["it"]="deeptextcommand",
["nl"]="dieptekstcommando",
["pe"]="فرمان‌متن‌عمیق",
["ro"]="deeptextcommand",
},
+ ["define"]={
+ ["en"]="define",
+ ["nl"]="definieer",
+ },
["default"]={
["cs"]="implicitni",
["de"]="default",
@@ -7546,11 +8368,19 @@ return {
["pe"]="پیش‌فرض",
["ro"]="implicit",
},
+ ["defaultwidth"]={
+ ["en"]="defaultwidth",
+ ["nl"]="defaultbreedte",
+ },
+ ["defaultheight"]={
+ ["en"]="defaultheight",
+ ["nl"]="defaulthoogte",
+ },
["delay"]={
["cs"]="prodleva",
["de"]="wartezeit",
["en"]="delay",
- ["fr"]="delai",
+ ["fr"]="retard",
["it"]="attesa",
["nl"]="wachttijd",
["pe"]="تاخیر",
@@ -7606,6 +8436,10 @@ return {
["pe"]="نمایش",
["ro"]="display",
},
+ ["displaythreshold"]={
+ ["en"]="displaythreshold",
+ ["fr"]="seuilaffichage",
+ },
["distance"]={
["cs"]="vzdalenost",
["de"]="abstand",
@@ -7618,6 +8452,7 @@ return {
},
["domain"]={
["en"]="domain",
+ ["fr"]="domaine",
},
["dot"]={
["cs"]="tecka",
@@ -7641,12 +8476,13 @@ return {
},
["down"]={
["en"]="down",
+ ["fr"]="enbas",
},
["dummy"]={
["cs"]="dummy",
["de"]="dummy",
["en"]="dummy",
- ["fr"]="dummy",
+ ["fr"]="factice",
["it"]="dummy",
["nl"]="dummy",
["pe"]="مصنوعی",
@@ -7694,15 +8530,19 @@ return {
},
["editor"]={
["en"]="editor",
+ ["fr"]="editeur",
},
["editoretaldisplay"]={
["en"]="editoretaldisplay",
+ ["fr"]="editeurealaffichage",
},
["editoretallimit"]={
["en"]="editoretallimit",
+ ["fr"]="editeureallimite",
},
["editoretaltext"]={
["en"]="editoretaltext",
+ ["fr"]="editeurealtexte",
},
["empty"]={
["cs"]="prazdne",
@@ -7716,17 +8556,22 @@ return {
},
["entities"]={
["en"]="entities",
+ ["fr"]="entitees",
["nl"]="entities",
},
["entries"]={
["en"]="entries",
+ ["fr"]="entrees",
["nl"]="ingangen",
},
+ ["processors"]={
+ ["en"]="processors",
+ },
["equalheight"]={
["cs"]="equalheight",
["de"]="equalheight",
["en"]="equalheight",
- ["fr"]="equalheight",
+ ["fr"]="hauteuregale",
["it"]="equalheight",
["nl"]="equalheight",
["pe"]="ارتفاع‌یکسان",
@@ -7736,7 +8581,7 @@ return {
["cs"]="equalwidth",
["de"]="equalwidth",
["en"]="equalwidth",
- ["fr"]="equalwidth",
+ ["fr"]="margeuregale",
["it"]="equalwidth",
["nl"]="equalwidth",
["pe"]="عرض‌یکسان",
@@ -7746,7 +8591,7 @@ return {
["cs"]="escape",
["de"]="escape",
["en"]="escape",
- ["fr"]="escape",
+ ["fr"]="echappatoire",
["it"]="escape",
["nl"]="escape",
["pe"]="فرار",
@@ -7754,15 +8599,19 @@ return {
},
["etaldisplay"]={
["en"]="etaldisplay",
+ ["fr"]="etalaffichage",
},
["etallimit"]={
["en"]="etallimit",
+ ["fr"]="etallimite",
},
["etaloption"]={
["en"]="etaloption",
+ ["fr"]="etaloption",
},
["etaltext"]={
["en"]="etaltext",
+ ["fr"]="etalttexte",
},
["evenmargin"]={
["cs"]="sudamarginalie",
@@ -7776,9 +8625,11 @@ return {
},
["exact"]={
["en"]="exact",
+ ["fr"]="exact",
},
["exitoffset"]={
["en"]="exitoffset",
+ ["fr"]="decalagesortie",
},
["expansion"]={
["cs"]="expanzen",
@@ -7792,6 +8643,7 @@ return {
},
["export"]={
["en"]="export",
+ ["fr"]="exporter",
["nl"]="exporteer",
},
["extras"]={
@@ -7818,12 +8670,16 @@ return {
["cs"]="fallback",
["de"]="fallback",
["en"]="fallback",
- ["fr"]="fallback",
+ ["fr"]="repli",
["it"]="fallback",
["nl"]="terugval",
["pe"]="عقب‌ریختن",
["ro"]="fallback",
},
+ ["fallbacks"]={
+ ["en"]="fallbacks",
+ ["fr"]="replis",
+ },
["family"]={
["cs"]="rodina",
["de"]="familie",
@@ -7836,12 +8692,19 @@ return {
},
["features"]={
["en"]="features",
+ ["fr"]="fonctionnalites",
+ },
+ ["featureset"]={
+ ["en"]="featureset",
+ ["fr"]="jeufonctionnalite",
},
["fences"]={
["en"]="fences",
+ ["fr"]="barrieres",
},
["field"]={
["en"]="field",
+ ["fr"]="champ",
["nl"]="veld",
},
["fieldbackgroundcolor"]={
@@ -7878,7 +8741,7 @@ return {
["cs"]="offsetpole",
["de"]="feldoffset",
["en"]="fieldoffset",
- ["fr"]="offsetchamp",
+ ["fr"]="decalagechamp",
["it"]="offsetcampo",
["nl"]="veldoffset",
["pe"]="آفست‌میدان",
@@ -7896,21 +8759,27 @@ return {
},
["filler"]={
["en"]="filler",
+ ["fr"]="remplisseur",
},
["filter"]={
["en"]="filter",
+ ["fr"]="filtre",
},
["filtercommand"]={
["en"]="filtercommand",
+ ["fr"]="commandefiltre",
},
["finalnamesep"]={
["en"]="finalnamesep",
+ ["fr"]="sepnomfinal",
},
["finalpagesep"]={
["en"]="finalpagesep",
+ ["fr"]="seppagefinale",
},
["finalpubsep"]={
["en"]="finalpubsep",
+ ["fr"]="seppubfinale",
},
["first"]={
["cs"]="prvni",
@@ -7924,6 +8793,7 @@ return {
},
["firstnamesep"]={
["en"]="firstnamesep",
+ ["fr"]="seppremiernom",
},
["firstpage"]={
["cs"]="prvnistranka",
@@ -7955,6 +8825,11 @@ return {
["pe"]="تمرکزدرون",
["ro"]="focusin",
},
+ ["focusoffset"]={
+ ["en"]="focusoffset",
+ ["fr"]="decalagefocus",
+ ["nl"]="focusoffset",
+ },
["focusout"]={
["cs"]="focusout",
["de"]="focusout",
@@ -7965,9 +8840,9 @@ return {
["pe"]="تمرکزبیرون",
["ro"]="focusout",
},
- ["focusoffset"]={
- ["en"]="focusoffset",
- ["nl"]="focusoffset",
+ ["font"]={
+ ["en"]="font",
+ ["nl"]="font",
},
["footer"]={
["cs"]="upati",
@@ -7983,7 +8858,7 @@ return {
["cs"]="vzdalenostupati",
["de"]="fusszeilenabstand",
["en"]="footerdistance",
- ["fr"]="dsitancepdp",
+ ["fr"]="distancepdp",
["it"]="distanzapdp",
["nl"]="voetafstand",
["pe"]="فاصله‌ته‌برگ",
@@ -8003,7 +8878,7 @@ return {
["cs"]="sila",
["de"]="zwinge",
["en"]="force",
- ["fr"]="force",
+ ["fr"]="forcer",
["it"]="forza",
["nl"]="forceer",
["pe"]="اجبار",
@@ -8039,6 +8914,11 @@ return {
["pe"]="شمایل",
["ro"]="format",
},
+ ["fractions"]={
+ ["en"]="fractions",
+ ["fr"]="fractions",
+ ["nl"]="breuken",
+ },
["frame"]={
["cs"]="ramecek",
["de"]="rahmen",
@@ -8111,6 +8991,7 @@ return {
},
["freeregion"]={
["en"]="freeregion",
+ ["fr"]="regionlibre",
["nl"]="vrijgebied",
},
["from"]={
@@ -8125,15 +9006,17 @@ return {
},
["functioncolor"]={
["en"]="functioncolor",
+ ["fr"]="couleurfonction",
},
["functionstyle"]={
["en"]="functionstyle",
+ ["fr"]="stylefonction",
},
["get"]={
["cs"]="ziskat",
["de"]="hole",
["en"]="get",
- ["fr"]="obtient",
+ ["fr"]="obtenir",
["it"]="prendi",
["nl"]="haal",
["pe"]="بگیر",
@@ -8151,6 +9034,7 @@ return {
},
["goodies"]={
["en"]="goodies",
+ ["fr"]="friandises",
},
["grid"]={
["cs"]="mrizka",
@@ -8164,15 +9048,17 @@ return {
},
["group"]={
["en"]="group",
+ ["fr"]="groupe",
},
["groupsuffix"]={
["en"]="groupsuffix",
+ ["fr"]="suffixegroupe",
},
["hang"]={
["cs"]="zaveseni",
["de"]="haengend",
["en"]="hang",
- ["fr"]="suspend",
+ ["fr"]="suspendre",
["it"]="sospendi",
["nl"]="hang",
["pe"]="بیاویز",
@@ -8180,10 +9066,12 @@ return {
},
["hcompact"]={
["en"]="hcompact",
+ ["fr"]="compacth",
["nl"]="hcomprimeer",
},
["headalign"]={
["en"]="headalign",
+ ["fr"]="alignertete",
["nl"]="kopuitlijnen",
},
["headcolor"]={
@@ -8216,15 +9104,11 @@ return {
["pe"]="تبدیل‌سر",
["ro"]="conversietitlu",
},
- ["headseparator"]={
- ["en"]="headseparator",
- ["nl"]="kopscheider",
- },
["header"]={
["cs"]="zahlavi",
["de"]="kopfzeile",
["en"]="header",
- ["fr"]="entete",
+ ["fr"]="entête",
["it"]="intestazione",
["nl"]="hoofd",
["pe"]="سربرگ",
@@ -8234,7 +9118,7 @@ return {
["cs"]="vzdalenostzahlavi",
["de"]="kopfzeilenabstand",
["en"]="headerdistance",
- ["fr"]="distanceentete",
+ ["fr"]="distanceentête",
["it"]="distanzaintestazione",
["nl"]="hoofdafstand",
["pe"]="فاصله‌سربرگ",
@@ -8244,7 +9128,7 @@ return {
["cs"]="statuszahlavi",
["de"]="kopfzeilenstatus",
["en"]="headerstate",
- ["fr"]="etatentete",
+ ["fr"]="etatentête",
["it"]="statointestazione",
["nl"]="hoofdstatus",
["pe"]="وضعیت‌سربرگ",
@@ -8270,6 +9154,11 @@ return {
["pe"]="شماره‌سر",
["ro"]="numartitlu",
},
+ ["headseparator"]={
+ ["en"]="headseparator",
+ ["fr"]="separateurtete",
+ ["nl"]="kopscheider",
+ },
["headstyle"]={
["cs"]="stylhlavicky",
["de"]="kopfstil",
@@ -8294,25 +9183,17 @@ return {
["cs"]="hfaktor",
["de"]="hfaktor",
["en"]="hfactor",
- ["fr"]="facteurhauteur",
+ ["fr"]="facteurh",
["it"]="hfactor",
["nl"]="hfactor",
["pe"]="عامل‌ارتفاع",
["ro"]="hfactor",
},
- ["vfactor"]={
- ["cs"]="vfaktor",
- ["de"]="vfaktor",
- ["en"]="vfactor",
- ["it"]="vfactor",
- ["nl"]="vfactor",
- ["ro"]="vfactor",
- },
["hfil"]={
["cs"]="hfil",
["de"]="hfil",
["en"]="hfil",
- ["fr"]="hfil",
+ ["fr"]="remplissageh",
["it"]="hfil",
["nl"]="hfil",
["pe"]="پرکردن‌ارتفاع",
@@ -8320,32 +9201,33 @@ return {
},
["hidenumber"]={
["en"]="hidenumber",
- },
- ["horizontal"]={
- ["cs"]="horizontalne",
- ["de"]="horizontal",
- ["en"]="horizontal",
- ["fr"]="horizontale",
- ["it"]="orizzontale",
- ["nl"]="horizontaal",
- ["pe"]="افقی",
- ["ro"]="orizontal",
+ ["fr"]="cachernumero",
},
["hoffset"]={
["cs"]="hoffset",
["de"]="hoffset",
["en"]="hoffset",
- ["fr"]="decalagehauteur",
+ ["fr"]="decalageh",
["it"]="hoffset",
["nl"]="hoffset",
["pe"]="آفست‌ا",
["ro"]="hoffset",
},
+ ["horizontal"]={
+ ["cs"]="horizontalne",
+ ["de"]="horizontal",
+ ["en"]="horizontal",
+ ["fr"]="horizontal",
+ ["it"]="orizzontale",
+ ["nl"]="horizontaal",
+ ["pe"]="افقی",
+ ["ro"]="orizontal",
+ },
["horoffset"]={
["cs"]="horoffset",
["de"]="rumpfabstand",
["en"]="horoffset",
- ["fr"]="horoffset",
+ ["fr"]="decalagehor",
["it"]="horoffset",
["nl"]="rugoffset",
["pe"]="آفست‌افق",
@@ -8355,7 +9237,7 @@ return {
["cs"]="hyphen",
["de"]="hyphen",
["en"]="hyphen",
- ["fr"]="hyphen",
+ ["fr"]="traitdunion",
["it"]="hyphen",
["nl"]="hyphen",
["pe"]="شکستن",
@@ -8363,12 +9245,13 @@ return {
},
["hyphens"]={
["en"]="hyphens",
+ ["fr"]="traitsdunion",
},
["icommand"]={
["cs"]="iprikaz",
["de"]="ibefehl",
["en"]="icommand",
- ["fr"]="icommande",
+ ["fr"]="commandei",
["it"]="icomando",
["nl"]="icommando",
["pe"]="icommand",
@@ -8376,12 +9259,13 @@ return {
},
["ignore"]={
["en"]="ignore",
+ ["fr"]="ignorer",
},
["in"]={
["cs"]="v",
["de"]="in",
["en"]="in",
- ["fr"]="in",
+ ["fr"]="dans",
["it"]="in",
["nl"]="in",
["pe"]="درون",
@@ -8401,7 +9285,7 @@ return {
["cs"]="zvysit",
["de"]="erhoehen",
["en"]="increment",
- ["fr"]="incremente",
+ ["fr"]="incrementer",
["it"]="incremento",
["nl"]="verhoog",
["pe"]="افزایش",
@@ -8411,7 +9295,7 @@ return {
["cs"]="zvysujicicislo",
["de"]="nummererhoehen",
["en"]="incrementnumber",
- ["fr"]="incrementenumero",
+ ["fr"]="incrementernumero",
["it"]="incrementanumero",
["nl"]="verhoognummer",
["pe"]="شماره‌افزایش",
@@ -8421,17 +9305,20 @@ return {
["cs"]="odsazovani",
["de"]="einziehen",
["en"]="indenting",
- ["fr"]="composeenalinea",
+ ["fr"]="indentation",
["it"]="rientro",
["nl"]="inspringen",
["pe"]="تورفتگی",
["ro"]="aliniat",
},
+ ["indentlist"]={
+ ["en"]="indentlist",
+ },
["indentnext"]={
["cs"]="odsadpristi",
["de"]="ziehefolgendeein",
["en"]="indentnext",
- ["fr"]="indentesuivant",
+ ["fr"]="indenterauuivant",
["it"]="rientrasuccessivo",
["nl"]="springvolgendein",
["pe"]="متن‌تورفته",
@@ -8439,6 +9326,7 @@ return {
},
["index"]={
["en"]="index",
+ ["fr"]="index",
},
["indicator"]={
["cs"]="indikator",
@@ -8452,6 +9340,11 @@ return {
},
["initialsep"]={
["en"]="initialsep",
+ ["fr"]="sepinitial",
+ },
+ ["inlinethreshold"]={
+ ["en"]="inlinethreshold",
+ ["fr"]="seuilenligne",
},
["inner"]={
["cs"]="vnitrni",
@@ -8485,13 +9378,16 @@ return {
},
["insidesection"]={
["en"]="insidesection",
+ ["fr"]="auseinsection",
["nl"]="binnensectie",
},
["instance"]={
["en"]="instance",
+ ["fr"]="instance",
},
["intent"]={
["en"]="intent",
+ ["fr"]="intention",
},
["interaction"]={
["cs"]="interakce",
@@ -8515,19 +9411,22 @@ return {
},
["internalgrid"]={
["en"]="internalgrid",
+ ["fr"]="grilleinterieure",
["nl"]="interngrid",
},
["italicfeatures"]={
["en"]="italicfeatures",
+ ["fr"]="fonctionnalitesitalique",
},
["italicfont"]={
["en"]="italicfont",
+ ["fr"]="policeitalique",
},
["itemalign"]={
["cs"]="itemalign",
["de"]="itemalign",
["en"]="itemalign",
- ["fr"]="itemalign",
+ ["fr"]="alignerelem",
["it"]="itemalign",
["nl"]="itemuitlijnen",
["pe"]="تنظیم‌آیتم",
@@ -8537,7 +9436,7 @@ return {
["cs"]="polozky",
["de"]="posten",
["en"]="items",
- ["fr"]="elements",
+ ["fr"]="élément",
["it"]="elementi",
["nl"]="items",
["pe"]="آیتمها",
@@ -8545,21 +9444,25 @@ return {
},
["joiners"]={
["en"]="joiners",
+ ["fr"]="joins",
},
["journalconversion"]={
["en"]="journalconversion",
+ ["fr"]="conversionjournal",
},
["juniorsep"]={
["en"]="juniorsep",
+ ["fr"]="sepjunior",
},
["keeptogether"]={
["en"]="keeptogether",
+ ["fr"]="conserverensemble",
},
["ken"]={
["cs"]="ken",
["de"]="ken",
["en"]="ken",
- ["fr"]="ken",
+ ["fr"]="rep",
["it"]="ken",
["nl"]="ken",
["pe"]="ken",
@@ -8569,7 +9472,7 @@ return {
["cs"]="keyexpansion",
["de"]="keyexpansion",
["en"]="keyexpansion",
- ["fr"]="keyexpansion",
+ ["fr"]="expansioncle",
["it"]="keyexpansion",
["nl"]="sleutelexpansie",
["pe"]="گسترش‌کلید",
@@ -8577,13 +9480,14 @@ return {
},
["keys"]={
["en"]="keys",
+ ["fr"]="cles",
["nl"]="sleutels",
},
["keyword"]={
["cs"]="keyword",
["de"]="keyword",
["en"]="keyword",
- ["fr"]="motcle",
+ ["fr"]="motclé",
["it"]="parolachiave",
["nl"]="trefwoord",
["pe"]="کلید‌واژه",
@@ -8599,17 +9503,36 @@ return {
["pe"]="برچسب",
["ro"]="eticheta",
},
+ ["labelalternative"]={
+ ["en"]="labelalternative",
+ ["fr"]="varianteetiquette",
+ ["nl"]="labelvariant",
+ },
+ ["labelcolor"]={
+ ["en"]="labelcolor",
+ ["fr"]="couleuretiquette",
+ ["nl"]="labelkleur",
+ },
["labeloffset"]={
["en"]="labeloffset",
+ ["fr"]="decalageetiquette",
+ },
+ ["labelstyle"]={
+ ["en"]="labelstyle",
+ ["fr"]="styleetiquette",
+ ["nl"]="labelletter",
},
["language"]={
["en"]="language",
+ ["fr"]="langue",
},
["last"]={
["en"]="last",
+ ["fr"]="dernier",
},
["lastnamesep"]={
["en"]="lastnamesep",
+ ["fr"]="sepderniernom",
},
["lastpage"]={
["cs"]="poslednistrana",
@@ -8623,12 +9546,15 @@ return {
},
["lastpagesep"]={
["en"]="lastpagesep",
+ ["fr"]="sepdernierepage",
},
["lastpubsep"]={
["en"]="lastpubsep",
+ ["fr"]="sepdernierepub",
},
["layout"]={
["en"]="layout",
+ ["fr"]="miseenpage",
["nl"]="layout",
},
["left"]={
@@ -8655,7 +9581,7 @@ return {
["cs"]="leftcompoundhyphen",
["de"]="leftcompoundhyphen",
["en"]="leftcompoundhyphen",
- ["fr"]="leftcompoundhyphen",
+ ["fr"]="traitdunioncomposegauche",
["it"]="leftcompoundhyphen",
["nl"]="linkerkoppelteken",
["pe"]="leftcompoundhyphen",
@@ -8695,7 +9621,7 @@ return {
["cs"]="lefthyphen",
["de"]="lefthyphen",
["en"]="lefthyphen",
- ["fr"]="lefthyphen",
+ ["fr"]="traitduniongauche",
["it"]="lefthyphen",
["nl"]="lefthyphen",
["pe"]="شکست‌چپ",
@@ -8751,6 +9677,10 @@ return {
["pe"]="نقل‌چپ",
["ro"]="minicitatstanga",
},
+ ["leftsample"]={
+ ["en"]="leftsample",
+ ["fr"]="echantillongauche",
+ },
["leftsentence"]={
["cs"]="vetavlevo",
["de"]="linkersatz",
@@ -8765,7 +9695,7 @@ return {
["cs"]="leftspeech",
["de"]="leftspeech",
["en"]="leftspeech",
- ["fr"]="leftspeech",
+ ["fr"]="discoursgauche",
["it"]="leftspeech",
["nl"]="linkeruitspraak",
["pe"]="سخنرانی‌چپ",
@@ -8775,7 +9705,7 @@ return {
["cs"]="stylvlevo",
["de"]="linkerstil",
["en"]="leftstyle",
- ["fr"]="leftstyle",
+ ["fr"]="stylegauche",
["it"]="stilesinistra",
["nl"]="linkerletter",
["pe"]="سبک‌چپ",
@@ -8813,9 +9743,11 @@ return {
},
["leftwords"]={
["en"]="leftwords",
+ ["fr"]="motsgauche",
},
["less"]={
["en"]="less",
+ ["fr"]="moins",
["nl"]="minder",
},
["level"]={
@@ -8842,7 +9774,7 @@ return {
["cs"]="limittext",
["de"]="limittext",
["en"]="limittext",
- ["fr"]="limittext",
+ ["fr"]="textelimite",
["it"]="limittext",
["nl"]="limiettekst",
["pe"]="مرزمتن",
@@ -8868,6 +9800,10 @@ return {
["pe"]="تصحیح‌خط",
["ro"]="corectielinie",
},
+ ["linedirection"]={
+ ["en"]="linedirection",
+ ["nl"]="regelrichting",
+ },
["lines"]={
["cs"]="radky",
["de"]="zeilen",
@@ -8920,6 +9856,7 @@ return {
},
["loffset"]={
["en"]="loffset",
+ ["fr"]="decalagel",
},
["logo"]={
["cs"]="logo",
@@ -8945,7 +9882,7 @@ return {
["cs"]="barvaznacky",
["de"]="beschrfarbe",
["en"]="marcolor",
- ["fr"]="couleurmarquage",
+ ["fr"]="couleurrem",
["it"]="coloremarcatura",
["nl"]="markleur",
["pe"]="رنگ‌حاش",
@@ -8975,7 +9912,7 @@ return {
["cs"]="textovahrana",
["de"]="marginalkante",
["en"]="marginedge",
- ["fr"]="bordmarge",
+ ["fr"]="margebord",
["it"]="bordomargine",
["nl"]="kantlijn",
["pe"]="لبه‌حاشیه",
@@ -8985,7 +9922,7 @@ return {
["cs"]="textmarginalnihookraje",
["de"]="marginalkantetext",
["en"]="marginedgetext",
- ["fr"]="textebordmarge",
+ ["fr"]="textemargebord",
["it"]="testobordomargine",
["nl"]="kantlijntekst",
["pe"]="متن‌لبه‌حاشیه",
@@ -9003,6 +9940,7 @@ return {
},
["mark"]={
["en"]="mark",
+ ["fr"]="marque",
["nl"]="kernmerk",
},
["marking"]={
@@ -9019,7 +9957,7 @@ return {
["cs"]="stylsnacky",
["de"]="beschrstil",
["en"]="marstyle",
- ["fr"]="stylemarquage",
+ ["fr"]="stylerem",
["it"]="stilemarcatura",
["nl"]="marletter",
["pe"]="سبک‌حاش",
@@ -9027,16 +9965,20 @@ return {
},
["mask"]={
["en"]="mask",
+ ["fr"]="masque",
["nl"]="masker",
},
["mathclass"]={
["en"]="mathclass",
+ ["fr"]="classemath",
},
["mathlimits"]={
["en"]="mathlimits",
+ ["fr"]="limitesmath",
},
["mathstyle"]={
["en"]="mathstyle",
+ ["fr"]="stylemath",
},
["max"]={
["cs"]="max",
@@ -9050,6 +9992,7 @@ return {
},
["maxdepth"]={
["en"]="maxdepth",
+ ["fr"]="profondeurmax",
},
["maxheight"]={
["cs"]="maxvyska",
@@ -9073,6 +10016,7 @@ return {
},
["maybeyear"]={
["en"]="maybeyear",
+ ["fr"]="anneepeutetre",
},
["menu"]={
["cs"]="menu",
@@ -9104,47 +10048,51 @@ return {
["pe"]="میان",
["ro"]="mijloc",
},
- ["middlecommand"]={
- ["en"]="middlecommand",
- ["nl"]="middencommando",
- },
["middlecolor"]={
["en"]="middlecolor",
+ ["fr"]="couleurmilieu",
["nl"]="middenkleur",
},
- ["middlestyle"]={
- ["en"]="middlestyle",
- ["nl"]="middenletter",
- },
- ["middlewidth"]={
- ["en"]="middlewidth",
- ["nl"]="middenbreedte",
+ ["middlecommand"]={
+ ["en"]="middlecommand",
+ ["fr"]="commandemilieu",
+ ["nl"]="middencommando",
},
["middlespeech"]={
["cs"]="middlespeech",
["de"]="middlespeech",
["en"]="middlespeech",
- ["fr"]="middlespeech",
+ ["fr"]="discoursmilieu",
["it"]="middlespeech",
["nl"]="middenuitspraak",
["pe"]="سخنرانی‌میانی",
["ro"]="middlespeech",
},
+ ["middlestyle"]={
+ ["en"]="middlestyle",
+ ["fr"]="stylemilieu",
+ ["nl"]="middenletter",
+ },
["middletext"]={
["cs"]="strednitext",
["de"]="mittigertext",
["en"]="middletext",
- ["fr"]="textecentre",
+ ["fr"]="textemilieu",
["it"]="testocentro",
["nl"]="middentekst",
["pe"]="متن‌میانی",
["ro"]="textmijloc",
},
+ ["middlewidth"]={
+ ["en"]="middlewidth",
+ ["fr"]="largeurmilieu",
+ ["nl"]="middenbreedte",
+ },
["midsentence"]={
["cs"]="midsentence",
["de"]="midsentence",
["en"]="midsentence",
- ["fr"]="midsentence",
+ ["fr"]="milieuphrase",
["it"]="midsentence",
["nl"]="middenzin",
["pe"]="جمله‌میانی",
@@ -9194,7 +10142,7 @@ return {
["cs"]="moffset",
["de"]="moffset",
["en"]="moffset",
- ["fr"]="moffset",
+ ["fr"]="decalagem",
["it"]="moffset",
["nl"]="moffset",
["pe"]="moffset",
@@ -9202,26 +10150,32 @@ return {
},
["monthconversion"]={
["en"]="monthconversion",
+ ["fr"]="conversionmois",
["nl"]="maandconversie",
},
["more"]={
["en"]="more",
+ ["fr"]="plus",
["nl"]="meer",
},
["mpdepth"]={
["en"]="mpdepth",
+ ["fr"]="profondeurmp",
["nl"]="mpdiepte",
},
["mpheight"]={
["en"]="mpheight",
+ ["fr"]="hauteurmp",
["nl"]="mphoogte",
},
["mpoffset"]={
["en"]="mpoffset",
+ ["fr"]="decalagemp",
["nl"]="mpoffset",
},
["mpwidth"]={
["en"]="mpwidth",
+ ["fr"]="largeurmp",
["nl"]="mpbreedte",
},
["n"]={
@@ -9246,12 +10200,13 @@ return {
},
["namesep"]={
["en"]="namesep",
+ ["fr"]="sepnom",
},
["nbottom"]={
["cs"]="nspodek",
["de"]="nunten",
["en"]="nbottom",
- ["fr"]="ninf",
+ ["fr"]="nbas",
["it"]="nfondo",
["nl"]="nonder",
["pe"]="nbottom",
@@ -9279,15 +10234,19 @@ return {
},
["nextleft"]={
["en"]="nextleft",
+ ["fr"]="suivantgauche",
},
["nextleftquotation"]={
["en"]="nextleftquotation",
+ ["fr"]="citationgauchesuivante",
},
["nextright"]={
["en"]="nextright",
+ ["fr"]="suivantdroite",
},
["nextrightquotation"]={
["en"]="nextrightquotation",
+ ["fr"]="citationdroitesuivante",
},
["nl"]={
["cs"]="nl",
@@ -9331,10 +10290,12 @@ return {
},
["note"]={
["en"]="note",
+ ["fr"]="note",
["nl"]="noot",
},
["notes"]={
["en"]="notes",
+ ["fr"]="notes",
["nl"]="noten",
},
["nr"]={
@@ -9361,7 +10322,7 @@ return {
["cs"]="nvrsek",
["de"]="noben",
["en"]="ntop",
- ["fr"]="nsup",
+ ["fr"]="nhaut",
["it"]="ncima",
["nl"]="nboven",
["pe"]="ntop",
@@ -9379,6 +10340,7 @@ return {
},
["numberalign"]={
["en"]="numberalign",
+ ["fr"]="alignernumero",
["nl"]="nummeruitlijnen",
},
["numbercolor"]={
@@ -9403,15 +10365,17 @@ return {
},
["numberconversion"]={
["en"]="numberconversion",
+ ["fr"]="conversionnumero",
},
["numberconversionset"]={
["en"]="numberconversionset",
+ ["fr"]="jeuconversionnumero",
},
["numberdistance"]={
["cs"]="numberdistance",
["de"]="numberdistance",
["en"]="numberdistance",
- ["fr"]="numberdistance",
+ ["fr"]="distancenumero",
["it"]="numberdistance",
["nl"]="nummerafstand",
["pe"]="فاصله‌شماره",
@@ -9421,7 +10385,7 @@ return {
["cs"]="cislovani",
["de"]="nummerierung",
["en"]="numbering",
- ["fr"]="numerotation",
+ ["fr"]="numérotation",
["it"]="numerazione",
["nl"]="nummeren",
["pe"]="شماره‌گذاری",
@@ -9429,18 +10393,21 @@ return {
},
["numberorder"]={
["en"]="numberorder",
+ ["fr"]="ordrenumero",
},
["numberprefix"]={
["en"]="numberprefix",
+ ["fr"]="prefixenumero",
},
["numbersegments"]={
["en"]="numbersegments",
+ ["fr"]="segmentsnumero",
},
["numberseparator"]={
["cs"]="oddelovaccisla",
["de"]="nummernseperator",
["en"]="numberseparator",
- ["fr"]="separateurnumbero",
+ ["fr"]="separateurnumero",
["it"]="separatorenumero",
["nl"]="nummerscheider",
["pe"]="جداکننده‌شماره",
@@ -9448,15 +10415,24 @@ return {
},
["numberseparatorset"]={
["en"]="numberseparatorset",
+ ["fr"]="jeuseparateurnumero",
},
["numberset"]={
["en"]="numberset",
+ ["fr"]="jeunumero",
},
["numberstarter"]={
["en"]="numberstarter",
+ ["fr"]="demarreurnumero",
},
["numberstopper"]={
["en"]="numberstopper",
+ ["fr"]="stoppeurnumero",
+ },
+ ["numberstrut"]={
+ ["en"]="numberstrut",
+ ["fr"]="entretoisenumero",
+ ["nl"]="nummerstrut",
},
["numberstyle"]={
["cs"]="stylcisla",
@@ -9472,7 +10448,7 @@ return {
["cs"]="numberwidth",
["de"]="numberwidth",
["en"]="numberwidth",
- ["fr"]="numberwidth",
+ ["fr"]="largeurnumero",
["it"]="numberwidth",
["nl"]="nummerbreedte",
["pe"]="عرض‌شماره",
@@ -9522,7 +10498,7 @@ return {
["cs"]="lichyokraj",
["de"]="ungeraderand",
["en"]="oddmargin",
- ["fr"]="margepaire",
+ ["fr"]="margeimpaire",
["it"]="marginedispari",
["nl"]="onevenmarge",
["pe"]="حاشیه‌فرد",
@@ -9532,7 +10508,7 @@ return {
["cs"]="offset",
["de"]="offset",
["en"]="offset",
- ["fr"]="offset",
+ ["fr"]="decalage",
["it"]="offset",
["nl"]="offset",
["pe"]="آفست",
@@ -9542,7 +10518,7 @@ return {
["cs"]="otevriakci",
["de"]="oeffenaktion",
["en"]="openaction",
- ["fr"]="actionouverture",
+ ["fr"]="actionouvrir",
["it"]="azioneapri",
["nl"]="openactie",
["pe"]="عمل‌باز",
@@ -9550,13 +10526,14 @@ return {
},
["openpage"]={
["en"]="openpage",
+ ["fr"]="ouvrirpage",
["nl"]="openpagina",
},
["openpageaction"]={
["cs"]="akceotevrenistranky",
["de"]="openpageaction",
["en"]="openpageaction",
- ["fr"]="actionouverturepage",
+ ["fr"]="actionouvrirpage",
["it"]="azioneapripagina",
["nl"]="openpaginaactie",
["pe"]="عمل‌صفحه‌باز",
@@ -9564,9 +10541,11 @@ return {
},
["openup"]={
["en"]="openup",
+ ["fr"]="ouverture",
},
["opticalsize"]={
["en"]="opticalsize",
+ ["fr"]="tailleoptique",
},
["option"]={
["cs"]="volba",
@@ -9580,12 +10559,9 @@ return {
},
["order"]={
["en"]="order",
+ ["fr"]="ordre",
["nl"]="volgorde",
},
- ["anchoring"]={
- ["en"]="anchoring",
- ["nl"]="verankering",
- },
["orientation"]={
["cs"]="orientation",
["de"]="orientation",
@@ -9598,6 +10574,7 @@ return {
},
["otherstext"]={
["en"]="otherstext",
+ ["fr"]="texteautres",
},
["outermargin"]={
["cs"]="outermargin",
@@ -9613,17 +10590,21 @@ return {
["cs"]="overprint",
["de"]="overprint",
["en"]="overprint",
- ["fr"]="overprint",
+ ["fr"]="surimpression",
["it"]="overprint",
["nl"]="overprint",
["pe"]="overprint",
["ro"]="overprint",
},
+ ["ownerpassword"]={
+ ["en"]="ownerpassword",
+ ["fr"]="motdepasseproprietaire",
+ },
["ownnumber"]={
["cs"]="vlastnicislo",
["de"]="eigenenummer",
["en"]="ownnumber",
- ["fr"]="numeroproprio",
+ ["fr"]="numeropropre",
["it"]="numeroproprio",
["nl"]="eigennummer",
["pe"]="شماره‌خود",
@@ -9631,6 +10612,7 @@ return {
},
["packcriterium"]={
["en"]="packcriterium",
+ ["fr"]="criterepack",
["nl"]="opelkaarcriterium",
},
["page"]={
@@ -9647,7 +10629,7 @@ return {
["cs"]="hranicestranky",
["de"]="seitenbegrenzung",
["en"]="pageboundaries",
- ["fr"]="limitespage",
+ ["fr"]="frontierespage",
["it"]="limitipagina",
["nl"]="paginaovergangen",
["pe"]="مرزهای‌صفحه",
@@ -9665,6 +10647,7 @@ return {
},
["pagecolormodel"]={
["en"]="pagecolormodel",
+ ["fr"]="modelecouleurpage",
["nl"]="paginakleurmodel",
},
["pagecommand"]={
@@ -9679,18 +10662,23 @@ return {
},
["pageconnector"]={
["en"]="pageconnector",
+ ["fr"]="connecteurpage",
},
["pageconversion"]={
["en"]="pageconversion",
+ ["fr"]="conversionpage",
},
["pageconversionset"]={
["en"]="pageconversionset",
+ ["fr"]="jeuconversionpage",
},
["pageleft"]={
["en"]="pageleft",
+ ["fr"]="pagegauche",
},
["pagemethod"]={
["en"]="pagemethod",
+ ["fr"]="methodepage",
["nl"]="paginamethode",
},
["pagenumber"]={
@@ -9705,48 +10693,63 @@ return {
},
["pageprefix"]={
["en"]="pageprefix",
+ ["fr"]="prefixepage",
},
["pageprefixconnector"]={
["en"]="pageprefixconnector",
+ ["fr"]="connecteurprefixepage",
},
["pageprefixconversion"]={
["en"]="pageprefixconversion",
+ ["fr"]="conversionprefixepage",
},
["pageprefixconversionset"]={
["en"]="pageprefixconversionset",
+ ["fr"]="jeuconversionprefixepage",
},
["pageprefixsegments"]={
["en"]="pageprefixsegments",
+ ["fr"]="segmentsprefixepage",
},
["pageprefixseparatorset"]={
["en"]="pageprefixseparatorset",
+ ["fr"]="jeuseparateurprefixepage",
},
["pageprefixset"]={
["en"]="pageprefixset",
+ ["fr"]="jeuprefixepage",
},
["pageprefixstarter"]={
["en"]="pageprefixstarter",
+ ["fr"]="demarreurprefixepage",
},
["pageprefixstopper"]={
["en"]="pageprefixstopper",
+ ["fr"]="stoppeurprefixpage",
},
["pageright"]={
["en"]="pageright",
+ ["fr"]="pagedroite",
},
["pagesegments"]={
["en"]="pagesegments",
+ ["fr"]="segmentspage",
},
["pagesep"]={
["en"]="pagesep",
+ ["fr"]="seppage",
},
["pageseparatorset"]={
["en"]="pageseparatorset",
+ ["fr"]="jeuseparateurpage",
},
["pageset"]={
["en"]="pageset",
+ ["fr"]="jeupage",
},
["pagestarter"]={
["en"]="pagestarter",
+ ["fr"]="demarreurpage",
},
["pagestate"]={
["cs"]="pagestate",
@@ -9760,6 +10763,7 @@ return {
},
["pagestopper"]={
["en"]="pagestopper",
+ ["fr"]="stoppeurpage",
},
["pagestyle"]={
["cs"]="stylstranky",
@@ -9803,12 +10807,13 @@ return {
},
["period"]={
["en"]="period",
+ ["fr"]="periode",
},
["place"]={
["cs"]="umistit",
["de"]="platziere",
["en"]="place",
- ["fr"]="place",
+ ["fr"]="placer",
["it"]="metti",
["nl"]="plaatsen",
["pe"]="بگذار",
@@ -9818,17 +10823,20 @@ return {
["cs"]="umistihlavicku",
["de"]="setzekopf",
["en"]="placehead",
- ["fr"]="placetete",
+ ["fr"]="placertete",
["it"]="mettitesta",
["nl"]="plaatskop",
["pe"]="بگذارسر",
["ro"]="punetitlu",
},
+ ["placeholder"]={
+ ["en"]="placeholder",
+ },
["placestopper"]={
["cs"]="predelmista",
["de"]="setzetrenner",
["en"]="placestopper",
- ["fr"]="emplacementstopper",
+ ["fr"]="placerstoppeur",
["it"]="mettistopper",
["nl"]="plaatsafsluiter",
["pe"]="بگذارایست",
@@ -9856,33 +10864,41 @@ return {
},
["prefixconnector"]={
["en"]="prefixconnector",
+ ["fr"]="connecteurprefixe",
},
["prefixconversion"]={
["en"]="prefixconversion",
+ ["fr"]="conversionprefixe",
},
["prefixconversionset"]={
["en"]="prefixconversionset",
+ ["fr"]="jeuconversionprefixe",
},
["prefixsegments"]={
["en"]="prefixsegments",
+ ["fr"]="segmentsprefixe",
},
["prefixseparatorset"]={
["en"]="prefixseparatorset",
+ ["fr"]="jeuseparateurprefixe",
},
["prefixset"]={
["en"]="prefixset",
+ ["fr"]="jeuprefixe",
},
["prefixstarter"]={
["en"]="prefixstarter",
+ ["fr"]="demarreurprefixe",
},
["prefixstopper"]={
["en"]="prefixstopper",
+ ["fr"]="stoppeurprefixe",
},
["preset"]={
["cs"]="prednastaveni",
["de"]="voreinstellung",
["en"]="preset",
- ["fr"]="prereglage",
+ ["fr"]="preregler",
["it"]="preimpostato",
["nl"]="preset",
["pe"]="preset",
@@ -9892,7 +10908,7 @@ return {
["cs"]="nahled",
["de"]="vorschau",
["en"]="preview",
- ["fr"]="previsualisation",
+ ["fr"]="apercu",
["it"]="anteprima",
["nl"]="preview",
["pe"]="پیش‌دید",
@@ -9920,13 +10936,14 @@ return {
},
["print"]={
["en"]="print",
+ ["fr"]="imprimer",
["nl"]="print",
},
["printable"]={
["cs"]="tisknutelne",
["de"]="druckbar",
["en"]="printable",
- ["fr"]="editable",
+ ["fr"]="imprimable",
["it"]="stampabile",
["nl"]="printbaar",
["pe"]="قابل‌چاپ",
@@ -9936,7 +10953,7 @@ return {
["cs"]="process",
["de"]="process",
["en"]="process",
- ["fr"]="process",
+ ["fr"]="traiter",
["it"]="process",
["nl"]="proces",
["pe"]="پردازش",
@@ -9944,15 +10961,19 @@ return {
},
["profile"]={
["en"]="profile",
+ ["fr"]="profil",
},
["properties"]={
["en"]="properties",
+ ["fr"]="proprietes",
},
["pubsep"]={
["en"]="pubsep",
+ ["fr"]="seppub",
},
["quotechar"]={
["en"]="quotechar",
+ ["fr"]="caracitation",
},
["radius"]={
["cs"]="polomer",
@@ -9976,6 +10997,7 @@ return {
},
["range"]={
["en"]="range",
+ ["fr"]="gamme",
["nl"]="bereik",
},
["reduction"]={
@@ -10000,6 +11022,7 @@ return {
},
["refcommand"]={
["en"]="refcommand",
+ ["fr"]="commanderef",
},
["reference"]={
["cs"]="odkaz",
@@ -10013,15 +11036,20 @@ return {
},
["referencemethod"]={
["en"]="referencemethod",
+ ["fr"]="methodereference",
+ },
+ ["referencetext"]={
+ ["en"]="referencetext",
},
["referenceprefix"]={
["en"]="referenceprefix",
+ ["fr"]="prefixereference",
},
["referencing"]={
["cs"]="odkazujici",
["de"]="referieren",
["en"]="referencing",
- ["fr"]="referencing",
+ ["fr"]="referencement",
["it"]="referencing",
["nl"]="refereren",
["pe"]="مراجعه",
@@ -10029,13 +11057,14 @@ return {
},
["region"]={
["en"]="region",
+ ["fr"]="region",
["nl"]="gebied",
},
["regionin"]={
["cs"]="oblastuvnitr",
["de"]="regionin",
["en"]="regionin",
- ["fr"]="entreregion",
+ ["fr"]="regiondedans",
["it"]="entraregione",
["nl"]="gebiedin",
["pe"]="ناحیه‌درون",
@@ -10045,7 +11074,7 @@ return {
["cs"]="oblastvne",
["de"]="regionaus",
["en"]="regionout",
- ["fr"]="regionexterieure",
+ ["fr"]="regiondehors",
["it"]="esciregione",
["nl"]="gebieduit",
["pe"]="ناحیه‌بیرون",
@@ -10053,21 +11082,25 @@ return {
},
["register"]={
["en"]="register",
+ ["fr"]="registre",
},
["regularfeatures"]={
["en"]="regularfeatures",
+ ["fr"]="fonctionnalitesordinaires",
},
["regularfont"]={
["en"]="regularfont",
+ ["fr"]="policereordinaire",
},
["renderingsetup"]={
["en"]="renderingsetup",
+ ["fr"]="configurationrendu",
},
["repeat"]={
["cs"]="opakovat",
["de"]="wiederholen",
["en"]="repeat",
- ["fr"]="repete",
+ ["fr"]="repeter",
["it"]="ripeti",
["nl"]="herhaal",
["pe"]="تکرار",
@@ -10077,7 +11110,7 @@ return {
["cs"]="reset",
["de"]="reset",
["en"]="reset",
- ["fr"]="reset",
+ ["fr"]="raz",
["it"]="reset",
["nl"]="reset",
["pe"]="بازنشانی",
@@ -10105,12 +11138,13 @@ return {
},
["resources"]={
["en"]="resources",
+ ["fr"]="ressources",
},
["reverse"]={
["cs"]="reverse",
["de"]="reverse",
["en"]="reverse",
- ["fr"]="inverse",
+ ["fr"]="inverser",
["it"]="invertito",
["nl"]="omgekeerd",
["pe"]="برعکس",
@@ -10126,6 +11160,10 @@ return {
["pe"]="راست",
["ro"]="dreapta",
},
+ ["rightchars"]={
+ ["en"]="rightchars",
+ ["fr"]="caracteresdroite",
+ },
["rightcolor"]={
["cs"]="barvavpravo",
["de"]="rechterfarbe",
@@ -10140,7 +11178,7 @@ return {
["cs"]="rightcompoundhyphen",
["de"]="rightcompoundhyphen",
["en"]="rightcompoundhyphen",
- ["fr"]="rightcompoundhyphen",
+ ["fr"]="traitdunioncomposedroite",
["it"]="rightcompoundhyphen",
["nl"]="rechterkoppelteken",
["pe"]="rightcompoundhyphen",
@@ -10170,7 +11208,7 @@ return {
["cs"]="ramecekvpravo",
["de"]="rechterrahmen",
["en"]="rightframe",
- ["fr"]="cadredroit",
+ ["fr"]="cadredroite",
["it"]="cornicedestra",
["nl"]="rechterkader",
["pe"]="قالب‌راست",
@@ -10180,7 +11218,7 @@ return {
["cs"]="righthyphen",
["de"]="righthyphen",
["en"]="righthyphen",
- ["fr"]="righthyphen",
+ ["fr"]="traitduniondroite",
["it"]="righthyphen",
["nl"]="righthyphen",
["pe"]="righthyphen",
@@ -10210,7 +11248,7 @@ return {
["cs"]="pravyoffset",
["de"]="rechterabstand",
["en"]="rightoffset",
- ["fr"]="rightoffset",
+ ["fr"]="decalagedroite",
["it"]="offsetdestro",
["nl"]="rechteroffset",
["pe"]="آفست‌راست",
@@ -10236,6 +11274,10 @@ return {
["pe"]="نقل‌راست",
["ro"]="minicitatdreapta",
},
+ ["rightsample"]={
+ ["en"]="rightsample",
+ ["fr"]="echantillondroite",
+ },
["rightsentence"]={
["cs"]="vetavpravo",
["de"]="rechtersatz",
@@ -10250,7 +11292,7 @@ return {
["cs"]="rightspeech",
["de"]="rightspeech",
["en"]="rightspeech",
- ["fr"]="rightspeech",
+ ["fr"]="discoursdroite",
["it"]="rightspeech",
["nl"]="rechteruitspraak",
["pe"]="سخنرانی‌راست",
@@ -10280,7 +11322,7 @@ return {
["cs"]="textvpravo",
["de"]="rechtertext",
["en"]="righttext",
- ["fr"]="textedroit",
+ ["fr"]="textedroite",
["it"]="testodestro",
["nl"]="rechtertekst",
["pe"]="متن‌راست",
@@ -10298,12 +11340,11 @@ return {
},
["rightwords"]={
["en"]="rightwords",
- },
- ["rightchars"]={
- ["en"]="rightchars",
+ ["fr"]="motsdroite",
},
["roffset"]={
["en"]="roffset",
+ ["fr"]="decalager",
},
["rotation"]={
["cs"]="rotace",
@@ -10319,7 +11360,7 @@ return {
["cs"]="linka",
["de"]="linie",
["en"]="rule",
- ["fr"]="ligne",
+ ["fr"]="trait",
["it"]="linea",
["nl"]="lijn",
["pe"]="خط",
@@ -10329,7 +11370,7 @@ return {
["cs"]="barvalinky",
["de"]="linienfarbe",
["en"]="rulecolor",
- ["fr"]="couleurligne",
+ ["fr"]="couleurtrait",
["it"]="colorelinea",
["nl"]="lijnkleur",
["pe"]="رنگ‌خط",
@@ -10337,13 +11378,14 @@ return {
},
["rulecommand"]={
["en"]="rulecommand",
+ ["fr"]="commandetrait",
["nl"]="lijncommando",
},
["rulethickness"]={
["cs"]="tloustkalinky",
["de"]="liniendicke",
["en"]="rulethickness",
- ["fr"]="epaisseurligne",
+ ["fr"]="epaisseurtrait",
["it"]="spessorelinea",
["nl"]="lijndikte",
["pe"]="ضخامت‌خط",
@@ -10359,12 +11401,6 @@ return {
["pe"]="همان‌صفحه",
["ro"]="aceeasipagina",
},
- ["leftsample"]={
- ["en"]="leftsample",
- },
- ["rightsample"]={
- ["en"]="rightsample",
- },
["sample"]={
["cs"]="vzor",
["de"]="muster",
@@ -10377,9 +11413,11 @@ return {
},
["samplesize"]={
["en"]="samplesize",
+ ["fr"]="tailleechantillon",
},
["saveinlist"]={
["en"]="saveinlist",
+ ["fr"]="enregistrerdansliste",
},
["scale"]={
["cs"]="meritko",
@@ -10395,7 +11433,7 @@ return {
["cs"]="rozsah",
["de"]="bereich",
["en"]="scope",
- ["fr"]="scope",
+ ["fr"]="perimetre",
["it"]="scope",
["nl"]="scope",
["pe"]="طرح",
@@ -10423,12 +11461,15 @@ return {
},
["sectionblock"]={
["en"]="sectionblock",
+ ["fr"]="blocsection",
},
["sectionconversion"]={
["en"]="sectionconversion",
+ ["fr"]="conversionsection",
},
["sectionconversionset"]={
["en"]="sectionconversionset",
+ ["fr"]="jeuconversionsection",
},
["sectionnumber"]={
["cs"]="cislooddilu",
@@ -10442,21 +11483,27 @@ return {
},
["sectionresetset"]={
["en"]="sectionresetset",
+ ["fr"]="jeurazsection",
},
["sectionsegments"]={
["en"]="sectionsegments",
+ ["fr"]="segmentssection",
},
["sectionseparatorset"]={
["en"]="sectionseparatorset",
+ ["fr"]="jeuseparateursection",
},
["sectionset"]={
["en"]="sectionset",
+ ["fr"]="jeusection",
},
["sectionstarter"]={
["en"]="sectionstarter",
+ ["fr"]="demarreursection",
},
["sectionstopper"]={
["en"]="sectionstopper",
+ ["fr"]="stoppeursection",
},
["separator"]={
["cs"]="oddelovac",
@@ -10470,28 +11517,30 @@ return {
},
["separatorcolor"]={
["en"]="separatorcolor",
+ ["fr"]="couleurseparateur",
["nl"]="scheiderkleur",
},
["separatorstyle"]={
["en"]="separatorstyle",
+ ["fr"]="styleseparateur",
["nl"]="scheiderletter",
},
["set"]={
["cs"]="set",
["de"]="set",
["en"]="set",
- ["fr"]="set",
+ ["fr"]="regler",
["it"]="set",
["nl"]="set",
["pe"]="قراربده",
["ro"]="set",
},
["setups"]={
- ["comment"]="no translations",
["en"]="setups",
},
["shrink"]={
["en"]="shrink",
+ ["fr"]="retrecir",
["nl"]="krimp",
},
["side"]={
@@ -10508,7 +11557,7 @@ return {
["cs"]="sidealign",
["de"]="sidealign",
["en"]="sidealign",
- ["fr"]="sidealign",
+ ["fr"]="alignercote",
["it"]="sidealign",
["nl"]="zijuitlijnen",
["pe"]="تنظیم‌کنار",
@@ -10518,7 +11567,7 @@ return {
["cs"]="sidemethod",
["de"]="sidemethod",
["en"]="sidemethod",
- ["fr"]="sidemethod",
+ ["fr"]="methodecote",
["it"]="sidemethod",
["nl"]="zijmethode",
["pe"]="روش‌کنار",
@@ -10528,7 +11577,7 @@ return {
["cs"]="bocnimezeraza",
["de"]="nebennachspatium",
["en"]="sidespaceafter",
- ["fr"]="espacelateralapres",
+ ["fr"]="espacelatéralaprès",
["it"]="spaziolateraledopo",
["nl"]="zijnawit",
["pe"]="فضای‌کناری‌بعد",
@@ -10546,15 +11595,12 @@ return {
},
["sidespaceinbetween"]={
["en"]="sidespaceinbetween",
+ ["fr"]="espacelateralentre",
["nl"]="zijtussenwit",
},
- ["spaceafterside"]={
- ["en"]="spaceafterside",
- ["nl"]="witnazij",
- },
- ["spacebeforeside"]={
- ["en"]="spacebeforeside",
- ["nl"]="witvoorzij",
+ ["sidethreshold"]={
+ ["en"]="sidethreshold",
+ ["fr"]="seuilcote",
},
["sign"]={
["cs"]="znak",
@@ -10566,11 +11612,16 @@ return {
["pe"]="علامت",
["ro"]="semn",
},
+ ["simplecommand"]={
+ ["en"]="simplecommand",
+ ["fr"]="commandesimple",
+ ["nl"]="simpelcommando",
+ },
["size"]={
["cs"]="velikost",
["de"]="groesse",
["en"]="size",
- ["fr"]="dimension",
+ ["fr"]="taille",
["it"]="dimensione",
["nl"]="formaat",
["pe"]="اندازه",
@@ -10578,9 +11629,11 @@ return {
},
["slantedfeatures"]={
["en"]="slantedfeatures",
+ ["fr"]="fonctionnalitesincline",
},
["slantedfont"]={
["en"]="slantedfont",
+ ["fr"]="policeinclinee",
},
["small"]={
["cs"]="male",
@@ -10594,22 +11647,26 @@ return {
},
["smallcapsfeatures"]={
["en"]="smallcapsfeatures",
+ ["fr"]="fonctionnalitespetitescaps",
},
["smallcapsfont"]={
["en"]="smallcapsfont",
+ ["fr"]="policepetitescaps",
},
["solution"]={
["en"]="solution",
+ ["fr"]="solution",
["nl"]="oplossing",
},
["sort"]={
["en"]="sort",
+ ["fr"]="trier",
},
["sorttype"]={
["cs"]="sorttype",
["de"]="sorttype",
["en"]="sorttype",
- ["fr"]="sorttype",
+ ["fr"]="modetri",
["it"]="sorttype",
["nl"]="sortering",
["pe"]="ترتیب‌تایپ",
@@ -10619,7 +11676,7 @@ return {
["cs"]="zdroj",
["de"]="quelle",
["en"]="source",
- ["fr"]="origine",
+ ["fr"]="source",
["it"]="origine",
["nl"]="bron",
["pe"]="منبع",
@@ -10639,12 +11696,17 @@ return {
["cs"]="mezeraza",
["de"]="nachspatium",
["en"]="spaceafter",
- ["fr"]="espaceapres",
+ ["fr"]="espaceaprès",
["it"]="spaziodopo",
["nl"]="nawit",
["pe"]="فضا‌بعداز",
["ro"]="spatiudupa",
},
+ ["spaceafterside"]={
+ ["en"]="spaceafterside",
+ ["fr"]="espaceaprèscoté",
+ ["nl"]="witnazij",
+ },
["spacebefore"]={
["cs"]="mezerapred",
["de"]="vorspatium",
@@ -10655,11 +11717,16 @@ return {
["pe"]="فضا‌قبل‌از",
["ro"]="spatiuinainte",
},
+ ["spacebeforeside"]={
+ ["en"]="spacebeforeside",
+ ["fr"]="espaceavantcote",
+ ["nl"]="witvoorzij",
+ },
["spaceinbetween"]={
["cs"]="spaceinbetween",
["de"]="spaceinbetween",
["en"]="spaceinbetween",
- ["fr"]="spaceinbetween",
+ ["fr"]="espaceentre",
["it"]="spaceinbetween",
["nl"]="tussenwit",
["pe"]="فضا‌دربین",
@@ -10677,12 +11744,13 @@ return {
},
["specification"]={
["en"]="specification",
+ ["fr"]="specification",
},
["split"]={
["cs"]="split",
["de"]="split",
["en"]="split",
- ["fr"]="split",
+ ["fr"]="partager",
["it"]="separa",
["nl"]="splitsen",
["pe"]="شکافتن",
@@ -10692,7 +11760,7 @@ return {
["cs"]="splitcolor",
["de"]="splitcolor",
["en"]="splitcolor",
- ["fr"]="splitcolor",
+ ["fr"]="couleurpartage",
["it"]="splitcolor",
["nl"]="splitskleur",
["pe"]="شکافتن‌رنگ",
@@ -10702,7 +11770,7 @@ return {
["cs"]="splitmethod",
["de"]="splitmethod",
["en"]="splitmethod",
- ["fr"]="splitmethod",
+ ["fr"]="methodepartage",
["it"]="splitmethod",
["nl"]="splitsmethode",
["pe"]="روش‌شکافتن",
@@ -10712,7 +11780,7 @@ return {
["cs"]="splitoffset",
["de"]="splitoffset",
["en"]="splitoffset",
- ["fr"]="splitoffset",
+ ["fr"]="decalagepartage",
["it"]="splitoffset",
["nl"]="splitsoffset",
["pe"]="شکافتن‌آفست",
@@ -10722,7 +11790,7 @@ return {
["cs"]="spot",
["de"]="spot",
["en"]="spot",
- ["fr"]="spot",
+ ["fr"]="tondirect",
["it"]="spot",
["nl"]="spot",
["pe"]="لکه",
@@ -10732,7 +11800,7 @@ return {
["cs"]="stack",
["de"]="stack",
["en"]="stack",
- ["fr"]="stack",
+ ["fr"]="pile",
["it"]="stack",
["nl"]="stapel",
["pe"]="توده",
@@ -10740,13 +11808,14 @@ return {
},
["stackname"]={
["en"]="stackname",
+ ["fr"]="nompile",
["nl"]="stapelnaam",
},
["start"]={
["cs"]="start",
["de"]="start",
["en"]="start",
- ["fr"]="demarre",
+ ["fr"]="début",
["it"]="inizia",
["nl"]="start",
["pe"]="شروع",
@@ -10754,13 +11823,14 @@ return {
},
["starter"]={
["en"]="starter",
+ ["fr"]="demarreur",
["nl"]="opener",
},
["state"]={
["cs"]="status",
["de"]="status",
["en"]="state",
- ["fr"]="etat",
+ ["fr"]="état",
["it"]="stato",
["nl"]="status",
["pe"]="وضعیت",
@@ -10770,7 +11840,7 @@ return {
["cs"]="krok",
["de"]="schritt",
["en"]="step",
- ["fr"]="pas",
+ ["fr"]="etape",
["it"]="passo",
["nl"]="stap",
["pe"]="گام",
@@ -10780,7 +11850,7 @@ return {
["cs"]="stop",
["de"]="stop",
["en"]="stop",
- ["fr"]="stoppe",
+ ["fr"]="fin",
["it"]="termina",
["nl"]="stop",
["pe"]="پایان",
@@ -10790,7 +11860,7 @@ return {
["cs"]="predel",
["de"]="abschnitttrenner",
["en"]="stopper",
- ["fr"]="taquet",
+ ["fr"]="stoppeur",
["it"]="stopper",
["nl"]="afsluiter",
["pe"]="ایست",
@@ -10800,7 +11870,7 @@ return {
["cs"]="natahnout",
["de"]="strecken",
["en"]="stretch",
- ["fr"]="etire",
+ ["fr"]="etirer",
["it"]="dilata",
["nl"]="rek",
["pe"]="کشیدن",
@@ -10808,25 +11878,18 @@ return {
},
["strip"]={
["en"]="strip",
+ ["fr"]="bande",
},
["strut"]={
["cs"]="strut",
["de"]="strut",
["en"]="strut",
- ["fr"]="strut",
+ ["fr"]="entretoise",
["it"]="strut",
["nl"]="strut",
["pe"]="بست",
["ro"]="strut",
},
- ["numberstrut"]={
- ["en"]="numberstrut",
- ["nl"]="nummerstrut",
- },
- ["titlestrut"]={
- ["en"]="titlestrut",
- ["nl"]="titelstrut",
- },
["style"]={
["cs"]="pismeno",
["de"]="stil",
@@ -10837,6 +11900,11 @@ return {
["pe"]="سبک",
["ro"]="stil",
},
+ ["stylealternative"]={
+ ["en"]="stylealternative",
+ ["fr"]="variantestyle",
+ ["nl"]="stylevariant",
+ },
["sub"]={
["cs"]="pod",
["de"]="unter",
@@ -10861,7 +11929,7 @@ return {
["cs"]="suffix",
["de"]="suffix",
["en"]="suffix",
- ["fr"]="suffix",
+ ["fr"]="suffixe",
["it"]="suffix",
["nl"]="suffix",
["pe"]="پسوند",
@@ -10869,23 +11937,29 @@ return {
},
["suffixseparator"]={
["en"]="suffixseparator",
+ ["fr"]="separateursuffixe",
["nl"]="suffixscheider",
},
["suffixstopper"]={
["en"]="suffixstopper",
+ ["fr"]="stoppeursuffixe",
["nl"]="suffixafsluiter",
},
["surnamefirstnamesep"]={
["en"]="surnamefirstnamesep",
+ ["fr"]="sepnomfamilleprenom",
},
["surnameinitialsep"]={
["en"]="surnameinitialsep",
+ ["fr"]="sepnomfamilleinitial",
},
["surnamesep"]={
["en"]="surnamesep",
+ ["fr"]="seprenom",
},
["svgstyle"]={
["en"]="svgstyle",
+ ["fr"]="stylesvg",
},
["sx"]={
["cs"]="sx",
@@ -10911,7 +11985,7 @@ return {
["cs"]="symzarovnani",
["de"]="symausrichtung",
["en"]="symalign",
- ["fr"]="symalignement",
+ ["fr"]="alignersym",
["it"]="symallinea",
["nl"]="symuitlijnen",
["pe"]="تنظیم‌نماد",
@@ -10929,6 +12003,7 @@ return {
},
["symbolcommand"]={
["en"]="symbolcommand",
+ ["fr"]="commandesymbole",
},
["symbolset"]={
["cs"]="sadasymbolu",
@@ -10984,7 +12059,7 @@ return {
["cs"]="synonymcommand",
["de"]="synonymbefehl",
["en"]="synonymcommand",
- ["fr"]="synonymcommand",
+ ["fr"]="commandesynonyme",
["it"]="synonymcommand",
["nl"]="synoniemcommando",
["pe"]="synonymcommand",
@@ -11022,6 +12097,7 @@ return {
},
["textalign"]={
["en"]="textalign",
+ ["fr"]="alignertexte",
},
["textcolor"]={
["cs"]="barvatextu",
@@ -11087,7 +12163,7 @@ return {
["cs"]="textmethod",
["de"]="textmethod",
["en"]="textmethod",
- ["fr"]="textmethod",
+ ["fr"]="methodetexte",
["it"]="textmethod",
["nl"]="tekstmethode",
["pe"]="روش‌متن",
@@ -11145,15 +12221,12 @@ return {
},
["threshold"]={
["en"]="threshold",
+ ["fr"]="seuil",
},
- ["sidethreshold"]={
- ["en"]="sidethreshold",
- },
- ["displaythreshold"]={
- ["en"]="displaythreshold",
- },
- ["inlinethreshold"]={
- ["en"]="inlinethreshold",
+ ["time"]={
+ ["en"]="time",
+ ["fr"]="temps",
+ ["nl"]="tijd",
},
["title"]={
["cs"]="titul",
@@ -11175,15 +12248,11 @@ return {
["pe"]="رنگ‌عنوان",
["ro"]="culoaretitlu",
},
- ["simplecommand"]={
- ["en"]="simplecommand",
- ["nl"]="simpelcommando",
- },
["titlecommand"]={
["cs"]="titlecommand",
["de"]="titlecommand",
["en"]="titlecommand",
- ["fr"]="titlecommand",
+ ["fr"]="commandetitre",
["it"]="titlecommand",
["nl"]="titelcommando",
["pe"]="فرمان‌عنوان",
@@ -11203,7 +12272,7 @@ return {
["cs"]="titleleft",
["de"]="titleleft",
["en"]="titleleft",
- ["fr"]="titleleft",
+ ["fr"]="gauchetitre",
["it"]="titleleft",
["nl"]="titellinks",
["pe"]="عنوان‌چپ",
@@ -11213,12 +12282,17 @@ return {
["cs"]="titleright",
["de"]="titleright",
["en"]="titleright",
- ["fr"]="titleright",
+ ["fr"]="droitetitre",
["it"]="titleright",
["nl"]="titelrechts",
["pe"]="عنوان‌راست",
["ro"]="titleright",
},
+ ["titlestrut"]={
+ ["en"]="titlestrut",
+ ["fr"]="entretoisetitre",
+ ["nl"]="titelstrut",
+ },
["titlestyle"]={
["cs"]="styltitulek",
["de"]="titelstil",
@@ -11241,6 +12315,7 @@ return {
},
["toffset"]={
["en"]="toffset",
+ ["fr"]="decalaget",
},
["tolerance"]={
["cs"]="tolerance",
@@ -11256,7 +12331,7 @@ return {
["cs"]="vrsek",
["de"]="oben",
["en"]="top",
- ["fr"]="sup",
+ ["fr"]="haut",
["it"]="cima",
["nl"]="boven",
["pe"]="بالا",
@@ -11264,13 +12339,14 @@ return {
},
["topcommand"]={
["en"]="topcommand",
+ ["fr"]="commandehaut",
["nl"]="bovencommando",
},
["topdistance"]={
["cs"]="vzdalenostvrsku",
["de"]="obenabstand",
["en"]="topdistance",
- ["fr"]="distancesup",
+ ["fr"]="distancehaut",
["it"]="distanzacima",
["nl"]="bovenafstand",
["pe"]="فاصله‌بالا",
@@ -11280,7 +12356,7 @@ return {
["cs"]="rameceknahore",
["de"]="obenrahmen",
["en"]="topframe",
- ["fr"]="cadresup",
+ ["fr"]="cadrehaut",
["it"]="cornicecima",
["nl"]="bovenkader",
["pe"]="قالب‌راست",
@@ -11290,7 +12366,7 @@ return {
["cs"]="offsetvrsku",
["de"]="obenoffset",
["en"]="topoffset",
- ["fr"]="decalagesup",
+ ["fr"]="decalagehaut",
["it"]="offsetcima",
["nl"]="bovenoffset",
["pe"]="آفست‌بالا",
@@ -11300,7 +12376,7 @@ return {
["cs"]="svrchnimezera",
["de"]="kopfspatium",
["en"]="topspace",
- ["fr"]="espacesup",
+ ["fr"]="espacehaut",
["it"]="spaziocima",
["nl"]="kopwit",
["pe"]="فضای‌بالا",
@@ -11310,7 +12386,7 @@ return {
["cs"]="statusvrsku",
["de"]="statusoben",
["en"]="topstate",
- ["fr"]="etatsup",
+ ["fr"]="etathaut",
["it"]="statocima",
["nl"]="bovenstatus",
["pe"]="وضعیت‌بالا",
@@ -11318,22 +12394,26 @@ return {
},
["totalnumber"]={
["en"]="totalnumber",
+ ["fr"]="nombretotal",
},
["transform"]={
- ["en"]="transform",
- ["nl"]="transformatie",
+ ["en"]="transform",
+ ["fr"]="transformer",
+ ["nl"]="transformatie",
},
["translate"]={
["en"]="translate",
+ ["fr"]="traduire",
},
["trimoffset"]={
["en"]="trimoffset",
+ ["fr"]="decalagecoupe",
},
["type"]={
["cs"]="typ",
["de"]="typ",
["en"]="type",
- ["fr"]="type",
+ ["fr"]="transcrire",
["it"]="type",
["nl"]="type",
["pe"]="تایپ",
@@ -11361,12 +12441,13 @@ return {
},
["up"]={
["en"]="up",
+ ["fr"]="enhaut",
},
["urlalternative"]={
["cs"]="urlalternativa",
["de"]="urlalternative",
["en"]="urlalternative",
- ["fr"]="alternativeurl",
+ ["fr"]="varianteurl",
["it"]="alternativaurl",
["nl"]="urlvariant",
["pe"]="urlalternative",
@@ -11382,6 +12463,10 @@ return {
["pe"]="urlspace",
["ro"]="spatiuurl",
},
+ ["userpassword"]={
+ ["en"]="userpassword",
+ ["fr"]="motdepasseutilisateur",
+ },
["validate"]={
["cs"]="validovat",
["de"]="validieren",
@@ -11394,13 +12479,14 @@ return {
},
["values"]={
["en"]="values",
+ ["fr"]="valeurs",
["nl"]="waarden",
},
["vcommand"]={
["cs"]="vprikaz",
["de"]="vbefehl",
["en"]="vcommand",
- ["fr"]="vcommande",
+ ["fr"]="commandev",
["it"]="vcomando",
["nl"]="vcommando",
["pe"]="vcommand",
@@ -11408,37 +12494,48 @@ return {
},
["vcompact"]={
["en"]="vcompact",
+ ["fr"]="compactv",
["nl"]="vcomprimeer",
},
["vector"]={
["en"]="vector",
+ ["fr"]="vecteur",
["nl"]="vector",
},
+ ["veroffset"]={
+ ["cs"]="offsethlavicky",
+ ["de"]="kopfoffset",
+ ["en"]="veroffset",
+ ["fr"]="decalagever",
+ ["it"]="veroffset",
+ ["nl"]="kopoffset",
+ ["pe"]="آفست‌عم",
+ ["ro"]="veroffset",
+ },
["vertical"]={
["cs"]="vertikalne",
["de"]="vertikal",
["en"]="vertical",
- ["fr"]="verticale",
+ ["fr"]="vertical",
["it"]="verticale",
["nl"]="vertikaal",
["pe"]="عمودی",
["ro"]="vertical",
},
- ["veroffset"]={
- ["cs"]="offsethlavicky",
- ["de"]="kopfoffset",
- ["en"]="veroffset",
- ["fr"]="veroffset",
- ["it"]="veroffset",
- ["nl"]="kopoffset",
- ["pe"]="آفست‌عم",
- ["ro"]="veroffset",
+ ["vfactor"]={
+ ["cs"]="vfaktor",
+ ["de"]="vfaktor",
+ ["en"]="vfactor",
+ ["fr"]="facteurv",
+ ["it"]="vfactor",
+ ["nl"]="vfactor",
+ ["ro"]="vfactor",
},
["vfil"]={
["cs"]="vfil",
["de"]="vfil",
["en"]="vfil",
- ["fr"]="vfil",
+ ["fr"]="remplissagev",
["it"]="vfil",
["nl"]="vfil",
["pe"]="vfil",
@@ -11446,12 +12543,13 @@ return {
},
["viewerprefix"]={
["en"]="viewerprefix",
+ ["fr"]="prefixevisualisateur",
},
["voffset"]={
["cs"]="voffset",
["de"]="voffset",
["en"]="voffset",
- ["fr"]="voffset",
+ ["fr"]="decalagev",
["it"]="voffset",
["nl"]="voffset",
["pe"]="آفست‌ع",
@@ -11459,12 +12557,13 @@ return {
},
["vonsep"]={
["en"]="vonsep",
+ ["fr"]="sepvon",
},
["way"]={
["cs"]="zpusob",
["de"]="art",
["en"]="way",
- ["fr"]="mode",
+ ["fr"]="maniere",
["it"]="modo",
["nl"]="wijze",
["pe"]="راه",
@@ -11474,7 +12573,7 @@ return {
["cs"]="sfaktor",
["de"]="bfaktor",
["en"]="wfactor",
- ["fr"]="facteurlargeur",
+ ["fr"]="facteurw",
["it"]="wfactor",
["nl"]="bfactor",
["pe"]="wfactor",
@@ -11502,12 +12601,18 @@ return {
},
["words"]={
["en"]="words",
+ ["fr"]="mots",
+ },
+ ["xanchor"]={
+ ["en"]="xanchor",
+ ["fr"]="ancrex",
+ ["nl"]="xanker",
},
["xfactor"]={
["cs"]="xfaktor",
["de"]="xfaktor",
["en"]="xfactor",
- ["fr"]="xfactor",
+ ["fr"]="facteurx",
["it"]="xfactor",
["nl"]="xfactor",
["pe"]="فاکتورایکس",
@@ -11515,6 +12620,7 @@ return {
},
["xhtml"]={
["en"]="xhtml",
+ ["fr"]="xhtml",
},
["xmax"]={
["cs"]="xmax",
@@ -11528,16 +12634,13 @@ return {
},
["xmlsetup"]={
["en"]="xmlsetup",
- },
- ["xanchor"]={
- ["en"]="xanchor",
- ["nl"]="xanker",
+ ["fr"]="configurationxml",
},
["xoffset"]={
["cs"]="xoffset",
["de"]="xoffset",
["en"]="xoffset",
- ["fr"]="xoffset",
+ ["fr"]="decalagex",
["it"]="xoffset",
["nl"]="xoffset",
["pe"]="آفست‌ایکس",
@@ -11547,7 +12650,7 @@ return {
["cs"]="xmeritko",
["de"]="xformat",
["en"]="xscale",
- ["fr"]="xscale",
+ ["fr"]="echellex",
["it"]="xscale",
["nl"]="xschaal",
["pe"]="مقیاس‌ایکس",
@@ -11557,17 +12660,22 @@ return {
["cs"]="xkrok",
["de"]="xschritt",
["en"]="xstep",
- ["fr"]="xstep",
+ ["fr"]="etapex",
["it"]="xstep",
["nl"]="xstap",
["pe"]="گام‌ایکس",
["ro"]="xstep",
},
+ ["yanchor"]={
+ ["en"]="yanchor",
+ ["fr"]="ancrey",
+ ["nl"]="yanker",
+ },
["yfactor"]={
["cs"]="yfaktor",
["de"]="yfaktor",
["en"]="yfactor",
- ["fr"]="yfactor",
+ ["fr"]="facteury",
["it"]="yfactor",
["nl"]="yfactor",
["pe"]="فاکتوروای",
@@ -11583,15 +12691,11 @@ return {
["pe"]="ymax",
["ro"]="ymax",
},
- ["yanchor"]={
- ["en"]="yanchor",
- ["nl"]="yanker",
- },
["yoffset"]={
["cs"]="yoffset",
["de"]="yoffset",
["en"]="yoffset",
- ["fr"]="yoffset",
+ ["fr"]="decalagey",
["it"]="yoffset",
["nl"]="yoffset",
["pe"]="آفست‌وای",
@@ -11601,7 +12705,7 @@ return {
["cs"]="ymeritko",
["de"]="yformat",
["en"]="yscale",
- ["fr"]="yscale",
+ ["fr"]="echelley",
["it"]="yscale",
["nl"]="yschaal",
["pe"]="مقیاس‌وای",
@@ -11611,25 +12715,19 @@ return {
["cs"]="ykrok",
["de"]="yschritt",
["en"]="ystep",
- ["fr"]="ystep",
+ ["fr"]="etapey",
["it"]="ystep",
["nl"]="ystap",
["pe"]="گام‌وای",
["ro"]="ystep",
},
- ["ownerpassword"]={
- ["en"]="ownerpassword",
- },
- ["userpassword"]={
- ["en"]="userpassword",
- },
},
["elements"]={
["answerlines"]={
["cs"]="answerlines",
["de"]="answerlines",
["en"]="answerlines",
- ["fr"]="answerlines",
+ ["fr"]="lignesreponse",
["it"]="answerlines",
["nl"]="antwoordregels",
["pe"]="answerlines",
@@ -11639,7 +12737,7 @@ return {
["cs"]="answerspace",
["de"]="answerspace",
["en"]="answerspace",
- ["fr"]="answerspace",
+ ["fr"]="espacereponse",
["it"]="answerspace",
["nl"]="antwoordruimte",
["pe"]="answerspace",
@@ -11649,7 +12747,7 @@ return {
["cs"]="zacatek",
["de"]="anfang",
["en"]="begin",
- ["fr"]="debut",
+ ["fr"]="commencer",
["it"]="inizio",
["nl"]="beginvan",
["pe"]="عنصرها",
@@ -11659,7 +12757,7 @@ return {
["cs"]="uplny",
["de"]="vollende",
["en"]="complete",
- ["fr"]="complete",
+ ["fr"]="complet",
["it"]="completo",
["nl"]="volledige",
["pe"]="کامل",
@@ -11689,7 +12787,7 @@ return {
["cs"]="konec",
["de"]="ende",
["en"]="end",
- ["fr"]="fin",
+ ["fr"]="terminer",
["it"]="fine",
["nl"]="eindvan",
["pe"]="انتها",
@@ -11709,7 +12807,7 @@ return {
["cs"]="ziskat",
["de"]="get",
["en"]="get",
- ["fr"]="obtient",
+ ["fr"]="obtenir",
["it"]="prendi",
["nl"]="haal",
["pe"]="بگیر",
@@ -11719,7 +12817,7 @@ return {
["cs"]="zvysit",
["de"]="erhoehen",
["en"]="increment",
- ["fr"]="incremente",
+ ["fr"]="incrementer",
["it"]="incrementa",
["nl"]="verhoog",
["pe"]="افزایش",
@@ -11749,7 +12847,7 @@ return {
["cs"]="nacist",
["de"]="laden",
["en"]="load",
- ["fr"]="charge",
+ ["fr"]="charger",
["it"]="carica",
["nl"]="laad",
["pe"]="بارگذاشتن",
@@ -11769,7 +12867,7 @@ return {
["cs"]="zlom",
["de"]="umbruch",
["en"]="makeup",
- ["fr"]="makeup",
+ ["fr"]="composition",
["it"]="makeup",
["nl"]="opmaak",
["pe"]="آرایش",
@@ -11789,7 +12887,7 @@ return {
["cs"]="umisti",
["de"]="platziere",
["en"]="place",
- ["fr"]="place",
+ ["fr"]="placer",
["it"]="metti",
["nl"]="plaats",
["pe"]="مکان",
@@ -11829,7 +12927,7 @@ return {
["cs"]="viz",
["de"]="sieh",
["en"]="see",
- ["fr"]="voit",
+ ["fr"]="voir",
["it"]="vedi",
["nl"]="zie",
["pe"]="ببینید",
@@ -11839,7 +12937,7 @@ return {
["cs"]="nastaveni",
["de"]="stelle",
["en"]="setup",
- ["fr"]="regle",
+ ["fr"]="configurer",
["it"]="imposta",
["nl"]="stel",
["pe"]="بارگذاری",
@@ -11849,7 +12947,7 @@ return {
["cs"]="start",
["de"]="start",
["en"]="start",
- ["fr"]="demarre",
+ ["fr"]="début",
["it"]="inizia",
["nl"]="start",
["pe"]="شروع",
@@ -11859,7 +12957,7 @@ return {
["cs"]="stop",
["de"]="stop",
["en"]="stop",
- ["fr"]="stoppe",
+ ["fr"]="fin",
["it"]="termina",
["nl"]="stop",
["pe"]="پایان",
@@ -11879,23 +12977,777 @@ return {
["cs"]="opis",
["de"]="type",
["en"]="type",
- ["fr"]="type",
+ ["fr"]="transcrire",
["it"]="type",
["nl"]="type",
["pe"]="تایپ",
["ro"]="type",
},
},
- ["variables"]={
- ["aside"]={
- ["en"]="aside",
+ ["setupstrings"]={
+ ["cd:angle-l"]={
+ ["en"]="<<...>>",
},
- ["ordinal"]={
- ["en"]="ordinal",
+ ["cd:angle-s"]={
+ ["en"]="<<...>>",
},
- ["Ordinal"]={
- ["en"]="Ordinal",
+ ["cd:apply-l"]={
+ ["en"]="[..,..=>..,..]",
+ },
+ ["cd:apply-s"]={
+ ["en"]="[..=>..]",
+ },
+ ["cd:assignment-l"]={
+ ["en"]="[..,..=..,..]",
+ ["lua"]="{ ..,..=..,.. } ",
+ },
+ ["cd:assignment-s"]={
+ ["en"]="[..=..]",
+ ["lua"]="{ ..=.. } ",
+ },
+ ["cd:assignmentbraces-l"]={
+ ["en"]="{..,..=..,..}",
+ },
+ ["cd:assignmentbraces-s"]={
+ ["en"]="{..=..}",
+ },
+ ["cd:assignmentbrackets-l"]={
+ ["en"]="[..,..=..,..]",
+ ["lua"]="{ ..,..=..,.. } ",
+ },
+ ["cd:assignmentbrackets-s"]={
+ ["en"]="[..=..]",
+ ["lua"]="{ ..=.. } ",
+ },
+ ["cd:assignmentparentheses-l"]={
+ ["en"]="(..,..=..,..)",
+ },
+ ["cd:assignmentparentheses-s"]={
+ ["en"]="(..=..)",
+ },
+ ["cd:braces-l"]={
+ ["en"]="{...,...}",
+ ["lua"]=".. ... ..",
+ },
+ ["cd:braces-s"]={
+ ["en"]="{...}",
+ ["lua"]="\"...\"",
+ },
+ ["cd:brackets-l"]={
+ ["en"]="[...,...]",
+ ["lua"]="{..., ...}",
+ },
+ ["cd:brackets-s"]={
+ ["en"]="[...]",
+ ["lua"]="{ ... }",
+ },
+ ["cd:buffer"]={
+ ["cs"]="buffer",
+ ["de"]="buffer",
+ ["en"]="buffer",
+ ["fr"]="tampon",
+ ["it"]="buffer",
+ ["nl"]="buffer",
+ ["ro"]="buffer",
+ },
+ ["cd:case-l"]={
+ ["en"]="\\case ",
+ },
+ ["cd:case-s"]={
+ ["en"]="\\case ",
+ },
+ ["cd:category"]={
+ ["cs"]="category",
+ ["de"]="category",
+ ["en"]="category",
+ ["fr"]="categorie",
+ ["it"]="category",
+ ["nl"]="category",
+ ["ro"]="category",
+ },
+ ["cd:character"]={
+ ["cs"]="character",
+ ["de"]="character",
+ ["en"]="character",
+ ["fr"]="caractere",
+ ["it"]="character",
+ ["nl"]="karakter",
+ ["ro"]="character",
+ },
+ ["cd:color"]={
+ ["cs"]="color",
+ ["de"]="color",
+ ["en"]="color",
+ ["fr"]="couleur",
+ ["it"]="color",
+ ["nl"]="kleur",
+ ["ro"]="color",
+ },
+ ["cd:column"]={
+ ["cs"]="column",
+ ["de"]="column",
+ ["en"]="column",
+ ["fr"]="colonne",
+ ["it"]="column",
+ ["nl"]="kolom",
+ ["ro"]="column",
+ },
+ ["cd:command"]={
+ ["cs"]="Befehl",
+ ["de"]="Befehl",
+ ["en"]="command",
+ ["fr"]="commande",
+ ["it"]="Befehl",
+ ["nl"]="commando",
+ ["ro"]="Befehl",
+ },
+ ["cd:content"]={
+ ["cs"]="content",
+ ["de"]="content",
+ ["en"]="content",
+ ["fr"]="contenu",
+ ["it"]="content",
+ ["nl"]="inhoud",
+ ["ro"]="content",
+ },
+ ["cd:content-l"]={
+ ["en"]="{.. ... ..}",
+ ["lua"]="\".. ... ..\"",
+ },
+ ["cd:content-s"]={
+ ["en"]="{...}",
+ ["lua"]="\"...\"",
+ },
+ ["cd:csname"]={
+ ["cs"]="csname",
+ ["de"]="csname",
+ ["en"]="csname",
+ ["fr"]="nomsc",
+ ["it"]="csname",
+ ["nl"]="naam",
+ ["ro"]="csname",
+ },
+ ["cd:csname-l"]={
+ ["en"]="\\...",
+ },
+ ["cd:csname-s"]={
+ ["en"]="\\...",
+ },
+ ["cd:delimiter"]={
+ ["cs"]="delimiter",
+ ["de"]="delimiter",
+ ["en"]="delimiter",
+ ["fr"]="delimiteur",
+ ["it"]="delimiter",
+ ["nl"]="delimiter",
+ ["ro"]="delimiter",
+ },
+ ["cd:destination"]={
+ ["cs"]="destination",
+ ["de"]="destination",
+ ["en"]="destination",
+ ["fr"]="destination",
+ ["it"]="destination",
+ ["nl"]="bestemming",
+ ["ro"]="destination",
+ },
+ ["cd:destination-l"]={
+ ["en"]="[..,{..[ref,..]},..]",
+ },
+ ["cd:destination-s"]={
+ ["en"]="[{..[ref]}]",
+ },
+ ["cd:dimension"]={
+ ["cs"]="Dimension",
+ ["de"]="Dimension",
+ ["en"]="dimension",
+ ["fr"]="dimension",
+ ["it"]="Dimension",
+ ["nl"]="maat",
+ ["ro"]="Dimension",
+ },
+ ["cd:displaymath"]={
+ ["cs"]="formula",
+ ["de"]="formula",
+ ["en"]="formula",
+ ["fr"]="affichemath",
+ ["it"]="formula",
+ ["nl"]="formule",
+ ["ro"]="formula",
+ },
+ ["cd:displaymath-l"]={
+ ["en"]="$$...$$",
+ },
+ ["cd:displaymath-s"]={
+ ["en"]="$$...$$",
+ },
+ ["cd:else-l"]={
+ ["en"]="\\else ",
+ },
+ ["cd:else-s"]={
+ ["en"]="\\else ",
+ },
+ ["cd:false"]={
+ ["cs"]="false",
+ ["de"]="false",
+ ["en"]="false",
+ ["fr"]="faux",
+ ["it"]="false",
+ ["nl"]="false",
+ ["ro"]="false",
+ },
+ ["cd:fi-l"]={
+ ["en"]="\\fi ",
+ },
+ ["cd:fi-s"]={
+ ["en"]="\\fi ",
+ },
+ ["cd:file"]={
+ ["cs"]="file",
+ ["de"]="file",
+ ["en"]="file",
+ ["fr"]="fichier",
+ ["it"]="file",
+ ["nl"]="file",
+ ["ro"]="file",
+ },
+ ["cd:file-l"]={
+ ["en"]=" ... ",
+ },
+ ["cd:file-s"]={
+ ["en"]=" ... ",
+ },
+ ["cd:first"]={
+ ["cs"]="first",
+ ["de"]="first",
+ ["en"]="first",
+ ["fr"]="premier",
+ ["it"]="first",
+ ["nl"]="eerste",
+ ["ro"]="first",
+ },
+ ["cd:font"]={
+ ["cs"]="font",
+ ["de"]="font",
+ ["en"]="font",
+ ["fr"]="police",
+ ["it"]="font",
+ ["nl"]="font",
+ ["ro"]="font",
+ },
+ ["cd:formula"]={
+ ["cs"]="Formel",
+ ["de"]="Formel",
+ ["en"]="formula",
+ ["fr"]="formule",
+ ["it"]="Formel",
+ ["nl"]="formule",
+ ["ro"]="Formel",
+ },
+ ["cd:identifier"]={
+ ["cs"]="Name",
+ ["de"]="Name",
+ ["en"]="identifier",
+ ["fr"]="identifiant",
+ ["it"]="Name",
+ ["nl"]="naam",
+ ["ro"]="Name",
+ },
+ ["cd:if-l"]={
+ ["en"]="\\if... ",
+ },
+ ["cd:if-s"]={
+ ["en"]="\\if... ",
+ },
+ ["cd:index"]={
+ ["cs"]="entry",
+ ["de"]="entry",
+ ["en"]="entry",
+ ["fr"]="index",
+ ["it"]="entry",
+ ["nl"]="ingang",
+ ["ro"]="entry",
+ },
+ ["cd:index-l"]={
+ ["en"]="{..+...+..}",
+ },
+ ["cd:index-s"]={
+ ["en"]="{...}",
+ },
+ ["cd:inherits"]={
+ ["cs"]="inherits",
+ ["de"]="inherits",
+ ["en"]="inherits",
+ ["fr"]="heritede",
+ ["it"]="inherits",
+ ["nl"]="erft",
+ ["ro"]="inherits",
+ },
+ ["cd:inlinemath-l"]={
+ ["en"]="$...$",
+ },
+ ["cd:inlinemath-s"]={
+ ["en"]="$...$",
+ },
+ ["cd:key"]={
+ ["cs"]="key",
+ ["de"]="key",
+ ["en"]="key",
+ ["fr"]="cle",
+ ["it"]="key",
+ ["nl"]="parameter",
+ ["ro"]="key",
+ },
+ ["cd:language"]={
+ ["cs"]="sprache",
+ ["de"]="sprache",
+ ["en"]="language",
+ ["fr"]="langage",
+ ["it"]="sprache",
+ ["nl"]="taal",
+ ["ro"]="sprache",
+ },
+ ["cd:last"]={
+ ["cs"]="last",
+ ["de"]="last",
+ ["en"]="last",
+ ["fr"]="dernier",
+ ["it"]="last",
+ ["nl"]="laatste",
+ ["ro"]="last",
+ },
+ ["cd:list"]={
+ ["cs"]="Liste",
+ ["de"]="Liste",
+ ["en"]="list",
+ ["fr"]="liste",
+ ["it"]="Liste",
+ ["nl"]="lijst",
+ ["ro"]="Liste",
+ },
+ ["cd:lpath"]={
+ ["cs"]="lpath",
+ ["de"]="lpath",
+ ["en"]="lpath",
+ ["fr"]="cheminl",
+ ["it"]="lpath",
+ ["nl"]="lpath",
+ ["ro"]="lpath",
+ },
+ ["cd:luafunction"]={
+ ["cs"]="luafunction",
+ ["de"]="luafunction",
+ ["en"]="luafunction",
+ ["fr"]="fonctionlua",
+ ["it"]="luafunction",
+ ["nl"]="luafunction",
+ ["ro"]="luafunction",
+ },
+ ["cd:macro-l"]={
+ ["en"]="\\... ",
+ },
+ ["cd:macro-s"]={
+ ["en"]="\\... ",
+ },
+ ["cd:mark"]={
+ ["cs"]="Beschriftung",
+ ["de"]="Beschriftung",
+ ["en"]="mark",
+ ["fr"]="marque",
+ ["it"]="Beschriftung",
+ ["nl"]="markering",
+ ["ro"]="Beschriftung",
+ },
+ ["cd:marking"]={
+ ["cs"]="marking",
+ ["de"]="marking",
+ ["en"]="marking",
+ ["fr"]="marquage",
+ ["it"]="marking",
+ ["nl"]="markering",
+ ["ro"]="marking",
+ },
+ ["cd:math"]={
+ ["cs"]="formula",
+ ["de"]="formula",
+ ["en"]="formula",
+ ["fr"]="math",
+ ["it"]="formula",
+ ["nl"]="formule",
+ ["ro"]="formula",
+ },
+ ["cd:math-l"]={
+ ["en"]="$...$",
+ },
+ ["cd:math-s"]={
+ ["en"]="$...$",
+ },
+ ["cd:matrix"]={
+ ["cs"]="n*m",
+ ["de"]="n*m",
+ ["en"]="n*m",
+ ["fr"]="matrice",
+ ["it"]="n*m",
+ ["nl"]="n*m",
+ ["ro"]="n*m",
+ },
+ ["cd:name"]={
+ ["cs"]="Name",
+ ["de"]="Name",
+ ["en"]="name",
+ ["fr"]="nom",
+ ["it"]="Name",
+ ["nl"]="naam",
+ ["ro"]="Name",
+ },
+ ["cd:noargument-l"]={
+ ["en"]="\\...",
+ },
+ ["cd:noargument-s"]={
+ ["en"]="\\...",
+ },
+ ["cd:node"]={
+ ["cs"]="node",
+ ["de"]="node",
+ ["en"]="node",
+ ["fr"]="noeud",
+ ["it"]="node",
+ ["nl"]="node",
+ ["ro"]="node",
+ },
+ ["cd:none-l"]={
+ ["en"]=".. ... ..",
+ },
+ ["cd:none-s"]={
+ ["en"]="...",
+ },
+ ["cd:nothing"]={
+ ["cs"]="empty",
+ ["de"]="empty",
+ ["en"]="empty",
+ ["fr"]="rien",
+ ["it"]="empty",
+ ["nl"]="leeg",
+ ["ro"]="empty",
+ },
+ ["cd:nothing-l"]={
+ ["en"]="...",
+ },
+ ["cd:nothing-s"]={
+ ["en"]="...",
+ },
+ ["cd:number"]={
+ ["cs"]="Nummer",
+ ["de"]="Nummer",
+ ["en"]="number",
+ ["fr"]="nombre",
+ ["it"]="Nummer",
+ ["nl"]="getal",
+ ["ro"]="Nummer",
+ },
+ ["cd:oneargument"]={
+ ["en"]="\\...#1",
+ },
+ ["cd:optional"]={
+ ["cs"]="opt",
+ ["de"]="opt",
+ ["en"]="opt",
+ ["fr"]="optionnel",
+ ["it"]="opt",
+ ["nl"]="opt",
+ ["ro"]="opt",
+ },
+ ["cd:or-l"]={
+ ["en"]="\\or ",
+ },
+ ["cd:or-s"]={
+ ["en"]="\\or ",
+ },
+ ["cd:par-l"]={
+ ["en"]="\\par ",
+ },
+ ["cd:par-s"]={
+ ["en"]="\\par ",
+ },
+ ["cd:parenthesis-l"]={
+ ["en"]="(...,...)",
+ },
+ ["cd:parenthesis-s"]={
+ ["en"]="(...)",
+ },
+ ["cd:path"]={
+ ["cs"]="path",
+ ["de"]="path",
+ ["en"]="path",
+ ["fr"]="chemin",
+ ["it"]="path",
+ ["nl"]="path",
+ ["ro"]="path",
+ },
+ ["cd:plural"]={
+ ["cs"]="plural",
+ ["de"]="plural",
+ ["en"]="plural",
+ ["fr"]="pluriel",
+ ["it"]="plural",
+ ["nl"]="naam",
+ ["ro"]="plural",
+ },
+ ["cd:position"]={
+ ["cs"]="position",
+ ["de"]="position",
+ ["en"]="position",
+ ["fr"]="position",
+ ["it"]="position",
+ ["nl"]="positie",
+ ["ro"]="position",
+ },
+ ["cd:position-l"]={
+ ["en"]="(...,...)",
+ },
+ ["cd:position-s"]={
+ ["en"]="(...)",
+ },
+ ["cd:processor"]={
+ ["cs"]="processor",
+ ["de"]="processor",
+ ["en"]="processor",
+ ["fr"]="processeur",
+ ["it"]="processor",
+ ["nl"]="verwerker",
+ ["ro"]="processor",
+ },
+ ["cd:reference"]={
+ ["cs"]="reference",
+ ["de"]="reference",
+ ["en"]="reference",
+ ["fr"]="reference",
+ ["it"]="reference",
+ ["nl"]="verwijzing",
+ ["ro"]="reference",
+ },
+ ["cd:reference-l"]={
+ ["en"]="[...,...]",
+ ["lua"]="{..., ...}",
+ },
+ ["cd:reference-s"]={
+ ["en"]="[...]",
+ ["lua"]="{ ... }",
+ },
+ ["cd:row"]={
+ ["cs"]="row",
+ ["de"]="row",
+ ["en"]="row",
+ ["fr"]="rang",
+ ["it"]="row",
+ ["nl"]="rij",
+ ["ro"]="row",
+ },
+ ["cd:section"]={
+ ["cs"]="Abschnitt",
+ ["de"]="Abschnitt",
+ ["en"]="section",
+ ["fr"]="section",
+ ["it"]="Abschnitt",
+ ["nl"]="sectie",
+ ["ro"]="Abschnitt",
+ },
+ ["cd:sectionblock"]={
+ ["cs"]="sectionblock",
+ ["de"]="sectionblock",
+ ["en"]="sectionblock",
+ ["fr"]="blocsection",
+ ["it"]="sectionblock",
+ ["nl"]="sectieblok",
+ ["ro"]="sectionblock",
+ },
+ ["cd:see"]={
+ ["cs"]="siehe",
+ ["de"]="siehe",
+ ["en"]="see",
+ ["fr"]="voir",
+ ["it"]="siehe",
+ ["nl"]="zie",
+ ["ro"]="siehe",
+ },
+ ["cd:sep-l"]={
+ ["en"]="\\",
+ },
+ ["cd:sep-s"]={
+ ["en"]="\\",
+ },
+ ["cd:setup"]={
+ ["cs"]="setup",
+ ["de"]="setup",
+ ["en"]="setup",
+ ["fr"]="configurer",
+ ["it"]="setup",
+ ["nl"]="setup",
+ ["ro"]="setup",
+ },
+ ["cd:sign"]={
+ ["en"]="[-+]",
+ },
+ ["cd:singular"]={
+ ["cs"]="singular",
+ ["de"]="singular",
+ ["en"]="singular",
+ ["fr"]="singulier",
+ ["it"]="singular",
+ ["nl"]="naam",
+ ["ro"]="singular",
+ },
+ ["cd:style"]={
+ ["cs"]="style",
+ ["de"]="style",
+ ["en"]="style",
+ ["fr"]="style",
+ ["it"]="style",
+ ["nl"]="letter",
+ ["ro"]="style",
+ },
+ ["cd:template"]={
+ ["cs"]="template",
+ ["de"]="template",
+ ["en"]="template",
+ ["fr"]="gabarit",
+ ["it"]="template",
+ ["nl"]="sjabloon",
+ ["ro"]="template",
+ },
+ ["cd:template-l"]={
+ ["en"]="[|...|...|]",
+ },
+ ["cd:template-s"]={
+ ["en"]="[|...|]",
+ },
+ ["cd:text"]={
+ ["cs"]="Text",
+ ["de"]="Text",
+ ["en"]="text",
+ ["fr"]="texte",
+ ["it"]="Text",
+ ["nl"]="tekst",
+ ["ro"]="Text",
+ },
+ ["cd:textual-l"]={
+ ["en"]=".. ... ..",
+ },
+ ["cd:textual-s"]={
+ ["en"]="...",
+ },
+ ["cd:threearguments"]={
+ ["en"]="\\...#1#2#3",
},
+ ["cd:threewords-l"]={
+ ["en"]="[..+..+..]",
+ },
+ ["cd:threewords-s"]={
+ ["en"]="[..+..+..]",
+ },
+ ["cd:title"]={
+ ["cs"]="Setup",
+ ["de"]="Setup",
+ ["en"]="setup",
+ ["fr"]="titre",
+ ["it"]="Setup",
+ ["nl"]="setup",
+ ["ro"]="Setup",
+ },
+ ["cd:to-l"]={
+ ["en"]="\\to ",
+ },
+ ["cd:to-s"]={
+ ["en"]="\\to ",
+ },
+ ["cd:triplet"]={
+ ["cs"]="triplet",
+ ["de"]="triplet",
+ ["en"]="triplet",
+ ["fr"]="triplet",
+ ["it"]="triplet",
+ ["nl"]="triplet",
+ ["ro"]="triplet",
+ },
+ ["cd:triplet-l"]={
+ ["en"]="[x:y:z,..]",
+ },
+ ["cd:triplet-s"]={
+ ["en"]="[x:y:z]",
+ },
+ ["cd:true"]={
+ ["cs"]="true",
+ ["de"]="true",
+ ["en"]="true",
+ ["fr"]="vrai",
+ ["it"]="true",
+ ["nl"]="true",
+ ["ro"]="true",
+ },
+ ["cd:twoarguments"]={
+ ["en"]="\\...#1#2",
+ },
+ ["cd:twowords-l"]={
+ ["en"]="[..+..]",
+ },
+ ["cd:twowords-s"]={
+ ["en"]="[..+..]",
+ },
+ ["cd:url"]={
+ ["cs"]="url",
+ ["de"]="url",
+ ["en"]="url",
+ ["fr"]="url",
+ ["it"]="url",
+ ["nl"]="url",
+ ["ro"]="url",
+ },
+ ["cd:userdata"]={
+ ["cs"]="userdata",
+ ["de"]="userdata",
+ ["en"]="userdata",
+ ["fr"]="donneesutilisateur",
+ ["it"]="userdata",
+ ["nl"]="gebruikersdata",
+ ["ro"]="userdata",
+ },
+ ["cd:value"]={
+ ["cs"]="value",
+ ["de"]="value",
+ ["en"]="value",
+ ["fr"]="valeur",
+ ["it"]="value",
+ ["nl"]="waarde",
+ ["ro"]="value",
+ },
+ ["cd:word"]={
+ ["cs"]="word",
+ ["de"]="word",
+ ["en"]="word",
+ ["fr"]="mot",
+ ["it"]="word",
+ ["nl"]="woord",
+ ["ro"]="word",
+ },
+ ["cd:word-l"]={
+ ["en"]="{.. ... ..}",
+ ["lua"]="\".. ... ..\"",
+ },
+ ["cd:word-s"]={
+ ["en"]="{...}",
+ ["lua"]="\"...\"",
+ },
+ ["cd:xmlsetup"]={
+ ["cs"]="xmlsetup",
+ ["de"]="xmlsetup",
+ ["en"]="xmlsetup",
+ ["fr"]="configurationxml",
+ ["it"]="xmlsetup",
+ ["nl"]="xmlsetup",
+ ["ro"]="xmlsetup",
+ },
+ },
+ ["variables"]={
["Addition"]={
["cs"]="Pridavek",
["de"]="Zusatz",
@@ -11908,6 +13760,7 @@ return {
},
["Alphabetic"]={
["en"]="Alphabetic",
+ ["fr"]="Alphabetique",
},
["Balloon"]={
["cs"]="Bublinka",
@@ -11933,7 +13786,7 @@ return {
["cs"]="Kapitalky",
["de"]="Versalien",
["en"]="Capital",
- ["fr"]="Capitale",
+ ["fr"]="Capitales",
["it"]="Maiuscolo",
["nl"]="Kapitaal",
["pe"]="Capital",
@@ -11943,7 +13796,7 @@ return {
["cs"]="Pismeno",
["de"]="Buchstabe",
["en"]="Character",
- ["fr"]="Caratere",
+ ["fr"]="Caractere",
["it"]="Lettera",
["nl"]="Letter",
["pe"]="Character",
@@ -11963,7 +13816,7 @@ return {
["cs"]="ZavritDokument",
["de"]="SchliesseDokument",
["en"]="CloseDocument",
- ["fr"]="FermeDocument",
+ ["fr"]="FermerDocument",
["it"]="ChiudiDocumento",
["nl"]="SluitDocument",
["pe"]="بستن‌نوشتار",
@@ -11973,7 +13826,7 @@ return {
["cs"]="UkoncitProhlizec",
["de"]="BeendeViewer",
["en"]="ExitViewer",
- ["fr"]="SortVisualisateur",
+ ["fr"]="SortirVisualisateur",
["it"]="EsciVisualizzatore",
["nl"]="VerlaatViewer",
["pe"]="خروج‌نمایشگر",
@@ -11993,7 +13846,7 @@ return {
["cs"]="FitHeight",
["de"]="HoehePassend",
["en"]="FitHeight",
- ["fr"]="AjusteHauteur",
+ ["fr"]="AdapterHauteur",
["it"]="FitHeight",
["nl"]="HoogtePassend",
["pe"]="پرکردن‌ارتفاع",
@@ -12003,7 +13856,7 @@ return {
["cs"]="FitWidth",
["de"]="BreitePassend",
["en"]="FitWidth",
- ["fr"]="AjusteLargeur",
+ ["fr"]="AdapterLargeur",
["it"]="FitWidth",
["nl"]="BreedtePassend",
["pe"]="پرکردن‌عرض",
@@ -12013,7 +13866,7 @@ return {
["cs"]="JdiNaStranku",
["de"]="GotoPage",
["en"]="GotoPage",
- ["fr"]="VaalaPage",
+ ["fr"]="AlleraPage",
["it"]="VaiAPagina",
["nl"]="GaNaarPagina",
["pe"]="برو‌به‌صفحه",
@@ -12043,7 +13896,7 @@ return {
["cs"]="SkryjPole",
["de"]="VerbergeFeld",
["en"]="HideField",
- ["fr"]="CacheChamp",
+ ["fr"]="CacherChamps",
["it"]="NascondiCampo",
["nl"]="VerbergVeld",
["pe"]="پنهان‌میدان",
@@ -12053,7 +13906,7 @@ return {
["cs"]="HideLayer",
["de"]="HideLayer",
["en"]="HideLayer",
- ["fr"]="CacheCalque",
+ ["fr"]="CacherCalque",
["it"]="HideLayer",
["nl"]="VerbergLaag",
["pe"]="پنهان‌لایه",
@@ -12083,7 +13936,7 @@ return {
["cs"]="NacistFormular",
["de"]="LadeFormular",
["en"]="LoadForm",
- ["fr"]="ChargeForm",
+ ["fr"]="ChargerFormulaire",
["it"]="CaricaForm",
["nl"]="LaadFormulier",
["pe"]="بارگذاشتن‌فرم",
@@ -12143,12 +13996,16 @@ return {
["cs"]="OpenNamedDocument",
["de"]="OpenNamedDocument",
["en"]="OpenNamedDocument",
- ["fr"]="OuvreDocumentNomme",
+ ["fr"]="OuvrirDocumentNomme",
["it"]="OpenNamedDocument",
["nl"]="OpenDocumentOpNaam",
["pe"]="بازکردن‌نوشتار‌ذخیره‌شده",
["ro"]="OpenNamedDocument",
},
+ ["Ordinal"]={
+ ["en"]="Ordinal",
+ ["fr"]="Ordinal",
+ },
["Paragraph"]={
["cs"]="Odstavec",
["de"]="Absatz",
@@ -12173,7 +14030,7 @@ return {
["cs"]="PauseRendering",
["de"]="PauseRendering",
["en"]="PauseRendering",
- ["fr"]="PauseRendering",
+ ["fr"]="PauseRendu",
["it"]="PauseRendering",
["nl"]="PauzeerRendering",
["pe"]="توقف‌تعبیر",
@@ -12213,7 +14070,7 @@ return {
["cs"]="VytisknoutDokument",
["de"]="DruckeDokument",
["en"]="PrintDocument",
- ["fr"]="ImprimeDocument",
+ ["fr"]="ImprimerDocument",
["it"]="StampaDocumento",
["nl"]="PrintDocument",
["pe"]="چاپ‌نوشتار",
@@ -12223,7 +14080,7 @@ return {
["cs"]="Query",
["de"]="Query",
["en"]="Query",
- ["fr"]="Query",
+ ["fr"]="Interroger",
["it"]="Richiesta",
["nl"]="RaadpleegDocument",
["pe"]="پرسش",
@@ -12233,7 +14090,7 @@ return {
["cs"]="QueryAgain",
["de"]="QueryAgain",
["en"]="QueryAgain",
- ["fr"]="QueryAgain",
+ ["fr"]="InterrogerSuivant",
["it"]="RinnovaRichiesta",
["nl"]="HerhaalRaadplegen",
["pe"]="پرسش‌دوباره",
@@ -12243,7 +14100,7 @@ return {
["cs"]="ResetFormulare",
["de"]="ZuruecksetzenFormular",
["en"]="ResetForm",
- ["fr"]="RazForm",
+ ["fr"]="RazFormulaire",
["it"]="ReimpostaForm",
["nl"]="ResetFormulier",
["pe"]="دوباره‌نشانی‌فرم",
@@ -12253,7 +14110,7 @@ return {
["cs"]="PokracovatFilm",
["de"]="FortsetzenFilm",
["en"]="ResumeMovie",
- ["fr"]="ReprendFilm",
+ ["fr"]="RepriseFilm",
["it"]="RiprendiFilm",
["nl"]="HervatFilm",
["pe"]="ادامه‌فیلم",
@@ -12263,7 +14120,7 @@ return {
["cs"]="ResumeRendering",
["de"]="ResumeRendering",
["en"]="ResumeRendering",
- ["fr"]="ResumeRendering",
+ ["fr"]="RepriseRendu",
["it"]="ResumeRendering",
["nl"]="HervatRendering",
["pe"]="ادامه‌تعبیر",
@@ -12273,7 +14130,7 @@ return {
["cs"]="PokracovatZvuk",
["de"]="ResumeSound",
["en"]="ResumeSound",
- ["fr"]="ReprendSon",
+ ["fr"]="RepriseSon",
["it"]="RiprendiSuono",
["nl"]="HervatGeluid",
["pe"]="ادامه‌صدا",
@@ -12293,7 +14150,7 @@ return {
["cs"]="UlozitDokument",
["de"]="SpeichereDokument",
["en"]="SaveDocument",
- ["fr"]="SauvegardeDocument",
+ ["fr"]="EnregistrerDocument",
["it"]="SalvaDocumento",
["nl"]="BewaarDocument",
["pe"]="ذخیره‌نوشتار",
@@ -12303,7 +14160,7 @@ return {
["cs"]="UlozitFormular",
["de"]="SpeicheFormular",
["en"]="SaveForm",
- ["fr"]="SauvegardeForm",
+ ["fr"]="EnregistrerFormulaire",
["it"]="SalvaForm",
["nl"]="BewaarFormulier",
["pe"]="ذخیره‌فرم",
@@ -12313,7 +14170,7 @@ return {
["cs"]="SaveNamedDocument",
["de"]="SaveNamedDocument",
["en"]="SaveNamedDocument",
- ["fr"]="SauvegardeDocumentNomme",
+ ["fr"]="EnregistrerDocumentNomme",
["it"]="SaveNamedDocument",
["nl"]="BewaarDocumentOpNaam",
["pe"]="ذخیره‌نوشتار‌بانام",
@@ -12323,7 +14180,7 @@ return {
["cs"]="HledatZnovu",
["de"]="WeiterSuchen",
["en"]="SearchAgain",
- ["fr"]="RechercheSuivant",
+ ["fr"]="ChercherSuivant",
["it"]="CercaAncora",
["nl"]="HerhaalZoeken",
["pe"]="جستجوی‌دوباره",
@@ -12333,7 +14190,7 @@ return {
["cs"]="ProhledatDokument",
["de"]="DokumentDurchsuchen",
["en"]="SearchDocument",
- ["fr"]="RechercheDocument",
+ ["fr"]="ChercherDocument",
["it"]="CercaDocumento",
["nl"]="DoorzoekDocument",
["pe"]="جستجوی‌نوشتار",
@@ -12343,7 +14200,7 @@ return {
["cs"]="UkazZalozky",
["de"]="ShowBookmarks",
["en"]="ShowBookmarks",
- ["fr"]="ShowBookmarks",
+ ["fr"]="MontrerMarquepages",
["it"]="MostraSegnalibro",
["nl"]="ShowBookmarks",
["pe"]="نمایش‌چوبخط",
@@ -12353,7 +14210,7 @@ return {
["cs"]="UkazPole",
["de"]="ZeigeFeld",
["en"]="ShowField",
- ["fr"]="MontreChamp",
+ ["fr"]="MontrerChamp",
["it"]="MostraCampo",
["nl"]="ToonVeld",
["pe"]="نمایش‌میدان",
@@ -12363,7 +14220,7 @@ return {
["cs"]="UkazNahledy",
["de"]="ShowThumbs",
["en"]="ShowThumbs",
- ["fr"]="ShowThumbs",
+ ["fr"]="MontrerVignettes",
["it"]="MostraThumbs",
["nl"]="ShowThumbs",
["pe"]="نمایش‌شصت",
@@ -12373,7 +14230,7 @@ return {
["cs"]="SpustitFilm",
["de"]="StartFilm",
["en"]="StartMovie",
- ["fr"]="DemarreFilm",
+ ["fr"]="débutFilm",
["it"]="IniziaFilm",
["nl"]="StartFilm",
["pe"]="شروع‌فیلم",
@@ -12383,7 +14240,7 @@ return {
["cs"]="StartRendering",
["de"]="StartRendering",
["en"]="StartRendering",
- ["fr"]="StartRendering",
+ ["fr"]="débutRendu",
["it"]="StartRendering",
["nl"]="StartRendering",
["pe"]="شروع‌تعبیر",
@@ -12393,7 +14250,7 @@ return {
["cs"]="StartZvuk",
["de"]="StartSound",
["en"]="StartSound",
- ["fr"]="DemarreSon",
+ ["fr"]="débutSon",
["it"]="IniziaSuono",
["nl"]="StartGeluid",
["pe"]="شروع‌صدا",
@@ -12403,7 +14260,7 @@ return {
["cs"]="ZastavitFilm",
["de"]="StopFilm",
["en"]="StopMovie",
- ["fr"]="StoppeFilm",
+ ["fr"]="FinFilm",
["it"]="FermaFilm",
["nl"]="StopFilm",
["pe"]="پایان‌فیلم",
@@ -12413,7 +14270,7 @@ return {
["cs"]="StopRendering",
["de"]="StopRendering",
["en"]="StopRendering",
- ["fr"]="StopRendering",
+ ["fr"]="FinRendu",
["it"]="StopRendering",
["nl"]="StopRendering",
["pe"]="پایان‌تعبیر",
@@ -12423,7 +14280,7 @@ return {
["cs"]="StopZvuk",
["de"]="StopSound",
["en"]="StopSound",
- ["fr"]="StoppeSon",
+ ["fr"]="FinSon",
["it"]="FermaSuono",
["nl"]="StopGeluid",
["pe"]="پایان‌صدا",
@@ -12433,7 +14290,7 @@ return {
["cs"]="PoslatFormular",
["de"]="VersendeFormular",
["en"]="SubmitForm",
- ["fr"]="SoumettreForm",
+ ["fr"]="SoumettreFormulaire",
["it"]="MandaForm",
["nl"]="VerzendFormulier",
["pe"]="تسلیم‌فرم",
@@ -12443,7 +14300,7 @@ return {
["cs"]="ToggleLayer",
["de"]="ToggleLayer",
["en"]="ToggleLayer",
- ["fr"]="ToggleLayer",
+ ["fr"]="BasculerCalque",
["it"]="ToggleLayer",
["nl"]="WisselLaag",
["pe"]="تغییرلایه",
@@ -12453,7 +14310,7 @@ return {
["cs"]="ZmenitProhlizec",
["de"]="WechseleViewer",
["en"]="ToggleViewer",
- ["fr"]="ChangeVisualisateur",
+ ["fr"]="BasculerVisualisateur",
["it"]="ScambiaVisualizzatore",
["nl"]="WisselViewer",
["pe"]="تغییرنمایشگر",
@@ -12473,7 +14330,7 @@ return {
["cs"]="VideLayer",
["de"]="VideLayer",
["en"]="VideLayer",
- ["fr"]="VideLayer",
+ ["fr"]="VideCalque",
["it"]="VideLayer",
["nl"]="ToonLaag",
["pe"]="VideLayer",
@@ -12563,16 +14420,12 @@ return {
["cs"]="absolutni",
["de"]="absolut",
["en"]="absolute",
- ["fr"]="absolute",
+ ["fr"]="absolu",
["it"]="assoluto",
["nl"]="absoluut",
["pe"]="قطعی",
["ro"]="absolut",
},
- ["anchor"]={
- ["en"]="anchor",
- ["nl"]="anker",
- },
["action"]={
["cs"]="akce",
["de"]="aktion",
@@ -12587,7 +14440,7 @@ return {
["cs"]="po",
["de"]="nach",
["en"]="after",
- ["fr"]="apres",
+ ["fr"]="après",
["it"]="dopo",
["nl"]="na",
["pe"]="بعداز",
@@ -12605,6 +14458,7 @@ return {
},
["alphabetic"]={
["en"]="alphabetic",
+ ["fr"]="Alphabetique",
},
["always"]={
["cs"]="vzdy",
@@ -12616,16 +14470,22 @@ return {
["pe"]="همواره",
["ro"]="totdeauna",
},
+ ["anchor"]={
+ ["en"]="anchor",
+ ["fr"]="ancre",
+ ["nl"]="anker",
+ },
["and"]={
["de"]="und",
["en"]="and",
+ ["fr"]="et",
["nl"]="en",
},
["answerarea"]={
["cs"]="answerarea",
["de"]="answerarea",
["en"]="answerarea",
- ["fr"]="answerarea",
+ ["fr"]="zonereponse",
["it"]="answerarea",
["nl"]="antwoordgebied",
["pe"]="answerarea",
@@ -12661,11 +14521,15 @@ return {
["pe"]="آوریل",
["ro"]="aprilie",
},
+ ["aside"]={
+ ["en"]="aside",
+ ["fr"]="apart",
+ },
["atleftmargin"]={
["cs"]="atleftmargin",
["de"]="atleftmargin",
["en"]="atleftmargin",
- ["fr"]="atleftmargin",
+ ["fr"]="enmargegauche",
["it"]="atleftmargin",
["nl"]="oplinkermarge",
["pe"]="درحاشیه‌چپ",
@@ -12675,7 +14539,7 @@ return {
["cs"]="naokraji",
["de"]="amrand",
["en"]="atmargin",
- ["fr"]="alamarge",
+ ["fr"]="enmarge",
["it"]="almargine",
["nl"]="opmarge",
["pe"]="درحاشیه",
@@ -12685,7 +14549,7 @@ return {
["cs"]="nastrance",
["de"]="aufseite",
["en"]="atpage",
- ["fr"]="alapage",
+ ["fr"]="enpage",
["it"]="apagina",
["nl"]="oppagina",
["pe"]="درصفحه",
@@ -12695,7 +14559,7 @@ return {
["cs"]="atrightmargin",
["de"]="atrightmargin",
["en"]="atrightmargin",
- ["fr"]="atrightmargin",
+ ["fr"]="enmargedroite",
["it"]="atrightmargin",
["nl"]="oprechtermarge",
["pe"]="درحاشیه‌راست",
@@ -12703,13 +14567,14 @@ return {
},
["attachment"]={
["en"]="attachment",
+ ["fr"]="piecejointe",
["nl"]="aanhangsel",
},
["august"]={
["cs"]="srpen",
["de"]="august",
["en"]="august",
- ["fr"]="août",
+ ["fr"]="aout",
["it"]="agosto",
["nl"]="augustus",
["pe"]="آگوست",
@@ -12746,6 +14611,7 @@ return {
},
["autopunctuation"]={
["en"]="autopunctuation",
+ ["fr"]="autoponctuation",
},
["back"]={
["cs"]="zpet",
@@ -12771,7 +14637,7 @@ return {
["cs"]="epilogy",
["de"]="epiloge",
["en"]="backmatter",
- ["fr"]="epilogue",
+ ["fr"]="pagesdefin",
["it"]="postambolo",
["nl"]="uitleidingen",
["pe"]="پس‌مطلب",
@@ -12791,7 +14657,7 @@ return {
["cs"]="zpetnamezera",
["de"]="rumpfspatium",
["en"]="backspace",
- ["fr"]="retourarriere",
+ ["fr"]="retourarrière",
["it"]="backspace",
["nl"]="rugwit",
["pe"]="فضای‌پشت",
@@ -12801,7 +14667,7 @@ return {
["cs"]="zpet",
["de"]="rueckwaerts",
["en"]="backward",
- ["fr"]="retourarriere",
+ ["fr"]="enarriere",
["it"]="indietro",
["nl"]="achteruit",
["pe"]="عقب‌گرد",
@@ -12809,6 +14675,7 @@ return {
},
["bbl"]={
["en"]="bbl",
+ ["fr"]="bbl",
},
["before"]={
["cs"]="pred",
@@ -12822,16 +14689,18 @@ return {
},
["begin"]={
["en"]="begin",
+ ["fr"]="commencer",
["nl"]="begin",
},
["bib"]={
["en"]="bib",
+ ["fr"]="bib",
},
["big"]={
["cs"]="velke",
["de"]="gross",
["en"]="big",
- ["fr"]="grand",
+ ["fr"]="important",
["it"]="grande",
["nl"]="groot",
["pe"]="بزرگ",
@@ -12841,7 +14710,7 @@ return {
["cs"]="bigbodyfont",
["de"]="bigbodyfont",
["en"]="bigbodyfont",
- ["fr"]="grandepolicecorp",
+ ["fr"]="policedecorpsimportante",
["it"]="grossofontdeltesto",
["nl"]="grootkorps",
["pe"]="قلم‌بدنه‌بزرگ",
@@ -12849,13 +14718,14 @@ return {
},
["bigger"]={
["en"]="bigger",
+ ["fr"]="plusimportant",
["nl"]="groter",
},
["bigpreference"]={
["cs"]="vysokapriorita",
["de"]="grosszuegig",
["en"]="bigpreference",
- ["fr"]="grandepreference",
+ ["fr"]="preferenceimportante",
["it"]="grandepreferenza",
["nl"]="grotevoorkeur",
["pe"]="اولویت‌بزرگ",
@@ -12865,7 +14735,7 @@ return {
["cs"]="prazdny",
["de"]="blanko",
["en"]="blank",
- ["fr"]="vide",
+ ["fr"]="vierge",
["it"]="rigovuoto",
["nl"]="blanko",
["pe"]="خالی",
@@ -12873,12 +14743,13 @@ return {
},
["block"]={
["en"]="block",
+ ["fr"]="bloc",
},
["blockquote"]={
["cs"]="blockquote",
["de"]="blockquote",
["en"]="blockquote",
- ["fr"]="blockquote",
+ ["fr"]="citerbloc",
["it"]="blockquote",
["nl"]="blokcitaat",
["pe"]="نقل‌بلوک",
@@ -12888,7 +14759,7 @@ return {
["cs"]="hlavnicasti",
["de"]="haupttexte",
["en"]="bodymatter",
- ["fr"]="texteprincipal",
+ ["fr"]="pagescorpsdetexte",
["it"]="testiprincipali",
["nl"]="hoofdteksten",
["pe"]="مطلب‌بدنه",
@@ -12918,7 +14789,7 @@ return {
["cs"]="tucnekurzivni",
["de"]="fettitalic",
["en"]="bolditalic",
- ["fr"]="italiquegras",
+ ["fr"]="grasitalique",
["it"]="grassettocorsivo",
["nl"]="vetitalic",
["pe"]="ایتالیک‌مشکی",
@@ -12928,7 +14799,7 @@ return {
["cs"]="tucnesklonene",
["de"]="fettgeneigt",
["en"]="boldslanted",
- ["fr"]="inclinegras",
+ ["fr"]="grasincline",
["it"]="grassettoinclinato",
["nl"]="vetschuin",
["pe"]="خوابیده‌مشکی",
@@ -12948,7 +14819,7 @@ return {
["cs"]="obe",
["de"]="beide",
["en"]="both",
- ["fr"]="lesdeux",
+ ["fr"]="chacun",
["it"]="entrambi",
["nl"]="beide",
["pe"]="هردو",
@@ -12956,12 +14827,13 @@ return {
},
["bothtext"]={
["en"]="bothtext",
+ ["fr"]="textechacun",
},
["bottom"]={
["cs"]="spodek",
["de"]="unten",
["en"]="bottom",
- ["fr"]="inf",
+ ["fr"]="bas",
["it"]="fondo",
["nl"]="onder",
["pe"]="پایین",
@@ -12969,6 +14841,7 @@ return {
},
["box"]={
["en"]="box",
+ ["fr"]="boite",
},
["brief"]={
["cs"]="brief",
@@ -12994,7 +14867,7 @@ return {
["cs"]="buffer",
["de"]="puffer",
["en"]="buffer",
- ["fr"]="buffer",
+ ["fr"]="tampon",
["it"]="buffer",
["nl"]="buffer",
["pe"]="بافر",
@@ -13022,6 +14895,7 @@ return {
},
["camel"]={
["en"]="camel",
+ ["fr"]="camel",
},
["cap"]={
["cs"]="kap",
@@ -13037,17 +14911,29 @@ return {
["cs"]="kapitalky",
["de"]="versalien",
["en"]="capital",
- ["fr"]="capitale",
+ ["fr"]="capitales",
["it"]="maiuscolo",
["nl"]="kapitaal",
["pe"]="capital",
["ro"]="majuscula",
},
+ ["category"]={
+ ["en"]="category",
+ ["fr"]="categorie",
+ },
+ ["cd:character"]={
+ ["en"]="cd:character",
+ ["fr"]="caracteres",
+ },
+ ["cd:font"]={
+ ["en"]="cd:font",
+ ["fr"]="police",
+ },
["center"]={
["cs"]="center",
["de"]="center",
["en"]="center",
- ["fr"]="center",
+ ["fr"]="centrer",
["it"]="center",
["nl"]="centreer",
["pe"]="مرکز",
@@ -13055,6 +14941,7 @@ return {
},
["centerlast"]={
["en"]="centerlast",
+ ["fr"]="centrerdernier",
},
["chapter"]={
["cs"]="kapitola",
@@ -13088,19 +14975,24 @@ return {
},
["chemical"]={
["en"]="chemical",
+ ["fr"]="chimique",
},
["chemicals"]={
["en"]="chemicals",
+ ["fr"]="chimiques",
},
["chemistry"]={
["en"]="chemistry",
+ ["fr"]="chimie",
["nl"]="chemie",
},
["cite"]={
["en"]="cite",
+ ["fr"]="cite",
},
["closed"]={
["en"]="closed",
+ ["fr"]="ferme",
["nl"]="gesloten",
},
["color"]={
@@ -13135,6 +15027,7 @@ return {
},
["combination"]={
["en"]="combination",
+ ["fr"]="combinaison",
["nl"]="combinatie",
},
["command"]={
@@ -13179,9 +15072,11 @@ return {
},
["compressseparator"]={
["en"]="compressseparator",
+ ["fr"]="separateurreduction",
},
["compressstopper"]={
["en"]="compressstopper",
+ ["fr"]="stoppeurreduction",
},
["concept"]={
["cs"]="koncept",
@@ -13195,6 +15090,7 @@ return {
},
["construction"]={
["en"]="construction",
+ ["fr"]="construction",
},
["content"]={
["cs"]="obsah",
@@ -13220,7 +15116,7 @@ return {
["cs"]="pokracovat",
["de"]="fortsetzten",
["en"]="continue",
- ["fr"]="continue",
+ ["fr"]="continuer",
["it"]="continua",
["nl"]="verder",
["pe"]="ادامه",
@@ -13228,6 +15124,7 @@ return {
},
["continued"]={
["en"]="continued",
+ ["fr"]="continue",
["nl"]="vervolgd",
},
["controls"]={
@@ -13264,7 +15161,7 @@ return {
["cs"]="cutspace",
["de"]="cutspace",
["en"]="cutspace",
- ["fr"]="cutspace",
+ ["fr"]="espacecoupe",
["it"]="cutspace",
["nl"]="snijwit",
["pe"]="فضای‌برش",
@@ -13272,6 +15169,7 @@ return {
},
["dataset"]={
["en"]="dataset",
+ ["fr"]="jeudedonnees",
},
["date"]={
["cs"]="datum",
@@ -13375,6 +15273,7 @@ return {
},
["down"]={
["en"]="down",
+ ["fr"]="enbas",
["nl"]="omlaag",
},
["each"]={
@@ -13399,10 +15298,22 @@ return {
},
["effective"]={
["en"]="effective",
+ ["fr"]="effectif",
["nl"]="effectief",
},
+ ["eight"]={
+ ["cs"]="eight",
+ ["de"]="acht",
+ ["en"]="eight",
+ ["fr"]="huit",
+ ["it"]="eight",
+ ["nl"]="acht",
+ ["pe"]="eight",
+ ["ro"]="eight",
+ },
["embed"]={
["en"]="embed",
+ ["fr"]="integrer",
["nl"]="sluitin",
},
["empty"]={
@@ -13417,30 +15328,28 @@ return {
},
["enable"]={
["en"]="enable",
+ ["fr"]="activer",
},
["end"]={
["en"]="end",
+ ["fr"]="terminer",
["nl"]="eind",
},
["endnote"]={
["cs"]="endnote",
["de"]="endnote",
["en"]="endnote",
- ["fr"]="notefin",
+ ["fr"]="noteseule",
["it"]="endnote",
["nl"]="eindnoot",
["pe"]="ته‌نوشت",
["ro"]="endnote",
},
- ["textnote"]={
- ["en"]="textnote",
- ["nl"]="tekstnoot",
- },
["enumeration"]={
["cs"]="vycet",
["de"]="nummerierung",
["en"]="enumeration",
- ["fr"]="enumeration",
+ ["fr"]="énumération",
["it"]="enumerazione",
["nl"]="doornummering",
["pe"]="شماره‌بندی",
@@ -13450,7 +15359,7 @@ return {
["cs"]="prostredi",
["de"]="umgebung",
["en"]="environment",
- ["fr"]="environement",
+ ["fr"]="environnement",
["it"]="ambiente",
["nl"]="omgeving",
["pe"]="محیط",
@@ -13468,12 +15377,13 @@ return {
},
["export"]={
["en"]="export",
+ ["fr"]="exporter",
},
["external"]={
["cs"]="externi",
["de"]="extern",
["en"]="external",
- ["fr"]="external",
+ ["fr"]="externe",
["it"]="esterno",
["nl"]="extern",
["pe"]="خارجی",
@@ -13481,6 +15391,7 @@ return {
},
["extremestretch"]={
["en"]="extremestretch",
+ ["fr"]="etirementextreme",
},
["fact"]={
["cs"]="fakt",
@@ -13492,6 +15403,10 @@ return {
["pe"]="fact",
["ro"]="fapt",
},
+ ["fallback"]={
+ ["en"]="fallback",
+ ["fr"]="repli",
+ },
["february"]={
["cs"]="unor",
["de"]="februar",
@@ -13504,6 +15419,7 @@ return {
},
["field"]={
["en"]="field",
+ ["fr"]="champ",
["nl"]="veld",
},
["figure"]={
@@ -13590,7 +15506,7 @@ return {
["cs"]="prizpusobive",
["de"]="passend",
["en"]="fit",
- ["fr"]="adapte",
+ ["fr"]="adapter",
["it"]="adatta",
["nl"]="passend",
["pe"]="پرکردن",
@@ -13606,51 +15522,11 @@ return {
["pe"]="پنج",
["ro"]="cinci",
},
- ["six"]={
- ["cs"]="six",
- ["de"]="sechs",
- ["en"]="six",
- ["fr"]="six",
- ["it"]="six",
- ["nl"]="zes",
- ["pe"]="six",
- ["ro"]="six",
- },
- ["seven"]={
- ["cs"]="seven",
- ["de"]="sieben",
- ["en"]="seven",
- ["fr"]="seven",
- ["it"]="seven",
- ["nl"]="zeven",
- ["pe"]="seven",
- ["ro"]="seven",
- },
- ["eight"]={
- ["cs"]="eight",
- ["de"]="acht",
- ["en"]="eight",
- ["fr"]="eight",
- ["it"]="eight",
- ["nl"]="acht",
- ["pe"]="eight",
- ["ro"]="eight",
- },
- ["nine"]={
- ["cs"]="nine",
- ["de"]="neun",
- ["en"]="nine",
- ["fr"]="nine",
- ["it"]="nine",
- ["nl"]="negen",
- ["pe"]="nine",
- ["ro"]="nine",
- },
["fix"]={
["cs"]="fixuj",
["de"]="stellewiederher",
["en"]="fix",
- ["fr"]="fixe",
+ ["fr"]="fix",
["it"]="fisso",
["nl"]="herstel",
["pe"]="ثابت‌کن",
@@ -13690,7 +15566,7 @@ return {
["cs"]="flushinner",
["de"]="flushinner",
["en"]="flushinner",
- ["fr"]="flushinner",
+ ["fr"]="alignerinterieur",
["it"]="flushinner",
["nl"]="lijnbinnen",
["pe"]="پمپ‌داخلی",
@@ -13700,7 +15576,7 @@ return {
["cs"]="flushleft",
["de"]="flushleft",
["en"]="flushleft",
- ["fr"]="flushleft",
+ ["fr"]="alignergauche",
["it"]="flushleft",
["nl"]="lijnlinks",
["pe"]="پمپ‌چپ",
@@ -13710,7 +15586,7 @@ return {
["cs"]="flushouter",
["de"]="flushouter",
["en"]="flushouter",
- ["fr"]="flushouter",
+ ["fr"]="alignerexterieur",
["it"]="flushouter",
["nl"]="lijnbuiten",
["pe"]="پمپ‌خارجی",
@@ -13720,7 +15596,7 @@ return {
["cs"]="flushright",
["de"]="flushright",
["en"]="flushright",
- ["fr"]="flushright",
+ ["fr"]="alignerdroite",
["it"]="flushright",
["nl"]="lijnrechts",
["pe"]="پمپ‌راست",
@@ -13728,8 +15604,13 @@ return {
},
["followingpage"]={
["en"]="followingpage",
+ ["fr"]="pagesuccesseur",
["nl"]="opvolgendepagina",
},
+ ["font"]={
+ ["en"]="font",
+ ["nl"]="font",
+ },
["footer"]={
["cs"]="upati",
["de"]="fusszeile",
@@ -13744,7 +15625,7 @@ return {
["cs"]="poznamkapodcarou",
["de"]="fussnote",
["en"]="footnote",
- ["fr"]="notepdp",
+ ["fr"]="notebdp",
["it"]="notapdp",
["nl"]="voetnoot",
["pe"]="پانوشت",
@@ -13754,7 +15635,7 @@ return {
["cs"]="sila",
["de"]="zwinge",
["en"]="force",
- ["fr"]="force",
+ ["fr"]="forcer",
["it"]="forza",
["nl"]="forceer",
["pe"]="اجبار",
@@ -13794,7 +15675,7 @@ return {
["cs"]="vpred",
["de"]="vorwaerts",
["en"]="forward",
- ["fr"]="avance",
+ ["fr"]="enavant",
["it"]="avanti",
["nl"]="vooruit",
["pe"]="به‌جلو",
@@ -13810,6 +15691,10 @@ return {
["pe"]="چهار",
["ro"]="patru",
},
+ ["fractions"]={
+ ["en"]="fractions",
+ ["fr"]="fractions",
+ },
["frame"]={
["cs"]="ramecek",
["de"]="rahmen",
@@ -13844,7 +15729,7 @@ return {
["cs"]="prednicasti",
["de"]="einleitungen",
["en"]="frontmatter",
- ["fr"]="preambule",
+ ["fr"]="pagesliminaires",
["it"]="preambolo",
["nl"]="inleidingen",
["pe"]="پیش‌مطلب",
@@ -13864,7 +15749,7 @@ return {
["cs"]="fullhz",
["de"]="fullhz",
["en"]="fullhz",
- ["fr"]="fullhz",
+ ["fr"]="hzcomplet",
["it"]="fullhz",
["nl"]="fullenhz",
["pe"]="fullhz",
@@ -13954,7 +15839,7 @@ return {
["cs"]="zaveseni",
["de"]="haengend",
["en"]="hang",
- ["fr"]="suspend",
+ ["fr"]="suspendre",
["it"]="sospendi",
["nl"]="hang",
["pe"]="بیاویز",
@@ -13964,7 +15849,7 @@ return {
["cs"]="visici",
["de"]="haengend",
["en"]="hanging",
- ["fr"]="suspend",
+ ["fr"]="suspension",
["it"]="sospeso",
["nl"]="hangend",
["pe"]="آویزان",
@@ -13972,6 +15857,7 @@ return {
},
["hangingboth"]={
["en"]="hangingboth",
+ ["fr"]="suspensionchacun",
["nl"]="beidehangend",
},
["head"]={
@@ -13988,12 +15874,17 @@ return {
["cs"]="zahlavi",
["de"]="kopfzeile",
["en"]="header",
- ["fr"]="entete",
+ ["fr"]="entête",
["it"]="intestazione",
["nl"]="hoofd",
["pe"]="سربرگ",
["ro"]="antet",
},
+ ["headintext"]={
+ ["en"]="headintext",
+ ["fr"]="tetedanstexte",
+ ["nl"]="kopintekst",
+ },
["height"]={
["cs"]="vyska",
["de"]="hoehe",
@@ -14018,7 +15909,7 @@ return {
["cs"]="vyse",
["de"]="vorher",
["en"]="hencefore",
- ["fr"]="precedent",
+ ["fr"]="precedemment",
["it"]="precedente",
["nl"]="hierboven",
["pe"]="hencefore",
@@ -14038,7 +15929,7 @@ return {
["cs"]="nize",
["de"]="nachher",
["en"]="hereafter",
- ["fr"]="suivant",
+ ["fr"]="ciapres",
["it"]="seguente",
["nl"]="hieronder",
["pe"]="ازاین‌به‌بعد",
@@ -14056,12 +15947,13 @@ return {
},
["hiddenbar"]={
["en"]="hiddenbar",
+ ["fr"]="barrecachee",
},
["hiding"]={
["cs"]="skryt",
["de"]="verbergen",
["en"]="hiding",
- ["fr"]="cache",
+ ["fr"]="encachant",
["it"]="nascondere",
["nl"]="verbergen",
["pe"]="پنهان‌کردن",
@@ -14071,7 +15963,7 @@ return {
["cs"]="vysoko",
["de"]="hoch",
["en"]="high",
- ["fr"]="haut",
+ ["fr"]="exp",
["it"]="alto",
["nl"]="hoog",
["pe"]="بلند",
@@ -14081,7 +15973,7 @@ return {
["cs"]="horizontalne",
["de"]="horizontal",
["en"]="horizontal",
- ["fr"]="horizontale",
+ ["fr"]="horizontal",
["it"]="orizzontale",
["nl"]="horizontaal",
["pe"]="افقی",
@@ -14091,7 +15983,7 @@ return {
["cs"]="hyphenated",
["de"]="hyphenate",
["en"]="hyphenated",
- ["fr"]="hyphenated",
+ ["fr"]="aveccesure",
["it"]="sillabato",
["nl"]="afgebroken",
["pe"]="شکسته",
@@ -14141,7 +16033,7 @@ return {
["cs"]="inherit",
["de"]="inherit",
["en"]="inherit",
- ["fr"]="herite",
+ ["fr"]="heriter",
["it"]="inherit",
["nl"]="erf",
["pe"]="ارث‌بردن",
@@ -14151,7 +16043,7 @@ return {
["cs"]="ininner",
["de"]="ininner",
["en"]="ininner",
- ["fr"]="ininner",
+ ["fr"]="dansinterieur",
["it"]="ininner",
["nl"]="inbinnen",
["pe"]="درداخلی",
@@ -14159,9 +16051,11 @@ return {
},
["ininneredge"]={
["en"]="ininneredge",
+ ["fr"]="dansbordinterieur",
},
["ininnermargin"]={
["en"]="ininnermargin",
+ ["fr"]="dansmargeinterieure",
},
["inleft"]={
["cs"]="ivlevo",
@@ -14195,6 +16089,7 @@ return {
},
["inline"]={
["en"]="inline",
+ ["fr"]="enligne",
},
["inmargin"]={
["cs"]="naokraji",
@@ -14240,7 +16135,7 @@ return {
["cs"]="inother",
["de"]="inother",
["en"]="inother",
- ["fr"]="inother",
+ ["fr"]="dansautre",
["it"]="inother",
["nl"]="inandere",
["pe"]="inother",
@@ -14250,7 +16145,7 @@ return {
["cs"]="inouter",
["de"]="inouter",
["en"]="inouter",
- ["fr"]="inouter",
+ ["fr"]="dansexterieur",
["it"]="inouter",
["nl"]="inbuiten",
["pe"]="درخارجی",
@@ -14258,15 +16153,17 @@ return {
},
["inouteredge"]={
["en"]="inouteredge",
+ ["fr"]="dansbordexterieur",
},
["inoutermargin"]={
["en"]="inoutermargin",
+ ["fr"]="dansmargeexterieure",
},
["inright"]={
["cs"]="ivpravo",
["de"]="imrechten",
["en"]="inright",
- ["fr"]="dansdroit",
+ ["fr"]="dansdroite",
["it"]="indestra",
["nl"]="inrechter",
["pe"]="درون‌راست",
@@ -14294,6 +16191,7 @@ return {
},
["integral"]={
["en"]="integral",
+ ["fr"]="integrale",
},
["interaction"]={
["cs"]="interakce",
@@ -14317,12 +16215,13 @@ return {
},
["interactive"]={
["en"]="interactive",
+ ["fr"]="interactif",
},
["intermezzi"]={
["cs"]="intermezzi",
["de"]="intermezzi",
["en"]="intermezzi",
- ["fr"]="intermezzi",
+ ["fr"]="interludes",
["it"]="intermezzi",
["nl"]="intermezzos",
["pe"]="میان‌پرده‌ها",
@@ -14332,7 +16231,7 @@ return {
["cs"]="intermezzo",
["de"]="intermezzo",
["en"]="intermezzo",
- ["fr"]="intermezzo",
+ ["fr"]="interlude",
["it"]="intermezzo",
["nl"]="intermezzo",
["pe"]="میان‌پرده",
@@ -14348,10 +16247,6 @@ return {
["pe"]="درون‌متن",
["ro"]="intext",
},
- ["headintext"]={
- ["en"]="headintext",
- ["nl"]="kopintekst",
- },
["intro"]={
["cs"]="uvod",
["de"]="intro",
@@ -14362,6 +16257,9 @@ return {
["pe"]="پیشگفتار",
["ro"]="intro",
},
+ ["invertedshort"]={
+ ["en"]="invertedshort",
+ },
["italic"]={
["cs"]="kurziva",
["de"]="italic",
@@ -14376,7 +16274,7 @@ return {
["cs"]="kurzivnitucne",
["de"]="italicfett",
["en"]="italicbold",
- ["fr"]="grasitalique",
+ ["fr"]="italiquegras",
["it"]="corsivograssetto",
["nl"]="italicvet",
["pe"]="مشکی‌ایتالیک",
@@ -14386,7 +16284,7 @@ return {
["cs"]="polozka",
["de"]="pos",
["en"]="item",
- ["fr"]="element",
+ ["fr"]="élément",
["it"]="elemento",
["nl"]="som",
["pe"]="آیتم",
@@ -14396,7 +16294,7 @@ return {
["cs"]="vycet",
["de"]="aufzaehlung",
["en"]="itemize",
- ["fr"]="lister",
+ ["fr"]="détailler",
["it"]="elenco",
["nl"]="opsomming",
["pe"]="آیتم‌بندی",
@@ -14406,7 +16304,7 @@ return {
["cs"]="pol",
["de"]="its",
["en"]="its",
- ["fr"]="its",
+ ["fr"]="els",
["it"]="its",
["nl"]="its",
["pe"]="آیم",
@@ -14426,16 +16324,12 @@ return {
["cs"]="spojeno",
["de"]="keinabstand",
["en"]="joinedup",
- ["fr"]="joinedup",
+ ["fr"]="sansespaceentre",
["it"]="unito",
["nl"]="aansluitend",
["pe"]="متصل‌بالا",
["ro"]="unit",
},
- ["notjoinedup"]={
- ["en"]="notjoinedup",
- ["nl"]="nietaansluitend",
- },
["july"]={
["cs"]="cervenec",
["de"]="juli",
@@ -14460,7 +16354,7 @@ return {
["cs"]="drzet",
["de"]="behalte",
["en"]="keep",
- ["fr"]="maintient",
+ ["fr"]="conserver",
["it"]="mantieni",
["nl"]="handhaaf",
["pe"]="نگهدار",
@@ -14468,6 +16362,7 @@ return {
},
["kerncharacters"]={
["en"]="kerncharacters",
+ ["fr"]="approchercaracteres",
},
["knockout"]={
["cs"]="knockout",
@@ -14533,7 +16428,7 @@ return {
["cs"]="lastpagenumber",
["de"]="lastpagenumber",
["en"]="lastpagenumber",
- ["fr"]="derniernumeropage",
+ ["fr"]="numerodenierepage",
["it"]="lastpagenumber",
["nl"]="laatstepaginanummer",
["pe"]="شماه‌صفحه‌آخر",
@@ -14553,7 +16448,7 @@ return {
["cs"]="layer",
["de"]="layer",
["en"]="layer",
- ["fr"]="layer",
+ ["fr"]="calque",
["it"]="layer",
["nl"]="layer",
["pe"]="layer",
@@ -14583,7 +16478,7 @@ return {
["cs"]="lefthanging",
["de"]="lefthanging",
["en"]="lefthanging",
- ["fr"]="lefthanging",
+ ["fr"]="suspensiongauche",
["it"]="lefthanging",
["nl"]="linkshangend",
["pe"]="آویزان‌چپ",
@@ -14603,7 +16498,7 @@ return {
["cs"]="levastranka",
["de"]="linkerseite",
["en"]="leftpage",
- ["fr"]="pagegauche",
+ ["fr"]="surpagegauche",
["it"]="paginasinistra",
["nl"]="linkerpagina",
["pe"]="صفحه‌چپ",
@@ -14613,7 +16508,7 @@ return {
["cs"]="lefttoright",
["de"]="lefttoright",
["en"]="lefttoright",
- ["fr"]="lefttoright",
+ ["fr"]="gaucheadroite",
["it"]="lefttoright",
["nl"]="lefttoright",
["pe"]="lefttoright",
@@ -14631,13 +16526,14 @@ return {
},
["less"]={
["en"]="less",
+ ["fr"]="moins",
["nl"]="minder",
},
["lesshyphenation"]={
["cs"]="lesshyphenation",
["de"]="lesshyphenation",
["en"]="lesshyphenation",
- ["fr"]="lesshyphenation",
+ ["fr"]="moinsdecesure",
["it"]="lesshyphenation",
["nl"]="lesshyphenation",
["pe"]="شکست‌کلمات‌کمتر",
@@ -14645,6 +16541,7 @@ return {
},
["letterspacing"]={
["en"]="letterspacing",
+ ["fr"]="espacementlettre",
},
["line"]={
["cs"]="radek",
@@ -14678,6 +16575,7 @@ return {
},
["linked"]={
["en"]="linked",
+ ["fr"]="lie",
},
["list"]={
["cs"]="seznam",
@@ -14703,7 +16601,7 @@ return {
["cs"]="lokalnihoprostredi",
["de"]="lokaleumgebung",
["en"]="localenvironment",
- ["fr"]="environementlocal",
+ ["fr"]="environnementlocal",
["it"]="ambientelocale",
["nl"]="deelomgeving",
["pe"]="محیط‌موضعی",
@@ -14733,7 +16631,7 @@ return {
["cs"]="nivy",
["de"]="hoti",
["en"]="lohi",
- ["fr"]="baha",
+ ["fr"]="inex",
["it"]="pedap",
["nl"]="laho",
["pe"]="پابا",
@@ -14741,12 +16639,13 @@ return {
},
["long"]={
["en"]="long",
+ ["fr"]="long",
},
["loose"]={
["cs"]="uvolnene",
["de"]="lose",
["en"]="loose",
- ["fr"]="perte",
+ ["fr"]="envrac",
["it"]="lento",
["nl"]="los",
["pe"]="شل",
@@ -14756,7 +16655,7 @@ return {
["cs"]="nizko",
["de"]="tief",
["en"]="low",
- ["fr"]="bas",
+ ["fr"]="ind",
["it"]="basso",
["nl"]="laag",
["pe"]="پایین",
@@ -14776,7 +16675,7 @@ return {
["cs"]="zlom",
["de"]="umbruch",
["en"]="makeup",
- ["fr"]="makeup",
+ ["fr"]="composition",
["it"]="makeup",
["nl"]="opmaak",
["pe"]="آرایش",
@@ -14786,7 +16685,7 @@ return {
["cs"]="mar",
["de"]="mar",
["en"]="mar",
- ["fr"]="mar",
+ ["fr"]="rem",
["it"]="mar",
["nl"]="mar",
["pe"]="حاش",
@@ -14816,7 +16715,7 @@ return {
["cs"]="textovahrana",
["de"]="marginalkante",
["en"]="marginedge",
- ["fr"]="bordmarge",
+ ["fr"]="margebord",
["it"]="bordomargine",
["nl"]="kantlijn",
["pe"]="لبه‌حاشیه",
@@ -14854,12 +16753,13 @@ return {
},
["math"]={
["en"]="math",
+ ["fr"]="math",
},
["mathalignment"]={
["cs"]="mathalignment",
["de"]="mathalignment",
["en"]="mathalignment",
- ["fr"]="mathalignment",
+ ["fr"]="alignementmath",
["it"]="mathalignment",
["nl"]="wiskundeuitlijnen",
["pe"]="تنظیم‌ریاضی",
@@ -14869,7 +16769,7 @@ return {
["cs"]="mathcases",
["de"]="mathcases",
["en"]="mathcases",
- ["fr"]="mathcases",
+ ["fr"]="casmath",
["it"]="mathcases",
["nl"]="mathcases",
["pe"]="حالتهای‌ریاضی",
@@ -14879,7 +16779,7 @@ return {
["cs"]="mathematika",
["de"]="mathematik",
["en"]="mathematics",
- ["fr"]="mathematique",
+ ["fr"]="mathematics",
["it"]="matematica",
["nl"]="wiskunde",
["pe"]="ریاضی",
@@ -14889,7 +16789,7 @@ return {
["cs"]="mathmatrix",
["de"]="mathmatrix",
["en"]="mathmatrix",
- ["fr"]="mathmatrix",
+ ["fr"]="matricemath",
["it"]="mathmatrix",
["nl"]="wiskundematrix",
["pe"]="ماتریش‌ریاضی",
@@ -14907,14 +16807,17 @@ return {
},
["maxdepth"]={
["en"]="maxdepth",
+ ["fr"]="profondeurmax",
["nl"]="maxdiepte",
},
["maxheight"]={
["en"]="maxheight",
+ ["fr"]="hauteurmax",
["nl"]="maxhoogte",
},
["maxwidth"]={
["en"]="maxwidth",
+ ["fr"]="largeurmax",
["nl"]="maxbreedte",
},
["may"]={
@@ -14969,6 +16872,7 @@ return {
},
["mindepth"]={
["en"]="mindepth",
+ ["fr"]="profondeurmin",
["nl"]="mindiepte",
},
["minheight"]={
@@ -15003,6 +16907,7 @@ return {
},
["mixed"]={
["en"]="mixed",
+ ["fr"]="mixte",
},
["monday"]={
["cs"]="pondeli",
@@ -15036,6 +16941,7 @@ return {
},
["mononormal"]={
["en"]="mononormal",
+ ["fr"]="normalmono",
},
["month"]={
["cs"]="mesic",
@@ -15049,13 +16955,14 @@ return {
},
["more"]={
["en"]="more",
+ ["fr"]="plus",
["nl"]="meer",
},
["morehyphenation"]={
["cs"]="morehyphenation",
["de"]="morehyphenation",
["en"]="morehyphenation",
- ["fr"]="morehyphenation",
+ ["fr"]="plusdecesure",
["it"]="morehyphenation",
["nl"]="morehyphenation",
["pe"]="شکست‌کلمات‌بیشتر",
@@ -15115,7 +17022,7 @@ return {
["cs"]="dalsi",
["de"]="folgende",
["en"]="next",
- ["fr"]="prochain",
+ ["fr"]="suivant",
["it"]="successivo",
["nl"]="volgende",
["pe"]="بعدی",
@@ -15161,6 +17068,16 @@ return {
["pe"]="زیرصفحه‌بعدی",
["ro"]="urmatoareasubpagina",
},
+ ["nine"]={
+ ["cs"]="nine",
+ ["de"]="neun",
+ ["en"]="nine",
+ ["fr"]="neuf",
+ ["it"]="nine",
+ ["nl"]="negen",
+ ["pe"]="nine",
+ ["ro"]="nine",
+ },
["no"]={
["cs"]="ne",
["de"]="nein",
@@ -15175,7 +17092,7 @@ return {
["cs"]="nocheck",
["de"]="nocheck",
["en"]="nocheck",
- ["fr"]="nonverifie",
+ ["fr"]="sansverifier",
["it"]="nocheck",
["nl"]="geencontrole",
["pe"]="بدون‌بررسی",
@@ -15183,12 +17100,13 @@ return {
},
["nodepth"]={
["en"]="nodepth",
+ ["fr"]="sansprodondeur",
},
["nofit"]={
["cs"]="nofit",
["de"]="nofit",
["en"]="nofit",
- ["fr"]="nofit",
+ ["fr"]="sansadapter",
["it"]="nofit",
["nl"]="nietpassend",
["pe"]="بدون‌پرکردن",
@@ -15198,7 +17116,7 @@ return {
["cs"]="nogrid",
["de"]="nogrid",
["en"]="nogrid",
- ["fr"]="nogrid",
+ ["fr"]="sansgrille",
["it"]="nogrid",
["nl"]="geengrid",
["pe"]="بدون‌توری",
@@ -15206,12 +17124,13 @@ return {
},
["noheight"]={
["en"]="noheight",
+ ["fr"]="sanshauteur",
},
["nohz"]={
["cs"]="nohz",
["de"]="nohz",
["en"]="nohz",
- ["fr"]="nohz",
+ ["fr"]="sanshz",
["it"]="nohz",
["nl"]="geenhz",
["pe"]="nohz",
@@ -15219,6 +17138,7 @@ return {
},
["noline"]={
["en"]="noline",
+ ["fr"]="sansligne",
},
["nomarking"]={
["cs"]="zadneznaceni",
@@ -15232,13 +17152,14 @@ return {
},
["nomenubar"]={
["en"]="nomenubar",
+ ["fr"]="sansbarremenu",
["nl"]="geenmenubalk",
},
["none"]={
["cs"]="zadny",
["de"]="kein",
["en"]="none",
- ["fr"]="rien",
+ ["fr"]="aucun",
["it"]="nessuno",
["nl"]="geen",
["pe"]="هیچکدام",
@@ -15256,6 +17177,7 @@ return {
},
["norepeat"]={
["en"]="norepeat",
+ ["fr"]="sansrepetition",
},
["normal"]={
["cs"]="normalni",
@@ -15267,6 +17189,9 @@ return {
["pe"]="نرمال",
["ro"]="normal",
},
+ ["normalshort"]={
+ ["en"]="normalshort",
+ },
["nospacing"]={
["cs"]="nospacing",
["de"]="nospacing",
@@ -15277,6 +17202,11 @@ return {
["pe"]="بدون‌فضاگذاری",
["ro"]="nospacing",
},
+ ["nostopper"]={
+ ["en"]="nostopper",
+ ["fr"]="sansstoppeur",
+ ["nl"]="geenafsluiter",
+ },
["not"]={
["cs"]="ne",
["de"]="nicht",
@@ -15289,15 +17219,17 @@ return {
},
["notation"]={
["en"]="notation",
+ ["fr"]="notation",
},
["note"]={
["en"]="note",
+ ["fr"]="note",
},
["nothanging"]={
["cs"]="nothanging",
["de"]="nothanging",
["en"]="nothanging",
- ["fr"]="nonsuspendu",
+ ["fr"]="sanssuspension",
["it"]="nonsospeso",
["nl"]="niethangend",
["pe"]="بدون‌آویزان‌کردن",
@@ -15307,12 +17239,17 @@ return {
["cs"]="nothyphenated",
["de"]="nothyphenated",
["en"]="nothyphenated",
- ["fr"]="nothyphenated",
+ ["fr"]="sanscesure",
["it"]="nonsillabato",
["nl"]="nietafgebroken",
["pe"]="بدون‌شکست",
["ro"]="nedespsilabe",
},
+ ["notjoinedup"]={
+ ["en"]="notjoinedup",
+ ["fr"]="passansespaceentre",
+ ["nl"]="nietaansluitend",
+ },
["november"]={
["cs"]="listopad",
["de"]="november",
@@ -15327,7 +17264,7 @@ return {
["cs"]="nikde",
["de"]="nirgens",
["en"]="nowhere",
- ["fr"]="nulpart",
+ ["fr"]="nullepart",
["it"]="danessunaparte",
["nl"]="nergens",
["pe"]="هیچ‌حا",
@@ -15387,7 +17324,7 @@ return {
["cs"]="vyp",
["de"]="aus",
["en"]="off",
- ["fr"]="desactive",
+ ["fr"]="arret",
["it"]="disattivo",
["nl"]="uit",
["pe"]="خاموش",
@@ -15397,7 +17334,7 @@ return {
["cs"]="offset",
["de"]="offset",
["en"]="offset",
- ["fr"]="offset",
+ ["fr"]="decalage",
["it"]="offset",
["nl"]="offset",
["pe"]="آفست",
@@ -15407,7 +17344,7 @@ return {
["cs"]="old",
["de"]="old",
["en"]="old",
- ["fr"]="old",
+ ["fr"]="ancien",
["it"]="old",
["nl"]="oud",
["pe"]="قدیمی",
@@ -15415,15 +17352,13 @@ return {
},
["oldstyle"]={
["en"]="oldstyle",
- },
- ["fractions"]={
- ["en"]="fractions",
+ ["fr"]="styleancien",
},
["on"]={
["cs"]="zap",
["de"]="an",
["en"]="on",
- ["fr"]="actif",
+ ["fr"]="marche",
["it"]="attivo",
["nl"]="aan",
["pe"]="روی",
@@ -15443,12 +17378,16 @@ return {
["cs"]="naproti",
["de"]="gegenueber",
["en"]="opposite",
- ["fr"]="opposition",
+ ["fr"]="enface",
["it"]="opposto",
["nl"]="naast",
["pe"]="مخالف",
["ro"]="opus",
},
+ ["ordinal"]={
+ ["en"]="ordinal",
+ ["fr"]="ordinal",
+ },
["outer"]={
["cs"]="vnejsi",
["de"]="aussen",
@@ -15483,7 +17422,7 @@ return {
["cs"]="nadtrzeno",
["de"]="ueberstrichen",
["en"]="overbar",
- ["fr"]="overbar",
+ ["fr"]="surligner",
["it"]="sopralinea",
["nl"]="overstreep",
["pe"]="میله‌رو",
@@ -15493,7 +17432,7 @@ return {
["cs"]="nadtrzeni",
["de"]="ueberstreichen",
["en"]="overbars",
- ["fr"]="overbars",
+ ["fr"]="surlignermots",
["it"]="sopralinee",
["nl"]="overstrepen",
["pe"]="میله‌ها‌رو",
@@ -15503,7 +17442,7 @@ return {
["cs"]="prekryv",
["de"]="overlay",
["en"]="overlay",
- ["fr"]="revetement",
+ ["fr"]="superposition",
["it"]="sovrapponi",
["nl"]="overlay",
["pe"]="پوشش",
@@ -15513,7 +17452,7 @@ return {
["cs"]="overprint",
["de"]="overprint",
["en"]="overprint",
- ["fr"]="overprint",
+ ["fr"]="surimpression",
["it"]="overprint",
["nl"]="overprint",
["pe"]="overprint",
@@ -15523,7 +17462,7 @@ return {
["cs"]="preskrtnuto",
["de"]="durchgestrichen",
["en"]="overstrike",
- ["fr"]="surlignetout",
+ ["fr"]="barrer",
["it"]="sbarrato",
["nl"]="doorstreep",
["pe"]="خط‌زدن",
@@ -15533,7 +17472,7 @@ return {
["cs"]="preskrtnuti",
["de"]="durchstreichen",
["en"]="overstrikes",
- ["fr"]="surligne",
+ ["fr"]="barrermots",
["it"]="sbarrati",
["nl"]="doorstrepen",
["pe"]="خط‌زدنها",
@@ -15543,7 +17482,7 @@ return {
["cs"]="zhustene",
["de"]="gepackt",
["en"]="packed",
- ["fr"]="groupe",
+ ["fr"]="sansespaceentreitem",
["it"]="impaccato",
["nl"]="opelkaar",
["pe"]="فشرده",
@@ -15623,7 +17562,7 @@ return {
["cs"]="odlozit",
["de"]="verschieben",
["en"]="postponing",
- ["fr"]="postponing",
+ ["fr"]="report",
["it"]="posporre",
["nl"]="uitstellen",
["pe"]="تاخیر",
@@ -15641,6 +17580,7 @@ return {
},
["precedingpage"]={
["en"]="precedingpage",
+ ["fr"]="pageantecedent",
["nl"]="voorafgaandepagina",
},
["preference"]={
@@ -15657,7 +17597,7 @@ return {
["cs"]="nahled",
["de"]="vorschau",
["en"]="preview",
- ["fr"]="previsualisation",
+ ["fr"]="apercu",
["it"]="anteprima",
["nl"]="preview",
["pe"]="پیش‌دید",
@@ -15715,13 +17655,14 @@ return {
},
["print"]={
["en"]="print",
+ ["fr"]="imprimer",
["nl"]="print",
},
["printable"]={
["cs"]="tisknutelne",
["de"]="druckbar",
["en"]="printable",
- ["fr"]="editable",
+ ["fr"]="imprimable",
["it"]="stampabile",
["nl"]="printbaar",
["pe"]="قابل‌چاپ",
@@ -15731,7 +17672,7 @@ return {
["cs"]="process",
["de"]="process",
["en"]="process",
- ["fr"]="process",
+ ["fr"]="traiter",
["it"]="process",
["nl"]="proces",
["pe"]="پردازش",
@@ -15789,6 +17730,7 @@ return {
},
["quarterline"]={
["en"]="quarterline",
+ ["fr"]="quartdeligne",
["nl"]="kwartregel",
},
["quotation"]={
@@ -15815,7 +17757,7 @@ return {
["cs"]="rozsah",
["de"]="ran",
["en"]="ran",
- ["fr"]="cours",
+ ["fr"]="gam",
["it"]="corse",
["nl"]="ran",
["pe"]="برد",
@@ -15865,12 +17807,17 @@ return {
["cs"]="znacka",
["de"]="merkmal",
["en"]="referral",
- ["fr"]="referral",
+ ["fr"]="redirection",
["it"]="referral",
["nl"]="kenmerk",
["pe"]="مراجعه",
["ro"]="referinta",
},
+ ["region"]={
+ ["en"]="region",
+ ["fr"]="region",
+ ["nl"]="gebied",
+ },
["register"]={
["cs"]="rejstrik",
["de"]="register",
@@ -15885,7 +17832,7 @@ return {
["cs"]="pravidelne",
["de"]="regular",
["en"]="regular",
- ["fr"]="regulier",
+ ["fr"]="ordinaire",
["it"]="regolare",
["nl"]="regular",
["pe"]="منظم",
@@ -15905,7 +17852,7 @@ return {
["cs"]="opakovat",
["de"]="wiederholen",
["en"]="repeat",
- ["fr"]="repete",
+ ["fr"]="repeter",
["it"]="ripeti",
["nl"]="herhaal",
["pe"]="تکرار",
@@ -15915,7 +17862,7 @@ return {
["cs"]="pozadovane",
["de"]="obligatorisch",
["en"]="required",
- ["fr"]="recquis",
+ ["fr"]="requis",
["it"]="richiestp",
["nl"]="verplicht",
["pe"]="موردنیاز",
@@ -15935,7 +17882,7 @@ return {
["cs"]="reverse",
["de"]="reverse",
["en"]="reverse",
- ["fr"]="inverse",
+ ["fr"]="inverser",
["it"]="invertito",
["nl"]="omgekeerd",
["pe"]="برعکس",
@@ -15965,7 +17912,7 @@ return {
["cs"]="righthanging",
["de"]="righthanging",
["en"]="righthanging",
- ["fr"]="righthanging",
+ ["fr"]="suspensiondroite",
["it"]="righthanging",
["nl"]="rechtshangend",
["pe"]="آویزان‌کردن‌راست",
@@ -15985,7 +17932,7 @@ return {
["cs"]="pravastranka",
["de"]="rechterseite",
["en"]="rightpage",
- ["fr"]="pagedroite",
+ ["fr"]="surpagedroite",
["it"]="paginadestra",
["nl"]="rechterpagina",
["pe"]="صفحه‌راست",
@@ -15995,7 +17942,7 @@ return {
["cs"]="righttoleft",
["de"]="righttoleft",
["en"]="righttoleft",
- ["fr"]="righttoleft",
+ ["fr"]="droiteagauche",
["it"]="righttoleft",
["nl"]="righttoleft",
["pe"]="righttoleft",
@@ -16005,7 +17952,7 @@ return {
["cs"]="antikva",
["de"]="antiqua",
["en"]="roman",
- ["fr"]="roman",
+ ["fr"]="romain",
["it"]="roman",
["nl"]="romaan",
["pe"]="رومن",
@@ -16025,7 +17972,7 @@ return {
["cs"]="otoc",
["de"]="drehe",
["en"]="rotate",
- ["fr"]="oriente",
+ ["fr"]="tourner",
["it"]="ruota",
["nl"]="roteer",
["pe"]="دوران",
@@ -16065,7 +18012,7 @@ return {
["cs"]="linka",
["de"]="linie",
["en"]="rule",
- ["fr"]="regle",
+ ["fr"]="trait",
["it"]="linea",
["nl"]="lijn",
["pe"]="خط",
@@ -16095,7 +18042,7 @@ return {
["cs"]="sanstucne",
["de"]="sansfett",
["en"]="sansbold",
- ["fr"]="sansgras",
+ ["fr"]="sansserifbold",
["it"]="sansgrassetto",
["nl"]="sansvet",
["pe"]="مشکی‌سانز",
@@ -16103,6 +18050,7 @@ return {
},
["sansnormal"]={
["en"]="sansnormal",
+ ["fr"]="normalsans",
},
["sansserif"]={
["cs"]="bezserifu",
@@ -16148,7 +18096,7 @@ return {
["cs"]="sectionblockenvironment",
["de"]="sectionblockenvironment",
["en"]="sectionblockenvironment",
- ["fr"]="environementblocsection",
+ ["fr"]="environnementblocsection",
["it"]="ambientebloccosezione",
["nl"]="sectieblokomgeving",
["pe"]="محیط‌بلوک‌بخش",
@@ -16168,7 +18116,7 @@ return {
["cs"]="viz",
["de"]="sieh",
["en"]="see",
- ["fr"]="voit",
+ ["fr"]="voir",
["it"]="vedi",
["nl"]="zie",
["pe"]="ببینید",
@@ -16176,9 +18124,11 @@ return {
},
["selectfont"]={
["en"]="selectfont",
+ ["fr"]="selectionnerpolice",
},
["separator"]={
["en"]="separator",
+ ["fr"]="separateur",
["nl"]="scheider",
},
["september"]={
@@ -16203,29 +18153,40 @@ return {
},
["serifbold"]={
["en"]="serifbold",
+ ["fr"]="serifgras",
},
["serifnormal"]={
["en"]="serifnormal",
+ ["fr"]="serifnormal",
},
["serried"]={
["cs"]="semknuto",
["de"]="kleinerabstand",
["en"]="serried",
- ["fr"]="serried",
+ ["fr"]="serre",
["it"]="vicino",
["nl"]="aanelkaar",
["pe"]="تنگ‌هم",
["ro"]="serried",
},
["setups"]={
- ["comment"]="no translations",
["en"]="setups",
},
+ ["seven"]={
+ ["cs"]="seven",
+ ["de"]="sieben",
+ ["en"]="seven",
+ ["fr"]="sept",
+ ["it"]="seven",
+ ["nl"]="zeven",
+ ["pe"]="seven",
+ ["ro"]="seven",
+ },
["sheet"]={
["cs"]="sheet",
["de"]="sheet",
["en"]="sheet",
- ["fr"]="sheet",
+ ["fr"]="feuille",
["it"]="sheet",
["nl"]="sheet",
["pe"]="ورقه",
@@ -16233,24 +18194,28 @@ return {
},
["shiftdown"]={
["en"]="shiftdown",
+ ["fr"]="decalerenbas",
},
["shiftup"]={
["en"]="shiftup",
+ ["fr"]="decalerenhaut",
},
["short"]={
["cs"]="short",
["de"]="kurz",
["en"]="short",
- ["fr"]="short",
+ ["fr"]="court",
["it"]="short",
["nl"]="kort",
["ro"]="short",
},
["simplefonts"]={
["en"]="simplefonts",
+ ["fr"]="policessimple",
},
["simplelist"]={
["en"]="simplelist",
+ ["fr"]="listesimple",
},
["singlesided"]={
["cs"]="jednostranne",
@@ -16262,6 +18227,16 @@ return {
["pe"]="یک‌رو",
["ro"]="ofata",
},
+ ["six"]={
+ ["cs"]="six",
+ ["de"]="sechs",
+ ["en"]="six",
+ ["fr"]="six",
+ ["it"]="six",
+ ["nl"]="zes",
+ ["pe"]="six",
+ ["ro"]="six",
+ },
["slanted"]={
["cs"]="sklonene",
["de"]="geneigt",
@@ -16276,7 +18251,7 @@ return {
["cs"]="sklonenetucne",
["de"]="geneigtfett",
["en"]="slantedbold",
- ["fr"]="grasincline",
+ ["fr"]="inclinegras",
["it"]="inclinatograssetto",
["nl"]="schuinvet",
["pe"]="مشکی‌خوابیده",
@@ -16296,7 +18271,7 @@ return {
["cs"]="smallbodyfont",
["de"]="smallbodyfont",
["en"]="smallbodyfont",
- ["fr"]="petitepolicecorps",
+ ["fr"]="policedecorpspetite",
["it"]="piccolofontdelcorpo",
["nl"]="kleinkorps",
["pe"]="قلم‌بدنه‌کوچک",
@@ -16306,7 +18281,7 @@ return {
["cs"]="maletucne",
["de"]="kleinfett",
["en"]="smallbold",
- ["fr"]="graspetit",
+ ["fr"]="petitgras",
["it"]="piccolograssetto",
["nl"]="kleinvet",
["pe"]="مشکی‌کوچک",
@@ -16316,7 +18291,7 @@ return {
["cs"]="maletucnekurzivni",
["de"]="kleinfettitalic",
["en"]="smallbolditalic",
- ["fr"]="italiquegraspetit",
+ ["fr"]="petitgrasitalique",
["it"]="piccolograssettocorsivo",
["nl"]="kleinvetitalic",
["pe"]="ایتالیک‌مشکی‌کوچک",
@@ -16326,7 +18301,7 @@ return {
["cs"]="maletucnesklonene",
["de"]="kleinfettgeneigt",
["en"]="smallboldslanted",
- ["fr"]="inclinegraspetit",
+ ["fr"]="petitgrasincline",
["it"]="piccolograssettoinclinato",
["nl"]="kleinvetschuin",
["pe"]="خوابیده‌مشکی‌کوچک",
@@ -16336,7 +18311,7 @@ return {
["cs"]="kapitalky",
["de"]="smallcaps",
["en"]="smallcaps",
- ["fr"]="petitescapitales",
+ ["fr"]="petitescaps",
["it"]="maiuscoletto",
["nl"]="smallcaps",
["pe"]="smallcaps",
@@ -16344,13 +18319,14 @@ return {
},
["smaller"]={
["en"]="smaller",
+ ["fr"]="pluspetit",
["nl"]="kleiner",
},
["smallitalic"]={
["cs"]="malekurzivni",
["de"]="kleinitalic",
["en"]="smallitalic",
- ["fr"]="italiquepetit",
+ ["fr"]="petititalique",
["it"]="piccolocorsivo",
["nl"]="kleinitalic",
["pe"]="ایتالیک‌کوچک",
@@ -16360,7 +18336,7 @@ return {
["cs"]="malekurzivnitucne",
["de"]="kleinitalicfett",
["en"]="smallitalicbold",
- ["fr"]="grasitaliquepetit",
+ ["fr"]="petititaliquegras",
["it"]="piccolocorsivograssetto",
["nl"]="kleinitalicvet",
["pe"]="مشکی‌ایتالیک‌کوچک",
@@ -16370,7 +18346,7 @@ return {
["cs"]="malenormalni",
["de"]="kleinnormal",
["en"]="smallnormal",
- ["fr"]="normalpetit",
+ ["fr"]="petitnormal",
["it"]="piccolonormale",
["nl"]="kleinnormaal",
["pe"]="نرمال‌کوچک",
@@ -16380,7 +18356,7 @@ return {
["cs"]="malesklonene",
["de"]="kleingeneigt",
["en"]="smallslanted",
- ["fr"]="inclinepetit",
+ ["fr"]="petitincline",
["it"]="piccoloinclinato",
["nl"]="kleinschuin",
["pe"]="خوابیده‌کوچک",
@@ -16390,7 +18366,7 @@ return {
["cs"]="malesklonenetucne",
["de"]="kleingeneigtfett",
["en"]="smallslantedbold",
- ["fr"]="grasinclinepetit",
+ ["fr"]="petitinclinegras",
["it"]="piccoloinclinatograssetto",
["nl"]="kleinschuinvet",
["pe"]="مشکی‌خوابیده‌کوچک",
@@ -16400,7 +18376,7 @@ return {
["cs"]="maletype",
["de"]="kleintippen",
["en"]="smalltype",
- ["fr"]="petittype",
+ ["fr"]="petitcaractere",
["it"]="piccolotype",
["nl"]="kleintype",
["pe"]="تایپ‌کوچک",
@@ -16428,6 +18404,7 @@ return {
},
["sorting"]={
["en"]="sorting",
+ ["fr"]="tri",
},
["space"]={
["cs"]="mezera",
@@ -16463,7 +18440,7 @@ return {
["cs"]="split",
["de"]="split",
["en"]="split",
- ["fr"]="split",
+ ["fr"]="partager",
["it"]="separa",
["nl"]="splitsen",
["pe"]="شکافتن",
@@ -16473,7 +18450,7 @@ return {
["cs"]="spot",
["de"]="spot",
["en"]="spot",
- ["fr"]="spot",
+ ["fr"]="tondirect",
["it"]="spot",
["nl"]="spot",
["pe"]="لکه",
@@ -16493,7 +18470,7 @@ return {
["cs"]="start",
["de"]="start",
["en"]="start",
- ["fr"]="demarre",
+ ["fr"]="activé",
["it"]="inizia",
["nl"]="start",
["pe"]="شروع",
@@ -16501,13 +18478,14 @@ return {
},
["starter"]={
["en"]="starter",
+ ["fr"]="demarreur",
["nl"]="opener",
},
["sticker"]={
["cs"]="sticker",
["de"]="sticker",
["en"]="sticker",
- ["fr"]="sticker",
+ ["fr"]="autocollant",
["it"]="sticker",
["nl"]="sticker",
["pe"]="دشنه",
@@ -16517,7 +18495,7 @@ return {
["cs"]="stop",
["de"]="stop",
["en"]="stop",
- ["fr"]="stoppe",
+ ["fr"]="fin",
["it"]="termina",
["nl"]="stop",
["pe"]="پایان",
@@ -16527,21 +18505,17 @@ return {
["cs"]="predel",
["de"]="trenner",
["en"]="stopper",
- ["fr"]="stopper",
+ ["fr"]="stoppeur",
["it"]="stopper",
["nl"]="afsluiter",
["pe"]="ایست",
["ro"]="stopper",
},
- ["nostopper"]={
- ["en"]="nostopper",
- ["nl"]="geenafsluiter",
- },
["stretch"]={
["cs"]="natahnout",
["de"]="strecken",
["en"]="stretch",
- ["fr"]="etire",
+ ["fr"]="etirer",
["it"]="dilata",
["nl"]="rek",
["pe"]="بکش",
@@ -16549,6 +18523,7 @@ return {
},
["stretched"]={
["en"]="stretched",
+ ["fr"]="etire",
},
["strict"]={
["cs"]="striktni",
@@ -16564,7 +18539,7 @@ return {
["cs"]="strong",
["de"]="strong",
["en"]="strong",
- ["fr"]="strong",
+ ["fr"]="fort",
["it"]="strong",
["nl"]="sterk",
["pe"]="محکم",
@@ -16574,7 +18549,7 @@ return {
["cs"]="strut",
["de"]="strut",
["en"]="strut",
- ["fr"]="strut",
+ ["fr"]="entretoise",
["it"]="strut",
["nl"]="strut",
["pe"]="بست",
@@ -16594,7 +18569,7 @@ return {
["cs"]="podzpet",
["de"]="unterrueckwaerts",
["en"]="subbackward",
- ["fr"]="sousretourarriere",
+ ["fr"]="petitenarriere",
["it"]="sottoindietro",
["nl"]="subachteruit",
["pe"]="زیرعقب‌گرد",
@@ -16604,7 +18579,7 @@ return {
["cs"]="subrovnice",
["de"]="subformel",
["en"]="subformula",
- ["fr"]="subformule",
+ ["fr"]="sousformule",
["it"]="subformula",
["nl"]="subformule",
["pe"]="زیرفرمول",
@@ -16614,7 +18589,7 @@ return {
["cs"]="podvpred",
["de"]="untervorwaerts",
["en"]="subforward",
- ["fr"]="sousavance",
+ ["fr"]="petitenavant",
["it"]="sottoavanti",
["nl"]="subvooruit",
["pe"]="زیرجلوگرد",
@@ -16642,6 +18617,7 @@ return {
},
["subs"]={
["en"]="subs",
+ ["fr"]="subs",
},
["subsection"]={
["cs"]="podsekce",
@@ -16867,7 +18843,7 @@ return {
["cs"]="synchronize",
["de"]="synchronize",
["en"]="synchronize",
- ["fr"]="synchronize",
+ ["fr"]="synchroniser",
["it"]="synchronize",
["nl"]="synchroniseer",
["pe"]="تطابق",
@@ -16875,6 +18851,7 @@ return {
},
["synonym"]={
["en"]="synonym",
+ ["fr"]="synonyme",
},
["system"]={
["cs"]="system",
@@ -16890,7 +18867,7 @@ return {
["cs"]="tabulka",
["de"]="tabelle",
["en"]="table",
- ["fr"]="tableau",
+ ["fr"]="table",
["it"]="tabella",
["nl"]="tabel",
["pe"]="جدول",
@@ -16920,7 +18897,7 @@ return {
["cs"]="konectabulky",
["de"]="tabellenende",
["en"]="tabletail",
- ["fr"]="queuetableau",
+ ["fr"]="queuetable",
["it"]="codatabella",
["nl"]="tabelstaart",
["pe"]="دنباله‌جدول",
@@ -16930,7 +18907,7 @@ return {
["cs"]="tabelator",
["de"]="tabulator",
["en"]="tabulate",
- ["fr"]="tabule",
+ ["fr"]="tabulation",
["it"]="tabulato",
["nl"]="tabulatie",
["pe"]="جدول‌بندی",
@@ -16940,7 +18917,7 @@ return {
["cs"]="tabulatehead",
["de"]="tabulatehead",
["en"]="tabulatehead",
- ["fr"]="tetetabule",
+ ["fr"]="tetetabulation",
["it"]="testatabulato",
["nl"]="tabulatiekop",
["pe"]="سرجدول‌بندی",
@@ -16950,7 +18927,7 @@ return {
["cs"]="tabulatetail",
["de"]="tabulatetail",
["en"]="tabulatetail",
- ["fr"]="queuetabule",
+ ["fr"]="queuetabulation",
["it"]="codatabulato",
["nl"]="tabulatiestaart",
["pe"]="دنباله‌جدول‌بندی",
@@ -16960,7 +18937,7 @@ return {
["cs"]="vysoko",
["de"]="lang",
["en"]="tall",
- ["fr"]="long",
+ ["fr"]="grand",
["it"]="alto",
["nl"]="lang",
["pe"]="دراز",
@@ -16970,7 +18947,7 @@ return {
["cs"]="strojopis",
["de"]="fernschreiber",
["en"]="teletype",
- ["fr"]="teletype",
+ ["fr"]="caractereterminal",
["it"]="teletype",
["nl"]="teletype",
["pe"]="دورنگاره",
@@ -17006,6 +18983,11 @@ return {
["pe"]="متن",
["ro"]="text",
},
+ ["textnote"]={
+ ["en"]="textnote",
+ ["fr"]="notetexte",
+ ["nl"]="tekstnoot",
+ },
["three"]={
["cs"]="tri",
["de"]="drei",
@@ -17028,6 +19010,7 @@ return {
},
["tight"]={
["en"]="tight",
+ ["fr"]="resserre",
["nl"]="krap",
},
["title"]={
@@ -17044,7 +19027,7 @@ return {
["cs"]="toggle",
["de"]="toggle",
["en"]="wissel",
- ["fr"]="toggle",
+ ["fr"]="basculer",
["it"]="toggle",
["nl"]="toggle",
["pe"]="تغییر",
@@ -17064,7 +19047,7 @@ return {
["cs"]="vrsek",
["de"]="oben",
["en"]="top",
- ["fr"]="sup",
+ ["fr"]="haut",
["it"]="cima",
["nl"]="boven",
["pe"]="بالا",
@@ -17104,7 +19087,7 @@ return {
["cs"]="opis",
["de"]="tippen",
["en"]="type",
- ["fr"]="type",
+ ["fr"]="transcrire",
["it"]="type",
["nl"]="type",
["pe"]="تایپ",
@@ -17114,7 +19097,7 @@ return {
["cs"]="typing",
["de"]="tippen",
["en"]="typing",
- ["fr"]="typing",
+ ["fr"]="transcription",
["it"]="typing",
["nl"]="typen",
["pe"]="تایپ‌کردن",
@@ -17134,7 +19117,7 @@ return {
["cs"]="podtrzeno",
["de"]="unterstrichen",
["en"]="underbar",
- ["fr"]="souslignetout",
+ ["fr"]="souligner",
["it"]="sottolinea",
["nl"]="onderstreep",
["pe"]="میله‌زیر",
@@ -17144,7 +19127,7 @@ return {
["cs"]="podtrzeni",
["de"]="unterstreichen",
["en"]="underbars",
- ["fr"]="sousligne",
+ ["fr"]="soulignermots",
["it"]="sottolinee",
["nl"]="onderstrepen",
["pe"]="میله‌‌های‌زیر",
@@ -17152,15 +19135,19 @@ return {
},
["understrike"]={
["en"]="understrike",
+ ["fr"]="soubarrer",
},
["understrikes"]={
["en"]="understrikes",
+ ["fr"]="soubarrermots",
},
["unframed"]={
["en"]="unframed",
+ ["fr"]="desencadre",
},
["unicode"]={
["en"]="unicode",
+ ["fr"]="unicode",
},
["unit"]={
["cs"]="jednotka",
@@ -17196,7 +19183,7 @@ return {
["cs"]="rozbalene",
["de"]="ungepackt",
["en"]="unpacked",
- ["fr"]="degroupe",
+ ["fr"]="avecespaceentreitem",
["it"]="unpacked",
["nl"]="vanelkaar",
["pe"]="غیرفشرده",
@@ -17204,6 +19191,7 @@ return {
},
["up"]={
["en"]="up",
+ ["fr"]="enhaut",
["nl"]="omhoog",
},
["url"]={
@@ -17220,7 +19208,7 @@ return {
["cs"]="uzito",
["de"]="verwende",
["en"]="used",
- ["fr"]="used",
+ ["fr"]="utilise",
["it"]="usato",
["nl"]="gebruikt",
["pe"]="استفاده‌شده",
@@ -17240,7 +19228,7 @@ return {
["cs"]="vertikalne",
["de"]="vertikal",
["en"]="vertical",
- ["fr"]="verticale",
+ ["fr"]="vertical",
["it"]="verticale",
["nl"]="vertikaal",
["pe"]="عمودی",
@@ -17278,15 +19266,17 @@ return {
},
["vfenced"]={
["en"]="vfenced",
+ ["fr"]="cloturev",
},
["vulgarfraction"]={
["en"]="vulgarfraction",
+ ["fr"]="vulgarfraction",
},
["weak"]={
["cs"]="weak",
["de"]="weak",
["en"]="weak",
- ["fr"]="weak",
+ ["fr"]="faible",
["it"]="weak",
["nl"]="zwak",
["pe"]="هفته",
@@ -17364,6 +19354,7 @@ return {
},
["words"]={
["en"]="words",
+ ["fr"]="mots",
},
["xml"]={
["cs"]="xml",
@@ -17396,597 +19387,4 @@ return {
["ro"]="da",
},
},
- ["setupstrings"]={
- ["cd:buffer"]={
- ["cs"]="buffer",
- ["de"]="buffer",
- ["en"]="buffer",
- ["fr"]="buffer",
- ["it"]="buffer",
- ["nl"]="buffer",
- ["ro"]="buffer",
- },
- ["cd:category"]={
- ["cs"]="category",
- ["de"]="category",
- ["en"]="category",
- ["fr"]="category",
- ["it"]="category",
- ["nl"]="category",
- ["ro"]="category",
- },
- ["cd:character"]={
- ["cs"]="character",
- ["de"]="character",
- ["en"]="character",
- ["fr"]="character",
- ["it"]="character",
- ["nl"]="karakter",
- ["ro"]="character",
- },
- ["cd:color"]={
- ["cs"]="color",
- ["de"]="color",
- ["en"]="color",
- ["fr"]="color",
- ["it"]="color",
- ["nl"]="kleur",
- ["ro"]="color",
- },
- ["cd:column"]={
- ["cs"]="column",
- ["de"]="column",
- ["en"]="column",
- ["fr"]="column",
- ["it"]="column",
- ["nl"]="kolom",
- ["ro"]="column",
- },
- ["cd:command"]={
- ["cs"]="Befehl",
- ["de"]="Befehl",
- ["en"]="command",
- ["fr"]="Befehl",
- ["it"]="Befehl",
- ["nl"]="commando",
- ["ro"]="Befehl",
- },
- ["cd:content"]={
- ["cs"]="content",
- ["de"]="content",
- ["en"]="content",
- ["fr"]="content",
- ["it"]="content",
- ["nl"]="inhoud",
- ["ro"]="content",
- },
- ["cd:csname"]={
- ["cs"]="csname",
- ["de"]="csname",
- ["en"]="csname",
- ["fr"]="csname",
- ["it"]="csname",
- ["nl"]="naam",
- ["ro"]="csname",
- },
- ["cd:delimiter"]={
- ["cs"]="delimiter",
- ["de"]="delimiter",
- ["en"]="delimiter",
- ["fr"]="delimiter",
- ["it"]="delimiter",
- ["nl"]="delimiter",
- ["ro"]="delimiter",
- },
- ["cd:destination"]={
- ["cs"]="destination",
- ["de"]="destination",
- ["en"]="destination",
- ["fr"]="destination",
- ["it"]="destination",
- ["nl"]="bestemming",
- ["ro"]="destination",
- },
- ["cd:dimension"]={
- ["cs"]="Dimension",
- ["de"]="Dimension",
- ["en"]="dimension",
- ["fr"]="Dimension",
- ["it"]="Dimension",
- ["nl"]="maat",
- ["ro"]="Dimension",
- },
- ["cd:displaymath"]={
- ["cs"]="formula",
- ["de"]="formula",
- ["en"]="formula",
- ["fr"]="formula",
- ["it"]="formula",
- ["nl"]="formule",
- ["ro"]="formula",
- },
- ["cd:false"]={
- ["cs"]="false",
- ["de"]="false",
- ["en"]="false",
- ["fr"]="false",
- ["it"]="false",
- ["nl"]="false",
- ["ro"]="false",
- },
- ["cd:file"]={
- ["cs"]="file",
- ["de"]="file",
- ["en"]="file",
- ["fr"]="file",
- ["it"]="file",
- ["nl"]="file",
- ["ro"]="file",
- },
- ["cd:path"]={
- ["cs"]="path",
- ["de"]="path",
- ["en"]="path",
- ["fr"]="path",
- ["it"]="path",
- ["nl"]="path",
- ["ro"]="path",
- },
- ["cd:first"]={
- ["cs"]="first",
- ["de"]="first",
- ["en"]="first",
- ["fr"]="first",
- ["it"]="first",
- ["nl"]="eerste",
- ["ro"]="first",
- },
- ["cd:font"]={
- ["cs"]="font",
- ["de"]="font",
- ["en"]="font",
- ["fr"]="font",
- ["it"]="font",
- ["nl"]="font",
- ["ro"]="font",
- },
- ["cd:formula"]={
- ["cs"]="Formel",
- ["de"]="Formel",
- ["en"]="formula",
- ["fr"]="Formel",
- ["it"]="Formel",
- ["nl"]="formule",
- ["ro"]="Formel",
- },
- ["cd:identifier"]={
- ["cs"]="Name",
- ["de"]="Name",
- ["en"]="identifier",
- ["fr"]="Name",
- ["it"]="Name",
- ["nl"]="naam",
- ["ro"]="Name",
- },
- ["cd:index"]={
- ["cs"]="entry",
- ["de"]="entry",
- ["en"]="entry",
- ["fr"]="entry",
- ["it"]="entry",
- ["nl"]="ingang",
- ["ro"]="entry",
- },
- ["cd:inherits"]={
- ["cs"]="inherits",
- ["de"]="inherits",
- ["en"]="inherits",
- ["fr"]="inherits",
- ["it"]="inherits",
- ["nl"]="erft",
- ["ro"]="inherits",
- },
- ["cd:key"]={
- ["cs"]="key",
- ["de"]="key",
- ["en"]="key",
- ["fr"]="key",
- ["it"]="key",
- ["nl"]="parameter",
- ["ro"]="key",
- },
- ["cd:language"]={
- ["cs"]="sprache",
- ["de"]="sprache",
- ["en"]="language",
- ["fr"]="sprache",
- ["it"]="sprache",
- ["nl"]="taal",
- ["ro"]="sprache",
- },
- ["cd:last"]={
- ["cs"]="last",
- ["de"]="last",
- ["en"]="last",
- ["fr"]="last",
- ["it"]="last",
- ["nl"]="laatste",
- ["ro"]="last",
- },
- ["cd:list"]={
- ["cs"]="Liste",
- ["de"]="Liste",
- ["en"]="list",
- ["fr"]="Liste",
- ["it"]="Liste",
- ["nl"]="lijst",
- ["ro"]="Liste",
- },
- ["cd:lpath"]={
- ["cs"]="lpath",
- ["de"]="lpath",
- ["en"]="lpath",
- ["fr"]="lpath",
- ["it"]="lpath",
- ["nl"]="lpath",
- ["ro"]="lpath",
- },
- ["cd:luafunction"]={
- ["cs"]="luafunction",
- ["de"]="luafunction",
- ["en"]="luafunction",
- ["fr"]="luafunction",
- ["it"]="luafunction",
- ["nl"]="luafunction",
- ["ro"]="luafunction",
- },
- ["cd:mark"]={
- ["cs"]="Beschriftung",
- ["de"]="Beschriftung",
- ["en"]="mark",
- ["fr"]="Beschriftung",
- ["it"]="Beschriftung",
- ["nl"]="markering",
- ["ro"]="Beschriftung",
- },
- ["cd:marking"]={
- ["cs"]="marking",
- ["de"]="marking",
- ["en"]="marking",
- ["fr"]="marking",
- ["it"]="marking",
- ["nl"]="markering",
- ["ro"]="marking",
- },
- ["cd:math"]={
- ["cs"]="formula",
- ["de"]="formula",
- ["en"]="formula",
- ["fr"]="formula",
- ["it"]="formula",
- ["nl"]="formule",
- ["ro"]="formula",
- },
- ["cd:matrix"]={
- ["cs"]="n*m",
- ["de"]="n*m",
- ["en"]="n*m",
- ["fr"]="n*m",
- ["it"]="n*m",
- ["nl"]="n*m",
- ["ro"]="n*m",
- },
- ["cd:name"]={
- ["cs"]="Name",
- ["de"]="Name",
- ["en"]="name",
- ["fr"]="Name",
- ["it"]="Name",
- ["nl"]="naam",
- ["ro"]="Name",
- },
- ["cd:node"]={
- ["cs"]="node",
- ["de"]="node",
- ["en"]="node",
- ["fr"]="node",
- ["it"]="node",
- ["nl"]="node",
- ["ro"]="node",
- },
- ["cd:nothing"]={
- ["cs"]="empty",
- ["de"]="empty",
- ["en"]="empty",
- ["fr"]="empty",
- ["it"]="empty",
- ["nl"]="leeg",
- ["ro"]="empty",
- },
- ["cd:number"]={
- ["cs"]="Nummer",
- ["de"]="Nummer",
- ["en"]="number",
- ["fr"]="Nummer",
- ["it"]="Nummer",
- ["nl"]="getal",
- ["ro"]="Nummer",
- },
- ["cd:optional"]={
- ["cs"]="opt",
- ["de"]="opt",
- ["en"]="opt",
- ["fr"]="opt",
- ["it"]="opt",
- ["nl"]="opt",
- ["ro"]="opt",
- },
- ["cd:plural"]={
- ["cs"]="plural",
- ["de"]="plural",
- ["en"]="plural",
- ["fr"]="plural",
- ["it"]="plural",
- ["nl"]="naam",
- ["ro"]="plural",
- },
- ["cd:position"]={
- ["cs"]="position",
- ["de"]="position",
- ["en"]="position",
- ["fr"]="position",
- ["it"]="position",
- ["nl"]="positie",
- ["ro"]="position",
- },
- ["cd:processor"]={
- ["cs"]="processor",
- ["de"]="processor",
- ["en"]="processor",
- ["fr"]="processor",
- ["it"]="processor",
- ["nl"]="verwerker",
- ["ro"]="processor",
- },
- ["cd:reference"]={
- ["cs"]="reference",
- ["de"]="reference",
- ["en"]="reference",
- ["fr"]="reference",
- ["it"]="reference",
- ["nl"]="verwijzing",
- ["ro"]="reference",
- },
- ["cd:row"]={
- ["cs"]="row",
- ["de"]="row",
- ["en"]="row",
- ["fr"]="row",
- ["it"]="row",
- ["nl"]="rij",
- ["ro"]="row",
- },
- ["cd:section"]={
- ["cs"]="Abschnitt",
- ["de"]="Abschnitt",
- ["en"]="section",
- ["fr"]="Abschnitt",
- ["it"]="Abschnitt",
- ["nl"]="sectie",
- ["ro"]="Abschnitt",
- },
- ["cd:sectionblock"]={
- ["cs"]="sectionblock",
- ["de"]="sectionblock",
- ["en"]="sectionblock",
- ["fr"]="sectionblock",
- ["it"]="sectionblock",
- ["nl"]="sectieblok",
- ["ro"]="sectionblock",
- },
- ["cd:see"]={
- ["cs"]="siehe",
- ["de"]="siehe",
- ["en"]="see",
- ["fr"]="siehe",
- ["it"]="siehe",
- ["nl"]="zie",
- ["ro"]="siehe",
- },
- ["cd:setup"]={
- ["cs"]="setup",
- ["de"]="setup",
- ["en"]="setup",
- ["fr"]="setup",
- ["it"]="setup",
- ["nl"]="setup",
- ["ro"]="setup",
- },
- ["cd:singular"]={
- ["cs"]="singular",
- ["de"]="singular",
- ["en"]="singular",
- ["fr"]="singular",
- ["it"]="singular",
- ["nl"]="naam",
- ["ro"]="singular",
- },
- ["cd:style"]={
- ["cs"]="style",
- ["de"]="style",
- ["en"]="style",
- ["fr"]="style",
- ["it"]="style",
- ["nl"]="letter",
- ["ro"]="style",
- },
- ["cd:template"]={
- ["cs"]="template",
- ["de"]="template",
- ["en"]="template",
- ["fr"]="template",
- ["it"]="template",
- ["nl"]="sjabloon",
- ["ro"]="template",
- },
- ["cd:text"]={
- ["cs"]="Text",
- ["de"]="Text",
- ["en"]="text",
- ["fr"]="Text",
- ["it"]="Text",
- ["nl"]="tekst",
- ["ro"]="Text",
- },
- ["cd:title"]={
- ["cs"]="Setup",
- ["de"]="Setup",
- ["en"]="setup",
- ["fr"]="Setup",
- ["it"]="Setup",
- ["nl"]="setup",
- ["ro"]="Setup",
- },
- ["cd:triplet"]={
- ["cs"]="triplet",
- ["de"]="triplet",
- ["en"]="triplet",
- ["fr"]="triplet",
- ["it"]="triplet",
- ["nl"]="triplet",
- ["ro"]="triplet",
- },
- ["cd:true"]={
- ["cs"]="true",
- ["de"]="true",
- ["en"]="true",
- ["fr"]="true",
- ["it"]="true",
- ["nl"]="true",
- ["ro"]="true",
- },
- ["cd:url"]={
- ["cs"]="url",
- ["de"]="url",
- ["en"]="url",
- ["fr"]="url",
- ["it"]="url",
- ["nl"]="url",
- ["ro"]="url",
- },
- ["cd:userdata"]={
- ["cs"]="userdata",
- ["de"]="userdata",
- ["en"]="userdata",
- ["fr"]="userdata",
- ["it"]="userdata",
- ["nl"]="gebruikersdata",
- ["ro"]="userdata",
- },
- ["cd:value"]={
- ["cs"]="value",
- ["de"]="value",
- ["en"]="value",
- ["fr"]="value",
- ["it"]="value",
- ["nl"]="waarde",
- ["ro"]="value",
- },
- ["cd:word"]={
- ["cs"]="word",
- ["de"]="word",
- ["en"]="word",
- ["fr"]="word",
- ["it"]="word",
- ["nl"]="woord",
- ["ro"]="word",
- },
- ["cd:xmlsetup"]={
- ["cs"]="xmlsetup",
- ["de"]="xmlsetup",
- ["en"]="xmlsetup",
- ["fr"]="xmlsetup",
- ["it"]="xmlsetup",
- ["nl"]="xmlsetup",
- ["ro"]="xmlsetup",
- },
- ["cd:sign"] = { en = "[-+]" },
- ["cd:csname-s"] = { en = "\\..." },
- ["cd:csname-l"] = { en = "\\..." },
- ["cd:noargument-s"] = { en = "\\..." },
- ["cd:noargument-l"] = { en = "\\..." },
- ["cd:oneargument"] = { en = "\\...#1" },
- ["cd:twoarguments"] = { en = "\\...#1#2" },
- ["cd:threearguments"] = { en = "\\...#1#2#3" },
- ["cd:braces-s"] = { en = "{...}", lua = '"..."' },
- ["cd:braces-l"] = { en = "{...,...}", lua = '".. ... .."' },
- ["cd:brackets-s"] = { en = "[...]", lua = "{ ... }" },
- ["cd:brackets-l"] = { en = "[...,...]", lua = "{..., ...}" },
- ["cd:parenthesis-s"] = { en = "(...)" },
- ["cd:parenthesis-l"] = { en = "(...,...)" },
- ["cd:index-s"] = { en = "{...}" },
- ["cd:index-l"] = { en = "{..+...+..}" },
- ["cd:math-s"] = { en = "$...$" },
- ["cd:math-l"] = { en = "$...$" },
- ["cd:inlinemath-s"] = { en = "$...$" },
- ["cd:inlinemath-l"] = { en = "$...$" },
- ["cd:displaymath-s"] = { en = "$$...$$" },
- ["cd:displaymath-l"] = { en = "$$...$$" },
- ["cd:template-s"] = { en = "[|...|]" },
- ["cd:template-l"] = { en = "[|...|...|]" },
- ["cd:twowords-s"] = { en = "[..+..]" },
- ["cd:twowords-l"] = { en = "[..+..]" },
- ["cd:threewords-s"] = { en = "[..+..+..]" },
- ["cd:threewords-l"] = { en = "[..+..+..]" },
- ["cd:angle-s"] = { en = "<<...>>" },
- ["cd:angle-l"] = { en = "<<...>>" },
- ["cd:reference-s"] = { en = "[...]", lua = "{ ... }" },
- ["cd:reference-l"] = { en = "[...,...]", lua = "{..., ...}" },
- ["cd:position-s"] = { en = "(...)" },
- ["cd:position-l"] = { en = "(...,...)" },
- ["cd:triplet-s"] = { en = "[x:y:z]" },
- ["cd:triplet-l"] = { en = "[x:y:z,..]" },
- ["cd:word-s"] = { en = "{...}", lua = '"..."' },
- ["cd:word-l"] = { en = "{.. ... ..}", lua = '".. ... .."' },
- ["cd:content-s"] = { en = "{...}", lua = '"..."' },
- ["cd:content-l"] = { en = "{.. ... ..}", lua = '".. ... .."' },
- ["cd:textual-s"] = { en = "..." },
- ["cd:textual-l"] = { en = ".. ... .." },
- ["cd:none-s"] = { en = "..." },
- ["cd:none-l"] = { en = ".. ... .." },
- ["cd:macro-s"] = { en = "\\... " },
- ["cd:macro-l"] = { en = "\\... " },
- ["cd:to-s"] = { en = "\\to " },
- ["cd:to-l"] = { en = "\\to " },
- ["cd:destination-s"] = { en = "[{..[ref]}]" },
- ["cd:destination-l"] = { en = "[..,{..[ref,..]},..]" },
- ["cd:nothing-s"] = { en = "..." },
- ["cd:nothing-l"] = { en = "..." },
- ["cd:file-s"] = { en = " ... " },
- ["cd:file-l"] = { en = " ... " },
- ["cd:assignment-s"] = { en = "[..=..]", lua = "{ ..=.. } " },
- ["cd:assignment-l"] = { en = "[..,..=..,..]", lua = "{ ..,..=..,.. } " },
- ["cd:assignmentbraces-s"] = { en = "{..=..}" },
- ["cd:assignmentbraces-l"] = { en = "{..,..=..,..}" },
- ["cd:assignmentbrackets-s"] = { en = "[..=..]", lua = "{ ..=.. } " },
- ["cd:assignmentbrackets-l"] = { en = "[..,..=..,..]", lua = "{ ..,..=..,.. } " },
- ["cd:assignmentparentheses-s"] = { en = "(..=..)" },
- ["cd:assignmentparentheses-l"] = { en = "(..,..=..,..)" },
- ["cd:apply-s"] = { en = "[..=>..]" },
- ["cd:apply-l"] = { en = "[..,..=>..,..]" },
- ["cd:if-s"] = { en = "\\if... " },
- ["cd:if-l"] = { en = "\\if... " },
- ["cd:case-s"] = { en = "\\case " },
- ["cd:case-l"] = { en = "\\case " },
- ["cd:else-s"] = { en = "\\else " },
- ["cd:else-l"] = { en = "\\else " },
- ["cd:or-s"] = { en = "\\or " },
- ["cd:or-l"] = { en = "\\or " },
- ["cd:fi-s"] = { en = "\\fi " },
- ["cd:fi-l"] = { en = "\\fi " },
- ["cd:par-s"] = { en = "\\par " },
- ["cd:par-l"] = { en = "\\par " },
- ["cd:sep-s"] = { en = "\\" },
- ["cd:sep-l"] = { en = "\\" },
- }
}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mult-def.mkiv b/Master/texmf-dist/tex/context/base/mkiv/mult-def.mkiv
index 78fcdf667dd..0a450e8b070 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mult-def.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/mult-def.mkiv
@@ -37,9 +37,9 @@
% some left-overs
-\def\c!HL{HL}
-\def\c!VL{VL}
-\def\c!NL{NL}
+\defineinterfaceconstant {HL} {HL}
+\defineinterfaceconstant {VL} {VL}
+\defineinterfaceconstant {NL} {NL}
% stop todo
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mult-dim.mkvi b/Master/texmf-dist/tex/context/base/mkiv/mult-dim.mkvi
index 0224e3dbb16..952550055c6 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mult-dim.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/mult-dim.mkvi
@@ -48,10 +48,10 @@
\setvalue{\??dimensionnormal-\v!big }#value#dimension#small#medium#big{#dimension=-#big\relax}
\letvalue{\??dimensionnormal\s!unknown}\assign_dimension_direct
-% \unexpanded\def\assigndimension#value%
+% \protected\def\assigndimension#value%
% {\csname\??dimensionnormal\ifcsname\??dimensionnormal#value\endcsname#value\else\s!unknown\fi\endcsname{#value}}
-\unexpanded\def\assigndimension#value%
+\protected\def\assigndimension#value%
{\ifcsname\??dimensionnormal#value\endcsname
\expandafter\lastnamedcs
\else
@@ -81,10 +81,10 @@
\setvalue{\??dimensionalfa\v!big }#value#macro#small#medium#big{\edef#macro{#big}}
\letvalue{\??dimensionalfa\s!unknown}\assign_alpha_dimension_direct
-% \unexpanded\def\assignalfadimension#value%
+% \protected\def\assignalfadimension#value%
% {\csname\??dimensionalfa\ifcsname\??dimensionalfa#value\endcsname#value\else\s!unknown\fi\endcsname{#value}}
-\unexpanded\def\assignalfadimension#value%
+\protected\def\assignalfadimension#value%
{\ifcsname\??dimensionalfa#value\endcsname
\expandafter\lastnamedcs
\else
@@ -115,10 +115,10 @@
\setvalue{\??dimensionvalue\v!big }#value#macro#small#medium#big{\edef#macro{#big}}
\letvalue{\??dimensionvalue\s!unknown}\assign_value_direct
-% \unexpanded\def\assignvalue#value%
+% \protected\def\assignvalue#value%
% {\csname\??dimensionvalue\ifcsname\??dimensionvalue#value\endcsname#value\else\s!unknown\fi\endcsname{#value}}
-\unexpanded\def\assignvalue#value%
+\protected\def\assignvalue#value%
{\ifcsname\??dimensionvalue#value\endcsname
\expandafter\lastnamedcs
\else
@@ -157,10 +157,10 @@
\setbox\b_assign_width\emptybox}
\letvalue{\??dimensionwidth\s!unknown}\assign_width_direct
-% \unexpanded\def\assignwidth#value%
+% \protected\def\assignwidth#value%
% {\csname\??dimensionwidth\ifcsname\??dimensionwidth#value\endcsname#value\else\s!unknown\fi\endcsname{#value}}
-\unexpanded\def\assignwidth#value%
+\protected\def\assignwidth#value%
{\ifcsname\??dimensionwidth#value\endcsname
\expandafter\lastnamedcs
\else
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mult-fmt.lua b/Master/texmf-dist/tex/context/base/mkiv/mult-fmt.lua
new file mode 100644
index 00000000000..0d11a425333
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkiv/mult-fmt.lua
@@ -0,0 +1,338 @@
+if not modules then modules = { } end modules ['mult-fmt'] = {
+ 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"
+}
+
+local next = next
+local concat, sortedhash = table.concat, table.sortedhash
+local sub, formatters = string.sub, string.formatters
+local utfsplit = utf.split
+
+local prtcatcodes = catcodes.numbers.prtcatcodes
+local contextsprint = context.sprint
+local implement = interfaces.implement
+
+local setmacro = token.set_macro
+local definedmacro = token.is_defined
+
+local report = logs.reporter("interface")
+local report_interface = logs.reporter("interface","initialization")
+local report_variable = logs.reporter("variable")
+local report_constant = logs.reporter("constant")
+local report_command = logs.reporter("command")
+local report_element = logs.reporter("element")
+local report_format = logs.reporter("format")
+local report_messagetag = logs.reporter("messagetag")
+local report_setupstring = logs.reporter("setupstring")
+
+local function limit(str,n)
+ if n > 6 and #str > n then
+ n = n - 4
+ local t = utfsplit(str)
+ local m = #t
+ if m > n then
+ t[n] = " ..."
+ str = concat(t,"",1,n)
+ end
+ end
+ return str
+end
+
+-- function interfaces.setuserinterface(interface,response)
+-- local variables = interfaces.variables
+-- local constants = interfaces.constants
+-- local elements = interfaces.elements
+-- local formats = interfaces.formats
+-- local translations = interfaces.translations
+-- local setupstrings = interfaces.setupstrings
+-- local complete = interfaces.complete
+-- local sharedstorage = storage.shared
+-- --
+-- sharedstorage.currentinterface, currentinterface = interface, interface
+-- sharedstorage.currentresponse, currentresponse = response, response
+-- --
+-- if environment.initex then
+-- local nofconstants = 0
+-- local nofvariables = 0
+-- local nofelements = 0
+-- local nofcommands = 0
+-- local nofformats = 0
+-- local noftranslations = 0
+-- local nofsetupstrings = 0
+-- --
+-- do
+-- local list = complete.constants -- forces the load
+-- local t = { }
+-- local f = formatters["\\ui_c{%s}{%s}"]
+-- local s = formatters["\\ui_s{%s}"]
+-- logs.startfilelogging(report,"translated constants")
+-- for given, constant in sortedhash(list) do
+-- constant = constant[interface] or constant.en or given
+-- constants[constant] = given -- breedte -> width
+-- nofconstants = nofconstants + 1
+-- if given == constant then
+-- t[nofconstants] = s(given)
+-- else
+-- t[nofconstants] = f(given,constant)
+-- end
+-- report_constant("%-40s: %s",given,constant)
+-- end
+-- logs.stopfilelogging()
+-- contextsprint(prtcatcodes,concat(t))
+-- end
+-- do
+-- local list = complete.variables -- forces the load
+-- local t = { }
+-- local f = formatters["\\ui_v{%s}{%s}"]
+-- logs.startfilelogging(report,"translated variables")
+-- for given, variable in sortedhash(list) do
+-- variable = variable[interface] or variable.en or given
+-- variables[given] = variable -- ja -> yes
+-- nofvariables = nofvariables + 1
+-- t[nofvariables] = f(given,variable)
+-- report_variable("%-40s: %s",given,variable)
+-- end
+-- logs.stopfilelogging()
+-- contextsprint(prtcatcodes,concat(t))
+-- end
+-- do
+-- local list = complete.elements -- forces the load
+-- local t = { }
+-- local f = formatters["\\ui_e{%s}{%s}"]
+-- logs.startfilelogging(report,"translated elements")
+-- for given, element in sortedhash(list) do
+-- element = element[interface] or element.en or given
+-- elements[element] = given
+-- nofelements = nofelements + 1
+-- t[nofelements] = f(given,element)
+-- report_element("%-40s: %s",given,element)
+-- end
+-- logs.stopfilelogging()
+-- contextsprint(prtcatcodes,concat(t))
+-- end
+-- do
+-- local list = complete.commands -- forces the load
+-- local t = { }
+-- local n = 0
+-- local f = formatters["\\ui_a\\%s\\%s"] -- formatters["\\ui_m{%s}{%s}"]
+-- logs.startfilelogging(report,"translated commands")
+-- for given, command in sortedhash(list) do
+-- command = command[interface] or command.en or given
+-- if command ~= given then
+-- n = n + 1
+-- t[n] = f(given,command)
+-- report_command("%-40s: %s",given,command)
+-- end
+-- nofcommands = nofcommands + 1
+-- end
+-- logs.stopfilelogging()
+-- contextsprint(prtcatcodes,"\\toksapp\\everydump{"..concat(t).."}")
+-- end
+-- do
+-- local list = complete.messages.formats
+-- logs.startfilelogging(report,"translated message formats")
+-- for given, format in sortedhash(list) do
+-- local found = format[interface] or format.en or given
+-- formats[given] = found
+-- nofformats = nofformats + 1
+-- report_messagetag("%-40s: %s",limit(given,38),limit(found,38))
+-- end
+-- logs.stopfilelogging()
+-- end
+-- do
+-- local list = complete.messages.translations
+-- logs.startfilelogging(report,"translated message tags")
+-- for given, translation in sortedhash(list) do
+-- local found = translation[interface] or translation.en or given
+-- translations[given] = found
+-- noftranslations = noftranslations + 1
+-- report_messagetag("%-40s: %s",given,found)
+-- end
+-- logs.stopfilelogging()
+-- end
+-- do
+-- local list = complete.setupstrings
+-- logs.startfilelogging(report,"translated setupstrings")
+-- for given, setupstring in sortedhash(list) do
+-- local found = setupstring[interface] or setupstring.en or given
+-- setupstrings[given] = found
+-- nofsetupstrings = nofsetupstrings + 1
+-- report_setupstring("%-40s: %s",given,found)
+-- end
+-- logs.stopfilelogging()
+-- end
+-- report_interface("definitions: %a constants, %a variables, %a elements, %a commands, %a formats, %a translations, %a setupstrings",
+-- nofconstants,nofvariables,nofelements,nofcommands,nofformats,noftranslations,nofsetupstrings)
+-- else
+-- report_interface("the language(s) can only be set when making the format")
+-- end
+-- interfaces.currentinterface = currentinterface
+-- interfaces.currentresponse = currentresponse
+-- end
+
+-- different per interface
+--
+-- en:
+--
+-- ui_c macro:#1#2 -> \immutable \gdefcsname \c!prefix! #1\endcsname {#1}
+-- ui_v macro:#1#2 -> \immutable \gdefcsname \v!prefix! #1\endcsname {#2}
+-- ui_e macro:#1#2 -> \immutable \gdefcsname \e!prefix! #1\endcsname {#2}
+-- ui_a macro:#1#2 -> \frozen \protected \def #2{#1}
+--
+-- otherwise:
+--
+-- ui_c macro:#1#2 -> \immutable \gdefcsname \c!prefix! #1\endcsname {#1}
+-- \immutable \gdefcsname \k!prefix! #2\endcsname {#1}
+
+function interfaces.setuserinterface(interface,response)
+ local variables = interfaces.variables
+ local constants = interfaces.constants
+ local elements = interfaces.elements
+ local formats = interfaces.formats
+ local translations = interfaces.translations
+ local setupstrings = interfaces.setupstrings
+ local complete = interfaces.complete
+ local sharedstorage = storage.shared
+ --
+ sharedstorage.currentinterface, currentinterface = interface, interface
+ sharedstorage.currentresponse, currentresponse = response, response
+ --
+ if environment.initex then
+ local nofconstants = 0
+ local nofvariables = 0
+ local nofelements = 0
+ local nofcommands = 0
+ local nofformats = 0
+ local noftranslations = 0
+ local nofsetupstrings = 0
+ local reversetoo = interface ~= "en"
+ --
+ do
+ local list = complete.constants -- forces the load
+ logs.startfilelogging(report,"translated constants")
+ for given, constant in sortedhash(list) do
+ constant = constant[interface] or constant.en or given
+ constants[constant] = given -- breedte -> width
+ nofconstants = nofconstants + 1
+ setmacro("c!" .. given,given,"immutable")
+ if reversetoo then
+ setmacro("k!" .. constant,given,"immutable")
+ end
+ report_constant("%-40s: %s",given,constant)
+ end
+ logs.stopfilelogging()
+ end
+ do
+ local list = complete.variables -- forces the load
+ logs.startfilelogging(report,"translated variables")
+ for given, variable in sortedhash(list) do
+ variable = variable[interface] or variable.en or given
+ variables[given] = variable -- ja -> yes
+ nofvariables = nofvariables + 1
+ setmacro("v!" .. given,variable,"immutable")
+ report_variable("%-40s: %s",given,variable)
+ end
+ logs.stopfilelogging()
+ end
+ do
+ local list = complete.elements -- forces the load
+ logs.startfilelogging(report,"translated elements")
+ for given, element in sortedhash(list) do
+ element = element[interface] or element.en or given
+ elements[element] = given
+ nofelements = nofelements + 1
+ setmacro("e!" .. given,element,"immutable")
+ report_element("%-40s: %s",given,element)
+ end
+ logs.stopfilelogging()
+ end
+-- do
+-- local list = complete.commands -- forces the load
+-- local todo = { } -- normally a small list
+-- logs.startfilelogging(report,"translated commands")
+-- for given, command in sortedhash(list) do
+-- command = command[interface] or command.en or given
+-- if command ~= given then
+-- report_command("%-40s: %s",given,command)
+-- todo[given] = command
+-- end
+-- nofcommands = nofcommands + 1
+-- end
+-- logs.stopfilelogging()
+-- -- For some reason we get corrupted definitions.
+-- luatex.registerdumpactions(function()
+-- for given, command in sortedhash(todo) do
+-- -- if definedmacro(given) then
+-- setmacro(command,"\\"..given,"frozen","protected","global")
+-- -- end
+-- end
+-- end)
+-- end
+ do
+ local list = complete.commands -- forces the load
+ local t = { }
+ local n = 0
+ local f = formatters["\\frozen\\protected\\def\\%s{\\%s}"] -- formatters["\\ui_m{%s}{%s}"]
+ logs.startfilelogging(report,"translated commands")
+ for given, command in sortedhash(list) do
+ command = command[interface] or command.en or given
+ if command ~= given then
+ n = n + 1
+ t[n] = f(command,given)
+ report_command("%-40s: %s",given,command)
+ end
+ nofcommands = nofcommands + 1
+ end
+ logs.stopfilelogging()
+ contextsprint(prtcatcodes,"\\toksapp\\everydump{"..concat(t).."}")
+ end
+ do
+ local list = complete.messages.formats
+ logs.startfilelogging(report,"translated message formats")
+ for given, format in sortedhash(list) do
+ local found = format[interface] or format.en or given
+ formats[given] = found
+ nofformats = nofformats + 1
+ report_messagetag("%-40s: %s",limit(given,38),limit(found,38))
+ end
+ logs.stopfilelogging()
+ end
+ do
+ local list = complete.messages.translations
+ logs.startfilelogging(report,"translated message tags")
+ for given, translation in sortedhash(list) do
+ local found = translation[interface] or translation.en or given
+ translations[given] = found
+ noftranslations = noftranslations + 1
+ report_messagetag("%-40s: %s",given,found)
+ end
+ logs.stopfilelogging()
+ end
+ do
+ local list = complete.setupstrings
+ logs.startfilelogging(report,"translated setupstrings")
+ for given, setupstring in sortedhash(list) do
+ local found = setupstring[interface] or setupstring.en or given
+ setupstrings[given] = found
+ nofsetupstrings = nofsetupstrings + 1
+ report_setupstring("%-40s: %s",given,found)
+ end
+ logs.stopfilelogging()
+ end
+ report_interface("definitions: %a constants, %a variables, %a elements, %a commands, %a formats, %a translations, %a setupstrings",
+ nofconstants,nofvariables,nofelements,nofcommands,nofformats,noftranslations,nofsetupstrings)
+ else
+ report_interface("the language(s) can only be set when making the format")
+ end
+ interfaces.currentinterface = currentinterface
+ interfaces.currentresponse = currentresponse
+end
+
+interfaces.implement {
+ name = "setuserinterface",
+ actions = interfaces.setuserinterface,
+ arguments = "2 strings",
+}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mult-fun.lua b/Master/texmf-dist/tex/context/base/mkiv/mult-fun.lua
index 99700f47458..4ecbb1abdf4 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mult-fun.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/mult-fun.lua
@@ -2,7 +2,7 @@ return {
internals = {
--
"nocolormodel", "greycolormodel", "graycolormodel", "rgbcolormodel", "cmykcolormodel",
- "shadefactor",
+ "shadefactor", "shadeoffset",
"textextoffset", "textextanchor",
"normaltransparent", "multiplytransparent", "screentransparent", "overlaytransparent",
"softlighttransparent", "hardlighttransparent", "colordodgetransparent", "colorburntransparent",
@@ -17,7 +17,7 @@ return {
"drawoptionsfactor",
"dq", "sq",
"crossingscale", "crossingoption",
- "contextlmtxmode",
+ "contextlmtxmode", "metafunversion", "minifunversion",
--
-- for the moment we put these here as they need to stand out
--
@@ -74,6 +74,7 @@ return {
"withshadedomain", "withshademethod", "withshadefactor", "withshadevector",
"withshadecenter", "withshadedirection", "withshaderadius", "withshadetransform",
"withshadestep", "withshadefraction", "withshadeorigin", "shownshadevector", "shownshadeorigin",
+ "shownshadedirection", "shownshadecenter",
"cmyk", "spotcolor", "multitonecolor", "namedcolor",
"drawfill", "undrawfill",
"inverted", "uncolored", "softened", "grayed", "greyed",
@@ -85,11 +86,12 @@ return {
"withmask", "bitmapimage",
"colordecimals", "ddecimal", "dddecimal", "ddddecimal", "colordecimalslist",
"textext", "thetextext", "rawtextext", "textextoffset", "texbox", "thetexbox", "rawtexbox", "istextext",
+ "rawmadetext", "validtexbox", "onetimetextext", "rawfmttext", "thefmttext", "fmttext", "onetimefmttext",
"notcached", "keepcached",
"verbatim",
"thelabel", "label",
"autoalign",
- "transparent", "withtransparency",
+ "transparent", "withtransparency", "withopacity",
"property", "properties", "withproperties",
"asgroup",
"infont", -- redefined using textext
@@ -174,6 +176,7 @@ return {
"isarray", "prefix", "dimension",
"getmacro", "getdimen", "getcount", "gettoks",
"setmacro", "setdimen", "setcount", "settoks",
+ "setglobalmacro", "setglobaldimen", "setglobalcount", "setglobaltoks",
--
"positionpath", "positioncurve", "positionxy", "positionpxy",
"positionwhd", "positionpage", "positionregion", "positionbox",
@@ -185,16 +188,21 @@ return {
--
"inpath", "pointof", "leftof", "rightof",
--
- "utflen", "utfsub",
+ "utfnum", "utflen", "utfsub",
--
"newhash", "disposehash", "inhash", "tohash",
--
"isarray", "prefix", "isobject",
--
- "comment", "report", "lua", "mp", "MP", "luacall",
+ "comment", "report", "lua", "lualist", "mp", "MP", "luacall",
--
"mirrored", "mirroredabout",
--
- "scriptindex",
+ "scriptindex", "newscriptindex",
+ --
+ "newcolor", "newrgbcolor", "newcmykcolor",
+ "newnumeric", "newboolean", "newtransform", "newpath", "newpicture", "newstring", "newpair",
+
+ "mpvar",
},
}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mult-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/mult-ini.lua
index 0c8581281d1..eb758fcbf07 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mult-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/mult-ini.lua
@@ -233,138 +233,6 @@ end
logs.setmessenger(context.verbatim.ctxreport)
--- todo: use setmacro
-
-function interfaces.setuserinterface(interface,response)
- sharedstorage.currentinterface, currentinterface = interface, interface
- sharedstorage.currentresponse, currentresponse = response, response
- if environment.initex then
- local setmacro = false
- -- local setmacro = interfaces.setmacro -- cleaner (but we need to test first)
- local nofconstants = 0
- local nofvariables = 0
- local nofelements = 0
- local nofcommands = 0
- local nofformats = 0
- local noftranslations = 0
- local nofsetupstrings = 0
- --
- if setmacro then
- for given, constant in next, complete.constants do
- constant = constant[interface] or constant.en or given
- constants[constant] = given -- breedte -> width
- nofconstants = nofconstants + 1
- setmacro("c!"..given,given)
- if currentinterface ~= "en" then
- setmacro("k!"..constant,given)
- end
- end
- else
- local t, f, s = { }, formatters["\\ui_c{%s}{%s}"], formatters["\\ui_s{%s}"]
- for given, constant in next, complete.constants do
- constant = constant[interface] or constant.en or given
- constants[constant] = given -- breedte -> width
- nofconstants = nofconstants + 1
- if given == constant then
- t[nofconstants] = s(given)
- else
- t[nofconstants] = f(given,constant)
- end
- end
- contextsprint(prtcatcodes,concat(t))
- end
- --
- if setmacro then
- for given, variable in next, complete.variables do
- variable = variable[interface] or variable.en or given
- variables[given] = variable -- ja -> yes
- nofvariables = nofvariables + 1
- setmacro("v!"..given,variable)
- end
- else
- local t, f = { }, formatters["\\ui_v{%s}{%s}"]
- for given, variable in next, complete.variables do
- variable = variable[interface] or variable.en or given
- variables[given] = variable -- ja -> yes
- nofvariables = nofvariables + 1
- t[nofvariables] = f(given,variable)
- end
- contextsprint(prtcatcodes,concat(t))
- end
- --
- if setmacro then
- for given, element in next, complete.elements do
- element = element[interface] or element.en or given
- elements[element] = given
- nofelements = nofelements + 1
- setmacro("e!"..given,element)
- end
- else
- local t, f = { }, formatters["\\ui_e{%s}{%s}"]
- for given, element in next, complete.elements do
- element = element[interface] or element.en or given
- elements[element] = given
- nofelements = nofelements + 1
- t[nofelements] = f(given,element)
- end
- contextsprint(prtcatcodes,concat(t))
- end
- --
- if setmacro then
- -- this can only work ok when we already have defined the command
- luatex.registerdumpactions(function()
- for given, command in next, complete.commands do
- command = command[interface] or command.en or given
- if command ~= given then
- setmacro(prtcatcodes,given,"\\"..command)
- end
- nofcommands = nofcommands + 1
- end
- end)
- else
- local t, n, f = { }, 0, formatters["\\ui_m{%s}{%s}"]
- for given, command in next, complete.commands do
- command = command[interface] or command.en or given
- if command ~= given then
- n = n + 1
- t[n] = f(given,command)
- end
- nofcommands = nofcommands + 1
- end
- contextsprint(prtcatcodes,concat(t))
- end
- --
- for given, format in next, complete.messages.formats do
- formats[given] = format[interface] or format.en or given
- nofformats = nofformats + 1
- end
- --
- for given, translation in next, complete.messages.translations do
- translations[given] = translation[interface] or translation.en or given
- noftranslations = noftranslations + 1
- end
- --
- for given, setupstring in next, complete.setupstrings do
- setupstring = setupstring[interface] or setupstring.en or given
- setupstrings[given] = setupstring
- nofsetupstrings = nofsetupstrings + 1
- end
- --
- report_interface("definitions: %a constants, %a variables, %a elements, %a commands, %a formats, %a translations, %a setupstrings",
- nofconstants,nofvariables,nofelements,nofcommands,nofformats,noftranslations,nofsetupstrings)
- else
- report_interface("the language(s) can only be set when making the format")
- end
- interfaces.currentinterface = currentinterface
- interfaces.currentresponse = currentresponse
-end
-
-interfaces.implement {
- name = "setuserinterface",
- actions = interfaces.setuserinterface,
- arguments = "2 strings",
-}
-
interfaces.cachedsetups = interfaces.cachedsetups or { }
interfaces.hashedsetups = interfaces.hashedsetups or { }
@@ -437,10 +305,10 @@ implement {
}
local function gss(s)
- contextsprint(vrbcatcodes,getsetupstring(s))
- end
+ contextsprint(vrbcatcodes,getsetupstring(s))
+end
-implement { -- will b eoverloaded
+implement { -- will be overloaded
name = "getsetupstring",
actions = gss,
arguments = "string",
@@ -454,16 +322,18 @@ implement {
local function showassignerror(namespace,key,line)
- local ns, instance = match(namespace,"^(%d+)[^%a]+(%a*)")
- if ns then
- namespace = corenamespaces[tonumber(ns)] or ns
- end
- -- injected in the stream for timing:
- if instance and instance ~= "" then
- context.writestatus("setup",formatters["error in line %a, namespace %a, instance %a, key %a"](line,namespace,instance,key))
- else
- context.writestatus("setup",formatters["error in line %a, namespace %a, key %a"](line,namespace,key))
- end
+ -- if key and key ~= "" and key ~= "," then
+ local ns, instance = match(namespace,"^(%d+)[^%a]+(%a*)")
+ if ns then
+ namespace = corenamespaces[tonumber(ns)] or ns
+ end
+ -- injected in the stream for timing:
+ if instance and instance ~= "" then
+ context.writestatus("setup",formatters["error in line %a, namespace %a, instance %a, key %a"](line,namespace,instance,key))
+ else
+ context.writestatus("setup",formatters["error in line %a, namespace %a, key %a"](line,namespace,key))
+ end
+ -- end
end
implement {
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mult-ini.mkiv b/Master/texmf-dist/tex/context/base/mkiv/mult-ini.mkiv
index 641c8a4f50e..75fa5c7bfa4 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mult-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/mult-ini.mkiv
@@ -20,6 +20,7 @@
\unprotect
\registerctxluafile{mult-ini}{}
+\registerctxluafile{mult-fmt}{initexonly}
%D \macros
%D [constanten,variabelen,commands]
@@ -59,6 +60,7 @@
\def\m!prefix!{m!}
\def\s!prefix!{s!}
\def\v!prefix!{v!}
+\def\t!prefix!{t!}
%D \macros
%D [constants,variables,commands]
@@ -105,33 +107,35 @@
%D than once. Savings like this should of course be implemented in english, just
%D because \TEX\ is english.
-\def\s!width {width} \let\!!width \s!width % obsolete
-\def\s!height{height} \let\!!height\s!height % obsolete
-\def\s!depth {depth} \let\!!depth \s!depth % obsolete
-\def\s!spread{spread} \let\!!spread\s!spread % obsolete
-\def\s!plus {plus} \let\!!plus \s!plus % obsolete
-\def\s!minus {minus} \let\!!minus \s!minus % obsolete
-\def\s!left {left}
-\def\s!right {right}
-\def\s!fil {fil}
-\def\s!fill {fill} \let\!!fill \s!fill % obsolete
-\def\s!filll {filll}
-\def\s!to {to} \let\!!to \s!to % obsolete
-\def\s!attr {attr}
-\def\s!axis {axis}
-
-\def\s!bottom{bottom}
-\def\s!top {top}
-\def\s!both {both}
-
-\def\s!reverse {reverse}
+\def\s!width {width}
+\def\s!height {height}
+\def\s!depth {depth}
+\def\s!spread {spread}
+\def\s!plus {plus}
+\def\s!minus {minus}
+\def\s!to {to}
+
+\def\s!fil {fil}
+\def\s!fill {fill}
+\def\s!filll {filll}
+
+\def\s!attr {attr}
+\def\s!axis {axis}
+\def\s!both {both}
+\def\s!bottom {bottom}
+\def\s!left {left}
+\def\s!options {options}
\def\s!orientation{orientation}
-\def\s!xoffset {xoffset}
+\def\s!reverse {reverse}
+\def\s!right {right}
+\def\s!top {top}
\def\s!xmove {xmove}
-\def\s!yoffset {yoffset}
+\def\s!xoffset {xoffset}
\def\s!ymove {ymove}
+\def\s!yoffset {yoffset}
%D \macros
+
%D {defineinterfaceconstant,
%D defineinterfacevariable,
%D defineinterfaceelement,
@@ -165,9 +169,9 @@
%D \def\e!name{meaning}
%D \stoptyping
-\unexpanded\def\defineinterfaceconstant #1#2{\expandafter\def\csname\c!prefix!#1\endcsname{#2}}
-\unexpanded\def\defineinterfacevariable #1#2{\expandafter\def\csname\v!prefix!#1\endcsname{#2}}
-\unexpanded\def\defineinterfaceelement #1#2{\expandafter\def\csname\e!prefix!#1\endcsname{#2}}
+\protected\def\defineinterfaceconstant#1#2{\expandafter\def\csname\c!prefix!#1\endcsname{#2}}
+\protected\def\defineinterfacevariable#1#2{\expandafter\def\csname\v!prefix!#1\endcsname{#2}}
+\protected\def\defineinterfaceelement #1#2{\expandafter\def\csname\e!prefix!#1\endcsname{#2}}
%D Next come some interface independant constants:
%D
@@ -175,7 +179,7 @@
%D \definefileconstant {name} {meaning}
%D \stoptyping
-\unexpanded\def\definefileconstant #1#2{\expandafter\def\csname\f!prefix!#1\endcsname{#2}}
+\protected\def\definefileconstant#1#2{\expandafter\def\csname\f!prefix!#1\endcsname{#2}}
%D And finaly we have the one argument, space saving constants
%D
@@ -184,8 +188,13 @@
%D \definemessageconstant {name}
%D \stoptyping
-\unexpanded\def\definesystemconstant #1{\expandafter\def\csname\s!prefix!#1\endcsname{#1}}
-\unexpanded\def\definemessageconstant #1{\expandafter\def\csname\m!prefix!#1\endcsname{#1}}
+\protected\def\definesystemconstant #1{\expandafter\def\csname\s!prefix!#1\endcsname{#1}}
+\protected\def\definemessageconstant#1{\expandafter\def\csname\m!prefix!#1\endcsname{#1}}
+
+%D For now here:
+
+\protected\def\definetagconstant #1{\expandafter\def\csname\t!prefix!#1\endcsname{#1}}
+\protected\def\aliastagconstant #1#2{\expandafter\let\csname\t!prefix!#1\expandafter\endcsname\csname\t!prefix!#2\endcsname}
%D In a parameter driven system, some parameters are shared by more system
%D components. In \CONTEXT\ we can distinguish parameters by a unique prefix. Such a
@@ -195,7 +204,7 @@
%D \definesystemvariable {name}
%D \stoptyping
-\unexpanded\def\definesystemvariable#1{\expandafter\edef\csname\??prefix#1\endcsname{\@@prefix#1}}
+\protected\def\definesystemvariable#1{\expandafter\edef\csname\??prefix#1\endcsname{\@@prefix#1}}
\definesystemvariable{ms}
@@ -260,7 +269,7 @@
%D \stopinterface
%D \stoptyping
-\unexpanded\def\startinterface #1
+\protected\def\startinterface #1
{\doifnot{#1}{all}{\doifnotinset\currentinterface{#1}{\gobbleuntil\stopinterface}}}
\let\stopinterface\relax
@@ -344,7 +353,7 @@
%D
%D These will become obsolete:
-\unexpanded\def\startmessages #1 library: #2 %
+\protected\def\startmessages #1 library: #2 %
{\begingroup
\ifcsname\m!prefix!#2\endcsname\else\setgvalue{\m!prefix!#2}{#2}\fi
\catcode\endoflineasciicode\othercatcode
@@ -359,21 +368,21 @@
\let\stopmessages\relax
-\unexpanded\def\setinterfacemessage#1#2#3%
+\protected\def\setinterfacemessage#1#2#3%
{\ifcsname\m!prefix!#1\endcsname\else\setgvalue{\m!prefix!#1}{#1}\fi
\clf_setinterfacemessage{#1}{#2}{#3}}
-\unexpanded\def\setmessagetext #1#2{\relax\edef\currentmessagetext{\clf_getmessage{#1}{#2}}}
-\unexpanded\def\getmessage #1#2{\relax\clf_getmessage{#1}{#2}}
-\unexpanded\def\doifelsemessage #1#2{\relax\clf_doifelsemessage{#1}{#2}}
-\unexpanded\def\showmessage #1#2#3{\relax\clf_showmessage{#1}{#2}{#3}}
-\unexpanded\def\writestatus #1#2{\relax\clf_writestatus{#1}{#2}}
-\unexpanded\def\message {\relax\clf_message}
+\protected\def\setmessagetext #1#2{\relax\edef\currentmessagetext{\clf_getmessage{#1}{#2}}}
+\protected\def\getmessage #1#2{\relax\clf_getmessage{#1}{#2}}
+\protected\def\doifelsemessage #1#2{\relax\clf_doifelsemessage{#1}{#2}}
+\protected\def\showmessage #1#2#3{\relax\clf_showmessage{#1}{#2}{#3}}
+\protected\def\writestatus #1#2{\relax\clf_writestatus{#1}{#2}}
+\protected\def\message {\relax\clf_message}
\let\doifmessageelse\doifelsemessage
-\unexpanded\def\inlinemessage #1{\dontleavehmode{\tttf#1}}
-\unexpanded\def\displaymessage#1{\blank\inlinemessage{#1}\blank}
+\protected\def\inlinemessage #1{\dontleavehmode{\tttf#1}}
+\protected\def\displaymessage#1{\blank\inlinemessage{#1}\blank}
\let\getsetupstring\clf_getsetupstring
\let\rawsetupstring\clf_rawsetupstring
@@ -392,15 +401,15 @@
%D backmapping (\type{\c!k...}) and make \type {\c!c...} similar to \type {\v!...}.
%D In that case we can simply the following setters.
-\unexpanded\def\doletvalue #1#2{\expandafter\let \csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname}
-\unexpanded\def\dosetvalue #1#2{\expandafter\def \csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname}
-\unexpanded\def\dosetevalue #1#2{\expandafter\edef\csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname}
-\unexpanded\def\dosetgvalue #1#2{\expandafter\gdef\csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname}
-\unexpanded\def\dosetxvalue #1#2{\expandafter\xdef\csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname}
-\unexpanded\def\doresetvalue #1#2{\expandafter\let \csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname\empty}
-\unexpanded\def\doignorevalue#1#2#3{\expandafter\let \csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname\empty}
+\protected\def\doletvalue #1#2{\expandafter\let \csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname}
+\protected\def\dosetvalue #1#2{\expandafter\def \csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname}
+\protected\def\dosetevalue #1#2{\expandafter\edef\csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname}
+\protected\def\dosetgvalue #1#2{\expandafter\gdef\csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname}
+\protected\def\dosetxvalue #1#2{\expandafter\xdef\csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname}
+\protected\def\doresetvalue #1#2{\expandafter\let \csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname\empty}
+\protected\def\doignorevalue#1#2#3{\expandafter\let \csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname\empty}
-\unexpanded\def\docopyvalue#1#2#3%
+\protected\def\docopyvalue#1#2#3%
{\ifcsname\k!prefix!#3\endcsname
\expandafter\def\csname#1\csname\k!prefix!#3\endcsname\expandafter\endcsname\expandafter
{\csname#2\csname\k!prefix!#3\endcsname\endcsname}%
@@ -411,15 +420,15 @@
\startinterface english
- \unexpanded\def\doletvalue #1#2{\expandafter \let\csname#1#2\endcsname}
- \unexpanded\def\dosetvalue #1#2{\expandafter \def\csname#1#2\endcsname}
- \unexpanded\def\dosetevalue #1#2{\expandafter\edef\csname#1#2\endcsname}
- \unexpanded\def\dosetgvalue #1#2{\expandafter\gdef\csname#1#2\endcsname}
- \unexpanded\def\dosetxvalue #1#2{\expandafter\xdef\csname#1#2\endcsname}
- \unexpanded\def\doresetvalue #1#2{\expandafter \let\csname#1#2\endcsname\empty}
- \unexpanded\def\doignorevalue#1#2#3{\expandafter \let\csname#1#2\endcsname\empty}
+ \protected\def\doletvalue #1#2{\expandafter \let\csname#1#2\endcsname}
+ \protected\def\dosetvalue #1#2{\expandafter \def\csname#1#2\endcsname}
+ \protected\def\dosetevalue #1#2{\expandafter\edef\csname#1#2\endcsname}
+ \protected\def\dosetgvalue #1#2{\expandafter\gdef\csname#1#2\endcsname}
+ \protected\def\dosetxvalue #1#2{\expandafter\xdef\csname#1#2\endcsname}
+ \protected\def\doresetvalue #1#2{\expandafter \let\csname#1#2\endcsname\empty}
+ \protected\def\doignorevalue#1#2#3{\expandafter \let\csname#1#2\endcsname\empty}
- \unexpanded\def\docopyvalue#1#2#3%
+ \protected\def\docopyvalue#1#2#3%
{\expandafter\def\csname#1#3\expandafter\endcsname\expandafter
{\csname#2#3\endcsname}}
@@ -428,9 +437,9 @@
%D We can now redefine some messages that will be introduced in the multi||lingual
%D system module.
-\unexpanded\def\showassignerror #1#2{\showmessage\m!check1{#1,#2}}
-\unexpanded\def\showargumenterror#1#2{\showmessage\m!check2{#1,#2}}
-\unexpanded\def\showdefinederror #1#2{\showmessage\m!check3{#1,#2}}
+\protected\def\showassignerror #1#2{\showmessage\m!check1{#1,#2}}
+\protected\def\showargumenterror#1#2{\showmessage\m!check2{#1,#2}}
+\protected\def\showdefinederror #1#2{\showmessage\m!check3{#1,#2}}
%D \CONTEXT\ is a parameter driven package. This means that users instruct the
%D system by means of variables, values and keywords. These instructions take the
@@ -598,7 +607,7 @@
%D simple setup command:
%D
%D \starttyping
-%D \unexpanded\def\setupbox[#1]%
+%D \protected\def\setupbox[#1]%
%D {\getparameters[\??bx][#1]}
%D \stoptyping
%D
@@ -667,11 +676,11 @@
% temporary mkiv hack (we can best just store the whole table in memory)
-\unexpanded\def\setinterfaceconstant#1#2%
+\protected\def\setinterfaceconstant#1#2%
{\clf_setinterfaceconstant{#1}{#2}%
\expandafter\def\csname\c!prefix!#1\endcsname{#1}}
-\unexpanded\def\setinterfacevariable#1#2%
+\protected\def\setinterfacevariable#1#2%
{\clf_setinterfacevariable{#1}{#2}%
\expandafter\def\csname\v!prefix!#1\endcsname{#2}}
@@ -682,7 +691,7 @@
%D too. It's a bit redundant, because in these situations we could use the
%D c||version, but for documentation purposes the x||alternative comes in handy.
-\unexpanded\def\defineinterfaceconstant#1#2%
+\protected\def\defineinterfaceconstant#1#2%
{\expandafter\def\csname\c!prefix!#1\endcsname{#2}}
%D \macros
@@ -697,7 +706,7 @@
%D {\stel<iets>in}. Such split elements are no problem, because we just define two
%D elements. When no second part is needed, we use a \type {-}:
-\unexpanded\def\setinterfaceelement#1#2%
+\protected\def\setinterfaceelement#1#2%
{\clf_setinterfaceelement{#1}{#2}%
\ifcsname\e!prefix!#1\endcsname
\doifnotvalue{\e!prefix!#1}{#2}{\setvalue{\e!prefix!#1}{#2}}%
@@ -705,38 +714,27 @@
\setvalue{\e!prefix!#1}{#2}%
\fi}
-\unexpanded\def\setinterfacecommand#1#2%
+\protected\def\setinterfacecommand#1#2%
{\doifnot{#1}{#2}% todo: let when already defined
{\expandafter\def\csname#2\expandafter\endcsname\expandafter{\csname#1\endcsname}}}
%D We just ignore these:
-\unexpanded\def\startvariables{\gobbleuntil\stopvariables} \let\stopvariables\relax
-\unexpanded\def\startconstants{\gobbleuntil\stopconstants} \let\stopconstants\relax
-\unexpanded\def\startelements {\gobbleuntil\stopelements } \let\stopelements \relax
-\unexpanded\def\startcommands {\gobbleuntil\stopcommands } \let\stopcommands \relax
+\protected\def\startvariables{\gobbleuntil\stopvariables} \let\stopvariables\relax
+\protected\def\startconstants{\gobbleuntil\stopconstants} \let\stopconstants\relax
+\protected\def\startelements {\gobbleuntil\stopelements } \let\stopelements \relax
+\protected\def\startcommands {\gobbleuntil\stopcommands } \let\stopcommands \relax
%D For at the \LUA\ end (experiment):
-% \def\do@sicon#1#2{\expandafter\gdef\csname\c!prefix!#1\endcsname{#1}%
-% \expandafter\gdef\csname\k!prefix!#2\endcsname{#1}} % backmapping from non english
-% \def\do@sivar#1#2{\expandafter\gdef\csname\v!prefix!#1\endcsname{#2}}
-% \def\do@siele#1#2{\expandafter\gdef\csname\e!prefix!#1\endcsname{#2}}
-% \def\do@sicom#1#2{\expandafter\gdef\csname#2\expandafter\endcsname\expandafter{\csname#1\endcsname}}
-%
-% \startinterface english
-%
-% \def\do@sicon#1#2{\expandafter\gdef\csname\c!prefix!#1\endcsname{#1}}
-%
-% \stopinterface
-
\def\ui_c#1#2{\expandafter\gdef\csname\c!prefix!#1\endcsname{#1}%
\expandafter\gdef\csname\k!prefix!#2\endcsname{#1}} % backmapping from non english
\def\ui_s #1{\expandafter\gdef\csname\c!prefix!#1\endcsname{#1}%
\expandafter\gdef\csname\k!prefix!#1\endcsname{#1}} % backmapping from non english
\def\ui_v#1#2{\expandafter\gdef\csname\v!prefix!#1\endcsname{#2}}
\def\ui_e#1#2{\expandafter\gdef\csname\e!prefix!#1\endcsname{#2}}
-\def\ui_m#1#2{\expandafter\gdef\csname#2\expandafter\endcsname\expandafter{\csname#1\endcsname}}
+%def\ui_m#1#2{\expandafter\gdef\csname#2\expandafter\endcsname\expandafter{\csname#1\endcsname}}
+\def\ui_a#1#2{\aliasmacro#2#1}
\startinterface english
@@ -760,11 +758,11 @@
\def\contextbanner
{ConTeXt \space
- ver: \contextversion \space \contextmark \space \contextkind \space \space
+ ver: \contextversion \space \contextmark \space \space
fmt: \formatversion \space \space
int: \currentinterface/\currentresponses}
-\unexpanded\def\showcontextbanner
+\protected\def\showcontextbanner
{\writestatus\m!system\empty
\writestatus\m!system\contextbanner
\writestatus\m!system\empty}
@@ -781,9 +779,9 @@
% \def\contextversionnumber#1.#2.#3 #4:#5\relax{#1\ifnum#2<10 0\fi\purenumber{#2}\ifnum#3<10 0\fi\purenumber{#3} #4:#5}
% \edef\contextversionnumber{\expandafter\contextversionnumber\contextversion\relax\space\contextmark}
-\unexpanded\def \contextversionnumber #1.#2.#3 #4:#5\relax{#1#2#3}
- \contextversionno \expandafter\contextversionnumber\contextversion\relax
- \edef \contextversionnumber {\the\contextversionno\space\contextmark}
+\protected\def \contextversionnumber #1.#2.#3 #4:#5\relax{#1#2#3}
+ \contextversionno \expandafter\contextversionnumber\contextversion\relax
+ \edef \contextversionnumber {\the\contextversionno\space\contextmark}
%D \macros
%D {everydump}
@@ -792,7 +790,7 @@
\ifx\undefined\everydump
\newtoks\everydump
- \def\dump{\the\everydump\normaldump}
+ \def\dump{\the\everydump\global\everydump\emptytoks\glet\dump\relax\normaldump}
\fi
% \appendtoks \showcontextbanner \to \everydump
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mult-low.lua b/Master/texmf-dist/tex/context/base/mkiv/mult-low.lua
index aa0329e48cf..a893d455c1f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mult-low.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/mult-low.lua
@@ -12,7 +12,7 @@ return {
["constants"] = {
--
"zerocount", "minusone", "minustwo", "plusone", "plustwo", "plusthree", "plusfour", "plusfive",
- "plussix", "plusseven", "pluseight", "plusnine", "plusten", "plussixteen",
+ "plussix", "plusseven", "pluseight", "plusnine", "plusten", "pluseleven", "plustwelve", "plussixteen",
"plusfifty", "plushundred", "plusonehundred", "plustwohundred", "plusfivehundred",
"plusthousand", "plustenthousand", "plustwentythousand", "medcard", "maxcard", "maxcardminusone",
"zeropoint", "onepoint", "halfapoint", "onebasepoint", "maxcount", "maxdimen", "scaledpoint", "thousandpoint",
@@ -34,7 +34,7 @@ return {
--
"fmtname", "fmtversion", "texengine", "texenginename", "texengineversion", "texenginefunctionality",
"luatexengine", "pdftexengine", "xetexengine", "unknownengine",
- "contextformat", "contextversion", "contextkind", "contextlmtxmode", "contextmark", "mksuffix",
+ "contextformat", "contextversion", "contextlmtxmode", "contextmark", "mksuffix",
--
"activecatcode",
--
@@ -45,26 +45,36 @@ return {
--
"attributeunsetvalue",
--
+ "statuswrite",
+ --
"uprotationangle", "rightrotationangle", "downrotationangle", "leftrotationangle",
--
"inicatcodes",
"ctxcatcodes", "texcatcodes", "notcatcodes", "txtcatcodes", "vrbcatcodes",
"prtcatcodes", "nilcatcodes", "luacatcodes", "tpacatcodes", "tpbcatcodes",
- "xmlcatcodes", "ctdcatcodes",
+ "xmlcatcodes", "ctdcatcodes", "rlncatcodes",
--
"escapecatcode", "begingroupcatcode", "endgroupcatcode", "mathshiftcatcode", "alignmentcatcode",
"endoflinecatcode", "parametercatcode", "superscriptcatcode", "subscriptcatcode", "ignorecatcode",
"spacecatcode", "lettercatcode", "othercatcode", "activecatcode", "commentcatcode", "invalidcatcode",
--
"tabasciicode", "newlineasciicode", "formfeedasciicode", "endoflineasciicode", "endoffileasciicode",
- "spaceasciicode", "hashasciicode", "dollarasciicode", "commentasciicode", "ampersandasciicode",
+ "commaasciicode", "spaceasciicode", "periodasciicode",
+ "hashasciicode", "dollarasciicode", "commentasciicode", "ampersandasciicode",
"colonasciicode", "backslashasciicode", "circumflexasciicode", "underscoreasciicode",
"leftbraceasciicode", "barasciicode", "rightbraceasciicode", "tildeasciicode", "delasciicode",
"leftparentasciicode", "rightparentasciicode",
"lessthanasciicode", "morethanasciicode", "doublecommentsignal",
"atsignasciicode", "exclamationmarkasciicode", "questionmarkasciicode",
"doublequoteasciicode", "singlequoteasciicode", "forwardslashasciicode",
- "primeasciicode", "hyphenasciicode",
+ "primeasciicode", "hyphenasciicode", "percentasciicode", "leftbracketasciicode", "rightbracketasciicode",
+ --
+ "frozenhsizecode", "frozenskipcode", "frozenhangcode", "frozenindentcode", "frozenparfillcode",
+ "frozenadjustcode", "frozenprotrudecode", "frozentolerancecode", "frozenstretchcode",
+ "frozenloosenesscode", "frozenlastlinecode", "frozenlinepenaltycode", "frozenclubpenaltycode",
+ "frozenwidowpenaltycode", "frozendisplaypenaltycode", "frozenbrokenpenaltycode",
+ "frozendemeritscode", "frozenshapecode", "frozenlinecode", "frozenhyphenationcode",
+ "frozenallcode",
--
"activemathcharcode",
--
@@ -74,8 +84,10 @@ return {
--
"bottomlevelgroupcode", "simplegroupcode", "hboxgroupcode", "adjustedhboxgroupcode", "vboxgroupcode",
"vtopgroupcode", "aligngroupcode", "noaligngroupcode", "outputgroupcode", "mathgroupcode",
- "discretionarygroupcode", "insertgroupcode", "vcentergroupcode", "mathchoicegroupcode",
- "semisimplegroupcode", "mathshiftgroupcode", "mathleftgroupcode", "vadjustgroupcode",
+ "discretionarygroupcode", "insertgroupcode", "vadjustgroupcode", "vcentergroupcode", "mathabovegroupcode",
+ "mathchoicegroupcode", "semisimplegroupcode", "mathshiftgroupcode", "mathleftgroupcode",
+ "localboxgroupcode", "splitoffgroupcode", "splitkeepgroupcode", "preamblegroupcode",
+ "alignsetgroupcode", "finrowgroupcode", "discretionarygroupcode",
--
"charnodecode", "hlistnodecode", "vlistnodecode", "rulenodecode", "insertnodecode", "marknodecode",
"adjustnodecode", "ligaturenodecode", "discretionarynodecode", "whatsitnodecode", "mathnodecode",
@@ -89,7 +101,7 @@ return {
"fontexheight", "fontemwidth", "fontextraspace", "slantperpoint",
"mathexheight", "mathemwidth",
"interwordspace", "interwordstretch", "interwordshrink", "exheight", "emwidth", "extraspace",
- "mathsupdisplay", "mathsupnormal", "mathsupcramped", "mathsubnormal", "mathsubcombined", "mathaxisheight",
+ "mathaxisheight",
"muquad",
--
-- maybe a different class
@@ -145,6 +157,23 @@ return {
"startlmtxmode", "stoplmtxmode", "startmkivmode", "stopmkivmode",
--
"wildcardsymbol",
+ --
+ "normalhyphenationmodecode", "automatichyphenationmodecode", "explicithyphenationmodecode",
+ "syllablehyphenationmodecode", "uppercasehyphenationmodecode", "completehyphenationmodecode",
+ "compoundhyphenationmodecode", "strictstarthyphenationmodecode", "strictendhyphenationmodecode",
+ "automaticpenaltyhyphenationmodecode", "explicitpenaltyhyphenationmodecode",
+ "permitgluehyphenationmodecode", "permitallhyphenationmodecode", "permitmathreplacehyphenationmodecode",
+ "forcecheckhyphenationmodecode", "lazyligatureshyphenationmodecode",
+ --
+ "normalizelinecode", "parindentskipcode", "swaphangindentcode", "swapparsshapecode", "breakafterdircode", "removemarginkernscode", "clipwidthcode",
+ --
+ "noligaturingcode", "nokerningcode", "noleftligaturecode", "noleftkerncode", "norightligaturecode", "norightkerncode",
+ "noexpansioncode", "noprotrusioncode",
+ --
+ "frozenflagcode", "tolerantflagcode", "protectedflagcode", "primitiveflagcode", "permanentflagcode", "noalignedflagcode", "immutableflagcode", "mutableflagcode",
+ "globalflagcode", "overloadedflagcode", "immediateflagcode", "conditionalflagcode", "valueflagcode", "instanceflagcode",
+ --
+ "continuewhenlmtxmode"
},
["helpers"] = {
--
@@ -179,6 +208,7 @@ return {
--
"strippedcsname","checkedstrippedcsname",
--
+ "nofarguments",
"firstargumentfalse", "firstargumenttrue",
"secondargumentfalse", "secondargumenttrue",
"thirdargumentfalse", "thirdargumenttrue",
@@ -187,7 +217,7 @@ return {
"sixthargumentfalse", "sixthargumenttrue",
"seventhargumentfalse", "seventhargumenttrue",
--
- "vkern", "hkern",
+ "vkern", "hkern", "vpenalty", "hpenalty",
--
"doglobal", "dodoglobal", "redoglobal", "resetglobal",
--
@@ -199,6 +229,7 @@ return {
--
"mathortext",
--
+ "thebox",
"htdp",
"unvoidbox",
"hfilll", "vfilll",
@@ -222,12 +253,18 @@ return {
--
"filledhboxb", "filledhboxr", "filledhboxg", "filledhboxc", "filledhboxm", "filledhboxy", "filledhboxk",
--
+ "scratchstring", "scratchstringone", "scratchstringtwo", "tempstring",
"scratchcounter", "globalscratchcounter", "privatescratchcounter",
"scratchdimen", "globalscratchdimen", "privatescratchdimen",
"scratchskip", "globalscratchskip", "privatescratchskip",
"scratchmuskip", "globalscratchmuskip", "privatescratchmuskip",
"scratchtoks", "globalscratchtoks", "privatescratchtoks",
"scratchbox", "globalscratchbox", "privatescratchbox",
+ "scratchmacro", "scratchmacroone", "scratchmacrotwo",
+ --
+ "scratchconditiontrue", "scratchconditionfalse", "ifscratchcondition",
+ "scratchconditiononetrue", "scratchconditiononefalse", "ifscratchconditionone",
+ "scratchconditiontwotrue", "scratchconditiontwofalse", "ifscratchconditiontwo",
--
"globalscratchcounterone", "globalscratchcountertwo", "globalscratchcounterthree",
--
@@ -235,14 +272,14 @@ return {
"triggergroupedcommand", "triggergroupedcommandcs",
"simplegroupedcommand", "pickupgroupedcommand",
--
- "normalbaselineskip", "normallineskip", "normallineskiplimit",
+ "usedbaselineskip", "usedlineskip", "usedlineskiplimit",
--
"availablehsize", "localhsize", "setlocalhsize", "distributedhsize", "hsizefraction",
--
"next", "nexttoken",
--
"nextbox", "dowithnextbox", "dowithnextboxcs", "dowithnextboxcontent", "dowithnextboxcontentcs", "flushnextbox",
- "boxisempty",
+ "boxisempty", "boxtostring", "contentostring", "prerolltostring",
--
"givenwidth", "givenheight", "givendepth", "scangivendimensions",
--
@@ -297,12 +334,18 @@ return {
"quitcondition", "truecondition", "falsecondition",
--
"tracingall", "tracingnone", "loggingall",
+ "showluatokens",
+ --
+ "aliasmacro",
--
"removetoks", "appendtoks", "prependtoks", "appendtotoks", "prependtotoks", "to",
--
- "endgraf", "endpar", "everyendpar", "reseteverypar", "finishpar", "empty", "null", "space", "quad", "enspace", "emspace", "charspace", "nbsp", "crlf",
- "obeyspaces", "obeylines", "obeyedspace", "obeyedline", "obeyedtab", "obeyedpage",
- "normalspace",
+ -- "everyendpar",
+ --
+ "endgraf", "endpar", "reseteverypar", "finishpar", "empty", "null", "space", "quad", "enspace", "emspace", "charspace", "nbsp", "crlf",
+ "obeyspaces", "obeylines", "obeytabs", "obeypages", "obeyedspace", "obeyedline", "obeyedtab", "obeyedpage",
+ "normalspace", "naturalspace", "controlspace", "normalspaces",
+ "ignoretabs", "ignorelines", "ignorepages", "ignoreeofs", "setcontrolspaces",
--
"executeifdefined",
--
@@ -324,8 +367,8 @@ return {
"getvalue", "getuvalue", "setvalue", "setevalue", "setgvalue", "setxvalue", "letvalue", "letgvalue",
"resetvalue", "undefinevalue", "ignorevalue",
"setuvalue", "setuevalue", "setugvalue", "setuxvalue",
- --
- "globallet", "glet", "udef", "ugdef", "uedef", "uxdef", "checked", "unique",
+ -- glet
+ "globallet", "udef", "ugdef", "uedef", "uxdef", "checked", "unique",
--
"getparameters", "geteparameters", "getgparameters", "getxparameters", "forgetparameters", "copyparameters",
--
@@ -335,7 +378,7 @@ return {
"processcommalist", "processcommacommand", "quitcommalist", "quitprevcommalist",
"processaction", "processallactions", "processfirstactioninset", "processallactionsinset",
--
- "unexpanded", "expanded", "startexpanded", "stopexpanded", "protected", "protect", "unprotect",
+ "unexpanded", "expanded", "startexpanded", "stopexpanded", "protect", "unprotect",
--
"firstofoneargument",
"firstoftwoarguments", "secondoftwoarguments",
@@ -352,9 +395,10 @@ return {
"gobbleoneoptional", "gobbletwooptionals", "gobblethreeoptionals", "gobblefouroptionals", "gobblefiveoptionals",
--
"dorecurse", "doloop", "exitloop", "dostepwiserecurse", "recurselevel", "recursedepth", "dofastloopcs", "fastloopindex", "fastloopfinal", "dowith",
+ "doloopovermatch", "doloopovermatched", "doloopoverlist",
--
"newconstant", "setnewconstant", "setconstant", "setconstantvalue",
- "newconditional", "settrue", "setfalse", "settruevalue", "setfalsevalue",
+ "newconditional", "settrue", "setfalse", "settruevalue", "setfalsevalue", "setconditional",
--
"newmacro", "setnewmacro", "newfraction",
"newsignal",
@@ -413,8 +457,11 @@ return {
"startdmath", "stopdmath", "normalstartdmath", "normalstopdmath",
"normalsuperscript", "normalsubscript", "normalnosuperscript", "normalnosubscript",
"superscript", "subscript", "nosuperscript", "nosubscript",
+ "superprescript", "subprescript", "nosuperprescript", "nosubsprecript",
--
- "uncramped", "cramped", "triggermathstyle", "mathstylefont", "mathsmallstylefont", "mathstyleface", "mathsmallstyleface", "mathstylecommand", "mathpalette",
+ "uncramped", "cramped",
+ "mathstyletrigger", "triggermathstyle",
+ "mathstylefont", "mathsmallstylefont", "mathstyleface", "mathsmallstyleface", "mathstylecommand", "mathpalette",
"mathstylehbox", "mathstylevbox", "mathstylevcenter", "mathstylevcenteredhbox", "mathstylevcenteredvbox",
"mathtext", "setmathsmalltextbox", "setmathtextbox",
"pushmathstyle", "popmathstyle",
@@ -433,7 +480,7 @@ return {
"ctxlua", "luacode", "lateluacode", "directluacode",
"registerctxluafile", "ctxloadluafile",
"luaversion", "luamajorversion", "luaminorversion",
- "ctxluacode", "luaconditional", "luaexpanded",
+ "ctxluacode", "luaconditional", "luaexpanded", "ctxluamatch",
"startluaparameterset", "stopluaparameterset", "luaparameterset",
"definenamedlua",
"obeylualines", "obeyluatokens",
@@ -444,11 +491,15 @@ return {
"cldprocessfile", "cldloadfile", "cldloadviafile", "cldcontext", "cldcommand",
--
"carryoverpar",
+ "freezeparagraphproperties", "defrostparagraphproperties",
+ "setparagraphfreezing", "forgetparagraphfreezing",
+ "updateparagraphproperties", "updateparagraphpenalties", "updateparagraphdemerits", "updateparagraphshapes", "updateparagraphlines",
+ --
"lastlinewidth",
--
"assumelongusagecs",
--
- "Umathbotaccent",
+ "Umathbotaccent", "Umathtopaccent",
--
"righttolefthbox", "lefttorighthbox", "righttoleftvbox", "lefttorightvbox", "righttoleftvtop", "lefttorightvtop",
"rtlhbox", "ltrhbox", "rtlvbox", "ltrvbox", "rtlvtop", "ltrvtop",
@@ -459,6 +510,7 @@ return {
"dirlre", "dirrle", "dirlro", "dirrlo",
--
"lesshyphens", "morehyphens", "nohyphens", "dohyphens",
+ "compounddiscretionary",
--
"Ucheckedstartdisplaymath", "Ucheckedstopdisplaymath",
--
@@ -469,6 +521,8 @@ return {
"naturalhbox", "naturalvbox", "naturalvtop", "naturalhpack", "naturalvpack", "naturaltpack",
"reversehbox", "reversevbox", "reversevtop", "reversehpack", "reversevpack", "reversetpack",
--
+ "hcontainer", "vcontainer", "tcontainer",
+ --
"frule",
--
"compoundhyphenpenalty",
@@ -476,5 +530,34 @@ return {
"start", "stop",
--
"unsupportedcs",
+ --
+ "openout", "closeout", "write", "openin", "closein", "read", "readline", "readfromterminal",
+ --
+ "boxlines", "boxline", "setboxline", "copyboxline",
+ "boxlinewd","boxlineht", "boxlinedp",
+ "boxlinenw","boxlinenh", "boxlinend",
+ "boxlinels", "boxliners", "boxlinelh", "boxlinerh",
+ "boxlinelp", "boxlinerp", "boxlinein",
+ "boxrangewd", "boxrangeht", "boxrangedp",
+ --
+ "bitwiseset", "bitwiseand", "bitwiseor", "bitwisexor", "bitwisenot", "bitwisenil",
+ "ifbitwiseand", "bitwise", "bitwiseshift", "bitwiseflip",
+ -- old ... very low level
+ "textdir", "linedir", "pardir", "boxdir",
+ --
+ "prelistbox", "postlistbox", "prelistcopy", "postlistcopy", "setprelistbox", "setpostlistbox",
+ --
+ "noligaturing", "nokerning", "noexpansion", "noprotrusion",
+ "noleftkerning", "noleftligaturing", "norightkerning", "norightligaturing",
+ --
+ "futureletnexttoken", "defbackslashbreak", "letbackslashbreak",
+ --
+ "pushoverloadmode", "popoverloadmode", "pushrunstate", "poprunstate",
+ --
+ "suggestedalias",
+ --
+ "newlocalcount", "newlocaldimen", "newlocalskip", "newlocalmuskip", "newlocaltoks", "newlocalbox",
+ "newlocalwrite", "newlocalread",
+ "setnewlocalcount", "setnewlocaldimen", "setnewlocalskip", "setnewlocalmuskip", "setnewlocaltoks", "setnewlocalbox",
}
}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mult-mes.lua b/Master/texmf-dist/tex/context/base/mkiv/mult-mes.lua
index 299f1a404ae..65ae022c0bb 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mult-mes.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/mult-mes.lua
@@ -1159,6 +1159,9 @@ return {
no = "slutten av blokk %a (seksjon)",
ro = "sfarsit de bloc sectiune %a",
},
+ ["structures:3"] = {
+ en = "title to bookmark: %s",
+ },
["symbols:1"] = {
cs = "nacita se soubor symbolu %a",
de = "Lade Symboldatei %a",
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mult-mps.lua b/Master/texmf-dist/tex/context/base/mkiv/mult-mps.lua
index 6385d3fe51f..a2a74b3b316 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mult-mps.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/mult-mps.lua
@@ -27,7 +27,6 @@ return {
"shipout", "show", "showdependencies", "showtoken", "showvariable",
"special",
"begingroup", "endgroup", "of", "curl", "tension", "and", "controls",
- "interpath", "on", "off",
"def", "vardef", "enddef", "expr", "suffix", "text", "primary", "secondary",
"tertiary", "primarydef", "secondarydef", "tertiarydef",
"randomseed", "also", "contour", "doublepath",
@@ -68,11 +67,14 @@ return {
"fontpart", "fontsize", "glyph", "restoreclipcolor", "troffmode",
--
"runscript", "maketext", "numbersystem",
+ "overloadmode", "setproperty",
},
commands = {
+ "on", "off",
+ "interpath",
"upto", "downto",
"beginfig", "endfig",
- "beginglyph", "endglyph", -- actually a mult-fun one
+ "beginglyph", "endglyph", "beginfont", "endfont", -- actually a mult-fun one
"rotatedaround", "reflectedabout",
"arrowhead",
"currentpen", "currentpicture", "cuttings",
@@ -119,6 +121,9 @@ return {
--
"triplet", "quadruplet", "totransform", "bymatrix",
--
+ "primitive", "permanent", "immutable", "mutable", "frozen",
+ --
+ "showproperty", "showhashentry",
},
internals = { -- we need to remove duplicates above
--
@@ -131,6 +136,10 @@ return {
"join_radius",
"charscale", -- actually a mult-fun one
--
+ "inicatcoderegime", "texcatcoderegime", "luacatcoderegime", "notcatcoderegime",
+ "vrbcatcoderegime", "prtcatcoderegime", "ctxcatcoderegime", "txtcatcoderegime",
+ "catcoderegime",
+ --
"ditto", "EOF", -- maybe also down etc
--
"pen_lft", "pen_rt", "pen_top", "pen_bot", -- "pen_count_",
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mult-prm.lua b/Master/texmf-dist/tex/context/base/mkiv/mult-prm.lua
index 279de60e2d6..250a5dfc18d 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mult-prm.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/mult-prm.lua
@@ -32,11 +32,14 @@ return {
"iffontchar",
"interactionmode",
"interlinepenalties",
+ "lastchkdim",
+ "lastchknum",
"lastlinefit",
"lastnodetype",
"marks",
"muexpr",
"mutoglue",
+ "numericscale",
"numexpr",
"pagediscards",
"parshapedimen",
@@ -44,7 +47,6 @@ return {
"parshapelength",
"predisplaydirection",
"protected",
- "readline",
"savinghyphcodes",
"savingvdiscards",
"scantokens",
@@ -55,16 +57,22 @@ return {
"splitdiscards",
"splitfirstmarks",
"topmarks",
+ "tracingalignments",
"tracingassigns",
"tracinggroups",
"tracingifs",
"tracingnesting",
- "tracingscantokens",
"unexpanded",
"unless",
"widowpenalties",
},
["luatex"]={
+ "UUskewed",
+ "UUskewedwithdelims",
+ "Uabove",
+ "Uabovewithdelims",
+ "Uatop",
+ "Uatopwithdelims",
"Uchar",
"Udelcode",
"Udelcodenum",
@@ -74,6 +82,7 @@ return {
"Uhextensible",
"Uleft",
"Umathaccent",
+ "Umathaccentbaseheight",
"Umathaxis",
"Umathbinbinspacing",
"Umathbinclosespacing",
@@ -90,6 +99,7 @@ return {
"Umathcharnum",
"Umathcharnumdef",
"Umathcharslot",
+ "Umathclass",
"Umathclosebinspacing",
"Umathcloseclosespacing",
"Umathcloseinnerspacing",
@@ -179,6 +189,8 @@ return {
"Umathskewedfractionhgap",
"Umathskewedfractionvgap",
"Umathspaceafterscript",
+ "Umathspacebeforescript",
+ "Umathspacingmode",
"Umathstackdenomdown",
"Umathstacknumup",
"Umathstackvgap",
@@ -197,9 +209,13 @@ return {
"Umathunderdelimiterbgap",
"Umathunderdelimitervgap",
"Umiddle",
+ "Unosubprescript",
"Unosubscript",
+ "Unosuperprescript",
"Unosuperscript",
+ "Uover",
"Uoverdelimiter",
+ "Uoverwithdelims",
"Uradical",
"Uright",
"Uroot",
@@ -210,7 +226,10 @@ return {
"Ustartmath",
"Ustopdisplaymath",
"Ustopmath",
+ "Ustyle",
+ "Usubprescript",
"Usubscript",
+ "Usuperprescript",
"Usuperscript",
"Uunderdelimiter",
"Uvextensible",
@@ -218,18 +237,22 @@ return {
"adjustspacingshrink",
"adjustspacingstep",
"adjustspacingstretch",
+ "afterassigned",
"aftergrouped",
+ "aliased",
"alignmark",
"aligntab",
+ "atendofgroup",
+ "atendofgrouped",
"attribute",
"attributedef",
"automaticdiscretionary",
- "automatichyphenmode",
"automatichyphenpenalty",
+ "automigrationmode",
"begincsname",
"beginlocalcontrol",
"boundary",
- "boxattr",
+ "boxattribute",
"boxdirection",
"boxorientation",
"boxtotal",
@@ -237,43 +260,68 @@ return {
"boxxoffset",
"boxymove",
"boxyoffset",
- "breakafterdirmode",
"catcodetable",
"clearmarks",
- "compoundhyphenmode",
"crampeddisplaystyle",
"crampedscriptscriptstyle",
"crampedscriptstyle",
"crampedtextstyle",
"csstring",
+ "defcsname",
+ "dimensiondef",
+ "directlua",
+ "edefcsname",
"efcode",
"endlocalcontrol",
+ "enforced",
"etoksapp",
"etokspre",
+ "everytab",
"exceptionpenalty",
+ "expand",
+ "expandafterpars",
+ "expandafterspaces",
+ "expandcstoken",
"expanded",
+ "expandtoken",
"explicitdiscretionary",
"explicithyphenpenalty",
"firstvalidlanguage",
- "fixupboxesmode",
"fontid",
+ "fontspecifiedsize",
"formatname",
"frozen",
+ "futuredef",
"futureexpand",
"futureexpandis",
"futureexpandisap",
+ "gdefcsname",
"gleaders",
"glet",
+ "gletcsname",
+ "gluespecdef",
"glyphdatafield",
+ "glyphoptions",
+ "glyphscale",
+ "glyphscriptfield",
+ "glyphscriptscale",
+ "glyphscriptscriptscale",
+ "glyphstatefield",
+ "glyphtextscale",
+ "glyphxoffset",
+ "glyphxscale",
+ "glyphyoffset",
+ "glyphyscale",
"gtoksapp",
"gtokspre",
"hjcode",
"hpack",
- "hyphenationbounds",
"hyphenationmin",
- "hyphenpenaltymode",
+ "hyphenationmode",
"ifabsdim",
"ifabsnum",
+ "ifarguments",
+ "ifboolean",
"ifchkdim",
"ifchknum",
"ifcmpdim",
@@ -281,27 +329,42 @@ return {
"ifcondition",
"ifcstok",
"ifdimval",
- "iffrozen",
+ "ifempty",
+ "ifflags",
+ "ifhastok",
+ "ifhastoks",
+ "ifhasxtoks",
"ifincsname",
+ "ifmathparameter",
+ "ifmathstyle",
"ifnumval",
- "ifprotected",
+ "ifparameter",
+ "ifparameters",
+ "ifrelax",
"iftok",
- "ifusercmd",
+ "ignorearguments",
"ignorepars",
- "immediateassigned",
- "immediateassignment",
+ "immediate",
+ "immutable",
"initcatcodetable",
+ "insertheights",
"insertht",
- "internalcodesmode",
+ "instance",
+ "integerdef",
+ "lastarguments",
"lastnamedcs",
"lastnodesubtype",
- "leftghost",
"leftmarginkern",
"letcharcode",
+ "letcsname",
"letfrozen",
"letprotected",
"linedirection",
+ "linepar",
+ "listcallbackmode",
"localbrokenpenalty",
+ "localcontrol",
+ "localcontrolled",
"localinterlinepenalty",
"localleftbox",
"localrightbox",
@@ -323,25 +386,35 @@ return {
"mathflattenmode",
"mathitalicsmode",
"mathnolimitsmode",
- "matholdmode",
"mathpenaltiesmode",
"mathrulesfam",
"mathrulesmode",
"mathrulethicknessmode",
+ "mathscale",
"mathscriptboxmode",
"mathscriptcharmode",
"mathscriptsmode",
"mathstyle",
"mathsurroundmode",
"mathsurroundskip",
+ "mugluespecdef",
+ "mutable",
+ "noaligned",
"noboundary",
"nohrule",
- "nokerns",
- "noligs",
+ "norelax",
+ "normalizelinemode",
"nospaces",
"novrule",
+ "orelse",
+ "orunless",
"outputbox",
+ "overloaded",
+ "overloadmode",
+ "parametercount",
+ "parattr",
"pardirection",
+ "permanent",
"postexhyphenchar",
"posthyphenchar",
"prebinoppenalty",
@@ -353,22 +426,30 @@ return {
"protrusionboundary",
"pxdimen",
"quitvmode",
- "rightghost",
"rightmarginkern",
"rpcode",
"savecatcodetable",
"scantextokens",
"setfontid",
- "shapemode",
+ "snapshotpar",
+ "supmarkmode",
+ "swapcsvalues",
"textdirection",
+ "thewithoutunit",
+ "tokenized",
"toksapp",
"tokspre",
+ "tolerant",
"tpack",
"tracingfonts",
+ "tracingmath",
+ "undent",
"unletfrozen",
"unletprotected",
"vpack",
"wordboundary",
+ "wrapuppar",
+ "xdefcsname",
"xtoksapp",
"xtokspre",
},
@@ -521,7 +602,6 @@ return {
"char",
"chardef",
"cleaders",
- "closein",
"clubpenalty",
"copy",
"count",
@@ -540,7 +620,6 @@ return {
"delimitershortfall",
"dimen",
"dimendef",
- "directlua",
"discretionary",
"displayindent",
"displaylimits",
@@ -571,7 +650,6 @@ return {
"everyjob",
"everymath",
"everypar",
- "everytab",
"everyvbox",
"exhyphenchar",
"exhyphenpenalty",
@@ -584,10 +662,12 @@ return {
"font",
"fontdimen",
"fontname",
+ "fontspecifiedname",
"futurelet",
"gdef",
"global",
"globaldefs",
+ "glyph",
"halign",
"hangafter",
"hangindent",
@@ -597,7 +677,6 @@ return {
"hfill",
"hfilneg",
"hfuzz",
- "hoffset",
"holdinginserts",
"hrule",
"hsize",
@@ -611,7 +690,6 @@ return {
"ifcase",
"ifcat",
"ifdim",
- "ifeof",
"iffalse",
"ifhbox",
"ifhmode",
@@ -653,7 +731,6 @@ return {
"looseness",
"lower",
"lowercase",
- "mag",
"mark",
"mathaccent",
"mathbin",
@@ -672,6 +749,8 @@ return {
"maxdeadcycles",
"maxdepth",
"meaning",
+ "meaningfull",
+ "meaningless",
"medmuskip",
"message",
"middle",
@@ -694,16 +773,15 @@ return {
"nullfont",
"number",
"omit",
- "openin",
"or",
"ordlimits",
- "orelse",
"outer",
"output",
"outputpenalty",
"over",
"overfullrule",
"overline",
+ "overshoot",
"overwithdelims",
"pagedepth",
"pagefilllstretch",
@@ -714,6 +792,7 @@ return {
"pagestretch",
"pagetotal",
"par",
+ "parfillleftskip",
"parfillskip",
"parindent",
"parshape",
@@ -729,13 +808,13 @@ return {
"prevgraf",
"radical",
"raise",
- "read",
"relax",
"relpenalty",
"right",
"righthyphenmin",
"rightskip",
"romannumeral",
+ "scaledfontdimen",
"scriptfont",
"scriptscriptfont",
"scriptscriptstyle",
@@ -771,11 +850,14 @@ return {
"thickmuskip",
"thinmuskip",
"time",
+ "todimension",
+ "tointeger",
"toks",
"toksdef",
"tolerance",
"topmark",
"topskip",
+ "toscaled",
"tracingcommands",
"tracinglostchars",
"tracingmacros",
@@ -790,11 +872,13 @@ return {
"underline",
"unhbox",
"unhcopy",
+ "unhpack",
"unkern",
"unpenalty",
"unskip",
"unvbox",
"unvcopy",
+ "unvpack",
"uppercase",
"vadjust",
"valign",
@@ -805,7 +889,6 @@ return {
"vfill",
"vfilneg",
"vfuzz",
- "voffset",
"vrule",
"vsize",
"vskip",
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mult-sys.mkiv b/Master/texmf-dist/tex/context/base/mkiv/mult-sys.mkiv
index 8f8794df71c..7e9792720ad 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mult-sys.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/mult-sys.mkiv
@@ -34,6 +34,7 @@
\definesystemconstant {hans}
\definesystemconstant {taco}
+\definesystemconstant {wolfgang}
%D First we define some system constants used for both the multi||lingual
%D interface and multi||linguag typesetting.
@@ -46,16 +47,17 @@
\definesystemconstant {ancientgreek} \definesystemconstant {agr}
\definesystemconstant {ancientlatin} \definesystemconstant {ala}
\definesystemconstant {arabic} \definesystemconstant {ar}
+\definesystemconstant {belarussian} \definesystemconstant {be}
\definesystemconstant {bokmal} \definesystemconstant {nb}
\definesystemconstant {catalan} \definesystemconstant {ca}
\definesystemconstant {chinese} \definesystemconstant {cn}
-\definesystemconstant {chinese} \definesystemconstant {cn}
\definesystemconstant {croatian} \definesystemconstant {hr}
\definesystemconstant {czech} \definesystemconstant {cs}
\definesystemconstant {danish} \definesystemconstant {da}
\definesystemconstant {dutch} \definesystemconstant {nl}
\definesystemconstant {english} \definesystemconstant {en}
\definesystemconstant {estonian} \definesystemconstant {et}
+\definesystemconstant {esperanto} % \definesystemconstant {eo}
\definesystemconstant {farsi} \definesystemconstant {fa} % just persian
\definesystemconstant {finnish} \definesystemconstant {fi}
\definesystemconstant {french} \definesystemconstant {fr}
@@ -63,6 +65,7 @@
\definesystemconstant {german} \definesystemconstant {de}
\definesystemconstant {greek} \definesystemconstant {gr}
\definesystemconstant {hebrew} \definesystemconstant {he}
+\definesystemconstant {yiddish} \definesystemconstant {yi}
\definesystemconstant {hungarian} \definesystemconstant {hu}
\definesystemconstant {italian} \definesystemconstant {it}
\definesystemconstant {japanese} \definesystemconstant {ja}
@@ -70,6 +73,7 @@
\definesystemconstant {latin} \definesystemconstant {la}
\definesystemconstant {lithuanian} \definesystemconstant {lt}
\definesystemconstant {malayalam} \definesystemconstant {ml}
+\definesystemconstant {macedonian} \definesystemconstant {mk}
\definesystemconstant {norwegian} \definesystemconstant {no}
\definesystemconstant {nynorsk} \definesystemconstant {nn}
\definesystemconstant {persian} \definesystemconstant {pe}
@@ -79,6 +83,7 @@
\definesystemconstant {russian} \definesystemconstant {ru}
\definesystemconstant {slovak} \definesystemconstant {sk}
\definesystemconstant {slovenian} \definesystemconstant {sl}
+\definesystemconstant {serbian} \definesystemconstant {sr}
\definesystemconstant {spanish} \definesystemconstant {es}
\definesystemconstant {swedish} \definesystemconstant {sv}
\definesystemconstant {thai} \definesystemconstant {th} % mojca mentioned it at BT2013 but we need more info
@@ -274,6 +279,7 @@
\definesystemconstant {start}
\definesystemconstant {stop}
\definesystemconstant {unknown}
+\definesystemconstant {unexpanded}
% translating setups is asking for a mess so we keep them as-is:
@@ -407,8 +413,11 @@
\definesystemconstant {text}
\definesystemconstant {paragraph}
\definesystemconstant {margintext}
+\definesystemconstant {themaintextcolor}
\definesystemconstant {line}
+\definesystemconstant {itemgroupcolumns}
+\definesystemconstant {vfrac}
\definesystemconstant {number}
\definesystemconstant {symbol}
\definesystemconstant {format}
@@ -573,19 +582,19 @@
\defineinterfaceconstant {e} {e} % can go
\defineinterfaceconstant {f} {f} % can go
-\defineinterfaceconstant {s} {s}
+%defineinterfaceconstant {s} {s}
\defineinterfaceconstant {r} {r}
\defineinterfaceconstant {g} {g}
-\defineinterfaceconstant {b} {b}
-\defineinterfaceconstant {c} {c}
+%defineinterfaceconstant {b} {b}
+%defineinterfaceconstant {c} {c}
\defineinterfaceconstant {m} {m}
-\defineinterfaceconstant {y} {y}
+%defineinterfaceconstant {y} {y}
\defineinterfaceconstant {k} {k}
-\defineinterfaceconstant {a} {a} % alternative
-\defineinterfaceconstant {t} {t} % transparency
+%defineinterfaceconstant {a} {a} % alternative
+%defineinterfaceconstant {t} {t} % transparency
\defineinterfaceconstant {p} {p} % percentage
-\defineinterfaceconstant {h} {h}
-\defineinterfaceconstant {s} {s}
+%defineinterfaceconstant {h} {h}
+%defineinterfaceconstant {s} {s}
\defineinterfaceconstant {v} {v}
\defineinterfaceconstant {rgb} {rgb}
@@ -672,7 +681,7 @@
\selectinterface
-%D Ok, here are some more, because we've got ouselves some extensions to \CONTEXT.
+%D Ok, here are some more, because we've got ourselves some extensions to \CONTEXT.
\definemessageconstant {addresses}
\definemessageconstant {documents}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-acc.lua b/Master/texmf-dist/tex/context/base/mkiv/node-acc.lua
index e6c6176026e..d8f4b25bf3a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-acc.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-acc.lua
@@ -129,10 +129,9 @@ end)
-- local done = false
-- for n, id in nextnode, tonuts(head) do
-- if id == disc then
--- local r = getfield(n,"replace")
--- local p = getfield(n,"pre")
--- if r and p then
--- local str = compact(r)
+-- local pre, post, replace = getdisc(n)
+-- if replace and pre then
+-- local str = compact(replace)
-- local hsh = hyphenated[str]
-- if not hsh then
-- hsh = #codes + 1
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-aux.lua b/Master/texmf-dist/tex/context/base/mkiv/node-aux.lua
index d13db4bbaf5..d3c537a3bce 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-aux.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-aux.lua
@@ -21,8 +21,7 @@ local glyph_code = nodecodes.glyph
local hlist_code = nodecodes.hlist
local vlist_code = nodecodes.vlist
local attributelist_code = nodecodes.attributelist -- temporary
-local localpar_code = nodecodes.localpar
-local ligatureglyph_code = nodes.glyphcodes.ligature
+local par_code = nodecodes.par
local nuts = nodes.nuts
local tonut = nuts.tonut
@@ -48,7 +47,6 @@ local setlink = nuts.setlink
local setlist = nuts.setlist
local setnext = nuts.setnext
local setprev = nuts.setprev
-local setcomponents = nuts.setcomponents
local setattrlist = nuts.setattrlist
local traversers = nuts.traversers
@@ -382,167 +380,11 @@ function nodes.rehpack(n,...)
rehpack(tonut(n),...)
end
-if CONTEXTLMTXMODE > 0 then
-
- local fastcopy = table.fastcopy
- local getprop = nuts.getprop
- local setprop = nuts.setprop
-
- local function set_components(base,list)
- local t = { }
- local n = 0
- while list do
- local char = isglyph(list)
- if char then
- n = n + 1
- t[n] = char
- end
- list = getnext(list)
- end
- setprop(base,"components",n > 0 and t or false)
- end
-
- local function get_components(base)
- return getprop(base,"components")
- end
-
- local function copy_no_components(base)
- local copy = copy_node(base)
- setprop(copy,"components",false) -- no metatable lookup!
- return copy
- end
-
- local function copy_only_glyphs(base)
- local t = getprop(base,"components") -- also metatable
- if t then
- return fastcopy(t)
- end
- end
-
- local function do_count(t,marks)
- local n = 0
- if t then
- for i=1,#t do
- local c = t[i]
- if type(c) == "table" then
- n = n + do_count(t,marks)
- elseif not marks[c] then
- n = n + 1
- else
- --marks don't count
- end
- end
- end
- return n
- end
-
- -- start is a mark and we need to keep that one
-
- local done = false
-
- local function count_components(base,marks)
- local char = isglyph(base)
- if char then
- if getsubtype(base) == ligatureglyph_code then
- if not done then
- logs.report("fonts","!")
- logs.report("fonts","! check count_components with mkiv !")
- logs.report("fonts","!")
- done = true
- end
- local t = getprop(base,"components")
- if t then
- return do_count(t,marks)
- end
- elseif not marks[char] then
- return 1
- end
- end
- return 0
- end
-
- nuts.set_components = set_components
- nuts.get_components = get_components
- nuts.copy_only_glyphs = copy_only_glyphs
- nuts.copy_no_components = copy_no_components
- nuts.count_components = count_components
-
-else
-
- local get_components = node.direct.getcomponents
- local set_components = node.direct.setcomponents
-
- local function copy_no_components(g,copyinjection)
- local components = get_components(g)
- if components then
- set_components(g)
- local n = copy_node(g)
- if copyinjection then
- copyinjection(n,g)
- end
- set_components(g,components)
- -- maybe also upgrade the subtype but we don't use it anyway
- return n
- else
- local n = copy_node(g)
- if copyinjection then
- copyinjection(n,g)
- end
- return n
- end
- end
-
- local function copy_only_glyphs(current)
- local head = nil
- local previous = nil
- for n in nextglyph, current do
- n = copy_node(n)
- if head then
- setlink(previous,n)
- else
- head = n
- end
- previous = n
- end
- return head
- end
-
- -- start is a mark and we need to keep that one
-
- local function count_components(start,marks)
- local char = isglyph(start)
- if char then
- if getsubtype(start) == ligatureglyph_code then
- local n = 0
- local components = get_components(start)
- while components do
- n = n + count_components(components,marks)
- components = getnext(components)
- end
- return n
- elseif not marks[char] then
- return 1
- end
- end
- return 0
- end
-
- nuts.set_components = set_components
- nuts.get_components = get_components
- nuts.copy_only_glyphs = copy_only_glyphs
- nuts.copy_no_components = copy_no_components
- nuts.count_components = count_components
-
-end
-
-nuts.setcomponents = function() report_error("unsupported: %a","setcomponents") end
-nuts.getcomponents = function() report_error("unsupported: %a","getcomponents") end
-
do
- local localparcodes = nodes.localparcodes
- local hmodepar_code = localparcodes.vmode_par
- local vmodepar_code = localparcodes.hmode_par
+ local parcodes = nodes.parcodes
+ local hmodepar_code = parcodes.vmode_par
+ local vmodepar_code = parcodes.hmode_par
local getnest = tex.getnest
local getsubtype = nuts.getsubtype
@@ -550,7 +392,7 @@ do
function nuts.setparproperty(action,...)
local tail = tonut(getnest().tail)
while tail do
- if getid(tail) == localpar_code then
+ if getid(tail) == par_code then
local s = getsubtype(tail)
if s == hmodepar_code or s == vmodepar_code then
return action(tail,...)
@@ -571,10 +413,7 @@ do
end
--- Currently only in luametatex ... experimental anyway .. if it doesn't end
--- up in luatex I'll move this to a different module.
-
-do
+if not nuts.getnormalizedline then
local nextnode = traversers.glue
local findfail = nuts.tail
@@ -617,14 +456,12 @@ do
nuts.find_node = find_node
- nodes.getnormalizeline = node.getnormalizeline or function() return 0 end
- nodes.setnormalizeline = node.setnormalizeline or function() end
-
- nuts.getnormalizedline = direct.getnormalizedline or function(h)
+ function nuts.getnormalizedline(h)
if getid(h) == hlist_code and getsubtype(h) == line_code then
local ls, rs = 0, 0
local lh, rh = 0, 0
- local is, ps = 0, 0
+ local lp, rp = 0, 0
+ local is = 0
local h = getlist(h)
local t = findtail(h)
for n, subtype in nextglue, h do
@@ -633,241 +470,21 @@ do
elseif subtype == lefthangskip_code then lh = getwidth(n)
elseif subtype == righthangskip_code then rh = getwidth(n)
elseif subtype == indentskip_code then is = getwidth(n)
- elseif subtype == parfillskip_code then ps = getwidth(n)
+ elseif subtype == parfillskip_code then rp = getwidth(n)
end
end
- return ls, rs, lh, rh, is, ps, h, t
- end
- end
-
-end
-
-if not nodes.count then
-
- local type = type
-
- local direct = node.direct
- local todirect = direct.tovaliddirect
- local tonode = direct.tonode
-
- local count = direct.count
- local length = direct.length
- local slide = direct.slide
-
- function node.count(id,first,last)
- return count(id,first and todirect(first), last and todirect(last) or nil)
- end
-
- function node.length(first,last)
- return length(first and todirect(first), last and todirect(last) or nil)
- end
-
- function node.slide(n)
- if n then
- n = slide(todirect(n))
- if n then
- return tonode(n)
- end
- end
- return nil
- end
-
- local hyphenating = direct.hyphenating
- local ligaturing = direct.ligaturing
- local kerning = direct.kerning
-
- -- kind of inconsistent
-
- function node.hyphenating(first,last)
- if first then
- local h, t = hyphenating(todirect(first), last and todirect(last) or nil)
- return h and tonode(h) or nil, t and tonode(t) or nil, true
- else
- return nil, false
- end
- end
-
- function node.ligaturing(first,last)
- if first then
- local h, t = ligaturing(todirect(first), last and todirect(last) or nil)
- return h and tonode(h) or nil, t and tonode(t) or nil, true
- else
- return nil, false
- end
- end
-
- function node.kerning(first,last)
- if first then
- local h, t = kerning(todirect(first), last and todirect(last) or nil)
- return h and tonode(h) or nil, t and tonode(t) or nil, true
- else
- return nil, false
- end
- end
-
- local protect_glyph = direct.protect_glyph
- local unprotect_glyph = direct.unprotect_glyph
- local protect_glyphs = direct.protect_glyphs
- local unprotect_glyphs = direct.unprotect_glyphs
-
- function node.protect_glyphs(first,last)
- protect_glyphs(todirect(first), last and todirect(last) or nil)
- end
-
- function node.unprotect_glyphs(first,last)
- unprotect_glyphs(todirect(first), last and todirect(last) or nil)
- end
-
- function node.protect_glyph(first)
- protect_glyph(todirect(first))
- end
-
- function node.unprotect_glyph(first)
- unprotect_glyph(todirect(first))
- end
-
- local flatten_discretionaries = direct.flatten_discretionaries
- local check_discretionaries = direct.check_discretionaries
- local check_discretionary = direct.check_discretionary
-
- function node.flatten_discretionaries(first)
- local h, count = flatten_discretionaries(todirect(first))
- return tonode(h), count
- end
-
- function node.check_discretionaries(n)
- check_discretionaries(todirect(n))
- end
-
- function node.check_discretionary(n)
- check_discretionary(todirect(n))
- end
-
- local hpack = direct.hpack
- local vpack = direct.vpack
- local list_to_hlist = direct.mlist_to_hlist
-
- function node.hpack(head,...)
- local h, badness = hpack(head and todirect(head) or nil,...)
- return tonode(h), badness
- end
-
- function node.vpack(head,...)
- local h, badness = vpack(head and todirect(head) or nil,...)
- return tonode(h), badness
- end
-
- function node.mlist_to_hlist(head,...)
- return tonode(mlist_to_hlist(head and todirect(head) or nil,...))
- end
-
- local end_of_math = direct.end_of_math
- local find_attribute = direct.find_attribute
- local first_glyph = direct.first_glyph
-
- function node.end_of_math(n)
- if n then
- n = end_of_math(todirect(n))
- if n then
- return tonode(n)
- end
- end
- return nil
- end
-
- function node.find_attribute(n,a)
- if n then
- local v, n = find_attribute(todirect(n),a)
- if n then
- return v, tonode(n)
- end
+ return {
+ leftskip = ls,
+ rightskip = rs,
+ lefthangskip = lh,
+ righthangskip = rh,
+ indent = is,
+ parfillrightskip = rp,
+ parfillleftskip = lp,
+ head = h,
+ tail = t,
+ }
end
- return nil
- end
-
- function node.first_glyph(first,last)
- local n = first_glyph(todirect(first), last and todirect(last) or nil)
- return n and tonode(n) or nil
- end
-
- local dimensions = direct.dimensions
- local rangedimensions = direct.rangedimensions
- local effective_glue = direct.effective_glue
-
- function node.dimensions(a,b,c,d,e)
- if type(a) == "userdata" then
- a = todirect(a)
- if type(b) == "userdata" then
- b = todirect(b)
- end
- return dimensions(a,b)
- else
- d = todirect(d)
- if type(e) == "userdata" then
- e = todirect(e)
- end
- return dimensions(a,b,c,d,e)
- end
- return 0, 0, 0
- end
-
- function node.rangedimensions(parent,first,last)
- return rangedimenensions(todirect(parent),todirect(first),last and todirect(last))
- end
-
- function node.effective_glue(list,parent)
- return effective_glue(list and todirect(list) or nil,parent and todirect(parent) or nil)
- end
-
- local uses_font = direct.uses_font
- local has_glyph = direct.has_glyph
- local protrusion_skippable = direct.protrusion_skippable
- local prepend_prevdepth = direct.prepend_prevdepth
- local make_extensible = direct.make_extensible
-
- function node.uses_font(n,f)
- return uses_font(todirect(n),f)
- end
-
- function node.has_glyph(n)
- return has_glyph(todirect(n))
- end
-
- function node.protrusion_skippable(n)
- return protrusion_skippable(todirect(n))
- end
-
- function node.prepend_prevdepth(n)
- local n, d = prepend_prevdepth(todirect(n))
- return tonode(n), d
- end
-
- function node.make_extensible(...)
- local n = make_extensible(...)
- return n and tonode(n) or nil
- end
-
- local last_node = direct.last_node
-
- function node.last_node()
- local n = last_node()
- return n and tonode(n) or nil
- end
-
- local is_zero_glue = direct.is_zero_glue
- local getglue = direct.getglue
- local setglue = direct.setglue
-
- function node.is_zero_glue(n)
- return is_zero_glue(todirect(n))
- end
-
- function node.get_glue(n)
- return get_glue(todirect(n))
- end
-
- function node.set_glue(n)
- return set_glue(todirect(n))
end
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-bck.lua b/Master/texmf-dist/tex/context/base/mkiv/node-bck.lua
index 53ace65e99e..ec84a3db5c3 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-bck.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-bck.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['node-bck'] = {
version = 1.001,
+ optimize = true,
comment = "companion to node-bck.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
@@ -62,9 +63,6 @@ local unsetvalue = attributes.unsetvalue
local linefillers = nodes.linefillers
-local a_color = privateattributes("color")
-local a_transparency = privateattributes("transparency")
-local a_colormodel = privateattributes("colormodel")
local a_background = privateattributes("background")
local a_alignbackground = privateattributes("alignbackground")
local a_linefiller = privateattributes("linefiller")
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-bck.mkiv b/Master/texmf-dist/tex/context/base/mkiv/node-bck.mkiv
index b093274430c..0e7bbb853f3 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-bck.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-bck.mkiv
@@ -34,12 +34,12 @@
\fi\fi}
\def\node_backgrounds_thecolorattr#1%
- {attr \colormodelattribute \attribute\colormodelattribute
+ {attr \colormodelattribute \c_attr_colormodel
attr \colorattribute \lastnamedcs
attr \transparencyattribute \thetransparencyattribute{#1} } % can be optimized
\def\thecolorattr#1%
- {attr \colormodelattribute \attribute\colormodelattribute
+ {attr \colormodelattribute \c_attr_colormodel
attr \colorattribute \csname\??colorattribute#1\endcsname
attr \transparencyattribute \thetransparencyattribute{#1} } % can be optimized
@@ -52,19 +52,19 @@
\def\thebackgroundcolorattr#1%
{attr \backgroundattribute \plusone
- attr \colormodelattribute \attribute\colormodelattribute
+ attr \colormodelattribute \c_attr_colormodel
attr \colorattribute \csname\??colorattribute#1\endcsname
attr \transparencyattribute \thetransparencyattribute{#1} } % can be optimized
\def\node_backgrounds_thebackgroundcolorattr#1%
{attr \backgroundattribute \plusone
- attr \colormodelattribute \attribute\colormodelattribute
+ attr \colormodelattribute \c_attr_colormodel
attr \colorattribute \lastnamedcs
attr \transparencyattribute \thetransparencyattribute{#1} } % can be optimized
\def\thealignbackgroundcolorattr#1%
{attr \alignbackgroundattribute \plusone
- attr \colormodelattribute \attribute\colormodelattribute
+ attr \colormodelattribute \c_attr_colormodel
attr \colorattribute \csname\??colorattribute#1\endcsname
attr \transparencyattribute \thetransparencyattribute{#1} } % can be optimized
@@ -81,9 +81,9 @@
% \dousecolorparameter{#2}%
% \normalexpanded{\endgroup#1
% attr \backgroundattribute \plusone
-% attr \colormodelattribute \the\attribute\colormodelattribute
-% attr \colorattribute \the\attribute\colorattribute
-% attr \transparencyattribute \the\attribute\transparencyattribute}}
+% attr \colormodelattribute \the\c_attr_colormodel
+% attr \colorattribute \the\c_attr_color
+% attr \transparencyattribute \the\c_attr_transparency}}
%
% more efficient:
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-cmp.lua b/Master/texmf-dist/tex/context/base/mkiv/node-cmp.lua
deleted file mode 100644
index e13e93d1f14..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/node-cmp.lua
+++ /dev/null
@@ -1,232 +0,0 @@
-if node.count then
- return
-end
-
-local type = type
-
-local node = node
-local direct = node.direct
-local todirect = direct.tovaliddirect
-local tonode = direct.tonode
-
-local count = direct.count
-local length = direct.length
-local slide = direct.slide
-
-function node.count(id,first,last)
- return count(id,first and todirect(first), last and todirect(last) or nil)
-end
-
-function node.length(first,last)
- return length(first and todirect(first), last and todirect(last) or nil)
-end
-
-function node.slide(n)
- if n then
- n = slide(todirect(n))
- if n then
- return tonode(n)
- end
- end
- return nil
-end
-
-local hyphenating = direct.hyphenating
-local ligaturing = direct.ligaturing
-local kerning = direct.kerning
-
--- kind of inconsistent
-
-function node.hyphenating(first,last)
- if first then
- local h, t = hyphenating(todirect(first), last and todirect(last) or nil)
- return h and tonode(h) or nil, t and tonode(t) or nil, true
- else
- return nil, false
- end
-end
-
-function node.ligaturing(first,last)
- if first then
- local h, t = ligaturing(todirect(first), last and todirect(last) or nil)
- return h and tonode(h) or nil, t and tonode(t) or nil, true
- else
- return nil, false
- end
-end
-
-function node.kerning(first,last)
- if first then
- local h, t = kerning(todirect(first), last and todirect(last) or nil)
- return h and tonode(h) or nil, t and tonode(t) or nil, true
- else
- return nil, false
- end
- end
-
-local protect_glyph = direct.protect_glyph
-local unprotect_glyph = direct.unprotect_glyph
-local protect_glyphs = direct.protect_glyphs
-local unprotect_glyphs = direct.unprotect_glyphs
-
-function node.protect_glyphs(first,last)
- protect_glyphs(todirect(first), last and todirect(last) or nil)
-end
-
-function node.unprotect_glyphs(first,last)
- unprotect_glyphs(todirect(first), last and todirect(last) or nil)
-end
-
-function node.protect_glyph(first)
- protect_glyph(todirect(first))
-end
-
-function node.unprotect_glyph(first)
- unprotect_glyph(todirect(first))
-end
-
-local flatten_discretionaries = direct.flatten_discretionaries
-local check_discretionaries = direct.check_discretionaries
-local check_discretionary = direct.check_discretionary
-
-function node.flatten_discretionaries(first)
- local h, count = flatten_discretionaries(todirect(first))
- return tonode(h), count
-end
-
-function node.check_discretionaries(n)
- check_discretionaries(todirect(n))
-end
-
-function node.check_discretionary(n)
- check_discretionary(todirect(n))
-end
-
-local hpack = direct.hpack
-local vpack = direct.vpack
-local list_to_hlist = direct.mlist_to_hlist
-
-function node.hpack(head,...)
- local h, badness = hpack(head and todirect(head) or nil,...)
- return tonode(h), badness
-end
-
-function node.vpack(head,...)
- local h, badness = vpack(head and todirect(head) or nil,...)
- return tonode(h), badness
-end
-
-function node.mlist_to_hlist(head,...)
- return tonode(mlist_to_hlist(head and todirect(head) or nil,...))
-end
-
-local end_of_math = direct.end_of_math
-local find_attribute = direct.find_attribute
-local first_glyph = direct.first_glyph
-
-function node.end_of_math(n)
- if n then
- n = end_of_math(todirect(n))
- if n then
- return tonode(n)
- end
- end
- return nil
-end
-
-function node.find_attribute(n,a)
- if n then
- local v, n = find_attribute(todirect(n),a)
- if n then
- return v, tonode(n)
- end
- end
- return nil
-end
-
-function node.first_glyph(first,last)
- local n = first_glyph(todirect(first), last and todirect(last) or nil)
- return n and tonode(n) or nil
-end
-
-local dimensions = direct.dimensions
-local rangedimensions = direct.rangedimensions
-local effective_glue = direct.effective_glue
-
-function node.dimensions(a,b,c,d,e)
- if type(a) == "userdata" then
- a = todirect(a)
- if type(b) == "userdata" then
- b = todirect(b)
- end
- return dimensions(a,b)
- else
- d = todirect(d)
- if type(e) == "userdata" then
- e = todirect(e)
- end
- return dimensions(a,b,c,d,e)
- end
- return 0, 0, 0
-end
-
-function node.rangedimensions(parent,first,last)
- return rangedimenensions(todirect(parent),todirect(first),last and todirect(last))
-end
-
-function node.effective_glue(list,parent)
- return effective_glue(list and todirect(list) or nil,parent and todirect(parent) or nil)
-end
-
-local uses_font = direct.uses_font
-local has_glyph = direct.has_glyph
-local protrusion_skippable = direct.protrusion_skippable
-local prepend_prevdepth = direct.prepend_prevdepth
-local make_extensible = direct.make_extensible
-
-function node.uses_font(n,f)
- return uses_font(todirect(n),f)
-end
-
-function node.has_glyph(n)
- return has_glyph(todirect(n))
-end
-
-function node.protrusion_skippable(n)
- return protrusion_skippable(todirect(n))
-end
-
-function node.prepend_prevdepth(n)
- local n, d = prepend_prevdepth(todirect(n))
- return tonode(n), d
-end
-
-function node.make_extensible(...)
- local n = make_extensible(...)
- return n and tonode(n) or nil
-end
-
-local last_node = direct.last_node
-
-function node.last_node()
- local n = last_node()
- return n and tonode(n) or nil
-end
-
-local is_zero_glue = direct.is_zero_glue
-local getglue = direct.getglue
-local setglue = direct.setglue
-
-function node.is_zero_glue(n)
- return is_zero_glue(todirect(n))
-end
-
-function node.get_glue(n)
- return get_glue(todirect(n))
-end
-
-function node.set_glue(n)
- return set_glue(todirect(n))
-end
-
-node.family_font = tex.getfontoffamily
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-ext.lua b/Master/texmf-dist/tex/context/base/mkiv/node-ext.lua
deleted file mode 100644
index 82ec04ee592..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/node-ext.lua
+++ /dev/null
@@ -1,30 +0,0 @@
-if not modules then modules = { } end modules ['node-ext'] = {
- 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"
-}
-
---[[ldx--
-<p>Serializing nodes can be handy for tracing. Also, saving and
-loading node lists can come in handy as soon we are going to
-use external applications to process node lists.</p>
---ldx]]--
-
-function nodes.show(stack)
--- logs.writer(table.serialize(stack))
-end
-
-function nodes.save(stack,name) -- *.ltn : luatex node file
--- if name then
--- file.savedata(name,table.serialize(stack))
--- else
--- logs.writer(table.serialize(stack))
--- end
-end
-
-function nodes.load(name)
--- return file.loaddata(name)
--- -- todo
-end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-fin.lua b/Master/texmf-dist/tex/context/base/mkiv/node-fin.lua
index a848cef69da..373cce3ce60 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-fin.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-fin.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['node-fin'] = {
version = 1.001,
+ optimize = true,
comment = "companion to node-fin.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
@@ -375,6 +376,7 @@ local function selective(attribute,head,inheritance,default) -- two attributes
else
check = has_dimensions(stack)
end
+ else
end
if check then
local c = getattr(stack,attribute)
@@ -634,100 +636,3 @@ end
statistics.register("attribute processing time", function()
return statistics.elapsedseconds(attributes,"front- and backend")
end)
-
--- -- --
-
-do
-
- local cleaners = { }
- local trace = true -- false
-
- function attributes.cleanup()
- if next(cleaners) then
- local values = setmetatableindex("table")
-
- if trace then
- starttiming(values)
- end
-
- local function check(l)
- for n, id in nextnode, l do
- if id == hlist_code or id == vlist_code or id == glue_code then
- local l = getlist(n)
- if l then
- check(l)
- end
- end
- for a in next, cleaners do
- local v = getattr(n,a)
- if v then
- -- values[a] = values[a] + 1
- values[a][v] = true
- end
- end
- end
- end
-
- local top = texgetnest("ptr")
- for i=1,top do
- local l = texgetnest(i)
- if l then
- check(tonut(l.head))
- end
- end
-
- do local l
- l = tonut(texlists.page_ins_head) if l then check(l) end
- l = tonut(texlists.contrib_head) if l then check(l) end
- l = tonut(texlists.page_discards_head) if l then check(l) end
- l = tonut(texlists.split_discards_head) if l then check(l) end
- l = tonut(texlists.page_head) if l then check(l) end
- end
-
- -- todo: traverseboxes
-
- for i=0,65535 do
- local b = getbox(i)
- if b then
- local l = getlist(b)
- if l then
- check(l)
- end
- end
- end
-
- for a, t in next, values do
- cleaners[a](a,t)
- end
-
- if trace then
- stoptiming(values)
- local a = table.sortedkeys(values)
- local t = statistics.elapsedtime(values)
- local r = tex.getcount("realpageno")
- if #a == 0 then
- logs.report("attributes","cleaning up at page %i took %s seconds, no attributes",r,t)
- else
- logs.report("attributes","cleaning up at page %i took %s seconds, attributes: % t",r,t,a)
- end
- end
- end
- end
-
- -- not yet used but when we do ... delay a call till we enable it (attr-ini.mkiv)
-
- -- local function show(a,t) for k, v in next, t do print(a,k) end end
- --
- -- attributes.registercleaner( 1, show)
- -- attributes.registercleaner( 2, show)
-
- function attributes.registercleaner(a,f)
- cleaners[a] = f
- end
-
- implement {
- name = "cleanupattributes",
- actions = attributes.cleanup,
- }
-
-end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-fin.mkiv b/Master/texmf-dist/tex/context/base/mkiv/node-fin.mkiv
index 086b19ae5dc..2bf0e0806cd 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-fin.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-fin.mkiv
@@ -19,6 +19,7 @@
\unprotect
\registerctxluafile{node-shp}{optimize}
+% \registerctxluafile{node-fin}{autosuffix,optimize} % we might generalize this one
\registerctxluafile{node-fin}{optimize} % we might generalize this one
% we might have two variants at some point (efficiency)
@@ -36,8 +37,8 @@
\newcount\c_syst_attr_trigger
-\edef\startinheritattributes{\attribute\triggerattribute\plusone}
-\edef\stopinheritattributes {\attribute\triggerattribute\attributeunsetvalue}
+\edef\startinheritattributes{\c_attr_trigger\plusone}
+\edef\stopinheritattributes {\c_attr_trigger\attributeunsetvalue}
\def\syst_attr_trigger_copy_yes{\afterassignment\syst_attr_trigger_copy_indeed\c_syst_attr_trigger}
\def\syst_attr_trigger_dump_yes{\afterassignment\syst_attr_trigger_dump_indeed\c_syst_attr_trigger}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-fnt.lua b/Master/texmf-dist/tex/context/base/mkiv/node-fnt.lua
index 1b245639b78..f3bb6228fe0 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-fnt.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-fnt.lua
@@ -45,13 +45,12 @@ local nuts = nodes.nuts
local getid = nuts.getid
local getsubtype = nuts.getsubtype
-local getdisc = nuts.getdisc
+local getreplace = nuts.getreplace
local getnext = nuts.getnext
local getprev = nuts.getprev
local getboth = nuts.getboth
local getdata = nuts.getdata
local getglyphdata = nuts.getglyphdata
------ getdisc = nuts.getdisc
local setchar = nuts.setchar
local setlink = nuts.setlink
@@ -139,37 +138,14 @@ fonts.hashes.processes = fontprocesses
-- inside a run which means that we need to keep track of this which in turn complicates matters
-- in a way i don't like
--- we need to deal with the basemode fonts here and can only run over ranges as we
--- otherwise get luatex craches due to all kind of asserts in the disc/lig builder
+-- we need to deal with the basemode fonts here and can only run over ranges as we otherwise get
+-- luatex craches due to all kind of asserts in the disc/lig builder
+
+-- there is no gain in merging used (dynamic 0) and dynamics apart from a bit less code
local ligaturing = nuts.ligaturing
local kerning = nuts.kerning
--- -- -- this will go away
---
--- local disccodes = nodes.disccodes
--- local explicitdisc_code = disccodes.explicit
--- local automaticdisc_code = disccodes.automatic
--- local expanders = nil
---
--- function fonts.setdiscexpansion(v)
--- if v == nil or v == true then
--- expanders = languages and languages.expanders
--- elseif type(v) == "table" then
--- expanders = v
--- else
--- expanders = false
--- end
--- end
---
--- function fonts.getdiscexpansion()
--- return expanders and true or false
--- end
---
--- fonts.setdiscexpansion(true)
---
--- -- -- till here
-
local function start_trace(head)
run = run + 1
report_fonts()
@@ -193,19 +169,15 @@ local function start_trace(head)
end
end
-local function stop_trace(u,usedfonts,a,attrfonts,b,basefonts,r,redundant,e,expanders)
+local function stop_trace(u,usedfonts,a,attrfonts,b,basefonts,r,redundant)
report_fonts()
report_fonts("statics : %s",u > 0 and concat(keys(usedfonts)," ") or "none")
report_fonts("dynamics: %s",a > 0 and concat(keys(attrfonts)," ") or "none")
report_fonts("built-in: %s",b > 0 and b or "none")
report_fonts("removed : %s",r > 0 and r or "none")
- -- if expanders then
- -- report_fonts("expanded: %s",e > 0 and e or "none")
- -- end
report_fonts()
end
-
do
local usedfonts
@@ -221,7 +193,7 @@ do
local lastproc
local lastnone
- local a, u, b, r, e
+ local a, u, b, r
local function protectnone()
protect_glyphs(firstnone,lastnone)
@@ -307,7 +279,7 @@ do
lastproc = nil
lastnone = nil
- a, u, b, r, e = 0, 0, 0, 0, 0
+ a, u, b, r = 0, 0, 0, 0
if trace_fontrun then
start_trace(head)
@@ -425,15 +397,13 @@ do
end
if force_discrun then
-
-- basefont is not supported in disc only runs ... it would mean a lot of
- -- ranges .. we could try to run basemode as a separate processor run but
- -- not for now (we can consider it when the new node code is tested
+ -- ranges .. we could try to run basemode as a separate processor run but not
+ -- for now (we can consider it when the new node code is tested
for d in nextdisc, head do
- -- we could use first_glyph, only doing replace is good enough because
- -- pre and post are normally used for hyphens and these come from fonts
- -- that part of the hyphenated word
- local _, _, r = getdisc(d)
+ -- doing only replace is good enough because pre and post are normally used
+ -- for hyphens and these come from fonts that part of the hyphenated word
+ local r = getreplace(d)
if r then
local prevfont = nil
local prevattr = nil
@@ -465,19 +435,13 @@ do
if firstnone then
protectnone()
end
- -- elseif expanders then
- -- local subtype = getsubtype(d)
- -- if subtype == automaticdisc_code or subtype == explicitdisc_code then
- -- expanders[subtype](d)
- -- e = e + 1
- -- end
end
end
end
if trace_fontrun then
- stop_trace(u,usedfonts,a,attrfonts,b,basefonts,r,redundant,e,expanders)
+ stop_trace(u,usedfonts,a,attrfonts,b,basefonts,r,redundant)
end
-- in context we always have at least 2 processors
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-gcm.lua b/Master/texmf-dist/tex/context/base/mkiv/node-gcm.lua
new file mode 100644
index 00000000000..5b598f6b033
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-gcm.lua
@@ -0,0 +1,96 @@
+if not modules then modules = { } end modules ['node-gmc'] = {
+ version = 1.001,
+ comment = "companion to node-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local type, tostring = type, tostring
+
+local nodes = nodes
+local nodecodes = nodes.nodecodes
+local ligature_code = nodes.glyphcodes.ligature
+local nuts = nodes.nuts
+
+local getnext = nuts.getnext
+local getsubtype = nuts.getsubtype
+local getprev = nuts.getprev
+local setlink = nuts.setlink
+local nextglyph = nuts.traversers.glyph
+local copy_node = nuts.copy
+local isglyph = nuts.isglyph
+
+local report_error = logs.reporter("node-aux:error")
+
+local get_components = node.direct.getcomponents
+local set_components = node.direct.setcomponents
+
+local function copy_no_components(g,copyinjection)
+ local components = get_components(g)
+ if components then
+ set_components(g)
+ local n = copy_node(g)
+ if copyinjection then
+ copyinjection(n,g)
+ end
+ set_components(g,components)
+ -- maybe also upgrade the subtype but we don't use it anyway
+ return n
+ else
+ local n = copy_node(g)
+ if copyinjection then
+ copyinjection(n,g)
+ end
+ return n
+ end
+end
+
+local function copy_only_glyphs(current)
+ local head = nil
+ local previous = nil
+ for n in nextglyph, current do
+ n = copy_node(n)
+ if head then
+ setlink(previous,n)
+ else
+ head = n
+ end
+ previous = n
+ end
+ return head
+end
+
+-- start is a mark and we need to keep that one
+
+local function count_components(start,marks)
+ local char = isglyph(start)
+ if char then
+ if getsubtype(start) == ligature_code then
+ local n = 0
+ local components = get_components(start)
+ while components do
+ n = n + count_components(components,marks)
+ components = getnext(components)
+ end
+ return n
+ elseif not marks[char] then
+ return 1
+ end
+ end
+ return 0
+end
+
+local function flush_components()
+ -- this is a no-op in mkiv / generic
+end
+
+nuts.set_components = set_components
+nuts.get_components = get_components
+nuts.copy_only_glyphs = copy_only_glyphs
+nuts.copy_no_components = copy_no_components
+nuts.count_components = count_components
+nuts.flush_components = flush_components
+
+nuts.setcomponents = function() report_error("unsupported: %a","setcomponents") end
+nuts.getcomponents = function() report_error("unsupported: %a","getcomponents") end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/node-ini.lua
index 8ebec4a1c62..701e3efa92c 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-ini.lua
@@ -78,19 +78,18 @@ local dircodes = mark(getsubtypes("dir"))
local glyphcodes = mark(getsubtypes("glyph"))
local disccodes = mark(getsubtypes("disc"))
local gluecodes = mark(getsubtypes("glue"))
-local leadercodes = mark(getsubtypes("leader"))
local fillcodes = mark(getsubtypes("fill"))
local boundarycodes = mark(getsubtypes("boundary"))
local penaltycodes = mark(getsubtypes("penalty"))
local kerncodes = mark(getsubtypes("kern"))
-local margincodes = CONTEXTLMTXMODE == 0 and mark(getsubtypes("marginkern")) or { }
+local margincodes = mark(getsubtypes("marginkern"))
local mathcodes = mark(getsubtypes("math"))
local noadcodes = mark(getsubtypes("noad"))
local radicalcodes = mark(getsubtypes("radical"))
local accentcodes = mark(getsubtypes("accent"))
local fencecodes = mark(getsubtypes("fence"))
----- fractioncodes = mark(getsubtypes("fraction"))
-local localparcodes = allocate { [0] = "new_graf", "local_box", "hmode_par", "penalty", "math" } -- only in luametatex now
+local parcodes = allocate { [0] = "vmode_par", "local_box", "hmode_par", "penalty", "math" }
local function simplified(t)
local r = { }
@@ -104,13 +103,13 @@ local nodecodes = simplified(node.types())
local whatcodes = simplified(node.whatsits and node.whatsits() or { })
local usercodes = allocate {
- [ 97] = "attribute", -- a
- [100] = "number", -- d
- [102] = "float", -- f
- [108] = "lua", -- l
- [110] = "node", -- n
- [115] = "string", -- s
- [116] = "token" -- t
+ [ 97] = "attribute", -- a
+ [100] = "number", -- d
+ [102] = "float", -- f
+ [108] = "lua", -- l
+ [110] = "node", -- n
+ [115] = "string", -- s
+ [116] = "token" -- t
}
local noadoptions = allocate {
@@ -125,23 +124,9 @@ local noadoptions = allocate {
right = 0x14 + 0x08,
}
--- local directionvalues = mark(getvalues("dir"))
--- local gluevalues = mark(getvalues("glue"))
--- local literalvalues = mark(getvalues("literal"))
-
local dirvalues = allocate {
- [0] = "TLT",
- [1] = "TRT",
- [2] = "LTL",
- [3] = "RTT",
-}
-
-local gluevalues = allocate {
- [0] = "normal",
- [1] = "fi",
- [2] = "fil",
- [3] = "fill",
- [4] = "filll",
+ [0] = "lefttoright",
+ [1] = "righttoleft",
}
local literalvalues = allocate {
@@ -154,6 +139,8 @@ local literalvalues = allocate {
[6] = "special",
}
+local gluevalues = mark(getvalues("glue"))
+
gluecodes = allocate(swapped(gluecodes,gluecodes))
dircodes = allocate(swapped(dircodes,dircodes))
boundarycodes = allocate(swapped(boundarycodes,boundarycodes))
@@ -171,35 +158,39 @@ margincodes = allocate(swapped(margincodes,margincodes))
disccodes = allocate(swapped(disccodes,disccodes))
accentcodes = allocate(swapped(accentcodes,accentcodes))
fencecodes = allocate(swapped(fencecodes,fencecodes))
-localparcodes = allocate(swapped(localparcodes,localparcodes))
+parcodes = allocate(swapped(parcodes,parcodes))
rulecodes = allocate(swapped(rulecodes,rulecodes))
-leadercodes = allocate(swapped(leadercodes,leadercodes))
usercodes = allocate(swapped(usercodes,usercodes))
noadoptions = allocate(swapped(noadoptions,noadoptions))
dirvalues = allocate(swapped(dirvalues,dirvalues))
gluevalues = allocate(swapped(gluevalues,gluevalues))
literalvalues = allocate(swapped(literalvalues,literalvalues))
+if not nodecodes.delimiter then
+ -- as in luametatex / lmtx
+ nodecodes.delimiter = nodecodes.delim
+ nodecodes[nodecodes.delimiter] = "delimiter"
+ nodecodes.delim = nil
+end
+
+if not nodecodes.par then
+ -- as in luametatex / lmtx
+ local p = nodecodes.localpar
+ nodecodes.par = p
+ nodecodes[p] = "par"
+end
+
if not gluecodes.indentskip then
- gluecodes.indentskip = gluecodes.userskip
- gluecodes.lefthangskip = gluecodes.userskip
- gluecodes.righthangskip = gluecodes.userskip
- gluecodes.correctionskip = gluecodes.userskip
- gluecodes.intermathskip = gluecodes.userskip
+ gluecodes.indentskip = gluecodes.userskip
+ gluecodes.lefthangskip = gluecodes.userskip
+ gluecodes.righthangskip = gluecodes.userskip
+ gluecodes.correctionskip = gluecodes.userskip
+ gluecodes.intermathskip = gluecodes.userskip
+ gluecodes.parfillleftskip = gluecodes.parfillskip
+ gluecodes.parfillrightskip = gluecodes.parfillskip
end
-if CONTEXTLMTXMODE > 0 then
- whatcodes.literal = 0x1 whatcodes[0x1] = "literal"
- whatcodes.latelua = 0x2 whatcodes[0x2] = "latelua"
- whatcodes.userdefined = 0x3 whatcodes[0x3] = "userdefined"
- whatcodes.savepos = 0x4 whatcodes[0x4] = "savepos"
- whatcodes.save = 0x5 whatcodes[0x5] = "save"
- whatcodes.restore = 0x6 whatcodes[0x6] = "restore"
- whatcodes.setmatrix = 0x7 whatcodes[0x7] = "setmatrix"
- whatcodes.open = 0x8 whatcodes[0x8] = "open"
- whatcodes.close = 0x9 whatcodes[0x9] = "close"
- whatcodes.write = 0xA whatcodes[0xA] = "write"
-elseif not whatcodes.literal then
+if not whatcodes.literal then
whatcodes.literal = whatcodes.pdfliteral
whatcodes.save = whatcodes.pdfsave
whatcodes.restore = whatcodes.pdfrestore
@@ -223,18 +214,14 @@ nodes.disccodes = disccodes
nodes.accentcodes = accentcodes
nodes.radicalcodes = radicalcodes
nodes.fencecodes = fencecodes
-nodes.localparcodes = localparcodes
+nodes.parcodes = parcodes
nodes.rulecodes = rulecodes
-nodes.leadercodes = leadercodes
nodes.usercodes = usercodes
nodes.noadoptions = noadoptions
nodes.dirvalues = dirvalues
nodes.gluevalues = gluevalues
nodes.literalvalues = literalvalues
-dirvalues.lefttoright = 0
-dirvalues.righttoleft = 1
-
nodes.subtypes = allocate {
[nodecodes.accent] = accentcodes,
[nodecodes.boundary] = boundarycodes,
@@ -245,7 +232,7 @@ nodes.subtypes = allocate {
[nodecodes.glyph] = glyphcodes,
[nodecodes.hlist] = listcodes,
[nodecodes.kern] = kerncodes,
- [nodecodes.localpar] = localparcodes,
+ [nodecodes.par] = parcodes,
-- [nodecodes.marginkern] = margincodes,
[nodecodes.math] = mathcodes,
[nodecodes.noad] = noadcodes,
@@ -255,31 +242,28 @@ nodes.subtypes = allocate {
-- [nodecodes.user] = usercodes,
[nodecodes.vlist] = listcodes,
[nodecodes.whatsit] = whatcodes,
+ [nodecodes.marginkern] = margincodes
}
-if CONTEXTLMTXMODE == 0 then
- nodes.subtypes[nodecodes.marginkern] = margincodes
-end
-
table.setmetatableindex(nodes.subtypes,function(t,k)
local v = { }
t[k] = v
return v
end)
-nodes.skipcodes = gluecodes -- more friendly
-nodes.directioncodes = dircodes -- more friendly
-nodes.whatsitcodes = whatcodes -- more official
+-- a few more friendly aliases:
+
+nodes.skipcodes = gluecodes
+nodes.directioncodes = dircodes
+nodes.whatsitcodes = whatcodes
nodes.marginkerncodes = margincodes
nodes.discretionarycodes = disccodes
-nodes.directionvalues = dirvalues -- more friendly
-nodes.skipvalues = gluevalues -- more friendly
-nodes.literalvalues = literalvalues -- more friendly
+nodes.directionvalues = dirvalues
+nodes.skipvalues = gluevalues
+nodes.literalvalues = literalvalues
glyphcodes.glyph = glyphcodes.character
-localparcodes.vmode_par = localparcodes.new_graf
-
listcodes.row = listcodes.alignment
listcodes.column = listcodes.alignment
@@ -307,7 +291,6 @@ nodes.codes = allocate { -- mostly for listing
accent = accentcodes,
fence = fencecodes,
rule = rulecodes,
- leader = leadercodes,
user = usercodes,
noadoptions = noadoptions,
}
@@ -351,18 +334,3 @@ trackers.register("system.showcodes", nodes.showcodes)
if node.fix_node_lists then
node.fix_node_lists(false)
end
-
--- We use the real node code numbers.
-
-if CONTEXTLMTXMODE > 0 then
-
- local texchardef = tex.chardef
-
- if texchardef then
- for i=0,nodecodes.glyph do
- texchardef(nodecodes[i] .. "nodecode",i)
- end
- tex.set("internalcodesmode",1)
- end
-
-end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-ini.mkiv b/Master/texmf-dist/tex/context/base/mkiv/node-ini.mkiv
index 5bf53cd2d01..072cb319aad 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-ini.mkiv
@@ -17,16 +17,13 @@
\newcount\filterstate \filterstate\plusone % hm, public
-\ifcase\contextlmtxmode \else
- \registerctxluafile{node-cmp}{}
-\fi
-
\registerctxluafile{node-ini}{}
\registerctxluafile{node-met}{}
\registerctxluafile{node-nut}{}
\registerctxluafile{node-res}{}
%registerctxluafile{node-ppt}{} % experimental, not used so probably useless
\registerctxluafile{node-aux}{}
+\registerctxluafile{node-gcm}{}
\registerctxluafile{node-tst}{}
\registerctxluafile{node-tra}{} % we might split it off (module)
\registerctxluafile{node-snp}{}
@@ -35,7 +32,7 @@
\registerctxluafile{node-dir}{} % experimental, not yet (and maybe never) used
\registerctxluafile{node-pro}{}
\registerctxluafile{node-ser}{}
-\registerctxluafile{node-ext}{}
+%registerctxluafile{node-ext}{}
\registerctxluafile{node-acc}{} % experimental
%registerctxluafile{node-prp}{} % makes no sense (yet)
\registerctxluafile{node-scn}{}
@@ -53,14 +50,4 @@
\unexpanded\def\visualizenextnodes{\dowithnextbox{\ctxlua{nodes.visualizebox(\number\nextbox,false,true)}}}
\unexpanded\def\visualizeflatnodes{\dowithnextbox{\ctxlua{nodes.visualizebox(\number\nextbox,true,true)}}}
-\unexpanded\def\starttracingnodes[#1]{\ctxlua{nodes.tracers.characters.start("#1")}}
-\unexpanded\def\stoptracingnodes {\ctxlua{nodes.tracers.characters.stop()}}
-
-% \starttext
-% \starttracingnodes[characters]
-% \input tufte \par
-% \input tufte \par
-% \stoptracingnodes
-% \stoptext
-
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-ltp.lua b/Master/texmf-dist/tex/context/base/mkiv/node-ltp.lua
index a85bdfe0128..6cb9e8d102f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-ltp.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-ltp.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['node-par'] = {
version = 1.001,
+ optimize = true,
comment = "companion to node-par.mkiv",
author = "Hans Hagen",
copyright = "ConTeXt Development Team",
@@ -259,7 +260,6 @@ local nodepool = nuts.pool
local nodecodes = nodes.nodecodes
local kerncodes = nodes.kerncodes
-local margincodes = nodes.margincodes
local disccodes = nodes.disccodes
local mathcodes = nodes.mathcodes
local fillcodes = nodes.fillcodes
@@ -281,12 +281,11 @@ local unset_code = nodecodes.unset
local marginkern_code = nodecodes.marginkern
local dir_code = nodecodes.dir
local boundary_code = nodecodes.boundary
-local localpar_code = nodecodes.localpar
+local par_code = nodecodes.par
local protrusionboundary_code = nodes.boundarycodes.protrusion
-local leaders_code = nodes.leadercodes.leaders
+local leaders_code = nodes.gluecodes.leaders
local indentlist_code = nodes.listcodes.indent
-local ligatureglyph_code = nodes.glyphcodes.ligature
local cancel_code = nodes.dircodes.cancel
local userkern_code = kerncodes.userkern
@@ -294,9 +293,6 @@ local italickern_code = kerncodes.italiccorrection
local fontkern_code = kerncodes.fontkern
local accentkern_code = kerncodes.accentkern
-local leftmargin_code = margincodes.left
------ rightmargin_code = margincodes.right
-
local automaticdisc_code = disccodes.automatic
local regulardisc_code = disccodes.regular
local firstdisc_code = disccodes.first
@@ -349,6 +345,11 @@ local new_hlist = nodepool.hlist
local getnormalizeline = nodes.getnormalizeline
+local packing_exactly = "exactly"
+local packing_additional = "additional"
+local packing_expanded = CONTEXTLMTXMODE > 0 and "expanded" or "cal_expand_ratio"
+local packing_substitute = CONTEXTLMTXMODE > 0 and "substiture" or "subst_ex_font"
+
-- helpers --
-- It makes more sense to move the somewhat messy dir state tracking
@@ -1321,7 +1322,7 @@ do
while current_break do
- -- hm, here we have head == localpar and in the engine it's a temp node
+ -- hm, here we have head == par and in the engine it's a temp node
head = inject_dirs_at_begin_of_line(dirstack,head)
@@ -1461,7 +1462,7 @@ do
p = nil
end
break
- elseif id == localpar_code then
+ elseif id == par_code then
break
elseif id == temp_code then
-- Go on.
@@ -1558,29 +1559,29 @@ do
start = insert_node_before(start,start,ls)
end
if normalize > 0 then
- local localpar = nil
- local localdir = nil
+ local par = nil
+ local dir = nil
local indent = nil
- local localpars = nil
+ local pars = nil
local notflocal = 0
for n, id, subtype in nextnode, start do
if id == hlist_code then
if normalize > 1 and subtype == indentlist_code then
indent = n
end
- elseif id == localpar_code then
+ elseif id == par_code then
if start_of_par(n) then --- maybe subtype check instead
- localpar = n
+ par = n
elseif noflocals then
noflocals = noflocals + 1
- localpars[noflocals] = n
+ pars[noflocals] = n
else
noflocals = 1
- localpars = { n }
+ pars = { n }
end
elseif id == dir_code then
- if localpar and not localdir and subtype(n) == cancel_code then
- localdir = n
+ if par and not dir and subtype(n) == cancel_code then
+ dir = n
end
end
end
@@ -1589,14 +1590,14 @@ do
setattributelist(i,start)
replace_node(indent,i)
end
- if localdir then
- local d = new_direction((getdirection(localpar)))
+ if dir then
+ local d = new_direction((getdirection(par)))
setattributelist(d,start)
- replace_node(localpar,d)
+ replace_node(par,d)
end
- if localpars then
+ if pars then
for i=1,noflocals do
- start = remove_node(start,localpars[i],true)
+ start = remove_node(start,pars[i],true)
end
end
end
@@ -1651,9 +1652,9 @@ do
local finished_line = nil
if adjust_spacing > 0 then
statistics.nofadjustedlines = statistics.nofadjustedlines + 1
- finished_line = xpack_nodes(start,cur_width,"cal_expand_ratio",par.par_break_dir,par.first_line,current_line) -- ,current_break.analysis)
+ finished_line = xpack_nodes(start,cur_width,packing_expanded,par.par_break_dir,par.first_line,current_line) -- ,current_break.analysis)
else
- finished_line = xpack_nodes(start,cur_width,"exactly",par.par_break_dir,par.first_line,current_line) -- ,current_break.analysis)
+ finished_line = xpack_nodes(start,cur_width,packing_exactly,par.par_break_dir,par.first_line,current_line) -- ,current_break.analysis)
end
if protrude_chars > 0 then
statistics.nofprotrudedlines = statistics.nofprotrudedlines + 1
@@ -1717,7 +1718,7 @@ do
local id = getid(next)
if id == glyph_code then
break
- elseif id == localpar_code then
+ elseif id == par_code then
-- nothing
elseif id < math_code then
-- messy criterium
@@ -1754,7 +1755,7 @@ par.head = head
if getnext(h) then
report_parbuilders("something is left over")
end
- if getid(h) ~= localpar_code then
+ if getid(h) ~= par_code then
report_parbuilders("no local par node")
end
end
@@ -2452,7 +2453,7 @@ par.head = head
if current then
local id = getid(current)
- if id == localpar_code then
+ if id == par_code then
par.init_internal_left_box = getfield(current,"box_left")
par.init_internal_left_box_width = getfield(current,"box_left_width")
par.internal_pen_inter = getfield(current,"pen_inter")
@@ -2615,7 +2616,7 @@ par.head = head
p_active, n_active = try_break(getpenalty(current), unhyphenated_code, par, first_p, current, checked_expansion)
elseif id == dir_code then
par.line_break_dir = checked_line_dir(dirstack,current) or par.line_break_dir
- elseif id == localpar_code then
+ elseif id == par_code then
par.internal_pen_inter = getfield(current,"pen_inter")
par.internal_pen_broken = getfield(current,"pen_broken")
par.internal_left_box = getfield(current,"box_left")
@@ -2881,7 +2882,7 @@ do
local function common_message(hlist,line,str)
write_nl("")
- if status.output_active then -- unset
+ if CONTEXTLMTXMODE > 0 and tex.getoutputactive() or status.output_active then
write(str," has occurred while \\output is active")
else
write(str)
@@ -2961,7 +2962,7 @@ do
setlist(hlist,head)
end
- local cal_expand_ratio = method == "cal_expand_ratio" or method == "subst_ex_font"
+ local cal_expand_ratio = method == packing_expanded or method == packing_substitute
direction = direction or texget("textdir")
@@ -3136,7 +3137,7 @@ do
if pre_adjust_tail then
pre_adjust_tail.next = nil -- todo
end
- if method == "additional" then
+ if method == packing_additional then
width = width + natural
end
setwhd(hlist,width,height,depth)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-met.lua b/Master/texmf-dist/tex/context/base/mkiv/node-met.lua
index db079c11628..31f9a16b28b 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-met.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-met.lua
@@ -1,4 +1,4 @@
-if not modules then modules = { } end modules ['node-nut'] = {
+if not modules then modules = { } end modules ['node-MET'] = {
version = 1.001,
comment = "companion to node-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
@@ -102,7 +102,7 @@ nodes.uses_font = node.uses_font
nodes.first_glyph = node.first_glyph
nodes.has_glyph = node.has_glyph or node.first_glyph
-nodes.current_attr = node.current_attr
+nodes.current_attributes = node.current_attributes or node.current_attr
nodes.has_field = node.has_field
nodes.last_node = node.last_node
nodes.usedlist = node.usedlist
@@ -629,233 +629,3 @@ end
nodes.keys = keys -- [id][subtype]
nodes.fields = nodefields -- (n)
-
-if not nodes.count then
-
- local type = type
-
- local direct = node.direct
- local todirect = direct.tovaliddirect
- local tonode = direct.tonode
-
- local count = direct.count
- local length = direct.length
- local slide = direct.slide
-
- function node.count(id,first,last)
- return count(id,first and todirect(first), last and todirect(last) or nil)
- end
-
- function node.length(first,last)
- return length(first and todirect(first), last and todirect(last) or nil)
- end
-
- function node.slide(n)
- if n then
- n = slide(todirect(n))
- if n then
- return tonode(n)
- end
- end
- return nil
- end
-
- local hyphenating = direct.hyphenating
- local ligaturing = direct.ligaturing
- local kerning = direct.kerning
-
- -- kind of inconsistent
-
- function node.hyphenating(first,last)
- if first then
- local h, t = hyphenating(todirect(first), last and todirect(last) or nil)
- return h and tonode(h) or nil, t and tonode(t) or nil, true
- else
- return nil, false
- end
- end
-
- function node.ligaturing(first,last)
- if first then
- local h, t = ligaturing(todirect(first), last and todirect(last) or nil)
- return h and tonode(h) or nil, t and tonode(t) or nil, true
- else
- return nil, false
- end
- end
-
- function node.kerning(first,last)
- if first then
- local h, t = kerning(todirect(first), last and todirect(last) or nil)
- return h and tonode(h) or nil, t and tonode(t) or nil, true
- else
- return nil, false
- end
- end
-
- local protect_glyph = direct.protect_glyph
- local unprotect_glyph = direct.unprotect_glyph
- local protect_glyphs = direct.protect_glyphs
- local unprotect_glyphs = direct.unprotect_glyphs
-
- function node.protect_glyphs(first,last)
- protect_glyphs(todirect(first), last and todirect(last) or nil)
- end
-
- function node.unprotect_glyphs(first,last)
- unprotect_glyphs(todirect(first), last and todirect(last) or nil)
- end
-
- function node.protect_glyph(first)
- protect_glyph(todirect(first))
- end
-
- function node.unprotect_glyph(first)
- unprotect_glyph(todirect(first))
- end
-
- local flatten_discretionaries = direct.flatten_discretionaries
- local check_discretionaries = direct.check_discretionaries
- local check_discretionary = direct.check_discretionary
-
- function node.flatten_discretionaries(first)
- local h, count = flatten_discretionaries(todirect(first))
- return tonode(h), count
- end
-
- function node.check_discretionaries(n)
- check_discretionaries(todirect(n))
- end
-
- function node.check_discretionary(n)
- check_discretionary(todirect(n))
- end
-
- local hpack = direct.hpack
- local vpack = direct.vpack
- local list_to_hlist = direct.mlist_to_hlist
-
- function node.hpack(head,...)
- local h, badness = hpack(head and todirect(head) or nil,...)
- return tonode(h), badness
- end
-
- function node.vpack(head,...)
- local h, badness = vpack(head and todirect(head) or nil,...)
- return tonode(h), badness
- end
-
- function node.mlist_to_hlist(head,...)
- return tonode(mlist_to_hlist(head and todirect(head) or nil,...))
- end
-
- local end_of_math = direct.end_of_math
- local find_attribute = direct.find_attribute
- local first_glyph = direct.first_glyph
-
- function node.end_of_math(n)
- if n then
- n = end_of_math(todirect(n))
- if n then
- return tonode(n)
- end
- end
- return nil
- end
-
- function node.find_attribute(n,a)
- if n then
- local v, n = find_attribute(todirect(n),a)
- if n then
- return v, tonode(n)
- end
- end
- return nil
- end
-
- function node.first_glyph(first,last)
- local n = first_glyph(todirect(first), last and todirect(last) or nil)
- return n and tonode(n) or nil
- end
-
- local dimensions = direct.dimensions
- local rangedimensions = direct.rangedimensions
- local effective_glue = direct.effective_glue
-
- function node.dimensions(a,b,c,d,e)
- if type(a) == "userdata" then
- a = todirect(a)
- if type(b) == "userdata" then
- b = todirect(b)
- end
- return dimensions(a,b)
- else
- d = todirect(d)
- if type(e) == "userdata" then
- e = todirect(e)
- end
- return dimensions(a,b,c,d,e)
- end
- return 0, 0, 0
- end
-
- function node.rangedimensions(parent,first,last)
- return rangedimenensions(todirect(parent),todirect(first),last and todirect(last))
- end
-
- function node.effective_glue(list,parent)
- return effective_glue(list and todirect(list) or nil,parent and todirect(parent) or nil)
- end
-
- local uses_font = direct.uses_font
- local has_glyph = direct.has_glyph
- local protrusion_skippable = direct.protrusion_skippable
- local prepend_prevdepth = direct.prepend_prevdepth
- local make_extensible = direct.make_extensible
-
- function node.uses_font(n,f)
- return uses_font(todirect(n),f)
- end
-
- function node.has_glyph(n)
- return has_glyph(todirect(n))
- end
-
- function node.protrusion_skippable(n)
- return protrusion_skippable(todirect(n))
- end
-
- function node.prepend_prevdepth(n)
- local n, d = prepend_prevdepth(todirect(n))
- return tonode(n), d
- end
-
- function node.make_extensible(...)
- local n = make_extensible(...)
- return n and tonode(n) or nil
- end
-
- local last_node = direct.last_node
-
- function node.last_node()
- local n = last_node()
- return n and tonode(n) or nil
- end
-
- local is_zero_glue = direct.is_zero_glue
- local getglue = direct.getglue
- local setglue = direct.setglue
-
- function node.is_zero_glue(n)
- return is_zero_glue(todirect(n))
- end
-
- function node.get_glue(n)
- return get_glue(todirect(n))
- end
-
- function node.set_glue(n)
- return set_glue(todirect(n))
- end
-
-end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-mig.lua b/Master/texmf-dist/tex/context/base/mkiv/node-mig.lua
index 6c10625eb64..13414c560c7 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-mig.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-mig.lua
@@ -14,157 +14,174 @@ local trace_migrations = false trackers.register("nodes.migrations", function(v)
local report_nodes = logs.reporter("nodes","migrations")
-local attributes = attributes
-local nodes = nodes
-local enableaction = nodes.tasks.enableaction
+local attributes = attributes
+local nodes = nodes
-local nuts = nodes.nuts
-local tonut = nuts.tonut
+local nuts = nodes.nuts
+local tonut = nuts.tonut
-local getnext = nuts.getnext
-local getid = nuts.getid
-local getlist = nuts.getlist
------ getattr = nuts.getattr
-local getprop = nuts.getprop
+local getnext = nuts.getnext
+local getid = nuts.getid
+local getlist = nuts.getlist
+local getprop = nuts.getprop
------ setattr = nuts.setattr
-local setprop = nuts.setprop
-local setlink = nuts.setlink
-local setlist = nuts.setlist
-local setprev = nuts.setprev
-local setnext = nuts.setnext
-local setboth = nuts.setboth
+local setprop = nuts.setprop
+local setlink = nuts.setlink
+local setlist = nuts.setlist
+local setprev = nuts.setprev
+local setnext = nuts.setnext
+local setboth = nuts.setboth
-local remove_node = nuts.remove
+local remove_node = nuts.remove
+local count = nuts.count
-local nodecodes = nodes.nodecodes
-local hlist_code = nodecodes.hlist
-local vlist_code = nodecodes.vlist
-local insert_code = nodecodes.ins
-local mark_code = nodecodes.mark
+local nodecodes = nodes.nodecodes
+local hlist_code = nodecodes.hlist
+local vlist_code = nodecodes.vlist
+local insert_code = nodecodes.ins
+local mark_code = nodecodes.mark
-local a_migrated = attributes.private("migrated")
+local a_migrated = attributes.private("migrated")
+local trialtypesetting = context.trialtypesetting
-local migrate_inserts, migrate_marks, inserts_too
+local migrate_inserts = false
+local migrate_marks = false
-local t_inserts, t_marks, t_sweeps = 0, 0, 0
+local t_inserts = 0
+local t_marks = 0
+local t_sweeps = 0
-local function locate(head,first,last,ni,nm)
+local function locate(head,first,last)
local current = head
while current do
local id = getid(current)
if id == vlist_code or id == hlist_code then
local list = getlist(current)
if list then
- list, first, last, ni, nm = locate(list,first,last,ni,nm)
- setlist(current,list)
+ local l
+ l, first, last = locate(list,first,last)
+ if l ~= list then
+ setlist(current,l)
+ end
end
current = getnext(current)
- elseif migrate_inserts and id == insert_code then
- local insert
- head, current, insert = remove_node(head,current)
- if first then
- setnext(insert)
- setlink(last,insert)
- else
- setboth(insert)
- first = insert
+ elseif id == insert_code then
+ if migrate_inserts then
+ local insert
+ head, current, insert = remove_node(head,current)
+ if first then
+ setnext(insert)
+ setlink(last,insert)
+ else
+ setboth(insert)
+ first = insert
+ end
+ last = insert
end
- last = insert
- ni = ni + 1
- elseif migrate_marks and id == mark_code then
- local mark
- head, current, mark = remove_node(head,current)
- if first then
- setnext(mark)
- setlink(last,mark)
- else
- setboth(mark)
- first = mark
+ elseif id == mark_code then
+ if migrate_marks then
+ local mark
+ head, current, mark = remove_node(head,current)
+ if first then
+ setnext(mark)
+ setlink(last,mark)
+ else
+ setboth(mark)
+ first = mark
+ end
+ last = mark
end
- last = mark
- nm = nm + 1
else
current = getnext(current)
end
end
- return head, first, last, ni, nm
+ return head, first, last
end
function nodes.handlers.migrate(head,where)
- if head then
+ if head and not trialtypesetting() then
if trace_migrations then
report_nodes("migration sweep %a",where)
end
local current = head
while current do
local id = getid(current)
- -- inserts_too is a temp hack, we should only do them when it concerns
- -- newly placed (flushed) inserts
-
- -- todo: getprop / setprop
-
- -- if id == vlist_code or id == hlist_code or (inserts_too and id == insert_code) and not getattr(current,a_migrated) then
- if id == vlist_code or id == hlist_code or (inserts_too and id == insert_code) and not getprop(current,"migrated") then
- -- setattr(current,a_migrated,1)
+ if (id == vlist_code or id == hlist_code or id == insert_code) and not getprop(current,"migrated") then
setprop(current,"migrated",true)
- t_sweeps = t_sweeps + 1
local h = getlist(current)
- local first, last, ni, nm
- while h do
- local id = getid(h)
- if id == vlist_code or id == hlist_code then
- h, first, last, ni, nm = locate(h,first,last,0,0)
+ if h then
+ t_sweeps = t_sweeps + 1
+ local first, last
+ while h do
+ local id = getid(h)
+ if id == vlist_code or id == hlist_code then
+ h, first, last = locate(h,first,last)
+ end
+ h = getnext(h)
end
- h = getnext(h)
- end
- if first then
- t_inserts = t_inserts + ni
- t_marks = t_marks + nm
- if trace_migrations and (ni > 0 or nm > 0) then
- report_nodes("sweep %a, container %a, %s inserts and %s marks migrated outwards during %a",
- t_sweeps,nodecodes[id],ni,nm,where)
- end
- -- inserts after head, use insert_after
- local n = getnext(current)
- if n then
- setlink(last,n)
+ if first then
+ if trace_migrations then
+ local ni = count(insert_code,first)
+ local nm = count(mark_code,first)
+ t_inserts = t_inserts + ni
+ t_marks = t_marks + nm
+ report_nodes("sweep %a, container %a, %s inserts and %s marks migrated outwards during %a",
+ t_sweeps,nodecodes[id],ni,nm,where)
+ end
+ local n = getnext(current)
+ if n then
+ setlink(last,n)
+ end
+ setlink(current,first)
+ current = last
end
- setlink(current,first)
- current = last
end
end
current = getnext(current)
end
- return head
end
+ return head
end
--- for the moment this way, this will disappear
-
-experiments.register("marks.migrate", function(v)
- if v then
- enableaction("mvlbuilders", "nodes.handlers.migrate")
+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
- migrate_marks = v
end)
-experiments.register("inserts.migrate", function(v)
- if v then
- enableaction("mvlbuilders", "nodes.handlers.migrate")
- end
- migrate_inserts = v
-end)
+-- Since we started with mkiv we had it as experiment but it is about time
+-- to have a more formal interface .. it's still optional due to possible
+-- side effects.
-experiments.register("inserts.migrate.nested", function(v)
- if v then
- enableaction("mvlbuilders", "nodes.handlers.migrate")
+local enableaction = nodes.tasks.enableaction
+local disableaction = nodes.tasks.disableaction
+
+local migrations = { }
+nodes.migrations = migrations
+local enabled = false
+
+local function check()
+ if migrate_marks or migrate_inserts then
+ if not enabled then
+ enableaction("mvlbuilders", "nodes.handlers.migrate")
+ enableaction("processors", "nodes.handlers.migrate")
+ enabled = true
+ end
+ else
+ if enabled then
+ disableaction("mvlbuilders", "nodes.handlers.migrate")
+ disableaction("processors", "nodes.handlers.migrate")
+ enabled = false
+ end
end
- inserts_too = v
-end)
+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)
+function migrations.setmarks(v)
+ migrate_marks = v
+ check()
+end
+
+function migrations.setinserts(v)
+ migrate_inserts = v
+ check()
+end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-mig.mkiv b/Master/texmf-dist/tex/context/base/mkiv/node-mig.mkiv
index 010d009b35b..0e76e479447 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-mig.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-mig.mkiv
@@ -13,9 +13,9 @@
\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 This is very experimental and although it is used in a real project it mostly
+%D serves a testbed for Taco and me so as prelude to extending the inserts
+%D mechanism.
%D
%D \starttyping
%D \automigrateinserts
@@ -42,20 +42,7 @@
\registerctxluafile{node-mig}{}
-\newtoks\everyautomigratefootnotes
-\newtoks\everyautomigratemarks
-
-\def\automigrateinserts{\the\everyautomigratefootnotes} % soon default but does not work (yet) for notes in captions (themselves inserts)
-\def\automigratemarks {\the\everyautomigratemarks}
-
-\appendtoks
- \let\postponenotes\relax
- \enableexperiments[inserts.migrate,inserts.migrate.nested]%
-\to \everyautomigratefootnotes
-
-\appendtoks
- \writestatus\m!system{migration of marks is normally not needed}%
- \enableexperiments[marks.migrate]%
-\to \everyautomigratemarks
+\protected\def\automigrateinserts{\setupinsertion[\c!anchoring=\v!auto]}
+ \let\automigratemarks \relax
\protect
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-nut.lua b/Master/texmf-dist/tex/context/base/mkiv/node-nut.lua
index e722bbd66a9..9909194e7ae 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-nut.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-nut.lua
@@ -1,4 +1,4 @@
-if not modules then modules = { } end modules ['node-met'] = {
+if not modules then modules = { } end modules ['node-nut'] = {
version = 1.001,
comment = "companion to node-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
@@ -200,11 +200,11 @@ nuts.unset_attribute = direct.unset_attribute
nuts.usedlist = direct.usedlist
nuts.uses_font = direct.uses_font
nuts.vpack = direct.vpack
-nuts.writable_spec = direct.writable_spec
nuts.write = direct.write
nuts.mlist_to_hlist = direct.mlist_to_hlist
nuts.has_dimensions = direct.has_dimensions
nuts.start_of_par = direct.start_of_par
+nuts.migrate = direct.migrate
if not nuts.mlist_to_hlist then
@@ -295,6 +295,7 @@ nuts.getdepth = direct.getdepth
nuts.setdepth = direct.setdepth
nuts.getshift = direct.getshift
nuts.setshift = direct.setshift
+nuts.gettotal = direct.gettotal
-- lmtx compatibility
@@ -307,6 +308,11 @@ nuts.setglyphdata = direct.setglyphdata or function(n,d) set_attribute(n,0,d
nuts.getruledata = direct.getglyphdata and getdata or function(n) return getfield(n,"transform") end
nuts.setruledata = direct.setglyphdata and setdata or function(n,d) return setfield(n,"transform",d) end
+-- maybe some day: [g|s]etglyphoptions and then use attribute for mkiv / generic but not now
+
+nuts.getoptions = direct.getoptions or function() return 0 end
+nuts.setoptions = direct.setoptions or function() end
+
-- so far
nuts.getnucleus = direct.getnucleus
@@ -315,6 +321,10 @@ nuts.getsup = direct.getsup
nuts.setsup = direct.setsup
nuts.getsub = direct.getsub
nuts.setsub = direct.setsub
+nuts.getsuppre = direct.getsuppre
+nuts.setsuppre = direct.setsuppre
+nuts.getsubpre = direct.getsubpre
+nuts.setsubpre = direct.setsubpre
nuts.getchar = direct.getchar
nuts.setchar = direct.setchar
@@ -326,6 +336,8 @@ nuts.setfam = direct.setfam
nuts.getboth = direct.getboth
nuts.setboth = direct.setboth
nuts.setlink = direct.setlink
+nuts.exchange = direct.exchange
+nuts.reverse = direct.reverse
nuts.setsplit = direct.setsplit
nuts.getlist = direct.getlist -- only hlist and vlist !
@@ -388,7 +400,7 @@ local d_setlink = direct.setlink
local d_setboth = direct.setboth
local d_getboth = direct.getboth
-local remove = CONTEXTLMTXMODE > 0 and d_remove_node or function(head,current,free_too)
+local remove = function(head,current,free_too)
if current then
local h, c = d_remove_node(head,current)
if free_too then
@@ -406,9 +418,9 @@ end
if not nuts.start_of_par then
- local localparcodes = nodes.localparcodes
- local hmodepar_code = localparcodes.vmode_par
- local vmodepar_code = localparcodes.hmode_par
+ local parcodes = nodes.parcodes
+ local hmodepar_code = parcodes.vmode_par
+ local vmodepar_code = parcodes.hmode_par
local getsubtype = nuts.getsubtype
@@ -421,6 +433,31 @@ end
-- for now
+if not nuts.exchange then
+
+ local d_getprev = direct.getprev
+ local d_getnext = direct.getnext
+ local d_setlink = direct.setlink
+
+ function nuts.exchange(head,first,second)
+ if first then
+ if not second then
+ second = d_getnext(first)
+ end
+ if second then
+ d_setlink(d_getprev(first),second,first,d_getnext(second))
+ if first == head then
+ return second
+ end
+ end
+ end
+ return head
+ end
+
+end
+
+-- for now
+
if not nuts.getpre then
local d_getdisc = direct.getdisc
@@ -436,6 +473,17 @@ if not nuts.getpre then
end
+if not nuts.gettotal then
+
+ local d_getheight = direct.getheight
+ local d_getdepth = direct.getdepth
+
+ function nuts.gettotal(n)
+ return (d_getheight(n) or 0) + (d_getdepth(n) or 0)
+ end
+
+end
+
-- alias
nuts.getsurround = nuts.getkern
@@ -768,8 +816,6 @@ nuts.tracedslide = tracedslide
nuts.untracedslide = untracedslide
nuts.nestedtracedslide = nestedtracedslide
--- nuts.slide = tracedslide
-
-- this might move
local propertydata = direct.get_properties_table(true)
@@ -833,6 +879,7 @@ local getstate = direct.getstate
local setstate = direct.setstate
if not setstate or not getstate then
+
setstate = function(n,v)
local p = propertydata[n]
if p then
@@ -841,6 +888,7 @@ if not setstate or not getstate then
propertydata[n] = { state = v }
end
end
+
getstate = function(n,v)
local p = propertydata[n]
if p then
@@ -853,11 +901,18 @@ if not setstate or not getstate then
return nil
end
end
- nuts.setstate = setstate
- nuts.getstate = getstate
end
-nuts.isdone = function(n,k)
+nuts.setstate = setstate
+nuts.getstate = getstate
+
+local getscript = direct.getscript or function(n,v) end -- elsewhere
+local setscript = direct.setscript or function(n,v) end -- elsewhere
+
+nuts.setscript = getscript
+nuts.getscript = setscript
+
+function nuts.isdone(n,k)
local p = propertydata[n]
if not p then
propertydata[n] = { [k] = true }
@@ -871,9 +926,6 @@ nuts.isdone = function(n,k)
return v
end
--- nodes.setprop = nodes.setproperty
--- nodes.getprop = nodes.getproperty
-
function nuts.copy_properties(source,target,what)
local newprops = propertydata[source]
if not newprops then
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-pag.lua b/Master/texmf-dist/tex/context/base/mkiv/node-pag.lua
deleted file mode 100644
index 9b8202042c5..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/node-pag.lua
+++ /dev/null
@@ -1,30 +0,0 @@
-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 = nodes.tasks.actions("pagebuilders")
-
-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/mkiv/node-pag.mkiv b/Master/texmf-dist/tex/context/base/mkiv/node-pag.mkiv
deleted file mode 100644
index 970939dcf76..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/node-pag.mkiv
+++ /dev/null
@@ -1,20 +0,0 @@
-%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 ADE \& \CONTEXT\ Development Team}]
-%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}{}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-par.lua b/Master/texmf-dist/tex/context/base/mkiv/node-par.lua
index d89edf6f4ca..5a0f0d2e94f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-par.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-par.lua
@@ -25,7 +25,7 @@ end
callbacks.register("insert_local_par",everypar,"after paragraph start")
local actions = sequencers.new {
- name = "newgraf",
+ name = "paragraph",
arguments = "mode,indented",
returnvalues = "indented",
results = "indented",
@@ -35,7 +35,7 @@ sequencers.appendgroup(actions,"before") -- user
sequencers.appendgroup(actions,"system") -- private
sequencers.appendgroup(actions,"after" ) -- user
-local function newgraf(mode,indented)
+local function paragraph(mode,indented)
local runner = actions.runner
if runner then
starttiming(builders)
@@ -45,4 +45,4 @@ local function newgraf(mode,indented)
return indented
end
-callbacks.register("new_graf",newgraf,"before paragraph start")
+callbacks.register("new_graf",paragraph,"before paragraph start")
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-ref.lua b/Master/texmf-dist/tex/context/base/mkiv/node-ref.lua
index ac43a84a368..098ed50c28e 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-ref.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-ref.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['node-ref'] = {
version = 1.001,
+ optimize = true,
comment = "companion to node-ref.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
@@ -93,10 +94,11 @@ local glue_code = nodecodes.glue
local glyph_code = nodecodes.glyph
local rule_code = nodecodes.rule
local dir_code = nodecodes.dir
-local localpar_code = nodecodes.localpar
+local par_code = nodecodes.par
local leftskip_code = gluecodes.leftskip
local rightskip_code = gluecodes.rightskip
+local parfillleftskip_code = gluecodes.parfillleftskip
local parfillskip_code = gluecodes.parfillskip
----- linelist_code = listcodes.line
@@ -322,7 +324,8 @@ local function inject_list(id,current,reference,make,stack,pardir,txtdir)
local last = find_node_tail(first)
if getid(last) == glue_code and getsubtype(last) == rightskip_code then
local prev = getprev(last)
- moveright = getid(first) == glue_code and getsubtype(first) == leftskip_code
+ -- this can be more clever
+ moveright = getid(first) == glue_code and (getsubtype(first) == leftskip_code or getsubtype(first) == parfillleftskip_code)
if prev and getid(prev) == glue_code and getsubtype(prev) == parfillskip_code then
width = dimensions(current,first,getprev(prev)) -- maybe not current as we already take care of it
else
@@ -414,16 +417,29 @@ local function inject_areas(head,attribute,make,stack,done,skip,parent,pardir,tx
if r then
done[r] = done[r] - 1
end
- elseif id == glue_code and getsubtype(current) == leftskip_code then -- any glue at the left?
- --
elseif id == dir_code then
local direction, pop = getdirection(current)
txtdir = not pop and direction -- we might need a stack
- elseif id == localpar_code then
+ elseif id == par_code then
if start_of_par(current) then
pardir = getdirection(current)
end
+ elseif id == glue_code and getsubtype(current) == leftskip_code then -- any glue at the left?
+ --
else
+ if id == glue_code then
+ local subtype = getsubtype(current)
+ -- todo in lmtx: lefthangskip and righthangskip
+ if subtype == leftskip_code or subtype == parfillleftskip_code then
+ goto NEXT
+ elseif subtype == rightskip_code or subtype == parfillskip_code then
+ if reference and (done[reference] or 0) == 0 then
+ head, current = inject_range(head,first,last,reference,make,stack,parent,pardir,firstdir)
+ reference, first, last, firstdir = nil, nil, nil, nil
+ end
+ goto NEXT
+ end
+ end
local r = getattr(current,attribute)
if not r then
-- just go on, can be kerns
@@ -431,7 +447,7 @@ local function inject_areas(head,attribute,make,stack,done,skip,parent,pardir,tx
reference, first, last, firstdir = r, current, current, txtdir
elseif r == reference then
last = current
- elseif (done[reference] or 0) == 0 then -- or id == glue_code and getsubtype(current) == right_skip_code
+ elseif (done[reference] or 0) == 0 then -- or (id == glue_code and getsubtype(current) == right_skip_code) then
if not skip or r > skip then -- maybe no > test
head, current = inject_range(head,first,last,reference,make,stack,parent,pardir,firstdir)
reference, first, last, firstdir = nil, nil, nil, nil
@@ -440,6 +456,7 @@ local function inject_areas(head,attribute,make,stack,done,skip,parent,pardir,tx
reference, first, last, firstdir = r, current, current, txtdir
end
end
+ ::NEXT::
current = getnext(current)
end
if reference and (done[reference] or 0) == 0 then
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-res.lua b/Master/texmf-dist/tex/context/base/mkiv/node-res.lua
index 1832a0d1e1b..478a46906e0 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-res.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-res.lua
@@ -26,7 +26,6 @@ local gluecodes = nodes.gluecodes
local kerncodes = nodes.kerncodes
local rulecodes = nodes.rulecodes
local nodecodes = nodes.nodecodes
-local leadercodes = nodes.leadercodes
local boundarycodes = nodes.boundarycodes
local usercodes = nodes.usercodes
@@ -36,6 +35,7 @@ local glyph_code = nodecodes.glyph
local rule_code = nodecodes.rule
local kern_code = nodecodes.kern
local glue_code = nodecodes.glue
+local gluespec_code = nodecodes.gluespec
local whatsit_code = nodecodes.whatsit
local currentfont = font.current
@@ -163,6 +163,7 @@ local fontkern = register_nut(new_nut(kern_code,kerncodes.fontkern))
local italickern = register_nut(new_nut(kern_code,kerncodes.italiccorrection))
local penalty = register_nut(new_nut(nodecodes.penalty))
local glue = register_nut(new_nut(glue_code))
+local gluespec = register_nut(new_nut(gluespec_code))
local glyph = register_nut(new_nut(glyph_code,0))
local textdir = register_nut(new_nut(nodecodes.dir))
@@ -198,7 +199,7 @@ local correctionskip = register_nut(new_nut(glue_code,gluecodes.correctionski
local temp = register_nut(new_nut(nodecodes.temp,0))
local noad = register_nut(new_nut(nodecodes.noad))
-local delimiter = register_nut(new_nut(nodecodes.delim))
+local delimiter = register_nut(new_nut(nodecodes.delimiter))
local fence = register_nut(new_nut(nodecodes.fence))
local submlist = register_nut(new_nut(nodecodes.submlist))
local accent = register_nut(new_nut(nodecodes.accent))
@@ -212,7 +213,7 @@ local choice = register_nut(new_nut(nodecodes.choice))
local boundary = register_nut(new_nut(nodecodes.boundary,boundarycodes.user))
local wordboundary = register_nut(new_nut(nodecodes.boundary,boundarycodes.word))
-local cleader = register_nut(copy_nut(glue)) setsubtype(cleader,leadercodes.cleaders) setglue(cleader,0,65536,0,2,0)
+local cleader = register_nut(copy_nut(glue)) setsubtype(cleader,gluecodes.cleaders) setglue(cleader,0,65536,0,2,0)
-- the dir field needs to be set otherwise crash:
@@ -283,6 +284,14 @@ function nutpool.italickern(k)
return n
end
+function nutpool.gluespec(width,stretch,shrink,stretch_order,shrink_order)
+ local n = copy_nut(gluespec)
+ if width or stretch or shrink or stretch_order or shrink_order then
+ setglue(n,width,stretch,shrink,stretch_order,shrink_order)
+ end
+ return n
+end
+
local function someskip(skip,width,stretch,shrink,stretch_order,shrink_order)
-- maybe setglue
local n = copy_nut(skip)
@@ -574,12 +583,17 @@ local usage = CONTEXTLMTXMODE > 0 and node.inuse or function()
return t
end
+local stock = CONTEXTLMTXMODE > 0 and node.instock or { }
+
nutpool .cleanup = cleanup
nodepool.cleanup = cleanup
nutpool .usage = usage
nodepool.usage = usage
+nutpool .stock = stock
+nodepool.stock = stock
+
-- end
statistics.register("cleaned up reserved nodes", function()
@@ -612,10 +626,10 @@ do
return v
end)
- traversers.node = nodes.traverse (glyph)
- traversers.char = nodes.traverse_char (glyph)
- if nuts.traverse_glyph then traversers.glyph = nodes.traverse_glyph(glyph) end
- if nuts.traverse_list then traversers.list = nodes.traverse_list (glyph) end
+ traversers.node = nodes.traverse (glyph)
+ traversers.char = nodes.traverse_char (glyph)
+ if nodes.traverse_glyph then traversers.glyph = nodes.traverse_glyph(glyph) end
+ if nodes.traverse_list then traversers.list = nodes.traverse_list (glyph) end
nodes.traversers = traversers
@@ -632,10 +646,11 @@ do
return v
end)
- traversers.node = nuts.traverse (glyph)
- traversers.char = nuts.traverse_char (glyph)
- if nuts.traverse_glyph then traversers.glyph = nuts.traverse_glyph(glyph) end
- if nuts.traverse_list then traversers.list = nuts.traverse_list (glyph) end
+ traversers.node = nuts.traverse (glyph)
+ traversers.char = nuts.traverse_char (glyph)
+ if nuts.traverse_glyph then traversers.glyph = nuts.traverse_glyph (glyph) end
+ if nuts.traverse_list then traversers.list = nuts.traverse_list (glyph) end
+ if nuts.traverse_content then traversers.content = nuts.traverse_content(glyph) end
nuts.traversers = traversers
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-rul.lua b/Master/texmf-dist/tex/context/base/mkiv/node-rul.lua
index b904e54d616..f60fb2406a7 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-rul.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-rul.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['node-rul'] = {
version = 1.001,
+ optimize = true,
comment = "companion to node-rul.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
@@ -74,7 +75,7 @@ local gluecodes = nodes.gluecodes
local listcodes = nodes.listcodes
local glyph_code = nodecodes.glyph
-local localpar_code = nodecodes.localpar
+local par_code = nodecodes.par
local dir_code = nodecodes.dir
local glue_code = nodecodes.glue
local hlist_code = nodecodes.hlist
@@ -587,7 +588,7 @@ function linefillers.handler(head)
else
break
end
- elseif id == localpar_code or id == dir_code then
+ elseif id == par_code or id == dir_code then
-- go on
elseif id == hlist_code then
if getsubtype(head) == indentlist_code then
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-rul.mkiv b/Master/texmf-dist/tex/context/base/mkiv/node-rul.mkiv
index 7f2093bf2c3..660c0d4e617 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-rul.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-rul.mkiv
@@ -162,14 +162,14 @@
\expandafter\let\expandafter\c_node_rules_index\csname\??barindex#1\endcsname
\advance\c_node_rules_index\plusone
\clf_enablerules % will be relaxed
- \attribute\ruledattribute\numexpr
+ \c_attr_ruled\numexpr
\plusthousand*\c_node_rules_index
% optimizing this one needs testing
+\csname\??barattribute#1\ifcsname\??bar#1:\number\c_node_rules_index\s!parent\endcsname:\number\c_node_rules_index\fi\endcsname
\relax}
\unexpanded\def\resetbar
- {\attribute\ruledattribute\attributeunsetvalue}
+ {\c_attr_ruled\attributeunsetvalue}
\unexpanded\def\nobar
{\groupedcommand
@@ -198,7 +198,7 @@
\unexpanded\def\pushbar[#1]%
{\global\advance\c_node_rules_nesting\plusone
- \expandafter\edef\csname\??barstack\number\c_node_rules_nesting\endcsname{\attribute\ruledattribute\the\attribute\ruledattribute}%
+ \expandafter\edef\csname\??barstack\number\c_node_rules_nesting\endcsname{\c_attr_ruled\the\c_attr_ruled}%
\node_rules_set{#1}}
\unexpanded\def\popbar
@@ -221,6 +221,8 @@
% \definebar[touchbar] [\c!method=0,\c!dy=-0.4,\c!offset=-0.0]
% \definebar[touchbars] [touchbar] [\c!continue=\v!yes]
+\pushoverloadmode
+
\let\normalmathoverbar \overbar
\let\normalmathunderbar \underbar
\let\normalmathoverstrike \overstrike
@@ -230,6 +232,8 @@
\definebar[\v!underbar] [\c!method=1,\c!dy=-0.4,\c!offset=-0.3,\c!continue=\v!yes]
\definebar[\v!overstrike][\c!method=0,\c!dy=0.4,\c!offset=0.5,\c!continue=\v!yes]
+\popoverloadmode
+
\definebar
[\v!understrike]
[\c!method=0,
@@ -405,7 +409,7 @@
\expandafter\let\expandafter\c_node_shifts_index\csname\??shiftindex#1\endcsname
\advance\c_node_shifts_index\plusone
\clf_enableshifts % will be relaxed
- \attribute\shiftedattribute\numexpr
+ \c_attr_shifted\numexpr
\plusthousand*\c_node_shifts_index
+\csname\??shiftattribute#1\ifcsname\??shift#1:\number\c_node_shifts_index\s!parent\endcsname:\number\c_node_shifts_index\fi\endcsname
\relax
@@ -525,7 +529,7 @@
\expandafter\let\expandafter\c_node_linefiller_index\csname\??linefillerindex#1\endcsname
\advance\c_node_linefiller_index\plusone
\clf_enablelinefillers
- \attribute\linefillerattribute\numexpr
+ \c_attr_linefiller\numexpr
\plusthousand*\c_node_linefiller_index
+\csname\??linefillerattribute#1\ifcsname\??linefiller#1:\number\c_node_linefiller_index\s!parent\endcsname:\number\c_node_linefiller_index\fi\endcsname
\relax}
@@ -601,7 +605,7 @@
\node_linefiller_set{#3}% already sets the attribute
#1%
attr \backgroundattribute \plusone
- % attr \linefillerattribute \the\attribute\linefillerattribute
+ % attr \linefillerattribute \the\c_attr_linefiller
{\box\nextbox}%
\egroup}%
#2}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-scn.lua b/Master/texmf-dist/tex/context/base/mkiv/node-scn.lua
index 055f5e20def..0ec1ba387c9 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-scn.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-scn.lua
@@ -24,7 +24,6 @@ local setlist = nuts.setlist
local end_of_math = nuts.end_of_math
local nodecodes = nodes.nodecodes
-local leadercodes = nodes.leadercodes
local gluecodes = nodes.gluecodes
local kerncodes = nodes.kerncodes
@@ -43,8 +42,7 @@ local vlist_code = nodecodes.vlist
local userskip_code = gluecodes.userskip
local spaceskip_code = gluecodes.spaceskip
local xspaceskip_code = gluecodes.xspaceskip
-
-local leaders_code = leadercodes.leaders
+local leaders_code = gluecodes.leaders
local fontkern_code = kerncodes.fontkern
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-ser.lua b/Master/texmf-dist/tex/context/base/mkiv/node-ser.lua
index 6fc2b7ea4cf..25a6dd6c39d 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-ser.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-ser.lua
@@ -19,7 +19,6 @@ local context = context
local nodes = nodes
local node = node
-local traverse = nodes.traverse
local is_node = nodes.is_node
local nodecodes = nodes.nodecodes
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-shp.lua b/Master/texmf-dist/tex/context/base/mkiv/node-shp.lua
index 306e38f6a58..58dc944951a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-shp.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-shp.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['node-shp'] = {
version = 1.001,
+ optimize = true,
comment = "companion to node-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
@@ -66,59 +67,61 @@ local removables = {
-- (like marks) is not saving much and removing empty boxes is even
-- dangerous because we can rely on dimensions (e.g. in references).
-local wipedisc = false -- we can use them in the export ... can be option
-
-local function cleanup_redundant(head) -- better name is: flatten_page
- local start = head
- while start do
- local id = getid(start)
- if id == disc_code then
- if getsubtype(start) == discretionarydisc_code then
- local _, _, replace, _, _ tail = getdisc(start,true)
- if replace then
- local prev, next = getboth(start)
- setfield(start,"replace",nil)
- if start == head then
- remove_node(head,start,true)
- head = replace
- else
- remove_node(head,start,true)
- end
- if next then
- setlink(tail,next)
- end
- if prev then
- setlink(prev,replace)
- else
- setprev(replace) -- to be sure
- end
- start = next
- elseif wipedisc then
- -- pre and post can have values
- head, start = remove_node(head,start,true)
- else
- start = getnext(start)
- end
- else
- start = getnext(start)
- end
- elseif id == hlist_code or id == vlist_code then
- local sl = getlist(start)
- if sl then
- local rl = cleanup_redundant(sl)
- if rl ~= sl then
- setlist(start,rl)
- end
- end
- start = getnext(start)
- else
- start = getnext(start)
- end
- end
- return head
-end
-
-handlers.cleanuppage = cleanup_redundant -- nut
+-- local wipedisc = false -- we can use them in the export ... can be option
+--
+-- local function cleanup_redundant(head) -- better name is: flatten_page
+-- local start = head
+-- while start do
+-- local id = getid(start)
+-- if id == disc_code then
+-- if getsubtype(start) == discretionarydisc_code then
+-- local _, _, replace, _, _ tail = getdisc(start,true)
+-- if replace then
+-- local prev, next = getboth(start)
+-- setfield(start,"replace",nil)
+-- if start == head then
+-- remove_node(head,start,true)
+-- head = replace
+-- else
+-- remove_node(head,start,true)
+-- end
+-- if next then
+-- setlink(tail,next)
+-- end
+-- if prev then
+-- setlink(prev,replace)
+-- else
+-- setprev(replace) -- to be sure
+-- end
+-- start = next
+-- elseif wipedisc then
+-- -- pre and post can have values
+-- head, start = remove_node(head,start,true)
+-- else
+-- start = getnext(start)
+-- end
+-- else
+-- start = getnext(start)
+-- end
+-- elseif id == hlist_code or id == vlist_code then
+-- local sl = getlist(start)
+-- if sl then
+-- local rl = cleanup_redundant(sl)
+-- if rl ~= sl then
+-- setlist(start,rl)
+-- end
+-- end
+-- start = getnext(start)
+-- else
+-- start = getnext(start)
+-- end
+-- end
+-- return head
+-- end
+--
+-- handlers.cleanuppage = cleanup_redundant -- nut
+
+handlers.cleanuppage = nuts.flatten_discretionaries
local function cleanup_flushed(head) -- rough
local start = head
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-syn.lua b/Master/texmf-dist/tex/context/base/mkiv/node-syn.lua
index 68a05234e90..d9c653abbb0 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-syn.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-syn.lua
@@ -170,15 +170,11 @@ local new_kern = nodepool.kern
local getdimensions = nuts.dimensions
local getrangedimensions = nuts.rangedimensions
-local get_synctex_fields = nuts.get_synctex_fields
------ set_synctex_fields = nuts.set_synctex_fields
-local set_synctex_line = tex.set_synctex_line
-local set_synctex_tag = tex.set_synctex_tag
-local force_synctex_tag = tex.force_synctex_tag
-local force_synctex_line = tex.force_synctex_line
------ get_synctex_tag = tex.get_synctex_tag
-local get_synctex_line = tex.get_synctex_line
-local set_synctex_mode = tex.set_synctex_mode
+local getsynctexfields = nuts.getsynctexfields or nuts.get_synctex_fields
+local forcesynctextag = tex.forcesynctextag or tex.force_synctex_tag
+local forcesynctexline = tex.forcesynctexline or tex.force_synctex_line
+local getsynctexline = tex.getsynctexline or tex.get_synctex_line
+local setsynctexmode = tex.setsynctexmode or tex.set_synctex_mode
local foundintree = resolvers.foundintree
@@ -212,7 +208,7 @@ local paused = 0
local used = false
local never = false
--- get rid of overhead
+-- get rid of overhead in mkiv
if tex.set_synctex_no_files then
tex.set_synctex_no_files(1)
@@ -261,18 +257,18 @@ function synctex.blockfilename(name)
end
function synctex.setfilename(name,line)
- if paused == 0 and force_synctex_tag and name then
- force_synctex_tag(sttags[name])
+ if paused == 0 and name then
+ forcesynctextag(sttags[name])
if line then
- force_synctex_line(line)
+ forcesynctexline(line)
end
end
end
function synctex.resetfilename()
- if paused == 0 and force_synctex_tag then
- force_synctex_tag(0)
- force_synctex_line(0)
+ if paused == 0 then
+ forcesynctextag(0)
+ forcesynctexline(0)
end
end
@@ -284,10 +280,10 @@ do
function synctex.pushline()
nesting = nesting + 1
if nesting == 1 then
- local l = get_synctex_line()
+ local l = getsynctexline()
ignored = l and l > 0
if not ignored then
- force_synctex_line(texget("inputlineno"))
+ forcesynctexline(texget("inputlineno"))
end
end
end
@@ -295,7 +291,7 @@ do
function synctex.popline()
if nesting == 1 then
if not ignored then
- force_synctex_line()
+ forcesynctexline()
ignored = false
end
end
@@ -469,7 +465,11 @@ local x_hlist do
local doaction = doaction_1
x_hlist = function(head,current,t,l,w,h,d)
- return insert_before(head,current,new_latelua(function() doaction(t,l,w,h,d) end))
+ if filehandle then
+ return insert_before(head,current,new_latelua(function() doaction(t,l,w,h,d) end))
+ else
+ return head
+ end
end
directives.register("system.synctex.compression", function(v)
@@ -520,7 +520,7 @@ local function collect_min(head)
local line = 0
while true do
if id == glyph_code then
- local tc, lc = get_synctex_fields(current)
+ local tc, lc = getsynctexfields(current)
if tc and tc > 0 then
tag = tc
line = lc
@@ -587,7 +587,7 @@ local function collect_max(head,parent)
local line = 0
while true do
if id == glyph_code then
- local tc, lc = get_synctex_fields(current)
+ local tc, lc = getsynctexfields(current)
if tc and tc > 0 then
if tag > 0 and (tag ~= tc or line ~= lc) then
head = inject(parent,head,first,last,tag,line)
@@ -615,7 +615,7 @@ local function collect_max(head,parent)
end
elseif id == glue_code then
if tag > 0 then
- local tc, lc = get_synctex_fields(current)
+ local tc, lc = getsynctexfields(current)
if tc and tc > 0 then
if tag ~= tc or line ~= lc then
head = inject(parent,head,first,last,tag,line)
@@ -730,7 +730,7 @@ end
function synctex.enable()
if not never and not enabled then
enabled = true
- set_synctex_mode(3) -- we want details
+ setsynctexmode(3) -- we want details
if not used then
nodes.tasks.enableaction("shipouts","luatex.synctex.collect")
report_system("synctex functionality is enabled, expect 5-10 pct runtime overhead!")
@@ -744,7 +744,7 @@ end
function synctex.disable()
if enabled then
- set_synctex_mode(0)
+ setsynctexmode(0)
report_system("synctex functionality is disabled!")
enabled = false
for i=1,#disablers do
@@ -768,13 +768,13 @@ local filename = nil
function synctex.pause()
paused = paused + 1
if enabled and paused == 1 then
- set_synctex_mode(0)
+ setsynctexmode(0)
end
end
function synctex.resume()
if enabled and paused == 1 then
- set_synctex_mode(3)
+ setsynctexmode(3)
end
paused = paused - 1
end
@@ -849,12 +849,17 @@ implement {
actions = synctex.resume,
}
-interfaces.implement {
+implement {
name = "synctexpushline",
actions = synctex.pushline,
}
-interfaces.implement {
+
+implement {
name = "synctexpopline",
actions = synctex.popline,
}
+implement {
+ name = "synctexdisable",
+ actions = synctex.disable,
+}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-tex.lua b/Master/texmf-dist/tex/context/base/mkiv/node-tex.lua
index 5857fd2e65b..cda6ff132d6 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-tex.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-tex.lua
@@ -16,7 +16,6 @@ local hyphenate = lang.hyphenate
local hyphenating = nuts.hyphenating
local ligaturing = nuts.ligaturing
local kerning = nuts.kerning
-local cleanup = nuts.flush_components
function kernel.hyphenation(head)
return (hyphenate(head)) -- nodes !
@@ -34,14 +33,6 @@ function kernel.kerning(head)
return (kerning(head))
end
-if cleanup then
-
- function kernel.cleanup(head)
- return (cleanup(head))
- end
-
-end
-
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/mkiv/node-tra.lua b/Master/texmf-dist/tex/context/base/mkiv/node-tra.lua
index c7556aba6d0..83c072c19b0 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-tra.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-tra.lua
@@ -77,7 +77,7 @@ local glue_code = nodecodes.glue
local kern_code = nodecodes.kern
local rule_code = nodecodes.rule
local dir_code = nodecodes.dir
-local localpar_code = nodecodes.localpar
+local par_code = nodecodes.par
local whatsit_code = nodecodes.whatsit
local dimenfactors = number.dimenfactors
@@ -115,19 +115,6 @@ function nodes.handlers.checkglyphs(head,message)
return false
end
-function nodes.handlers.checkforleaks(sparse)
- local l = { }
- local q = used_nodes()
- for p, id in nextnode, q do
- local s = table.serialize(nodes.astable(p,sparse),nodecodes[id])
- l[s] = (l[s] or 0) + 1
- end
- flush_list(q)
- for k, v in next, l do
- report_nodes("%s * %s",v,k)
- end
-end
-
local fontcharacters -- = fonts.hashes.descriptions
local function tosequence(start,stop,compact)
@@ -167,7 +154,7 @@ local function tosequence(start,stop,compact)
elseif id == dir_code then
local d, p = getdirection(start)
n = n + 1 ; t[n] = "[<" .. (p and "-" or "+") .. d .. ">]" -- todo l2r etc
- elseif id == localpar_code and start_of_par(current) then
+ elseif id == par_code and start_of_par(current) then
n = n + 1 ; t[n] = "[<" .. getdirection(start) .. ">]" -- todo l2r etc
elseif compact then
n = n + 1 ; t[n] = "[]"
@@ -315,14 +302,6 @@ local function showsimplelist(h,depth,n)
end
end
--- \startluacode
--- callbacks.register('buildpage_filter',function() nodes.show_simple_list(tex.lists.contrib_head) end)
--- \stopluacode
--- \vbox{b\footnote{n}a}
--- \startluacode
--- callbacks.register('buildpage_filter',nil)
--- \stopluacode
-
nodes.showsimplelist = function(h,depth) showsimplelist(h,depth,0) end
local function listtoutf(h,joiner,textonly,last,nodisc)
@@ -503,8 +482,8 @@ function number.tobasepoints (n,fmt) return numbertodimen(n,"bp",fmt) end
function number.topicas (n,fmt) return numbertodimen(n "pc",fmt) end
function number.todidots (n,fmt) return numbertodimen(n,"dd",fmt) end
function number.tociceros (n,fmt) return numbertodimen(n,"cc",fmt) end
-function number.tonewdidots (n,fmt) return numbertodimen(n,"nd",fmt) end
-function number.tonewciceros (n,fmt) return numbertodimen(n,"nc",fmt) end
+-------- number.tonewdidots (n,fmt) return numbertodimen(n,"nd",fmt) end
+-------- number.tonewciceros (n,fmt) return numbertodimen(n,"nc",fmt) end
function nodes.topoints (n,fmt) return nodetodimen(n,"pt",fmt) end
function nodes.toinches (n,fmt) return nodetodimen(n,"in",fmt) end
@@ -516,8 +495,8 @@ function nodes.tobasepoints (n,fmt) return nodetodimen(n,"bp",fmt) end
function nodes.topicas (n,fmt) return nodetodimen(n "pc",fmt) end
function nodes.todidots (n,fmt) return nodetodimen(n,"dd",fmt) end
function nodes.tociceros (n,fmt) return nodetodimen(n,"cc",fmt) end
-function nodes.tonewdidots (n,fmt) return nodetodimen(n,"nd",fmt) end
-function nodes.tonewciceros (n,fmt) return nodetodimen(n,"nc",fmt) end
+-------- nodes.tonewdidots (n,fmt) return nodetodimen(n,"nd",fmt) end
+-------- nodes.tonewciceros (n,fmt) return nodetodimen(n,"nc",fmt) end
-- stop redefinition
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-typ.lua b/Master/texmf-dist/tex/context/base/mkiv/node-typ.lua
index 021bfefc263..adf0d18c005 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-typ.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-typ.lua
@@ -8,33 +8,36 @@ if not modules then modules = { } end modules ['node-typ'] = {
-- code has been moved to blob-ini.lua
-local typesetters = nodes.typesetters or { }
-nodes.typesetters = typesetters
+local typesetters = nodes.typesetters or { }
+nodes.typesetters = typesetters
-local nuts = nodes.nuts
-local tonode = nuts.tonode
-local tonut = nuts.tonut
+local nuts = nodes.nuts
+local tonode = nuts.tonode
+local tonut = nuts.tonut
-local setlink = nuts.setlink
-local setchar = nuts.setchar
-local setattrlist = nuts.setattrlist
+local setlink = nuts.setlink
+local setchar = nuts.setchar
+local setattrlist = nuts.setattrlist
-local getfont = nuts.getfont
-local getattrlist = nuts.getattrlist
+local getfont = nuts.getfont
+local getattrlist = nuts.getattrlist
-local hpack_node_list = nuts.hpack
-local vpack_node_list = nuts.vpack
-local full_hpack_list = nuts.fullhpack
+local hpack_node_list = nuts.hpack
+local vpack_node_list = nuts.vpack
+local full_hpack_list = nuts.fullhpack
-local nodepool = nuts.pool
-local new_glyph = nodepool.glyph
-local new_glue = nodepool.glue
+local nodepool = nuts.pool
+local new_glyph = nodepool.glyph
+local new_glue = nodepool.glue
-local utfvalues = utf.values
+local utfvalues = utf.values
-local currentfont = font.current -- mabe nicer is fonts .current
-local currentattr = node.current_attr -- mabe nicer is attributes.current
-local fontparameters = fonts.hashes.parameters
+local currentfont = font.current -- mabe nicer is fonts .current
+local currentattributes = node.current_attributes -- mabe nicer is attributes.current
+
+local fontparameters = fonts.hashes.parameters
+
+if not currentattributes then currentattributes = node.current_attr end -- CONTEXTLMTXMODE == 0
-- when attrid == true then take from glyph or current else use the given value
@@ -51,7 +54,7 @@ local function tonodes(str,fontid,spacing,templateglyph,attrid) -- quick and dir
if templateglyph then
attrid = false -- we copy with the glyph
else
- attrid = currentattr()
+ attrid = currentattributes()
end
end
local fp = fontparameters[fontid]
diff --git a/Master/texmf-dist/tex/context/base/mkiv/pack-bar.mkiv b/Master/texmf-dist/tex/context/base/mkiv/pack-bar.mkiv
index b67d6f14b28..99323b43564 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/pack-bar.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/pack-bar.mkiv
@@ -40,7 +40,7 @@
\installcorenamespace{positionbar}
-\installsimplecommandhandler \??positionbar {positionbar}
+\installsimplecommandhandler \??positionbar {positionbar} \??positionbar
\setuppositionbar
[\c!min=1,
@@ -63,7 +63,8 @@
\unexpanded\def\verticalpositionbar[#1]%
{\vbox to \vsize
- {\setuppositionbar[#1]%
+ {\hsize\positionbarparameter\c!width
+ \setuppositionbar[#1]%
\usepositionbarstyleandcolor\c!style\c!color
\vskip\zeropoint\s!plus \positionbarparameter\c!n \s!fill
\vskip\zeropoint\s!plus-\positionbarparameter\c!min\s!fill
@@ -75,17 +76,18 @@
{\hpack to \hsize
{\setuppositionbar[#1]%
\usepositionbarstyleandcolor\c!style\c!color
- \leaders\vrule\hskip\zeropoint\s!plus\numexpr\positionbarparameter\c!n-\positionbarparameter\c!min+\plusone\relax\s!fill
\vrule\s!width\zeropoint\s!height\positionbarparameter\c!height\s!depth\positionbarparameter\c!depth
+ \leaders\vrule\hskip\zeropoint\s!plus\numexpr\positionbarparameter\c!n-\positionbarparameter\c!min+\plusone\relax\s!fill
\hskip\zeropoint\s!plus \positionbarparameter\c!max\s!fill
\hskip\zeropoint\s!plus-\positionbarparameter\c!n \s!fill}}
\unexpanded\def\verticalgrowingbar[#1]%
{\vpack to \vsize
- {\setuppositionbar[#1]%
+ {\hsize\positionbarparameter\c!width
+ \setuppositionbar[#1]%
\usepositionbarstyleandcolor\c!style\c!color
- \leaders\hrule\vskip\zeropoint\s!plus\numexpr\positionbarparameter\c!n-\positionbarparameter\c!min+\plusone\relax\s!fill
\hrule\s!width\positionbarparameter\c!width\s!height\zeropoint\s!depth\zeropoint
+ \leaders\hrule\vskip\zeropoint\s!plus\numexpr\positionbarparameter\c!n-\positionbarparameter\c!min+\plusone\relax\s!fill
\vskip\zeropoint\s!plus \positionbarparameter\c!max\s!fill
\vskip\zeropoint\s!plus-\positionbarparameter\c!n \s!fill}}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/pack-box.mkiv b/Master/texmf-dist/tex/context/base/mkiv/pack-box.mkiv
index 422f090f0b9..4c9a4c17d5c 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/pack-box.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/pack-box.mkiv
@@ -337,7 +337,7 @@
\pack_boxes_collector_check_box{#1}%
\ifconditional\c_pack_boxes_collector_valid_box
\letcollectorparameter\c!voffset\zeropoint
- \letcollectorparameter\h!voffset\zeropoint
+ \letcollectorparameter\c!hoffset\zeropoint
\ifsecondargument
\setupcurrentcollector[#2]%
\fi
diff --git a/Master/texmf-dist/tex/context/base/mkiv/pack-com.mkiv b/Master/texmf-dist/tex/context/base/mkiv/pack-com.mkiv
index fe622509a10..17675fa7ab6 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/pack-com.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/pack-com.mkiv
@@ -77,11 +77,15 @@
\to \everyinsidefloat
\newcount\c_pack_combinations_nesting % local
+
\newcount\c_pack_combinations_x % global
\newcount\c_pack_combinations_y % global
\newcount\c_pack_combinations_max % global
-\newbox \b_pack_combinations_captions % global
-\newbox \b_pack_combinations_temp % global
+
+\newdimen\d_pack_combinations_ht % global
+
+\newbox \b_pack_combinations_captions % global % can go
+\newbox \b_pack_combinations_temp % global % can go
\newbox \b_pack_combinations_content % local
\newbox \b_pack_combinations_caption % local
@@ -95,6 +99,9 @@
\newcount\c_pack_combinations_x_saved
\newcount\c_pack_combinations_y_saved
\newcount\c_pack_combinations_max_saved
+
+\newdimen\d_pack_combinations_ht_saved
+
\newbox \b_pack_combinations_captions_saved
\newbox \b_pack_combinations_temp_saved
\newbox \b_pack_combinations_content_saved
@@ -108,6 +115,7 @@
\c_pack_combinations_x_saved \c_pack_combinations_x
\c_pack_combinations_y_saved \c_pack_combinations_y
\c_pack_combinations_max_saved\c_pack_combinations_max
+ \d_pack_combinations_ht_saved \d_pack_combinations_ht
\setbox\b_pack_combinations_captions_saved\box\b_pack_combinations_captions
\setbox\b_pack_combinations_temp_saved \box\b_pack_combinations_temp
\setbox\b_pack_combinations_content_saved \box\b_pack_combinations_content
@@ -121,6 +129,7 @@
\global\c_pack_combinations_x \c_pack_combinations_x_saved
\global\c_pack_combinations_y \c_pack_combinations_y_saved
\global\c_pack_combinations_max\c_pack_combinations_max_saved
+ \global\d_pack_combinations_ht \d_pack_combinations_ht_saved
\global\setbox\b_pack_combinations_captions\box\b_pack_combinations_captions_saved
\global\setbox\b_pack_combinations_temp \box\b_pack_combinations_temp_saved
\setbox\b_pack_combinations_content \box\b_pack_combinations_content_saved
@@ -360,7 +369,7 @@
\to \everydefinecombination
\def\pack_combinations_pickup
- {\dostarttagged\t!combinationpair\empty
+ {\dostarttagged\t!combinationpair\empty % better make this text
\dostarttagged\t!combinationcontent\empty
\assumelongusagecs\pack_combinations_pickup_content_indeed}
@@ -474,37 +483,72 @@
\pack_combinations_flush_captions
\egroup}
+% \def\pack_combinations_save_caption
+% {\global\setbox\b_pack_combinations_captions\hpack
+% {\hpack{\box\b_pack_combinations_caption}%
+% \unhbox\b_pack_combinations_captions}}
+%
+% \def\pack_combinations_flush_captions
+% {\noalign
+% {\ifdim\ht\b_pack_combinations_captions>\zeropoint
+% \nointerlineskip % indeed
+% \combinationparameter\c!inbetween
+% \global\c_pack_combinations_x\c_pack_combinations_max
+% \glet\pack_combinations_flush_captions_indeed\pack_combinations_flush_captions_yes
+% \else
+% \global\setbox\b_pack_combinations_captions\emptybox
+% \glet\pack_combinations_flush_captions_indeed\pack_combinations_flush_captions_nop
+% \fi}%
+% \pack_combinations_flush_captions_indeed
+% \crcr}
+%
+% \def\pack_combinations_flush_captions_yes
+% {\global\setbox\b_pack_combinations_captions\hpack
+% {\unhbox\b_pack_combinations_captions
+% \global\setbox\b_pack_combinations_temp\lastbox}%
+% \box\b_pack_combinations_temp
+% \global\advance\c_pack_combinations_x\minusone\relax
+% \ifnum\c_pack_combinations_x>\zerocount
+% \expandafter\pack_combinations_flush_captions_yes_followup
+% \else
+% \global\setbox\b_pack_combinations_captions\emptybox
+% \fi}
+
+\installcorenamespace{combinationcaption}
+
\def\pack_combinations_save_caption
- {\global\setbox\b_pack_combinations_captions\hpack
- {\hpack{\box\b_pack_combinations_caption}%
- \unhbox\b_pack_combinations_captions}}
+ {\ifdim\htdp\b_pack_combinations_caption>\d_pack_combinations_ht
+ \global\d_pack_combinations_ht\htdp\b_pack_combinations_caption
+ \fi
+ \savebox{\??combinationcaption:\number\c_pack_combinations_nesting}{\number\c_pack_combinations_x}{\box\b_pack_combinations_caption}}
\def\pack_combinations_flush_captions
{\noalign
- {\ifdim\ht\b_pack_combinations_captions>\zeropoint
+ {\ifdim\d_pack_combinations_ht>\zeropoint
\nointerlineskip % indeed
\combinationparameter\c!inbetween
\global\c_pack_combinations_x\c_pack_combinations_max
\glet\pack_combinations_flush_captions_indeed\pack_combinations_flush_captions_yes
\else
- \global\setbox\b_pack_combinations_captions\emptybox
\glet\pack_combinations_flush_captions_indeed\pack_combinations_flush_captions_nop
\fi}%
\pack_combinations_flush_captions_indeed
\crcr}
\def\pack_combinations_flush_captions_yes
- {\global\setbox\b_pack_combinations_captions\hpack
- {\unhbox\b_pack_combinations_captions
- \global\setbox\b_pack_combinations_temp\lastbox}%
- \box\b_pack_combinations_temp
- \global\advance\c_pack_combinations_x\minusone\relax
- \ifnum\c_pack_combinations_x>\zerocount
+ {\vpack to \d_pack_combinations_ht\bgroup
+ \foundbox{\??combinationcaption:\number\c_pack_combinations_nesting}{\number\c_pack_combinations_x}%
+ \vss
+ \egroup
+ \global\advance\c_pack_combinations_x\minusone
+ \ifnum\c_pack_combinations_x>\zerocount % \c_pack_combinations_max
\expandafter\pack_combinations_flush_captions_yes_followup
\else
- \global\setbox\b_pack_combinations_captions\emptybox
+ \global\d_pack_combinations_ht\zeropoint
+ \initializeboxstack{\??combinationcaption:\number-\c_pack_combinations_nesting}%
\fi}
+
\let\pack_combinations_flush_captions_nop\donothing
\def\pack_combinations_flush_captions_yes_followup
@@ -539,8 +583,15 @@
\let\stopfloatcombination\relax
+% \unexpanded\def\pack_combinations_float_hack_a#1%
+% {\strc_floats_build_box_separate_split{\getlocalfloat{#1}}%
+% \box\b_strc_floats_separate_content}
+
+% \unexpanded\def\pack_combinations_float_hack_b#1%
+% {\box\b_strc_floats_separate_caption}
+
\unexpanded\def\pack_combinations_float_hack_a#1%
- {\strc_floats_build_box_separate_split{\getlocalfloat{#1}}%
+ {\strc_floats_build_box_separate_split{#1}%
\box\b_strc_floats_separate_content}
\unexpanded\def\pack_combinations_float_hack_b#1%
diff --git a/Master/texmf-dist/tex/context/base/mkiv/pack-lyr.mkxl b/Master/texmf-dist/tex/context/base/mkiv/pack-lyr.mkxl
deleted file mode 100644
index 43460092e7e..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/pack-lyr.mkxl
+++ /dev/null
@@ -1,794 +0,0 @@
-%D \module
-%D [ file=pack-lyr,
-%D version=2000.10.20,
-%D title=\CONTEXT\ Packaging Macros,
-%D subtitle=Layers,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Packaging Macros / Layers}
-
-% todo : first / last / next / +... => page key
-% test on left/right box when no doublesided option given
-% use \ifcsname instead of doifvalue
-
-\unprotect
-
-% When being backgrounds layers get the background offset displacement. Should be
-% an option, on by default (compatibility).
-
-%D The layering mechanism implemented here is independent of the output routine, but
-%D future extensions may depend on a more close cooperation.
-%D
-%D First we overload a macro from \type {pack-rul}. From now on we accept a
-%D (optional) argument: the specific layer it will go in. This means that we can
-%D move an overlay from one background to the other using the dimensions of the
-%D parent.
-
-\ifdefined\defineoverlay \else \message{loaded to early} \wait \fi
-
-\unexpanded\def\defineoverlay
- {\dotripleempty\pack_framed_define_overlay}
-
-\def\pack_framed_define_overlay[#1][#2][#3]% overlay [layer] content
- {\ifthirdargument
- %\writestatus{BEWARE}{This (overlay definition) has changed!}% temp
- \def\pack_framed_define_overlay_indeed##1{\setvalue{\??overlay##1}{\setlayer[#2]{\executedefinedoverlay{##1}{#3}}}}%
- \else
- \def\pack_framed_define_overlay_indeed##1{\setvalue{\??overlay##1}{\executedefinedoverlay{##1}{#2}}}%
- \fi
- \processcommalist[#1]\pack_framed_define_overlay_indeed}
-
-%D We use the command handler code. The previous, more direct parameter handling was
-%D 25\% faster when no parameters were passed when adding content to a layer.
-%D However, when we pass for instance a preset, the new methos is some 10\% faster
-%D and it happens that in most cases we do pass some parameters. It would be
-%D interesting to see if we can push the preset in between the regular chain but it
-%D could also lead to unwanted side effects when nesting layer placement.
-
-\installcorenamespace{layer}
-\installcorenamespace{layerbox}
-\installcorenamespace{layerpreset}
-\installcorenamespace{layerposition} % brr, unreadable
-
-%D \macros
-%D {definelayer,setuplayer}
-%D
-%D Each layer gets its own (global) box. This also means that the data that goes
-%D into a layer, is typeset immediately. Each layer automatically gets an associated
-%D overlay, which can be used in any background assignment.
-%D
-%D After a layer is defined, you can change its characteristics.
-
-\installcommandhandler \??layer {layer} \??layer
-
-\setuplayer
- [\c!state=\v!start,
- %\c!doublesided=,
- %\c!preset=,
- %\c!option=,
- %\c!corner=,
- %\c!page=,
- %\c!rotation=, % geen 0 !
- \c!direction=\v!normal,
- \c!position=\v!no,
- \c!method=\v!overlay,
- \c!x=\zeropoint,
- \c!y=\zeropoint,
- \c!line=0,
- \c!column=0,
- \c!width=\wd\nextbox, % don't change this globally
- \c!height=\ht\nextbox, % don't change this globally
- \c!offset=\zeropoint,
- \c!hoffset=\zeropoint,
- \c!voffset=\zeropoint,
- \c!dx=\zeropoint,
- \c!dy=\zeropoint,
- \c!location=rb,
- \c!sx=1,
- \c!sy=1,
- \c!region=\layeranchor]
-
-\def\layeranchor{\currentlayer:\the\realpageno}
-
-\let\p_pack_layers_doublesided\empty
-\let\p_pack_layers_state \empty
-\let\p_pack_layers_option \empty
-\let\p_pack_layers_method \empty
-\let\p_pack_layers_preset \empty
-\let\p_pack_layers_rotation \empty
-\let\p_pack_layers_position \empty
-\let\p_pack_layers_hoffset \empty
-\let\p_pack_layers_voffset \empty
-\let\p_pack_layers_offset \empty
-\let\p_pack_layers_dx \empty
-\let\p_pack_layers_dy \empty
-\let\p_pack_layers_sx \empty
-\let\p_pack_layers_sy \empty
-\let\p_pack_layers_x \empty
-\let\p_pack_layers_y \empty
-\let\p_pack_layers_corner \empty
-\let\p_pack_layers_location \empty
-\let\p_pack_layers_line \empty
-\let\p_pack_layers_column \empty
-\let\p_pack_layers_width \empty
-\let\p_pack_layers_height \empty
-\let\p_pack_layers_direction \empty
-\let\p_pack_layers_region \empty
-
-\let\m_pack_layers_page \empty
-\let\m_pack_layers_target \empty
-\let\m_pack_layers_region \empty
-\let\m_pack_layers_anchor \empty
-
-\newconditional\c_pack_layers_repeated
-\newconditional\c_pack_layers_trace
-\newcount \c_pack_layers_current_data
-
-\newbox\b_layers
-
-\newdimen\d_pack_layers_x_size
-\newdimen\d_pack_layers_y_size
-\newdimen\d_pack_layers_x_offset
-\newdimen\d_pack_layers_y_offset
-\newdimen\d_pack_layers_x_position
-\newdimen\d_pack_layers_y_position
-
-\newdimen\layerwidth
-\newdimen\layerheight
-
-\let\lastlayerxpos\!!zeropoint
-\let\lastlayerypos\!!zeropoint
-\let\lastlayerwd \!!zeropoint
-\let\lastlayerht \!!zeropoint
-\let\lastlayerdp \!!zeropoint
-
-\appendtoks
- \edef\p_pack_layers_doublesided{\layerparameter\c!doublesided}%
- \ifx\p_pack_layers_doublesided\v!yes
- \relateparameterhandlers{layer}{\v!left \currentlayer}{layer}\currentlayer % permits left*
- \relateparameterhandlers{layer}{\v!right\currentlayer}{layer}\currentlayer % permits right*
- \pack_layers_preset_box{\v!left \currentlayer}%
- \pack_layers_preset_box{\v!right\currentlayer}%
- \fi
- \pack_layers_preset_box\currentlayer
- \normalexpanded{\defineoverlay[\currentlayer][\noexpand\composedlayer{\currentlayer}]}%
-\to \everydefinelayer
-
-\def\pack_layers_preset_box#1%
- {\ifcsname\??layerbox#1\endcsname
- \resetlayer[#1]%
- \else
- \expandafter\newbox\csname\??layerbox#1\endcsname
- \fi}
-
-%D \macros
-%D {resetlayer}
-%D
-%D This macro hardly needs an explanation (but is seldom needed anyway).
-
-\def\pack_layers_reset_box#1%
- {\ifcsname\??layerbox#1\endcsname
- %\global\setbox\csname\??layerbox#1\endcsname\emptybox
- \global\setbox\lastnamedcs\emptybox
- \fi}
-
-\def\resetlayer[#1]%
- {\pack_layers_reset_box{#1}%
- \pack_layers_reset_box{\v!left #1}%
- \pack_layers_reset_box{\v!right#1}%
- \pack_layers_reset_box{#1:\the\realpageno}}
-
-%D \macros
-%D {setlayer}
-%D
-%D Data is moved into a layer with the following macro. When \type {position} is
-%D set, relative positioning is used, with the current point as reference point.
-%D Otherwise the topleft corner is used as reference point.
-%D
-%D \starttyping
-%D \setlayer [identifier] [optional parameters] {data}
-%D \stoptyping
-
-\def\setcurrentlayerdimensions
- {\dodoubleempty\pack_layers_set_current_dimensions}
-
-\def\pack_layers_set_current_dimensions[#1][#2]% name left|right
- {\edef\currentlayerwidth {\thelayerwidth {#2#1}}%
- \edef\currentlayerheight{\thelayerheight{#2#1}}}
-
-\def\thelayerwidth #1{\the\ifcsname\??layerbox#1\endcsname\wd\lastnamedcs\else\zeropoint\fi}
-\def\thelayerheight#1{\the\ifcsname\??layerbox#1\endcsname\ht\lastnamedcs\else\zeropoint\fi}
-
-\unexpanded\def\setlayer
- {\dotripleempty\pack_layers_set}
-
-\def\pack_layers_set[#1][#2][#3]% #4 == box do \fi is ok
- {\bgroup
- \checkpositionoverlays % otherwise funny regions
- \edef\currentlayer{#1}%
- \edef\p_pack_layers_state{\layerparameter\c!state}%
- \ifx\p_pack_layers_state\v!stop
- \dowithnextboxcs\egroup\hbox % no pack ?
- \orelse\ifthirdargument
- \pack_layers_set_indeed[#1][#2][#3]%
- \else
- \ifcondition\validassignment{#2}%
- \pack_layers_set_indeed[#1][][#2]%
- \else
- \pack_layers_set_indeed[#1][#2][]%
- \fi
- \fi}
-
-\def\pack_layers_set_indeed[#1][#2][#3]% #2 = links/rechts
- {\page_backgrounds_recalculate % brrr
- \global\advance\c_pack_layers_current_data\plusone
- \forgetall
- \dontcomplain
- \edef\p_pack_layers_option{\layerparameter\c!option}%
- \ifx\p_pack_layers_option\v!test
- \settrue\c_pack_layers_trace
- \traceboxplacementtrue
- \fi
- \edef\m_pack_layers_target{#2}%
- \dowithnextbox{\pack_layers_set_finish{#3}}\hbox}
-
-\def\pack_layers_set_finish#1%
- {\ifcsname\??layerbox\currentlayer\endcsname % can move up
- \ifx\m_pack_layers_target\v!even
- \ifodd\realpageno
- % discard nextbox
- \else
- \let\m_pack_layers_target\v!left
- \pack_layers_set_content{#1}%
- \fi
- \orelse\ifx\m_pack_layers_target\v!odd
- \ifodd\realpageno
- \let\m_pack_layers_target\v!right
- \pack_layers_set_content{#1}%
- \else
- % discard nextbox
- \fi
- \else
- \pack_layers_set_content{#1}%
- \fi
- \else
- \writestatus{layer}{unknown layer \currentlayer}%
- \fi
- \egroup}
-
-% todo: left/right
-% todo: get position data in one go
-
-\def\pack_layers_set_last_position_yes % target: left|right
- {% this will become one call
- \edef\m_pack_layers_anchor{\??layerposition\the\c_pack_layers_current_data}%
- \edef\m_pack_layers_page {\MPp\m_pack_layers_anchor}%
- %edef\m_pack_layers_region{\MPr\m_pack_layers_anchor}% wrong one
- \edef\m_pack_layers_region{\layerparameter\c!region}%
- \d_pack_layers_x_position \dimexpr-\MPx\m_pack_layers_region+\MPx\m_pack_layers_anchor\relax
- \d_pack_layers_y_position \dimexpr \MPy\m_pack_layers_region-\MPy\m_pack_layers_anchor+\MPh\m_pack_layers_region\relax
- \xdef\lastlayerxpos{\the\d_pack_layers_x_position}%
- \xdef\lastlayerypos{\the\d_pack_layers_y_position}%
- % \writestatus{layering}{region: \m_pack_layers_region=>\MPxywhd\m_pack_layers_region}%
- % \writestatus {}{anchor: \m_pack_layers_anchor=>\MPxywhd\m_pack_layers_anchor}%
- % \writestatus {}{offset: \c!dx,\c!dy =>\lastlayerxpos,\lastlayerypos}%
- \global\letlayerparameter\c!state\v!start % needed ?
- \setbox\b_layers\vpack to \d_pack_layers_y_size
- {\hpack to \d_pack_layers_x_size
- {\xypos\m_pack_layers_anchor\hss}%
- \vss}}
-
-\def\pack_layers_set_last_position_nop
- {\setbox\b_layers\emptybox
- \d_pack_layers_x_position\p_pack_layers_sx\dimexpr\p_pack_layers_x\relax
- \d_pack_layers_y_position\p_pack_layers_sy\dimexpr\p_pack_layers_y\relax
- \glet\lastlayerxpos\!!zeropoint
- \glet\lastlayerypos\!!zeropoint
- \doifinset\v!bottom\p_pack_layers_corner\pack_layers_set_bottom_positions
- \doifinset\v!right \p_pack_layers_corner\pack_layers_set_right_positions
- \doifinset\v!middle\p_pack_layers_corner\pack_layers_set_middle_positions
- \edef\m_pack_layers_page{\layerparameter\c!page}}
-
-\unexpanded\def\definelayerpreset
- {\dodoubleargument\pack_layers_define_preset}
-
-\def\pack_layers_define_preset[#1][#2]%
- {\doifelseassignment{#2}
- {\setvalue{\??layerpreset#1}{\setupcurrentlayer[#2]}}
- {\setvalue{\??layerpreset#1}{\csname\??layerpreset#2\endcsname}}}
-
-\def\pack_layers_set_content#1%
- {\layerwidth \layerparameter\c!width % global (local later)
- \layerheight\layerparameter\c!height % global (local later)
- \d_pack_layers_x_size\layerwidth
- \d_pack_layers_y_size\layerheight
- %
- \setupcurrentlayer[#1]% preroll
- %
- \edef\p_pack_layers_preset {\layerparameter\c!preset }%
- %
- \ifcsname\??layerpreset\p_pack_layers_preset\endcsname
- \lastnamedcs
- \setupcurrentlayer[#1]% postroll
- \fi
- %
- \edef\p_pack_layers_rotation {\layerparameter\c!rotation }%
- \edef\p_pack_layers_position {\layerparameter\c!position }%
- \edef\p_pack_layers_hoffset {\layerparameter\c!hoffset }%
- \edef\p_pack_layers_voffset {\layerparameter\c!voffset }%
- \edef\p_pack_layers_offset {\layerparameter\c!offset }%
- \edef\p_pack_layers_dx {\layerparameter\c!dx }%
- \edef\p_pack_layers_dy {\layerparameter\c!dy }%
- \edef\p_pack_layers_sx {\layerparameter\c!sx }%
- \edef\p_pack_layers_sy {\layerparameter\c!sy }%
- \edef\p_pack_layers_x {\layerparameter\c!x }%
- \edef\p_pack_layers_y {\layerparameter\c!y }%
- \edef\p_pack_layers_corner {\layerparameter\c!corner }%
- \edef\p_pack_layers_location {\layerparameter\c!location }%
- \edef\p_pack_layers_line {\layerparameter\c!line }%
- \edef\p_pack_layers_column {\layerparameter\c!column }%
- \edef\p_pack_layers_width {\layerparameter\c!width }% local ones
- \edef\p_pack_layers_height {\layerparameter\c!height }% local ones
- \edef\p_pack_layers_direction{\layerparameter\c!direction}%
- %
- \ifx\p_pack_layers_position\v!overlay
- \let\p_pack_layers_width \zeropoint
- \let\p_pack_layers_height \zeropoint
- \let\p_pack_layers_position\v!yes
- \fi
- \ifx\p_pack_layers_rotation\empty \else
- % use direct call
- \setbox\nextbox\hpack
- {\rotate[\c!location=\v!high,\c!rotation=\layerparameter\c!rotation]{\box\nextbox}}%
- \fi
- \d_pack_layers_x_offset\p_pack_layers_sx\dimexpr
- \ifx\p_pack_layers_hoffset\v!max\d_pack_layers_x_size\else\p_pack_layers_hoffset\fi+\p_pack_layers_offset+\p_pack_layers_dx
- \relax
- \d_pack_layers_y_offset\p_pack_layers_sy\dimexpr
- \ifx\p_pack_layers_voffset\v!max\d_pack_layers_y_size\else\p_pack_layers_voffset\fi+\p_pack_layers_offset+\p_pack_layers_dy
- \relax
- \ifx\p_pack_layers_position\v!yes
- \pack_layers_set_last_position_yes
- \else
- \pack_layers_set_last_position_nop
- \fi
- %
- \ifx\m_pack_layers_page\empty \else % is expanded
- \edef\m_pack_layers_page{:\m_pack_layers_page}%
- \ifcsname\??layerbox\m_pack_layers_target\currentlayer\m_pack_layers_page\endcsname \else
- \expandafter\newbox\csname\??layerbox\m_pack_layers_target\currentlayer\m_pack_layers_page\endcsname
- \fi
- \fi
- \chardef\layerpagebox\csname\??layerbox\m_pack_layers_target\currentlayer\m_pack_layers_page\endcsname
- \ifvoid\layerpagebox
- \gsetboxllx\layerpagebox\zeropoint
- \gsetboxlly\layerpagebox\zeropoint
- \fi
- \global\setbox\layerpagebox\vpack %to \layerparameter\c!height % new, otherwise no negative y possible
- {\offinterlineskip
- \ifvoid\layerpagebox
- \let\lastlayerwidth \zeropoint
- \let\lastlayerheight\zeropoint
- \else
- \edef\lastlayerwidth {\the\wd\layerpagebox}%
- \edef\lastlayerheight{\the\ht\layerpagebox}%
- \ht\layerpagebox\zeropoint
- \dp\layerpagebox\zeropoint
- \wd\layerpagebox\zeropoint
- \ifx\p_pack_layers_direction\v!reverse\else
- \box\layerpagebox
- \fi
- \fi
- % don't move
- \xdef\lastlayerwd{\the\wd\nextbox}%
- \xdef\lastlayerht{\the\ht\nextbox}% % not entirely ok when grid !
- \xdef\lastlayerdp{\the\dp\nextbox}% % not entirely ok when grid !
- % this code
- \ifx\p_pack_layers_location\v!grid
- \ht\nextbox\strutheight
- \dp\nextbox\strutdepth
- \else
- \setbox\nextbox\hpack
- {\alignedbox[\p_pack_layers_location]\vpack{\box\nextbox}}%
- \fi
- \ifnum\p_pack_layers_line=\zerocount\else % no \ifcase, can be negative
- \advance\d_pack_layers_y_position\dimexpr\p_pack_layers_line\lineheight+\topskip-\lineheight-\ht\nextbox\relax
- \fi
- \ifnum\p_pack_layers_column=\zerocount\else % no \ifcase, can be negative
- \advance\d_pack_layers_x_position\layoutcolumnoffset\p_pack_layers_column\relax
- \fi
- \ifx\p_pack_layers_location\v!grid
- \setbox\nextbox\hpack
- {\alignedbox[rb]\vpack{\box\nextbox}}%
- \fi
- % ll registration
- \scratchdimen\dimexpr\d_pack_layers_x_position+\d_pack_layers_x_offset\relax
- \ifdim\scratchdimen<\getboxllx\layerpagebox
- \gsetboxllx\layerpagebox\scratchdimen
- \fi
- \advance\scratchdimen\wd\nextbox
- \wd\nextbox\ifdim\scratchdimen>\lastlayerwidth \scratchdimen \else \lastlayerwidth \fi
- \scratchdimen\dimexpr\d_pack_layers_y_position+\d_pack_layers_y_offset\relax
- \ifdim\scratchdimen<\getboxlly\layerpagebox
- \gsetboxlly\layerpagebox\scratchdimen
- \fi
- % ll compensation
- \advance\scratchdimen\dimexpr\ht\nextbox+\dp\nextbox\relax
- \ht\nextbox\ifdim\scratchdimen>\lastlayerheight \scratchdimen \else \lastlayerheight \fi
- \dp\nextbox\zeropoint
- % placement
- \hsize\p_pack_layers_width
- \vpack to \p_pack_layers_height \bgroup
- \smashbox\nextbox
- \vskip\dimexpr\d_pack_layers_y_position+\d_pack_layers_y_offset\relax
- \hskip\dimexpr\d_pack_layers_x_position+\d_pack_layers_x_offset\relax
- % or maybe instead of the \vskip
- % \raise-\dimexpr\d_pack_layers_y_position+\d_pack_layers_y_offset\relax
- \box\nextbox
- \ifvoid\layerpagebox
- % already flushed
- \else
- % the reverse case % check !
- \vskip-\dimexpr\d_pack_layers_y_position+\d_pack_layers_y_offset\relax
- \box\layerpagebox
- \fi
- \egroup}%
- % when position is true, the layerbox holds the compensation and needs
- % to be placed; never change this !
- \ifvoid\b_layers \else
- \box\b_layers
- \fi}
-
-\def\pack_layers_set_bottom_positions
- {\ifnum\p_pack_layers_line=\zerocount\else % can be < 0
- \edef\p_pack_layers_line{\the\numexpr-\p_pack_layers_line+\layoutlines+\plusone\relax}% use counter instead ?
- \fi
- \ifdim\d_pack_layers_y_size>\zeropoint
- \advance\d_pack_layers_y_position-\d_pack_layers_y_size
- \d_pack_layers_y_position-\d_pack_layers_y_position
- \d_pack_layers_y_offset-\d_pack_layers_y_offset
- \fi}
-
-\def\pack_layers_set_right_positions
- {\ifnum\p_pack_layers_column=\zerocount\else % can be < 0
- \edef\p_pack_layers_column{\the\numexpr-\layerparameter\c!column+\layoutcolumns+\plusone\relax}% use counter instead ?
- \fi
- \ifdim\d_pack_layers_x_size>\zeropoint
- \advance\d_pack_layers_x_position-\d_pack_layers_x_size
- \d_pack_layers_x_position-\d_pack_layers_x_position
- \d_pack_layers_x_offset-\d_pack_layers_x_offset
- \fi}
-
-\def\pack_layers_set_middle_positions
- {\ifdim\d_pack_layers_x_size>\zeropoint \advance\d_pack_layers_x_position.5\d_pack_layers_x_size \fi
- \ifdim\d_pack_layers_y_size>\zeropoint \advance\d_pack_layers_y_position.5\d_pack_layers_y_size \fi}
-
-%D Given the task to be accomplished, the previous macro is not even that
-%D complicated. It mainly comes down to skipping to the right place and placing a
-%D box on top of or below the existing content. In the case of position tracking,
-%D another reference point is chosen.
-
-%D \macros
-%D {doifelselayerdata}
-
-\def\doifelselayerdata#1%
- {\ifcsname\??layerbox#1\endcsname
- %\ifvoid\csname\??layerbox#1\endcsname
- \ifvoid\lastnamedcs
- \doubleexpandafter\secondoftwoarguments
- \else
- \doubleexpandafter\firstoftwoarguments
- \fi
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\let\doiflayerdataelse\doifelselayerdata
-
-%D \macros
-%D {flushlayer}
-%D
-%D When we flush a layer, we flush both the main one and the page dependent one
-%D (when defined). This feature is more efficient in \ETEX\ since there testing for
-%D an undefined macro does not takes hash space.
-
-% todo: setups before flush, handy hook
-
-\unexpanded\def\flushlayer[#1]% quite core, so optimized (todo: check for void)
- {\begingroup
- \forgetall
- \edef\currentlayer{#1}%
- \edef\p_pack_layers_state{\layerparameter\c!state}%
- \ifx\p_pack_layers_state\v!stop
- % nothing
- \orelse\ifx\p_pack_layers_state\v!next
- \global\letlayerparameter\c!state\v!start % dangerous, stack-built-up
- \orelse\ifx\p_pack_layers_state\v!continue
- \global\letlayerparameter\c!state\v!repeat % dangerous, stack-built-up
- \else
- \edef\p_pack_layers_doublesided{\layerparameter\c!doublesided}%
- \ifx\p_pack_layers_doublesided\v!yes
- \ifcsname\??layerbox#1\endcsname
- % we can make a dedicated one for this
- \doifbothsidesoverruled
- {\pack_layers_flush_double\v!left }%
- {\pack_layers_flush_double\v!right}%
- {\pack_layers_flush_double\v!left }%
- \else
- \pack_layers_flush_single
- \fi
- \else
- \pack_layers_flush_single
- \fi
- \fi
- \endgroup}
-
-% \def\pack_layers_flush_single
-% {\startoverlay
-% {\ifcsname\??layerbox \currentlayer \endcsname\pack_layers_flush_indeed\plusone \currentlayer \fi}%
-% {\ifcsname\??layerbox \currentlayer:\the\realpageno\endcsname\pack_layers_flush_indeed\zerocount{\currentlayer:\the\realpageno}\fi}%
-% \stopoverlay}
-%
-% \def\pack_layers_flush_double#1%
-% {\startoverlay
-% {\ifcsname\??layerbox \currentlayer \endcsname\pack_layers_flush_indeed\plusone \currentlayer \fi}%
-% {\ifcsname\??layerbox \currentlayer:\the\realpageno\endcsname\pack_layers_flush_indeed\zerocount {\currentlayer:\the\realpageno}\fi}%
-% {\ifcsname\??layerbox#1\currentlayer \endcsname\pack_layers_flush_indeed\plusone {#1\currentlayer }\fi}%
-% {\ifcsname\??layerbox#1\currentlayer:\the\realpageno\endcsname\pack_layers_flush_indeed\zerocount{#1\currentlayer:\the\realpageno}\fi}%
-% \stopoverlay}
-
-% optimized:
-
-\def\pack_layers_flush_single
- {\ifcsname\??layerbox\currentlayer\endcsname
- \ifvoid\lastnamedcs
- \ifcsname\??layerbox\currentlayer:\the\realpageno\endcsname
- \ifvoid\lastnamedcs\else
- \chardef\b_layer_two\lastnamedcs
- \pack_layers_flush_indeed\zerocount{\currentlayer:\the\realpageno}\b_layer_two
- \fi
- \fi
- \else
- \chardef\b_layer_one\lastnamedcs
- \ifcsname\??layerbox\currentlayer:\the\realpageno\endcsname
- \ifvoid\lastnamedcs\else
- \chardef\b_layer_two\lastnamedcs
- \startoverlay
- {\pack_layers_flush_indeed\plusone \currentlayer \b_layer_one}%
- {\pack_layers_flush_indeed\zerocount{\currentlayer:\the\realpageno}\b_layer_two}%
- \stopoverlay
- \fi
- \else
- \pack_layers_flush_indeed\plusone\currentlayer\b_layer_one
- \fi
- \fi
- \orelse\ifcsname\??layerbox\currentlayer:\the\realpageno\endcsname
- \ifvoid\lastnamedcs
- % nothing
- \else
- \chardef\b_layer_two\lastnamedcs
- \pack_layers_flush_indeed\zerocount{\currentlayer:\the\realpageno}\b_layer_two
- \fi
- \fi}
-
-% less optimized:
-
-\def\pack_layers_flush_double#1%
- {\startoverlay
- {\ifcsname\??layerbox\currentlayer\endcsname
- \ifvoid\lastnamedcs\else \chardef\b_layer_two\lastnamedcs
- \pack_layers_flush_indeed\plusone\currentlayer\b_layer_two
- \fi
- \fi}%
- {\ifcsname\??layerbox\currentlayer:\the\realpageno\endcsname
- \ifvoid\lastnamedcs\else \chardef\b_layer_two\lastnamedcs
- \pack_layers_flush_indeed\zerocount{\currentlayer:\the\realpageno}\b_layer_two
- \fi
- \fi}%
- {\ifcsname\??layerbox#1\currentlayer\endcsname
- \ifvoid\lastnamedcs\else \chardef\b_layer_two\lastnamedcs
- \pack_layers_flush_indeed\plusone{#1\currentlayer}\b_layer_two
- \fi
- \fi}%
- {\ifcsname\??layerbox#1\currentlayer:\the\realpageno\endcsname
- \ifvoid\lastnamedcs\else \chardef\b_layer_two\lastnamedcs
- \pack_layers_flush_indeed\zerocount{#1\currentlayer:\the\realpageno}\b_layer_two
- \fi
- \fi}%
- \stopoverlay}
-
-\let\pack_layers_top_fill \relax
-\let\pack_layers_bottom_fill\vss
-
-%def\pack_layers_flush_indeed#1#2%
-\def\pack_layers_flush_indeed#1#2#3%
- {\begingroup % already grouped
- \offinterlineskip
- \edef\p_pack_layers_preset{\layerparameter\c!preset}%
- \ifcsname\??layerpreset\p_pack_layers_preset\endcsname
- \lastnamedcs
- \fi
- \edef\p_pack_layers_method{\layerparameter\c!method}%
- \edef\p_pack_layers_option{\layerparameter\c!option}%
- \ifx\p_pack_layers_option\v!test
- \settrue\c_pack_layers_trace
- \traceboxplacementtrue
- \fi
- \ifcase#1\relax
- \setfalse\c_pack_layers_repeated
- \else
- \edef\p_pack_layers_position{\layerparameter\c!position}%
- \ifx\p_pack_layers_position\v!yes
- \setfalse\c_pack_layers_repeated
- \else
- \edef\p_pack_layers_repeat{\layerparameter\c!repeat}%
- \ifx\p_pack_layers_repeat\v!yes
- \settrue\c_pack_layers_repeated
- \orelse\ifx\p_pack_layers_state\v!repeat
- \settrue\c_pack_layers_repeated
- \else
- \setfalse\c_pack_layers_repeated
- \fi
- \fi
- \fi
- %chardef\b_layers\csname\??layerbox#2\endcsname % trick
- \let\b_layers#3%
- % we need to copy in order to retain the negative offsets for a next
- % stage of additions, i.e. llx/lly accumulate in repeat mode and the
- % compensation may differ each flush depending on added content
- \setbox\nextbox
- \ifx\p_pack_layers_method\v!fit
- \pack_layers_positioned_box_yes
- \else
- \pack_layers_positioned_box_nop
- \fi
- % todo: method=offset => overlayoffset right/down (handy for backgrounds with offset)
- \doifelseoverlay{#2}%
- {\setlayoutcomponentattribute{\v!layer:#2}}%
- \resetlayoutcomponentattribute
- % we have conflicting demands: some mechanisms want ll anchoring .. I need to figure this out
- % and maybe we will have 'origin=bottom' or so
- \setbox\nextbox
- \ifx\p_pack_layers_option\v!test \ruledvbox \else \vpack \fi \ifx\p_pack_layers_method\v!overlay to \d_overlay_height \fi \layoutcomponentboxattribute
- {\pack_layers_top_fill
-%
-% \hpack \ifx\p_pack_layers_method\v!overlay to \d_overlay_width \fi
-% {\box\nextbox
-% \hss}%
-%
- \ifx\p_pack_layers_method\v!overlay \wd\nextbox\d_overlay_width\fi
- \box\nextbox
-%
- \pack_layers_bottom_fill}%
- % \edef\currentlayer{#2}% :\the\realpageno}% local .. check \anchor
- % \edef\p_pack_layers_position{\layerparameter\c!position}% local
- \ifx\p_pack_layers_position\v!yes
- \edef\p_pack_layers_region{\layerparameter\c!region}%
- \ifx\p_pack_layers_region\empty
- \else
- \anch_mark_tagged_box\nextbox\p_pack_layers_region % was \layeranchor
- \fi
- \fi
- \box\nextbox
- %
- \ifconditional\c_pack_layers_repeated\else
- \gsetboxllx\b_layers\zeropoint
- \gsetboxlly\b_layers\zeropoint
- \fi
- \endgroup}
-
-\def\pack_layers_positioned_box_yes
- {\vpack
- {\vskip-\getboxlly\b_layers
- \hskip-\getboxllx\b_layers
- \hsize-\dimexpr\getboxllx\b_layers-\wd\b_layers\relax
- \ifconditional\c_pack_layers_repeated\copy\else\box\fi\b_layers}}
-
-\def\pack_layers_positioned_box_nop
- {\ifconditional\c_pack_layers_repeated\copy\else\box\fi\b_layers}
-
-% \definelayer[test][method=fit] \setupcolors[state=start,option=test]
-%
-% \framed[framecolor=red,offset=overlay]{\setlayer[test]{aa}\setlayer[test][x=10pt]{g}\flushlayer[test]}
-% \framed[framecolor=red,offset=overlay]{\setlayer[test]{aa}\setlayer[test][x=-10pt]{bb}\flushlayer[test]}
-% \framed[framecolor=red,offset=overlay]{\setlayer[test][x=-20pt]{cccccc}\flushlayer[test]}
-% \framed[framecolor=red,offset=overlay]{\setlayer[test]{dd}\setlayer[test][x=-20pt,y=-3pt]{eeeeee}\flushlayer[test]}
-
-%D \macros
-%D {composedlayer,placelayer,tightlayer}
-%D
-%D This is a handy shortcut, which saves a couple of braces when we use it as
-%D parameter. This name also suits better to other layering commands.
-
-\unexpanded\def\composedlayer#1{\flushlayer[#1]}
-
-\unexpanded\def\tightlayer[#1]%
- {\hpack
- {\def\currentlayer{#1}% todo: left/right
- \setbox\nextbox\emptybox
- \d_overlay_width \layerparameter\c!width
- \d_overlay_height\layerparameter\c!height
- \composedlayer{#1}}}
-
-\let\placelayer\flushlayer
-
-%D \macros
-%D {setMPlayer}
-%D
-%D The following layer macro uses the positions that are registered by \METAPOST.
-%D
-%D \starttyping
-%D \definelayer[test]
-%D
-%D \setMPlayer [test] [somepos-1] {Whatever we want here!}
-%D \setMPlayer [test] [somepos-2] {Whatever we need there!}
-%D \setMPlayer [test] [somepos-3] {\externalfigure[cow.mps][width=2cm]}
-%D
-%D \startuseMPgraphic{oeps}
-%D draw fullcircle scaled 10cm withcolor red ;
-%D register ("somepos-1",2cm,3cm,center currentpicture) ;
-%D register ("somepos-2",8cm,5cm,(-1cm,-2cm)) ;
-%D register ("somepos-3",0cm,0cm,(-2cm,2cm)) ;
-%D \stopuseMPgraphic
-%D
-%D \getMPlayer[test]{\useMPgraphic{oeps}}
-%D \stoptyping
-%D
-%D The last line is equivalent to
-%D
-%D \starttyping
-%D \framed
-%D [background={foreground,test},offset=overlay]
-%D {\useMPgraphic{oeps}}
-%D \stoptyping
-
-\unexpanded\def\setMPlayer
- {\dotripleempty\pack_layers_set_MP}
-
-\def\MPlayerwidth {\hsize}
-\def\MPlayerheight{\vsize}
-
-\def\pack_layers_set_MP[#1][#2][#3]%
- {\edef\MPlayerwidth {\MPw{#2}}%
- \edef\MPlayerheight{\MPh{#2}}%
- \setlayer[#1][\c!x=\MPx{#2},\c!y=\MPy{#2},\c!position=\v!no,#3]}
-
-\unexpanded\def\getMPlayer
- {\dodoubleempty\pack_layers_get_MP}
-
-\def\pack_layers_get_MP[#1][#2]%
- {\framed[\c!background={\v!foreground,#1},\c!frame=\v!off,\c!offset=\v!overlay,#2]} % takes argument
-
-%D Watch out, a redefinition:
-
-\ifdefined\settextpagecontent \else
- \writestatus\m!system{error in page-lyr.tex} \wait
-\fi
-
-\definelayer
- [OTRTEXT]
-
-\setuplayer
- [OTRTEXT]
- [\c!width=\innermakeupwidth,
- \c!height=\textheight]
-
-\let\normalsettextpagecontent\settextpagecontent % will be overloaded in page-spr
-
-\unexpanded\def\settextpagecontent#1#2#3% #2 and #3 will disappear
- {\doifelselayerdata{OTRTEXT}
- {\setbox#1\hpack to \makeupwidth
- {\startoverlay
- {\tightlayer[OTRTEXT]} % first, otherwise problems with toc
- {\normalsettextpagecontent{#1}{#2}{#3}\box#1}
- \stopoverlay}%
- \dp#1\zeropoint}%
- {\normalsettextpagecontent{#1}{#2}{#3}}}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/pack-mrl.mkiv b/Master/texmf-dist/tex/context/base/mkiv/pack-mrl.mkiv
index e5d19d3b3de..1b7d4eb3018 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/pack-mrl.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/pack-mrl.mkiv
@@ -36,7 +36,7 @@
\installcorenamespace{blackrules}
-\installsimplecommandhandler \??blackrules {blackrules}
+\installsimplecommandhandler \??blackrules {blackrules} \??blackrules
\unexpanded\def\blackrule
{\hpack\bgroup
@@ -810,9 +810,9 @@
%D a piece of text, like
%D
%D \startbuffer
-%D
-%D \stopbuffer\fillinline \input reich \par
+%D \fillinline \input reich \par
%D \fillinline[margin=0cm] \input reich \par
+%D \stopbuffer
%D
%D \startexample
%D \getbuffer
diff --git a/Master/texmf-dist/tex/context/base/mkiv/pack-obj.lua b/Master/texmf-dist/tex/context/base/mkiv/pack-obj.lua
index ea36b10de7a..445085776f3 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/pack-obj.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/pack-obj.lua
@@ -176,6 +176,7 @@ function objects.restore(ns,id) -- why not just pass a box number here too (ok,
number = index,
page = getcount("realpageno"),
}
+ -- list is a rule
setlink(list,page)
end
setbox("objectbox",hbox)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/pack-ori.lua b/Master/texmf-dist/tex/context/base/mkiv/pack-ori.lua
deleted file mode 100644
index a786b19ef13..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/pack-ori.lua
+++ /dev/null
@@ -1,70 +0,0 @@
-if not modules then modules = { } end modules ['pack-ori'] = {
- version = 1.001,
- comment = "companion to supp-box.mkiv",
- author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
- copyright = "PRAGMA ADE / ConTeXt Development Team",
- license = "see context related readme files"
-}
-
-local context = context
-local implement = interfaces.implement
-local variables = interfaces.variables
-
-local settings_to_array = utilities.parsers.settings_to_array
-
-local orientation = {
- [variables.up] = 0x000,
- [variables.left] = 0x001,
- [variables.down] = 0x002,
- [variables.right] = 0x003,
- [variables.top] = 0x004,
- [variables.bottom] = 0x005,
-}
-local vertical = {
- [variables.line] = 0x000,
- [variables.top] = 0x010,
- [variables.bottom] = 0x020,
- [variables.middle] = 0x030,
-}
-local horizontal = {
- [variables.middle] = 0x000,
- [variables.flushleft] = 0x100,
- [variables.flushright] = 0x200,
- [variables.left] = 0x300,
- [variables.right] = 0x400,
-}
-
-implement {
- name = "toorientation",
- public = true,
- arguments = {
- {
- { "horizontal", "string" },
- { "vertical", "string" },
- { "orientation", "string" },
- }
- },
- actions = function(t)
- local n = 0
- local m = t.horizontal if m then n = n | (horizontal [m] or 0) end
- local m = t.vertical if m then n = n | (vertical [m] or 0) end
- local m = t.orientation if m then n = n | (orientation[m] or 0) end
- -- logs.report("orientation","0x%03X : %s",n,table.sequenced(t))
- context(n)
- end,
-}
-
-implement {
- name = "stringtoorientation",
- public = true,
- arguments = "string",
- actions = function(s)
- local n = 0
- local t = settings_to_array(s)
- local m = t[1] if m then n = n | (horizontal [m] or 0) end
- local m = t[2] if m then n = n | (vertical [m] or 0) end
- local m = t[3] if m then n = n | (orientation[m] or 0) end
- -- logs.report("orientation","0x%03X : %s",n,s)
- context(n)
- end,
-}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/pack-ori.mkxl b/Master/texmf-dist/tex/context/base/mkiv/pack-ori.mkxl
deleted file mode 100644
index 061768f94f9..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/pack-ori.mkxl
+++ /dev/null
@@ -1,88 +0,0 @@
-%D \module
-%D [ file=pack-ori, % was experimental
-%D version=2019.07.30,
-%D title=\CONTEXT\ Packaging Macros,
-%D subtitle=Anchoring,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Packaging Macros / Anchoring}
-
-\registerctxluafile{pack-ori}{}
-
-\unprotect
-
-%D Possible options are:
-%D
-%D \starttabulate[|T|T|]
-%D \NC orientation \NC up left down right top bottom
-%D \NC vertical \NC line top bottom middle
-%D \NC horizontal \NC middle flushleft flushright left right
-%D \stoptabulate
-
-\installcorenamespace{orientation}
-\installcorenamespace{orientations}
-
-\installcommandhandler \??orientation {orientation} \??orientation
-
-\setuporientation
- [\c!orientation=\v!normal,
- \c!horizontal=\v!normal,
- \c!vertical=\v!normal]
-
-\appendtoks
- \expandafter\chardef\csname\??orientations\currentorientation\endcsname\toorientation
- orientation {\orientationparameter\c!orientation}
- horizontal {\orientationparameter\c!horizontal}
- vertical {\orientationparameter\c!vertical}
- \relax\relax
-\to \everydefineorientation
-
-\defineorientation[\v!normal]
-
-\defineorientation[\v!up] [\c!orientation=\v!up]
-\defineorientation[\v!down] [\c!orientation=\v!down]
-\defineorientation[\v!left] [\c!orientation=\v!left]
-\defineorientation[\v!right] [\c!orientation=\v!right]
-\defineorientation[\v!top] [\c!orientation=\v!top]
-\defineorientation[\v!bottom][\c!orientation=\v!bottom]
-
-%D There will be some more helpers here.
-
-\def\theorientation#1%
- {\numexpr
- \ifcsname\??orientations#1\endcsname
- \lastnamedcs
- \else
- \zerocount
- \fi
- \relax}
-
-\def\autoorientation#1%
- {\numexpr
- \ifcsname\??orientations#1\endcsname
- \lastnamedcs
- \else
- \auto_orientation{#1}%
- \fi
- \relax}
-
-\def\auto_orientation#1%
- {\immediateassignment\global\expandafter\chardef\csname\??orientations#1\endcsname\stringtoorientation{#1}%
- \csname\??orientations#1\endcsname}
-
-\unexpanded\def\doifelseorientation#1%
- {\ifcsname\??orientations#1\endcsname
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-% \def\iforientationcsname#1{\ifcsname\??orientations}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/pack-rul.lua b/Master/texmf-dist/tex/context/base/mkiv/pack-rul.lua
index ef8d8136f48..8e410f0cfc0 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/pack-rul.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/pack-rul.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['pack-rul'] = {
version = 1.001,
+ optimize = true,
comment = "companion to pack-rul.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
@@ -122,6 +123,7 @@ local function doreshapeframedbox(n)
if hdone then
for h, id, subtype, list in nextlist, list do
if list and id == hlist_code then
+ -- called a lot so maybe a simple case is needed
if subtype == boxlist_code or subtype == linelist_code then
-- getdirection is irrelevant here so it will go
-- somehow a parfillskip also can get influenced
diff --git a/Master/texmf-dist/tex/context/base/mkiv/pack-rul.mkiv b/Master/texmf-dist/tex/context/base/mkiv/pack-rul.mkiv
index 8732c7e6b7c..e06949ed80e 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/pack-rul.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/pack-rul.mkiv
@@ -1542,7 +1542,7 @@
\d_framed_linewidth
\fi
\ifconditional\c_framed_has_offset
- \advance\d_framed_applied_offset\localoffset
+ \advance\d_framed_applied_offset\localoffset\relax
\fi
\ifconditional\c_framed_has_extra_offset
\pack_framed_apply_extra_offsets % includes \d_framed_applied_offset
@@ -1900,7 +1900,7 @@
{\iffirstargument
\setupcurrentmathframed[#1]%
\fi
- \c_framed_mstyle\mathstyle
+ \c_framed_mstyle\normalmathstyle
\edef\m_framed_location{\mathframedparameter\c!location}%
\ifx\m_framed_location\v!mathematics
\let\normalstrut\pack_framed_math_pos
@@ -2693,7 +2693,7 @@
% \edef\p_framed_text_strut{\letframedtextparameter\c!strut}% to be used
\letframedtextparameter\c!strut\v!no
\inheritedframedtextframed\bgroup
- \let\\=\endgraf
+ \let\\\endgraf
\edef\p_framed_text_depthcorrection{\framedtextparameter\c!depthcorrection}%
\ifx\p_framed_text_depthcorrection\v!on
\pack_framed_text_start_depth_correction
@@ -2814,7 +2814,7 @@
\letframedtextparameter\c!strut\v!no
\inheritedframedtextframed\bgroup
\blank[\v!disable]%
- \let\\=\endgraf
+ \let\\\endgraf
\useframedtextstyleandcolor\c!style\c!color
\vskip-\strutdp % brrr why is this needed ... needs to be sorted out, see testcase 1
\framedtextparameter\c!inner
@@ -3007,8 +3007,6 @@
%D A Goodie:
-\def\v!unframed{unframed}
-
\defineframed
[\v!unframed]
[\c!frame=\v!off,
diff --git a/Master/texmf-dist/tex/context/base/mkiv/pack-rul.mkxl b/Master/texmf-dist/tex/context/base/mkiv/pack-rul.mkxl
deleted file mode 100644
index 8fd23fbb1b7..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/pack-rul.mkxl
+++ /dev/null
@@ -1,3089 +0,0 @@
-%D \module
-%D [ file=pack-rul, % was core-rul,
-%D version=1998.10.16,
-%D title=\CONTEXT\ Packaging Macros,
-%D subtitle=Ruled Content,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Packaging Macros / Ruled Content}
-
-%D The code here is expanded lots of time as framed is used in many places. This is
-%D why the code here is (and gets) optimized as much as possible. Also, by avoiding
-%D packaging and expansion we also keep tracing reasonable. For instance, multiple
-%D stacked backgrounds can slow down a run if not optimized this way.
-
-\registerctxluafile{pack-rul}{optimize}
-
-\unprotect
-
-% \definesystemvariable {ol} % OmLijnd -> check scrn-fld too
-
-%D \macros
-%D {linewidth, setuplinewidth}
-%D
-%D This module deals with rules (lines) in several ways. First we introduce two
-%D macros that can be used to set some common characteristics.
-%D
-%D \showsetup{setuplinewidth}
-%D
-%D The linewidth is available in \type{\linewidth}. The preset value of .4pt equals
-%D the default hard coded \TEX\ rule width.
-
-\newdimen\linewidth
-
-\unexpanded\def\setuplinewidth
- {\dosingleargument\pack_framed_setup_line_width}
-
-\def\pack_framed_setup_line_width[#1]%
- {\assigndimension{#1}\linewidth{.2\points}{.4\points}{.6\points}}
-
-%D The parameter handler:
-
-\installcorenamespace{framed}
-\installcorenamespace{framedtop}
-\installcorenamespace{framedbottom}
-\installcorenamespace{framedleft}
-\installcorenamespace{framedright}
-
-\installcorenamespace{regularframed}
-\installcorenamespace{simplifiedframed}
-
-\installcommandhandler \??framed {framed} \??framed
-
-\let\pack_framed_framedparameter \framedparameter
-\let\pack_framed_framedparameterhash\framedparameterhash
-\let\pack_framed_setupcurrentframed \setupcurrentframed
-
-\def\pack_framed_initialize
- {\let\framedparameter \pack_framed_framedparameter
- \let\framedparameterhash\pack_framed_framedparameterhash
- \let\setupcurrentframed \pack_framed_setupcurrentframed
- \inframedtrue}
-
-%D A helper:
-
-\def\frameddimension#1{\the\dimexpr\framedparameter{#1}\relax}
-
-%D Inheritance:
-
-\def\installinheritedframed#1%
- {\normalexpanded{\doinstallinheritedframed
- \expandafter\noexpand\csname current#1\endcsname
- \expandafter\noexpand\csname #1parameter\endcsname
- \expandafter\noexpand\csname #1parameterhash\endcsname
- \expandafter\noexpand\csname do#1parameter\endcsname
- \expandafter\noexpand\csname do#1parentparameter\endcsname
- \expandafter\noexpand\csname do#1rootparameter\endcsname
- \expandafter\noexpand\csname setupcurrent#1\endcsname
- \expandafter\noexpand\csname inherited#1framed\endcsname
- \expandafter\noexpand\csname inherited#1framedbox\endcsname}} % new
-
-\unexpanded\def\doinstallinheritedframed#1#2#3#4#5#6#7#8#9%
- {\def#5##1##2{\ifx##1\relax#6{##2}\else#4{##1}{##2}\fi}%
- %\def#6##1{\ifcsname\??framed:##1\endcsname\??framed:##1\else\s!empty\fi}% root
- \def#6##1{\ifcsname\??framed:##1\endcsname\??framed:##1\else\??empty\fi}% root
- \unexpanded\def#8%
- {\bgroup
- \bgroup
- \inframedtrue
- \let\currentframed #1%
- \let\framedparameter #2%
- \let\framedparameterhash#3%
- \let\setupcurrentframed #7%
- \pack_framed_process_indeed}%
- \unexpanded\def#9%
- {\bgroup
- \inframedtrue
- \let\currentframed #1%
- \let\framedparameter #2%
- \let\framedparameterhash#3%
- \let\setupcurrentframed #7%
- \pack_framed_process_box_indeed}}
-
-\unexpanded\def\installframedcommandhandler#1#2#3%
- {\installcommandhandler{#1}{#2}{#3}%
- \installinheritedframed{#2}}
-
-\unexpanded\def\installframedautocommandhandler#1#2#3%
- {\installautocommandhandler{#1}{#2}{#3}%
- \installinheritedframed{#2}}
-
-\unexpanded\def\installsimpleframedcommandhandler#1#2#3%
- {\installsimplecommandhandler{#1}{#2}{#3}%
- \installinheritedframed{#2}}
-
-% for regular framed
-
-\setupframed
- [\c!width=\v!fit,
- \c!height=\v!broad,
- %\c!minheight=\zeropoint,
- %\c!lines=,
- \c!offset=.25\exheight, % \defaultframeoffset
- \c!empty=\v!no,
- \c!frame=\v!on,
- %\c!topframe=,
- %\c!bottomframe=,
- %\c!leftframe=,
- %\c!rightframe=,
- \c!radius=.5\bodyfontsize,
- \c!rulethickness=\linewidth,
- \c!corner=\v!rectangular,
- \c!depth=\zeropoint,
- %\c!foregroundcolor=,
- %\c!foregroundstyle=,
- %\c!background=,
- %\c!backgroundcolor=,
- \c!backgroundoffset=\zeropoint,
- %\c!framecolor=,
- \c!frameoffset=\zeropoint,
- \c!backgroundcorner=\framedparameter\c!corner, % use \p_ here
- \c!backgroundradius=\framedparameter\c!radius,
- \c!backgrounddepth=\framedparameter\c!depth,
- \c!framecorner=\framedparameter\c!corner,
- \c!frameradius=\framedparameter\c!radius,
- \c!framedepth=\framedparameter\c!depth,
- %\c!component=,
- %\c!region=,
- %\c!align=,
- \c!bottom=\vss,
- %\c!top=,
- \c!strut=\v!yes,
- \c!autostrut=\v!yes,
- \c!location=\v!normal,
- %\c!orientation=,
- %\c!anchoring=,
- \c!autowidth=\v!yes,
- %\c!setups=,
- \c!loffset=\zeropoint,
- \c!roffset=\zeropoint,
- \c!toffset=\zeropoint,
- \c!boffset=\zeropoint]
-
-%D For backgrounds and such:
-
-\defineframed
- [\??simplifiedframed]
- [\c!frame=\v!off,
- \c!depth=\zeropoint,
- \c!offset=\v!overlay,
- \c!component=,
- \c!region=,
- \c!radius=.5\bodyfontsize,
- \c!rulethickness=\linewidth,
- \c!corner=\v!rectangular,
- \c!backgroundoffset=\zeropoint,
- \c!frameoffset=\zeropoint,
- \c!backgroundcorner=\framedparameter\c!corner, % use \p_ here
- \c!backgroundradius=\framedparameter\c!radius,
- \c!backgrounddepth=\framedparameter\c!depth,
- \c!framecorner=\framedparameter\c!corner,
- \c!frameradius=\framedparameter\c!radius,
- \c!framedepth=\framedparameter\c!depth,
- \c!location=\v!normal,
- \c!loffset=\zeropoint,
- \c!roffset=\zeropoint,
- \c!toffset=\zeropoint,
- \c!boffset=\zeropoint]
-
-\unexpanded\def\definesimplifiedframed[#1]% no settings
- {\defineframed[#1][\??simplifiedframed]%
- \expandafter\let\csname#1\endcsname\undefined}
-
-\expandafter\let\csname\??simplifiedframed\endcsname\undefined
-
-%D We will communicate through module specific variables, current framed
-%D parameters and some reserved dimension registers.
-
-\newdimen\d_framed_target_wd
-\newdimen\d_framed_target_ht
-\newdimen\d_framed_target_dp
-\newdimen\d_framed_linewidth \let\ruledlinewidth\d_framed_linewidth % needed at lua end
-
-\let\p_framed_frame \empty % \framedparameter\c!frame
-\let\p_framed_backgroundoffset\empty
-\let\p_framed_foregroundstyle \empty
-\let\p_framed_autostrut \empty
-\let\p_framed_location \empty
-\let\p_framed_orientation \empty
-\let\p_framed_anchoring \empty
-\let\p_framed_autowidth \empty
-\let\p_framed_franalyze \empty
-\let\p_framed_backgroundcorner\empty
-\let\p_framed_backgroundradius\empty
-\let\p_framed_framecorner \empty
-\let\p_framed_frameradius \empty
-\let\p_framed_lines \empty
-\let\p_framed_empty \empty
-\let\p_framed_backgroundcolor \empty
-\let\p_framed_framecolor \empty
-\let\p_framed_component \empty
-\let\p_framed_background \empty
-\let\p_framed_rulethickness \empty
-\let\p_framed_foregroundcolor \empty
-\let\p_framed_setups \empty
-
-%D We don't have to stick to a \TEX\ drawn rule, but also can use rounded
-%D or even fancier shapes, as we will see later on.
-
-\def\pack_framed_filled_box
- {\edef\p_framed_backgroundcorner{\framedparameter\c!backgroundcorner}%
- \ifx\p_framed_backgroundcorner\v!rectangular
- \pack_framed_filled_box_normal
- \else
- \pack_framed_filled_box_radius
- \fi}
-
-\def\pack_framed_filled_box_normal
- {\vrule
- \s!width \d_framed_target_wd
- \s!height\d_framed_target_ht
- \s!depth \d_framed_target_dp
- \relax}
-
-\def\pack_framed_filled_box_radius
- {\edef\p_framed_backgroundradius{\framedparameter\c!backgroundradius}%
- \ifzeropt\dimexpr\p_framed_backgroundradius\relax % just in case of .x\bodyfontsize
- \pack_framed_filled_box_normal
- \else
- \pack_framed_filled_box_round
- \fi}
-
-\def\pack_framed_filled_box_round
- {\raise\d_framed_target_dp\hpack{\frule
- type fill
- width \d_framed_target_wd
- height \d_framed_target_ht
- depth \d_framed_target_dp
- line \d_framed_linewidth
- radius \p_framed_backgroundradius\space
- corner {\p_framed_backgroundcorner}
- \relax}}
-
-\def\pack_framed_stroked_box
- {\edef\p_framed_framecorner{\framedparameter\c!framecorner}%
- \ifx\p_framed_framecorner\v!rectangular
- \pack_framed_stroked_box_normal
- \else
- \pack_framed_stroked_box_radius
- \fi}
-
-\def\pack_framed_stroked_box_radius
- {\edef\p_framed_frameradius{\framedparameter\c!frameradius}%
- \ifzeropt\dimexpr\p_framed_frameradius\relax % just in case of .x\bodyfontsize
- \pack_framed_stroked_box_normal
- \orelse\ifx\p_framed_frame\v!on
- \pack_framed_stroked_box_round
- \fi}
-
-% \pack_framed_stroked_box_normal % later
-
-\def\pack_framed_stroked_box_round
- {\raise\d_framed_target_dp\hpack{\frule
- width \d_framed_target_wd
- height \d_framed_target_ht
- depth \d_framed_target_dp
- line \d_framed_linewidth
- radius \p_framed_frameradius\space
- corner {\p_framed_framecorner}
- \relax}}
-
-% a lot of weird corners
-%
-% \startTEXpage
-% \dontleavehmode\framed
-% [corner=0,frame=on,framecolor=green,
-% background=color,backgroundcolor=yellow]{\tttf TEST \twodigits\recurselevel}%
-% \vskip1em
-% \dontleavehmode\dostepwiserecurse {1} {4}{1}{\framed
-% [corner=\recurselevel,frame=on,framecolor=green,
-% background=color,backgroundcolor=yellow]{\tttf TEST \twodigits\recurselevel}%
-% \quad}
-% \vskip1em
-% \dontleavehmode\dostepwiserecurse {5} {8}{1}{\framed
-% [corner=\recurselevel,frame=on,framecolor=green,
-% background=color,backgroundcolor=yellow]{\tttf TEST \twodigits\recurselevel}%
-% \quad}
-% \vskip1em
-% \dontleavehmode\dostepwiserecurse {1} {4}{1}{\framed
-% [corner=\recurselevel,frame=on,framecolor=green]{\tttf TEST \twodigits\recurselevel}%
-% \quad}
-% \vskip1em
-% \dontleavehmode\dostepwiserecurse {5} {8}{1}{\framed
-% [corner=\recurselevel,frame=on,framecolor=green]{\tttf TEST \twodigits\recurselevel}%
-% \quad}
-% \vskip1em
-% \dontleavehmode\dostepwiserecurse {9}{12}{1}{\framed
-% [corner=\recurselevel,frame=on,framecolor=green]{\tttf TEST \twodigits\recurselevel}%
-% \quad}
-% \vskip1em
-% \dontleavehmode\dostepwiserecurse{13}{16}{1}{\framed
-% [corner=\recurselevel,frame=on,framecolor=green]{\tttf TEST \twodigits\recurselevel}%
-% \quad}
-% \vskip1em
-% \dontleavehmode\dostepwiserecurse{17}{20}{1}{\framed
-% [corner=\recurselevel,frame=on,framecolor=green]{\tttf TEST \twodigits\recurselevel}%
-% \quad}
-% \vskip1em
-% \dontleavehmode\dostepwiserecurse{21}{24}{1}{\framed
-% [corner=\recurselevel,frame=on,framecolor=green]{\tttf TEST \twodigits\recurselevel}%
-% \quad}
-% \vskip1em
-% \dontleavehmode\dostepwiserecurse{25}{28}{1}{\framed
-% [corner=\recurselevel,frame=on,framecolor=green]{\tttf TEST \twodigits\recurselevel}%
-% \quad}
-% \stopTEXpage
-
-%D It won't be a surprise that we not only provide gray boxes, but also colored
-%D ones. Here it is:
-
-\def\pack_framed_background_box_color
- {\edef\p_framed_backgroundcolor{\framedparameter\c!backgroundcolor}%
- \ifx\p_framed_backgroundcolor\empty \else
- \doifcolor\p_framed_backgroundcolor\pack_framed_background_box_color_indeed
- \fi}
-
-\def\pack_framed_background_box_color_indeed
- {\hpack{\dousecolorparameter\p_framed_backgroundcolor\pack_framed_filled_box}}
-
-%D \macros
-%D {defineoverlay, doifoverlayelse, overlayoffset,
-%D overlaywidth, overlayheight, overlaydepth,
-%D overlaycolor, overlaylinecolor, overlaylinewidth}
-%D
-%D Before we define the macro that actually takes card of the backgrounds, we
-%D introduce overlays. An overlay is something that contrary to its name lays {\em
-%D under} the text. An example of an overlay definition is:
-%D
-%D \startbuffer[tmp-1]
-%D \defineoverlay
-%D [fancy]
-%D [{\externalfigure
-%D [mp-cont.502]
-%D [width=\overlaywidth,
-%D height=\overlayheight]}]
-%D \stopbuffer
-%D
-%D \typebuffer[tmp-1]
-%D
-%D That for instance can be uses in:
-%D
-%D \startbuffer[tmp-2]
-%D \framed[backgroundachtergrond=fancy]{How Fancy!}
-%D \framed[backgroundachtergrond=fancy,frame=off]{Even More Fancy!}
-%D \stopbuffer
-%D
-%D and looks like:
-%D
-%D \startlinecorrection
-%D \vbox{\baselineskip24pt\getbuffer[tmp-1]\getbuffer[tmp-2]}
-%D \stoplinecorrection
-%D
-%D The formal definition is:
-%D
-%D \showsetup{defineoverlay}
-%D
-%D This macro's definition is a bit obscure, due the many non||used arguments and
-%D the two step call that enable the setting of the width, height and depth
-%D variables. Multiple backgrounds are possible and are specified as:
-%D
-%D \starttyping
-%D \framed[background={one,two,three}]{Three backgrounds!}
-%D \stoptyping
-%D
-%D Most drawing packages only know width and height. Therefore the dimensions have a
-%D slightly different meaning here:
-%D
-%D \startitemize[packed]
-%D \item \type{\overlaywidth }: width of the overlay
-%D \item \type{\overlayheight}: height plus depth of the overlay
-%D \item \type{\overlaydepth }: depth of the overlay
-%D \stopitemize
-%D
-%D The resulting box is lowered to the right depth.
-
-%def\overlaywidth {\the\hsize\space} % We preset the variables
-%def\overlayheight {\the\vsize\space} % to some reasonable default
-%def\overlaydepth {0pt } % values. The attributes
-%let\overlayoffset \overlaydepth % of the frame can be (are)
-%let\overlaylinewidth \overlaydepth % set somewhere else.
-\let\overlaycolor \empty
-\let\overlaylinecolor \empty
-
-\def\overlayradius{\framedparameter\c!frameradius}
-
-\newdimen\d_overlay_width
-\newdimen\d_overlay_height
-\newdimen\d_overlay_depth
-\newdimen\d_overlay_offset
-\newdimen\d_overlay_linewidth
-
-\let\m_overlay_region\empty
-
-% expandable ... in a future version the space will go (in mp one can use Overlay*)
-
-\def\overlaywidth {\the\d_overlay_width \space} % We preset the variables
-\def\overlayheight {\the\d_overlay_height \space} % to some reasonable default
-\def\overlaydepth {\the\d_overlay_depth \space} % values.
-\def\overlayoffset {\the\d_overlay_offset \space} % of the frame can be (are)
-\def\overlaylinewidth {\the\d_overlay_linewidth\space} % set somewhere else.
-\def\overlayregion {\m_overlay_region}
-
-% public but kind of protected
-
-\def\usedoverlaywidth {\dimexpr\d_overlay_width \relax}
-\def\usedoverlayheight {\dimexpr\d_overlay_height \relax}
-\def\usedoverlaydepth {\dimexpr\d_overlay_depth \relax}
-\def\usedoverlayoffset {\dimexpr\d_overlay_offset \relax}
-\def\usedoverlaylinewidth{\dimexpr\d_overlay_linewidth\relax}
-
-%D The next register is used to initialize overlays.
-
-\newtoks\everyoverlay
-
-%D An example of an initialization is the following (overlays can contain text
-%D and be executed under an regime where interlineskip is off).
-
-\installcorenamespace{overlay}
-\installcorenamespace{overlaybuiltin}
-
-\appendtoks
- \oninterlineskip
-\to \everyoverlay
-
-\prependtoks
- \hsize\d_overlay_width
- \vsize\d_overlay_height
-\to \everyoverlay
-
-\unexpanded\def\defineoverlay
- {\dodoubleargument\pack_framed_define_overlay}
-
-\def\pack_framed_define_overlay[#1][#2]%
- {\def\pack_framed_define_overlay_indeed##1{\setvalue{\??overlay##1}{\executedefinedoverlay{##1}{#2}}}%
- \processcommalist[#1]\pack_framed_define_overlay_indeed}
-
-% \unexpanded\def\executedefinedoverlay#1#2% we can share the definitions
-% {\bgroup % redundant grouping
-% \setbox\scratchbox\hbox\bgroup
-% \ifzeropt\d_framed_target_dp
-% \the\everyoverlay#2% saves wrapping (and lua call)
-% \else
-% \lower\d_framed_target_dp
-% \hbox{\the\everyoverlay#2}%
-% \fi
-% \egroup
-% \setlayoutcomponentattribute{\v!overlay:#1}%
-% \setbox\scratchbox\hpack \layoutcomponentboxattribute
-% {\kern -.5\dimexpr\wd\scratchbox-\d_framed_target_wd\relax % was \d_overlay_width
-% \raise-.5\dimexpr\ht\scratchbox-\d_framed_target_ht\relax % not \d_overlay_height !
-% \box\scratchbox}%
-% \wd\scratchbox\d_framed_target_wd
-% \ht\scratchbox\d_framed_target_ht
-% \dp\scratchbox\d_framed_target_dp
-% \box\scratchbox
-% \egroup}
-
-% 20191231: moved from cont-exp:
-
-\unexpanded\def\executedefinedoverlay#1#2% we can share the definitions
- {\bgroup % redundant grouping
- \setlayoutcomponentattribute{\v!overlay:#1}%
- \setbox\scratchbox\hbox \layoutcomponentboxattribute{\the\everyoverlay#2}%
- \boxxoffset\scratchbox-.5\dimexpr\wd\scratchbox-\d_framed_target_wd\relax % was \d_overlay_width
- \boxyoffset\scratchbox-.5\dimexpr\ht\scratchbox-\d_framed_target_ht+\d_framed_target_dp\relax % not \d_overlay_height !
- \wd\scratchbox\d_framed_target_wd
- \ht\scratchbox\d_framed_target_ht
- \dp\scratchbox\d_framed_target_dp
- \box\scratchbox
- \egroup}
-
-%D \macros
-%D {overlayfakebox}
-
-% \unexpanded\def\overlayfakebox
-% {\hpack
-% {\setbox\scratchbox\emptyhbox
-% \wd\scratchbox\d_overlay_width
-% \ht\scratchbox\d_overlay_height
-% \box\scratchbox}}
-
-\unexpanded\def\overlayfakebox
- {\hpack % redundant but needs testing
- {\novrule
- \s!width \d_overlay_width
- \s!height\d_overlay_height
- \s!depth \zeropoint}}
-
-%D For testing we provide:
-
-\def\doifelseoverlay#1% only tests external overlays
- {\ifcsname\??overlay#1\endcsname
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\let\doifoverlayelse\doifelseoverlay
-
-%D The content of the box will be (temporary) saved in a box. We also have an
-%D extra box for backgrounds.
-
-\newbox\b_framed_normal
-\newbox\b_framed_extra
-
-\newtoks\everybackgroundbox
-
-\let\m_framed_background\empty % we might need a public name
-
-\def\pack_framed_process_background
- {\ifcsname\??overlaybuiltin\m_framed_background\endcsname
- \expandafter\pack_framed_process_background_indeed_internal\lastnamedcs
- \orelse\ifcsname\??overlay\m_framed_background\endcsname
- \expandafter\pack_framed_process_background_indeed_external\lastnamedcs
- \fi}
-
-\def\pack_framed_process_background_indeed_internal#1% % : in name
- {\bgroup
- \setbox\b_framed_extra\hpack\bgroup
- \ifzeropt\framedbackgroundoffset\else
- \kern-\framedbackgroundoffset
- \fi
- \hbox\bgroup#1\egroup
- \egroup
- \wd\b_framed_extra\zeropoint
- \ht\b_framed_extra\framedbackgroundheight
- \dp\b_framed_extra\framedbackgrounddepth
- \box\b_framed_extra
- \egroup}
-
-\def\pack_framed_process_background_indeed_external
- {\pack_framed_overlay_initialize
- \pack_framed_process_background_indeed_internal}
-
-\def\pack_framed_process_backgrounds#1,#2% #2 gobbles spaces (we could avoid one catch if we have nextbackground)
- {\edef\m_framed_background{#1}%
- \ifx\m_framed_background\s!unknown\else
- \pack_framed_process_background
- \expandafter\pack_framed_process_backgrounds
- \fi#2}
-
-%D Beware, a backgroundbox can be empty which is another reason why we set the
-%D width to zero instead of back-skipping.
-
-\newdimen\framedbackgroundwidth
-\newdimen\framedbackgroundheight
-\newdimen\framedbackgrounddepth
-\newdimen\framedbackgroundoffset
-
-\def\pack_framed_background_box_content% fuzzy but needed hack, this \vss, otherwise
- {\vpack to \framedbackgroundheight{\vss\box\b_framed_normal\vss}} % vertical shift \backgroundheight
-
-\def\pack_framed_set_region % experiment
- {\ifx\m_overlay_region\v!yes
- \edef\m_overlay_region{\reservedautoregiontag}%
- \fi}
-
-\def\pack_framed_add_region % experiment
- {\anch_mark_tagged_box\b_framed_normal\m_overlay_region}
-
-\def\pack_framed_add_background
- {\setbox\b_framed_normal\hpack % was vbox % see also *1*
- {%\pack_framed_forgetall % can be relaxed
- \boxmaxdepth\maxdimen
- \framedbackgroundoffset\d_framed_backgroundoffset
- \framedbackgroundwidth \wd\b_framed_normal
- \framedbackgroundheight\ht\b_framed_normal
- \framedbackgrounddepth \dp\b_framed_normal
- \d_framed_target_wd\dimexpr\framedbackgroundwidth +2\framedbackgroundoffset\relax
- \d_framed_target_ht\dimexpr\framedbackgroundheight+ \framedbackgroundoffset\relax
- \d_framed_target_dp\dimexpr\framedbackgrounddepth + \framedbackgroundoffset+\framedparameter\c!backgrounddepth\relax
- \let\pack_framed_overlay_initialize\pack_framed_overlay_initialize_indeed
- \ifx\p_framed_component\empty
- \resetlayoutcomponentattribute
- \else
- \setlayoutcomponentattribute{\v!background:\p_framed_component}%
- \fi
- \let\foregroundbox\pack_framed_background_box_content
- \hpack \layoutcomponentboxattribute to \framedbackgroundwidth\bgroup % width in case 'foreground' is used as overlay
- \the\everybackgroundbox % moved
- \expandafter\pack_framed_process_backgrounds\p_framed_background,\s!unknown,\relax % hm, messy .. look into it
- \box\b_framed_normal
- \hss
- \egroup}}
-
-\def\pack_framed_overlay_initialize_indeed
- {\d_overlay_width \d_framed_target_wd
- \d_overlay_height \dimexpr\d_framed_target_ht+\d_framed_target_dp\relax
- \d_overlay_depth \d_framed_target_dp
- \d_overlay_linewidth \d_framed_linewidth
- \d_overlay_offset \framedbackgroundoffset\relax
- \edef\overlaycolor {\framedparameter\c!backgroundcolor}% let ?
- \edef\overlaylinecolor{\framedparameter\c!framecolor}% only needed for layers
- %\edef\overlaycorner {\framedparameter\c!backgroundcorner}%
- %\edef\overlayradius {\framedparameter\c!backgroundradius}%
- \let\pack_framed_overlay_initialize\relax}
-
-%D One can explictly insert the foreground box. For that purpose we introduce the
-%D overlay \type {foreground}.
-%D
-%D We predefine two already familiar backgrounds:
-
-%letvalue{\??overlaybuiltin\v!screen }\pack_framed_background_box_gray
-\letvalue{\??overlaybuiltin\v!color }\pack_framed_background_box_color
-\letvalue{\??overlaybuiltin\v!foreground}\pack_framed_background_box_content % replaces: \defineoverlay[\v!foreground][\foregroundbox]
-
-%D We can specify overlays as a comma separated list of overlays, a sometimes
-%D handy feature.
-%D
-%D Besides backgrounds (overlays) we also need some macros to draw outlines (ruled
-%D borders). Again we have to deal with square and round corners. The first category
-%D can be handled by \TEX\ itself, the latter one depends on the driver. This macro
-%D also support a negative offset.
-
-\def\pack_framed_add_outline
- {\setbox\b_framed_normal\hpack % rules on top of box
- {\d_framed_target_wd\dimexpr\wd\b_framed_normal+2\d_framed_frameoffset\relax
- \d_framed_target_ht\dimexpr\ht\b_framed_normal+ \d_framed_frameoffset\relax
- \d_framed_target_dp\dimexpr\dp\b_framed_normal+ \d_framed_frameoffset+\framedparameter\c!framedepth\relax
- \ifdim\d_framed_target_dp<\zeropoint
- \advance\d_framed_target_ht \d_framed_target_dp
- \scratchdimen-\d_framed_target_dp
- \d_framed_target_dp\zeropoint
- \else
- \scratchdimen\zeropoint
- \fi
- \edef\overlaylinecolor{\framedparameter\c!framecolor}% twice, also in background
- \setbox\b_framed_extra\hpack
- {\kern-\d_framed_frameoffset
- \raise\scratchdimen
- \hpack{\ifx\overlaylinecolor\empty\else\dousecolorparameter\overlaylinecolor\fi\pack_framed_stroked_box}}%
- \wd\b_framed_extra\wd\b_framed_normal
- \ht\b_framed_extra\ht\b_framed_normal
- \dp\b_framed_extra\dp\b_framed_normal
- \wd\b_framed_normal\zeropoint
- \box\b_framed_normal
- \box\b_framed_extra}}
-
-\def\pack_framed_stroked_box_normal_opened
- {\setbox\scratchbox\vpack \bgroup
- \csname\??framedtop\p_framed_frame\framedparameter\c!topframe\endcsname
- \nointerlineskip % new (needed for fences)
- \hpack \bgroup
- \csname\??framedleft\p_framed_frame\framedparameter\c!leftframe\endcsname
- \novrule
- \s!width \d_framed_target_wd
- \s!height\d_framed_target_ht
- \s!depth \d_framed_target_dp
- \csname\??framedright\p_framed_frame\framedparameter\c!rightframe\endcsname
- \egroup
- \nointerlineskip % new (needed for fences)
- \csname\??framedbottom\p_framed_frame\framedparameter\c!bottomframe\endcsname
- \egroup
- \wd\scratchbox\d_framed_target_wd
- \ht\scratchbox\d_framed_target_ht
- \dp\scratchbox\d_framed_target_dp
- \box\scratchbox}
-
-\def\pack_framed_stroked_box_normal_closed
- {\hpack\bgroup
- \scratchdimen.5\d_framed_linewidth
- \hskip\scratchdimen
- \clf_framedoutline
- \dimexpr\d_framed_target_wd-\d_framed_linewidth\relax
- \dimexpr\d_framed_target_ht-\scratchdimen\relax
- \dimexpr\d_framed_target_dp-\scratchdimen\relax
- \d_framed_linewidth
- \relax
- \egroup}
-
-\def\pack_framed_stroked_box_normal
- {\ifx\p_framed_frame\v!closed
- \pack_framed_stroked_box_normal_closed
- \else
- \pack_framed_stroked_box_normal_opened
- \fi}
-
-\def\pack_framed_t_rule{\hrule\s!height\d_framed_linewidth\kern-\d_framed_linewidth}
-\def\pack_framed_b_rule{\kern-\d_framed_linewidth\hrule\s!height\d_framed_linewidth}
-\def\pack_framed_r_rule{\kern-\d_framed_linewidth\vrule\s!width\d_framed_linewidth}
-\def\pack_framed_l_rule{\vrule\s!width\d_framed_linewidth\kern-\d_framed_linewidth}
-
-\letvalue{\??framedtop \v!on \v!on}\pack_framed_t_rule
-\letvalue{\??framedtop \v!off\v!on}\pack_framed_t_rule
-\letvalue{\??framedtop \v!on }\pack_framed_t_rule
-
-\letvalue{\??framedbottom\v!on \v!on}\pack_framed_b_rule
-\letvalue{\??framedbottom\v!off\v!on}\pack_framed_b_rule
-\letvalue{\??framedbottom\v!on }\pack_framed_b_rule
-
-\letvalue{\??framedleft \v!on \v!on}\pack_framed_l_rule
-\letvalue{\??framedleft \v!off\v!on}\pack_framed_l_rule
-\letvalue{\??framedleft \v!on }\pack_framed_l_rule
-
-\letvalue{\??framedright \v!on \v!on}\pack_framed_r_rule
-\letvalue{\??framedright \v!off\v!on}\pack_framed_r_rule
-\letvalue{\??framedright \v!on }\pack_framed_r_rule
-
-% no overlapping rules
-
-\def\pack_framed_t_rules{\hpack{\kern\d_framed_linewidth\vrule\s!width\dimexpr\d_framed_target_wd-2\d_framed_linewidth\relax\s!height\d_framed_linewidth}\nointerlineskip\kern-\d_framed_linewidth}
-\def\pack_framed_b_rules{\kern-\d_framed_linewidth\nointerlineskip\hpack{\kern\d_framed_linewidth\vrule\s!width\dimexpr\d_framed_target_wd-2\d_framed_linewidth\relax\s!height\d_framed_linewidth}}
-\def\pack_framed_r_rules{\kern-\d_framed_linewidth\vrule\s!height\dimexpr\d_framed_target_ht-\d_framed_linewidth\relax\s!depth-\d_framed_linewidth\s!width\d_framed_linewidth}
-\def\pack_framed_l_rules{\vrule\s!height\dimexpr\d_framed_target_ht-\d_framed_linewidth\relax\s!depth-\d_framed_linewidth\s!width\d_framed_linewidth\kern-\d_framed_linewidth}
-
-\letvalue{\??framedtop \v!small\v!small}\pack_framed_t_rules
-\letvalue{\??framedtop \v!off \v!small}\pack_framed_t_rules
-\letvalue{\??framedtop \v!small }\pack_framed_t_rules
-
-\letvalue{\??framedbottom\v!small\v!small}\pack_framed_b_rules
-\letvalue{\??framedbottom\v!off \v!small}\pack_framed_b_rules
-\letvalue{\??framedbottom\v!small }\pack_framed_b_rules
-
-\letvalue{\??framedleft \v!small\v!small}\pack_framed_l_rules
-\letvalue{\??framedleft \v!off \v!small}\pack_framed_l_rules
-\letvalue{\??framedleft \v!small }\pack_framed_l_rules
-
-\letvalue{\??framedright \v!small\v!small}\pack_framed_r_rules
-\letvalue{\??framedright \v!off \v!small}\pack_framed_r_rules
-\letvalue{\??framedright \v!small }\pack_framed_r_rules
-
-% \framed
-% [width=4cm,height=3cm,rulethickness=3mm,
-% frame=off,rightframe=on,leftframe=on,topframe=on,bottomframe=on]
-% {}
-% \framed
-% [width=4cm,height=3cm,rulethickness=3mm,
-% frame=off,rightframe=small,leftframe=small,topframe=small,bottomframe=small]
-% {}
-% \framed
-% [width=4cm,height=3cm,rulethickness=3mm,
-% frame=off,rightframe=small,leftframe=small,topframe=small,bottomframe=on]
-% {}
-
-%D The next few macros are probably the most misused ones in \CONTEXT. They deal
-%D with putting rules around boxes, provide backgrounds, offer alignment features,
-%D and some more. We start with defining some booleans. These give an impression of
-%D what we are going to take into account.
-
-% todo : \c_framed_hasoffset
-% faster : \let\c_framed_hasoffset\falseconditional
-
-\newconditional\c_framed_has_offset
-\newconditional\c_framed_has_width
-\newconditional\c_framed_has_height
-\newconditional\c_framed_has_format
-\newconditional\c_framed_is_overlaid
-\newconditional\c_framed_has_frame
-\newconditional\c_framed_has_extra_offset
-\newconditional\c_framed_text_location_none
-
-\newconstant \c_framed_has_strut % 0=relaxes 1=pseudostruts 2=realstruts
-
-%D \macros
-%D {framed, setupframed}
-%D
-%D Ruled boxes are typeset using \type{\framed}. This command is quite versatile
-%D and, although some users will probably seldom use it, one cannot overlook its
-%D features.
-%D
-%D \showsetup{setupframed}
-%D \showsetup{framed}
-%D
-%D This general macro is a special version of an even more general case, that can
-%D easily be linked into other macros that need some kind of framing. The local
-%D version is called with an extra parameter: the variable identifier. The reason
-%D for passing this identifier between brackets lays in the mere fact that this way
-%D we can use the optional argument grabbers.
-
-\def\defaultframeoffset{.25\exheight}
-
-\installcorenamespace{regularframedlevel}
-
-\unexpanded\def\installregularframed#1%
- {\defineframed[#1]}
-
-\unexpanded\def\presetlocalframed[#1]%
- {\defineframed[#1]}
-
-% \presetlocalframed[\??framed]
-
-\newcount\c_pack_framed_nesting
-
-\unexpanded\def\pack_framed_process_framed[#1]%
- {\bgroup
- \iffirstargument % faster
- \setupcurrentframed[#1]% here !
- \fi
- \pack_framed_process_indeed}
-
-\unexpanded\def\framed
- {\bgroup
- \advance\c_pack_framed_nesting\plusone
- \expandafter\let\csname\??framed>\the\c_pack_framed_nesting:\s!parent\endcsname\??framed
- \edef\currentframed{>\the\c_pack_framed_nesting}%
- \pack_framed_initialize
- \dosingleempty\pack_framed_process_framed}
-
-\unexpanded\def\startframed
- {\dosingleempty\pack_framed_start_framed}
-
-\def\pack_framed_start_framed[#1]%
- {\bgroup
- \doifelseassignment{#1}\pack_framed_start_framed_yes\pack_framed_start_framed_nop{#1}}
-
-\def\pack_framed_start_framed_yes#1%
- {\advance\c_pack_framed_nesting\plusone
- \expandafter\let\csname\??framed>\the\c_pack_framed_nesting:\s!parent\endcsname\??framed
- \iffirstargument\secondargumenttrue\fi % dirty trick
- \edef\currentframed{>\the\c_pack_framed_nesting}%
- \pack_framed_initialize
- \bgroup
- \iffirstargument
- \secondargumenttrue % dirty trick
- \setupcurrentframed[#1]% here !
- \fi
- \pack_framed_process_indeed
- \bgroup
- \ignorespaces}
-
-\def\pack_framed_start_framed_nop#1%
- {\edef\currentframed{#1}%
- \dosingleempty\pack_framed_start_framed_nop_indeed}
-
-\def\pack_framed_start_framed_nop_indeed[#1]%
- {\pack_framed_initialize
- \bgroup
- \iffirstargument
- \setupcurrentframed[#1]% here !
- \fi
- \pack_framed_process_indeed
- \bgroup
- \ignorespaces}
-
-% till here
-
-\unexpanded\def\stopframed
- {\removeunwantedspaces
- \egroup}
-
-\unexpanded\def\normalframedwithsettings[#1]%
- {\bgroup
- \advance\c_pack_framed_nesting\plusone
- \expandafter\let\csname\??framed>\the\c_pack_framed_nesting:\s!parent\endcsname\??framed
- \bgroup
- \edef\currentframed{>\the\c_pack_framed_nesting}%
- \pack_framed_initialize
- \setupcurrentframed[#1]%
- \pack_framed_process_indeed}
-
-%D \startbuffer
-%D \setupframed [framecolor=yellow] \framed{A}
-%D \defineframed[myframed] [framecolor=blue] \myframed{B}
-%D \setupframed [myframed] [framecolor=red] \myframed{C}
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-%D
-%D \startbuffer
-%D \presetlocalframed[myframed]
-%D \localframed[myframed][framecolor=green]{oeps}
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-
-%D \macros
-%D {ifinframed}
-%D
-%D The normal case first presets all parameters and next starts looking for the user
-%D supplied ones. The first step is omitted in the local case, because these are
-%D preset at declaration time and keep their values unless explictly changed. By
-%D presetting the variables everytime the normal command is called, we can use this
-%D command nested, without the unwanted side effect of inheritance. The boolean is
-%D used to speed up the color stack.
-
-\newif\ifinframed
-
-%D The next one is faster on multiple backgrounds per page. No
-%D dimensions can be set, only frames and backgrounds.
-
-\unexpanded\def\fastlocalframed[#1]#2[#3]#4% 3-4
- {\bgroup
- \edef\currentframed{#1}%
- \pack_framed_initialize
- \setbox\b_framed_normal\hbox{#4}%
- \iftrialtypesetting \else
- \edef\m_overlay_region{\framedparameter\c!region}%
- \ifx\m_overlay_region\empty\else
- \pack_framed_set_region
- \fi
- \fi
- \setupcurrentframed[#3]%
- \edef\p_framed_rulethickness{\framedparameter\c!rulethickness}% also used in backgrounds
- \d_framed_frameoffset\framedparameter\c!frameoffset\relax % also used in backgrounds
- \edef\p_framed_frame{\framedparameter\c!frame}%
- \edef\p_framed_background{\framedparameter\c!background}%
- % not here, in calling macro: setups
- \pack_framed_remove_depth
- \ifx\p_framed_frame\v!overlay \orelse \ifx\p_framed_frame\v!none \else
- \ifx\p_framed_rulethickness\empty\else
- \d_framed_linewidth\p_framed_rulethickness\relax
- \fi
- \pack_framed_add_outline % real or invisible frame
- \fi
- \ifx\p_framed_background\empty \else
- \edef\p_framed_backgroundoffset{\framedparameter\c!backgroundoffset}%
- \d_framed_backgroundoffset
- \ifx\p_framed_backgroundoffset\v!frame
- \d_framed_frameoffset
- \else
- \p_framed_backgroundoffset
- \fi
- \edef\p_framed_component{\framedparameter\c!component}%
- \pack_framed_add_background
- \fi
- \pack_framed_restore_depth
- \iftrialtypesetting\orelse\ifx\m_overlay_region\empty\else
- \pack_framed_add_region
- \fi
- \box\b_framed_normal
- \egroup}
-
-%D The next macro uses a box and takes its natural width and height so these
-%D can better be correct.
-
-\unexpanded\def\pack_framed_process_box_indeed#1#2% component box (assumes parameters set and grouped usage)
- {\setbox\b_framed_normal\box#2% could actually be \let\b_framed_normal#2
- \edef\m_overlay_region{\framedparameter\c!region}%
- \ifx\m_overlay_region\empty\else
- \pack_framed_set_region
- \fi
- \edef\p_framed_rulethickness{\framedparameter\c!rulethickness}% also used in backgrounds
- \d_framed_frameoffset\framedparameter\c!frameoffset\relax % also used in backgrounds
- \edef\p_framed_frame{\framedparameter\c!frame}%
- \edef\p_framed_background{\framedparameter\c!background}%
- \ifx\p_framed_frame\v!overlay \orelse \ifx\p_framed_frame\v!none \else
- \ifx\p_framed_rulethickness\empty \else
- \d_framed_linewidth\p_framed_rulethickness\relax
- \fi
- \pack_framed_add_outline % real or invisible frame
- \fi
- \ifx\p_framed_background\empty \else
- \edef\p_framed_backgroundoffset{\framedparameter\c!backgroundoffset}%
- \d_framed_backgroundoffset
- \ifx\p_framed_backgroundoffset\v!frame
- \d_framed_frameoffset
- \else
- \p_framed_backgroundoffset
- \fi
- \edef\p_framed_component{#1}%
- \pack_framed_add_background
- \fi
- \ifx\m_overlay_region\empty\else
- \pack_framed_add_region
- \fi
- \box\b_framed_normal
- \egroup}
-
-\unexpanded\def\localbackgroundframed#1% namespace component box
- {\bgroup
- \edef\currentframed{#1}%
- \pack_framed_initialize
- \pack_framed_process_box_indeed} % group ends here
-
-\let\postprocessframebox\relax
-
-%D A nice example by Aditya:
-%D
-%D \starttyping
-%D \setupframed
-%D [loffset=\framedparameter{hoffset},
-%D roffset=\framedparameter{hoffset},
-%D hoffset=\zeropoint]
-%D
-%D \defineframed[test][hoffset=1cm]
-%D \stoptyping
-
-\newdimen\d_framed_width
-\newdimen\d_framed_height
-\newdimen\d_framed_frameoffset
-\newdimen\d_framed_backgroundoffset
-\newdimen\d_framed_local_offset
-
-% todo: protect local \framednames
-
-\unexpanded\def\localframed
- {\bgroup
- \dodoubleempty\pack_framed_local}
-
-\unexpanded\def\pack_framed_local[#1][#2]%
- {\bgroup
- \edef\currentframed{#1}%
- \pack_framed_initialize
- \ifsecondargument % faster
- \setupcurrentframed[#2]% here !
- \fi
- \pack_framed_process_indeed}
-
-\unexpanded\def\directlocalframed[#1]% no optional
- {\bgroup
- \bgroup
- \edef\currentframed{#1}%
- \pack_framed_initialize
- \pack_framed_process_indeed}
-
-\unexpanded\def\localframedwithsettings[#1][#2]% no checking (so no spaces between)
- {\bgroup
- \bgroup
- \edef\currentframed{#1}%
- \pack_framed_initialize
- \setupcurrentframed[#2]% here !
- \pack_framed_process_indeed}
-
-% done
-
-\def\c!fr!analyze{fr:analyze} % private option
-
-\let\delayedbegstrut\relax
-\let\delayedendstrut\relax
-\let\delayedstrut \relax
-
-\let\localoffset\empty
-\let\localwidth \empty
-\let\localheight\empty
-\let\localformat\empty
-\let\localstrut \empty
-
-\unexpanded\def\pack_framed_process_indeed
- {\d_framed_frameoffset\framedparameter\c!frameoffset
- \edef\p_framed_backgroundoffset{\framedparameter\c!backgroundoffset}%
- \d_framed_backgroundoffset
- \ifx\p_framed_backgroundoffset\v!frame
- \d_framed_frameoffset
- \else
- \p_framed_backgroundoffset
- \fi
- % new, experimental dirty hook
- \framedparameter\c!extras
- % to get the right spacing
- \edef\p_framed_foregroundstyle{\framedparameter\c!foregroundstyle}%
- \ifx\p_framed_foregroundstyle\empty\else\dousestyleparameter\p_framed_foregroundstyle\fi
- % beware, both the frame and background offset can be overruled
- %
- \edef\p_framed_setups{\framedparameter\c!setups}%
- % the next macros are visible
- \edef\localoffset{\framedparameter\c!offset}%
- \edef\localwidth {\framedparameter\c!width}%
- \edef\localheight{\framedparameter\c!height}%
- \edef\localformat{\framedparameter\c!align}%
- \edef\localstrut {\framedparameter\c!strut}%
- % these are not
- \edef\p_framed_autostrut {\framedparameter\c!autostrut}%
- \edef\p_framed_frame {\framedparameter\c!frame}%
- \edef\p_framed_location {\framedparameter\c!location}%
- \edef\p_framed_orientation{\framedparameter\c!orientation}%
- \edef\p_framed_anchoring {\framedparameter\c!anchoring}%
- %
- \edef\p_framed_autowidth {\framedparameter\c!autowidth}%
- \edef\p_framed_franalyze {\framedparameter\c!fr!analyze}% experimental option
- %
- \ifx\p_framed_frame\v!overlay % no frame, no offset, no framewidth
- \setfalse\c_framed_has_frame
- \let\localoffset\v!overlay
- \orelse\ifx\p_framed_frame\v!none % no frame, no framewidth
- \setfalse\c_framed_has_frame
- \else
- \settrue\c_framed_has_frame
- \fi
- \ifconditional\c_framed_has_frame
- \edef\p_framed_rulethickness{\framedparameter\c!rulethickness}%
- \ifx\p_framed_rulethickness\empty\else
- \d_framed_linewidth\p_framed_rulethickness\relax
- \fi
- \else
- \d_framed_linewidth\zeropoint
- \fi
- % 2013/03/12: a change of order (sizes before align
- \ifx\localwidth\v!local
- \setlocalhsize
- \fi
- %
- \forgetall % should happen after \localwidth but before align
- %
- \ifx\localformat\empty
- \setfalse\c_framed_has_format
- \else
- \settrue\c_framed_has_format
- \dosetraggedcommand\localformat % not that fast
- \fi
- %
- \ifcsname\??framedoffsetalternative\localoffset\endcsname
- \lastnamedcs
- \else
- \framed_offset_alternative_unknown
- \fi
- \ifcsname\??framedwidthalternative\localwidth\endcsname
- \lastnamedcs
- \else
- \framed_width_alternative_unknown
- \fi
- \ifcsname\??framedheightalternative\localheight\endcsname
- \lastnamedcs
- \else
- \framed_height_alternative_unknown
- \fi
- % the next check could move to heightalternative
- \ifconditional\c_framed_has_height
- % obey user set height, also downward compatible
- \else
- \edef\p_framed_lines{\framedparameter\c!lines}%
- \ifx\p_framed_lines\empty
- \orelse\ifcase\p_framed_lines
- \else
- \d_framed_height\p_framed_lines\lineheight
- \edef\localheight{\the\d_framed_height}%
- \settrue\c_framed_has_height
- \fi
- \fi
- % this is now an option: width=local
- %
- % \ifdim\d_framed_width=\hsize
- % \parindent\zeropoint
- % \setlocalhsize
- % \d_framed_width\localhsize
- % \fi
- % i.e. disable (colsetbackgroundproblemintechniek)
- \advance\d_framed_width -2\d_framed_local_offset
- \advance\d_framed_height -2\d_framed_local_offset
- \ifcsname\??framedstrutalternative\localstrut\endcsname
- \lastnamedcs
- \else
- \framed_offset_alternative_unknown
- \fi
- % the next check could move to strutalternative
- \ifcase\c_framed_has_strut % none (not even noindent)
- \let\localbegstrut\relax
- \let\localendstrut\relax
- \let\localstrut \relax
- \or % no / overlay
- \let\localbegstrut\pseudobegstrut
- \let\localendstrut\pseudoendstrut
- \let\localstrut \pseudostrut
- \else
- \let\localbegstrut\begstrut
- \let\localendstrut\endstrut
- \let\localstrut \strut
- \fi
- \ifx\p_framed_autostrut\v!yes
- \let\delayedbegstrut\relax
- \let\delayedendstrut\relax
- \let\delayedstrut \relax
- \else
- \let\delayedbegstrut\localbegstrut
- \let\delayedendstrut\localendstrut
- \let\delayedstrut \localstrut
- \let\localbegstrut \relax
- \let\localendstrut \relax
- \let\localstrut \relax
- \fi
- \ifconditional\c_framed_has_height
- \let\\\pack_framed_vboxed_newline
- \ifconditional\c_framed_has_width
- \let\hairline\pack_framed_vboxed_hairline
- \ifconditional\c_framed_has_format
- \let\next\pack_framed_format_format_yes
- \else
- \let\next\pack_framed_format_format_nop
- \fi
- \else
- \let\hairline\pack_framed_hboxed_hairline
- \ifconditional\c_framed_has_format
- \let\next\pack_framed_format_format_height
- \else
- \let\next\pack_framed_format_format_vsize
- \fi
- \fi
- \orelse\ifconditional\c_framed_has_width
- \ifconditional\c_framed_has_format
- \let\hairline\pack_framed_vboxed_hairline
- \let\\\pack_framed_vboxed_newline
- \let\next\pack_framed_format_format_width
- \else
- \let\hairline\pack_framed_hboxed_hairline
- \let\\\pack_framed_hboxed_newline
- \let\next\pack_framed_format_format_hsize
- \fi
- \else
- \let\hairline\pack_framed_hboxed_hairline
- \let\\\pack_framed_hboxed_newline
- \let\next\pack_framed_format_format_no_size
- \fi
- \pack_framed_check_extra_offsets
- \edef\p_framed_background{\framedparameter\c!background}%
-% \ifx\p_framed_background\empty
-% \let\pack_framed_forgetall\forgetall
-% \else
-% \let\pack_framed_forgetall\relax
-% \forgetall
-% \fi
- \edef\framedwidth {\the\ifdim\d_framed_width >\zeropoint \d_framed_width \else\zeropoint\fi}% public
- \edef\framedheight{\the\ifdim\d_framed_height>\zeropoint \d_framed_height\else\zeropoint\fi}% public
- \edef\framedoffset{\the\dimexpr\ifconditional\c_framed_has_offset\localoffset \else\zeropoint\fi}% public
- \ifx\p_framed_orientation\empty
- \let\pack_framed_stop_orientation\relax
- \else
- \pack_framed_start_orientation
- \fi
- \afterassignment\pack_framed_restart
- \setbox\b_framed_normal\next}
-
-% alternatives for width, height, strut and offset
-
-\installcorenamespace{framedwidthalternative}
-\installcorenamespace{framedheightalternative}
-\installcorenamespace{framedstrutalternative}
-\installcorenamespace{framedoffsetalternative}
-
-% widths
-
-\setvalue{\??framedwidthalternative\empty}%
- {\ifconditional\c_framed_has_format
- \settrue\c_framed_has_width
- \d_framed_width\hsize
- \else
- \setfalse\c_framed_has_width
- \d_framed_width\zeropoint
- \fi}
-
-\setvalue{\??framedwidthalternative\v!fit}%
- {\ifconditional\c_framed_has_format
- \settrue\c_framed_has_width
- \d_framed_width\hsize
- \else
- \setfalse\c_framed_has_width
- \d_framed_width\zeropoint
- \fi}
-
-\setvalue{\??framedwidthalternative\v!fixed}% equals \v!fit but no shapebox
- {\ifconditional\c_framed_has_format
- \settrue\c_framed_has_width
- \d_framed_width\hsize
- \else
- \setfalse\c_framed_has_width
- \d_framed_width\zeropoint
- \fi}
-
-\setvalue{\??framedwidthalternative\v!broad}%
- {\settrue\c_framed_has_width
- \d_framed_width\hsize}
-
-\setvalue{\??framedwidthalternative\v!max}% idem broad
- {\settrue\c_framed_has_width
- \d_framed_width\hsize}
-
-\setvalue{\??framedwidthalternative\v!local}%
- {\settrue\c_framed_has_width
- %\setlocalhsize
- \d_framed_width\localhsize}
-
-\setvalue{\??framedwidthalternative\s!unknown}%
- {\settrue\c_framed_has_width
- \d_framed_width\localwidth}
-
-\def\framed_width_alternative_unknown
- {\settrue\c_framed_has_width
- \d_framed_width\localwidth}
-
-% heights
-
-\setvalue{\??framedheightalternative\empty}%
- {\setfalse\c_framed_has_height
- \d_framed_height\zeropoint}
-
-\setvalue{\??framedheightalternative\v!fit}%
- {\setfalse\c_framed_has_height
- \d_framed_height\zeropoint}
-
-\setvalue{\??framedheightalternative\v!broad}%
- {\setfalse\c_framed_has_height
- \d_framed_height\zeropoint}
-
-\setvalue{\??framedheightalternative\v!max}%
- {\settrue\c_framed_has_height
- \d_framed_height\vsize}
-
-\setvalue{\??framedheightalternative\s!unknown}%
- {\settrue\c_framed_has_height
- \d_framed_height\localheight}
-
-\def\framed_height_alternative_unknown
- {\settrue\c_framed_has_height
- \d_framed_height\localheight}
-
-% struts (use let instead?)
-
-\setvalue{\??framedstrutalternative\v!no}%
- {\c_framed_has_strut\plusone}
-
-\setvalue{\??framedstrutalternative\v!global}%
- {\setstrut}
-
-\setvalue{\??framedstrutalternative\v!local}%
- {\setfontstrut}
-
-\setvalue{\??framedstrutalternative\v!yes}%
- {\setstrut}
-
-\setvalue{\??framedstrutalternative\s!unknown}%
- {\setstrut}
-
-\def\framed_strut_alternative_unknown
- {\setstrut}
-
-\setvalue{\??framedstrutalternative\v!none}% not even pseudo struts
- {\c_framed_has_strut\zerocount}
-
-% offsets
-
-\setvalue{\??framedoffsetalternative\v!none}%
- {\setfalse\c_framed_has_offset
- \c_framed_has_strut\plusone
- \setfalse\c_framed_is_overlaid
- \d_framed_local_offset\d_framed_linewidth}
-
-\setvalue{\??framedoffsetalternative\v!overlay}%
- {% \ifx\p_framed_frame\v!no \setfalse\c_framed_has_frame \fi % test first
- \setfalse\c_framed_has_offset
- \c_framed_has_strut\plusone
- \settrue\c_framed_is_overlaid
- \d_framed_local_offset\zeropoint}
-
-% \setvalue{\??framedoffsetalternative\v!strut}%
-% {\setfalse\c_framed_has_offset
-% \c_framed_has_strut\plustwo
-% \settrue\c_framed_is_overlaid
-% \d_framed_local_offset\zeropoint}
-
-\setvalue{\??framedoffsetalternative\v!default}% new per 2-6-2000
- {\settrue \c_framed_has_offset
- \c_framed_has_strut\plustwo
- \setfalse\c_framed_is_overlaid
- \let\localoffset\defaultframeoffset
- \letframedparameter\c!offset\defaultframeoffset % brrr
- \d_framed_local_offset\dimexpr\localoffset+\d_framed_linewidth\relax}
-
-\def\framed_offset_alternative_unknown
- {\settrue \c_framed_has_offset
- \c_framed_has_strut\plustwo
- \setfalse\c_framed_is_overlaid
- \let\defaultframeoffset\localoffset
- \d_framed_local_offset\dimexpr\localoffset+\d_framed_linewidth\relax}
-
-\letvalue{\??framedoffsetalternative\s!unknown}\framed_offset_alternative_unknown
-
-% so far for alternatives
-
-\let\pack_framed_stop_orientation\relax
-
-\def\pack_framed_restart
- {\aftergroup\pack_framed_finish}
-
-\def\pack_framed_do_top
- {\raggedtopcommand
- \framedparameter\c!top
- \edef\p_blank{\framedparameter\c!blank}%
- \ifx\p_blank\v!yes\else % auto or no
- \doinhibitblank
- \fi}
-
-\def\pack_framed_do_bottom
- {\framedparameter\c!bottom
- \raggedbottomcommand}
-
-%D Careful analysis of this macro will learn us that not all branches in the last
-%D conditionals can be encountered, that is, some assignments to \type{\next} will
-%D never occur. Nevertheless we implement the whole scheme, if not for future
-%D extensions.
-
-%D \macros
-%D {doassigncheckedframeoffset}
-%D
-%D Offset helper (see menus):
-
-\def\doassigncheckedframeoffset#1#2% could be a fast \csname .. \endcsname
- {\edef\checkedframeoffset{#2}%
- #1%
- \ifx\checkedframeoffset\empty \zeropoint\orelse
- \ifx\checkedframeoffset\v!overlay\zeropoint\orelse
- \ifx\checkedframeoffset\v!none \zeropoint\orelse
- \ifx\checkedframeoffset\v!frame \zeropoint\orelse
- \ifx\checkedframeoffset\v!default\zeropoint\else
- #2%
- \fi
- \relax}
-
-%D \macros
-%D {ifreshapeframebox}
-%D
-%D The last few lines tell what to do after the content of the box is collected and
-%D passed to the next macro. In the case of a fixed width and centered alignment,
-%D the content is evaluated and used to determine the most natural width. The rest
-%D of the code deals with backgrounds and frames.
-
-\newif\ifreshapeframebox \reshapeframeboxtrue
-
-%D Beware: setting \type {top} and \type {bottom} to nothing, may
-%D result in a frame that is larger that the given height! try:
-%D
-%D \starttyping
-%D \framed
-%D [height=3cm,top=,bottom=,offset=overlay]
-%D {\strut test \shapefill \strut test}
-%D \stoptyping
-%D
-%D This is intended behaviour and not a bug! One can always set
-%D
-%D \starttyping
-%D ...,bottom=\kern0pt,...
-%D \stoptyping
-
-% experiment ... \p_framed_franalyze -> we could support 'first' as location key
-% option but then we will always do an analysis and reimplement the location
-% options (btw, beware of location settings of derived functionality that bleed
-% into this
-
-\def\pack_framed_finish_a
- {\ifreshapeframebox
- \pack_framed_reshape_process
- \orelse\ifx\p_framed_franalyze\v!yes
- \pack_framed_reshape_analyze
- \else
- \pack_framed_reshape_reset
- \fi
- \setfalse\c_framed_has_width}
-
-\def\pack_framed_finish_b
- {\ifx\p_framed_franalyze\v!yes
- \pack_framed_reshape_analyze
- \else
- \pack_framed_reshape_reset
- \fi
- \setfalse\c_framed_has_width}
-
-\def\pack_framed_finish_c
- {\ifx\p_framed_franalyze\v!yes
- \pack_framed_reshape_analyze
- \else
- \pack_framed_reshape_reset
- \fi}
-
-\def\pack_framed_profile_box
- {\profilegivenbox\p_profile\b_framed_normal
- \setbox\b_framed_normal\vpack{\unvbox\b_framed_normal}}
-
-\unexpanded\def\pack_framed_finish
- {%\pack_framed_stop_orientation % hm, wrong place ! should rotate the result (after reshape) .. moved down
- \pack_framed_locator_before\p_framed_location
- \ifconditional\c_framed_has_format
- %\ifconditional\c_framed_has_height \else
- % \edef\p_profile{\framedparameter\c!profile}%
- % \ifx\p_profile\empty\else
- % \pack_framed_profile_box
- % \fi
- %\fi
- \ifx\p_framed_autowidth\v!force
- \pack_framed_finish_a
- \orelse\ifx\localwidth\v!fit
- \ifx\p_framed_autowidth\v!yes
- \pack_framed_finish_a
- \else
- \pack_framed_finish_b
- \fi
- \orelse\ifx\localwidth\v!fixed
- \pack_framed_finish_b
- \else
- \pack_framed_finish_c
- \fi
- \ifconditional\c_framed_has_height \else
- \edef\p_profile{\framedparameter\c!profile}%
- \ifx\p_profile\empty\else
- \pack_framed_profile_box
- \fi
- \fi
- \ifconditional\page_postprocessors_needed_box
- % quite late
- \page_postprocessors_linenumbers_box\b_framed_normal
- \fi
- \else
- \pack_framed_finish_c
- \fi
- \ifconditional\c_framed_has_width
- \wd\b_framed_normal\d_framed_width
- \fi
- \ifconditional\c_framed_has_height
- \ht\b_framed_normal\d_framed_height
- \else
- \edef\p_framed_minheight{\framedparameter\c!minheight}%
- \ifx\p_framed_minheight\empty \else
- \ifdim\ht\b_framed_normal<\p_framed_minheight
- \ht\b_framed_normal\p_framed_minheight
- \fi
- \fi
- \fi
- \edef\p_framed_empty{\framedparameter\c!empty}%
- \ifx\p_framed_empty\v!yes
- \pack_framed_fake_box
- \fi
- \ifx\p_framed_anchoring\empty\else
- \pack_framed_handle_anchoring
- \fi
- \pack_framed_stop_orientation % moved here at 2014-05-25
- \iftrialtypesetting \else
- \edef\m_overlay_region{\framedparameter\c!region}%
- \ifx\m_overlay_region\empty\else
- \pack_framed_set_region
- \fi
- \fi
- \d_framed_applied_offset
- \ifconditional\c_framed_is_overlaid
- \zeropoint
- \else
- \d_framed_linewidth
- \fi
- \ifconditional\c_framed_has_offset
- \advance\d_framed_applied_offset\localoffset
- \fi
- \ifconditional\c_framed_has_extra_offset
- \pack_framed_apply_extra_offsets % includes \d_framed_applied_offset
- \else
- \ifzeropt\d_framed_applied_offset
- \else
- \pack_framed_widen_box
- \fi
- \fi
- %
- \ifx\postprocessframebox\relax \else
- \let\next\postprocessframebox
- \let\postprocessframebox\relax % prevent nesting
- \next\b_framed_normal
- \fi
- \iftrialtypesetting
- % new
- \else
- \ifconditional\c_framed_has_frame % real or invisible frame
- \pack_framed_add_outline
- \fi
- \ifx\p_framed_background\empty \else
- \edef\p_framed_component{\framedparameter\c!component}%
- \pack_framed_add_background
- \fi
- \fi
- \pack_framed_locator_after\p_framed_location
- \iftrialtypesetting \else
- \ifx\m_overlay_region\empty\else
- \pack_framed_add_region
- \fi
- \fi
- \box\b_framed_normal
- \global\frameddimensionstate % global so to be used directly afterwards !
- \ifconditional\c_framed_has_width
- \ifconditional\c_framed_has_height \plusthree \else \plusone \fi
- \else
- \ifconditional\c_framed_has_height \plustwo \else \zerocount \fi
- \fi
- \egroup
- \egroup}
-
-%D Anchoring is experimental and was prototyped around the ctx meeting in 2018 but
-%D never mede it into the core yet. It operates independent of the orientation
-%D mechanism already present. It's a rather efficient feature. Best is to use
-%D predefined orientations, like:
-%D
-%D \starttyping
-%D \defineorientation[leftflushleft] [orientation=left,horizontal=flushleft]
-%D
-%D \framed [anchoring={leftflushleft}] {anchoring}
-%D \stoptyping
-%D
-%D But this also works:
-%D
-%D \starttyping
-%D \framed [anchoring={flushleft,top,up}] {anchoring}
-%D \stoptyping
-%D
-%D When an anchoring is given (use \type {normal} for the default) you can also
-%D use the \type {xanchor} and \type {yanchor} offsets.
-
-% because we mess with the width later on, we need double wrapping:
-
-\def\pack_framed_handle_anchoring
- {\scratchcounter\autoorientation\p_framed_anchoring\relax
- \edef\p_xanchor{\framedparameter\c!xanchor}%
- \edef\p_yanchor{\framedparameter\c!yanchor}%
- \setbox\b_framed_normal\hpack{\hpack % here
- % using the keyword approachs works ok, don't mess with orientation
- % directly here using \boxorientation ... it doesn't work that well
- \s!orientation\scratchcounter
- \ifx\p_xanchor\empty\else \s!xoffset \p_xanchor\fi
- \ifx\p_yanchor\empty\else \s!yoffset \p_yanchor\fi
- {\box\b_framed_normal}}}
-
-\installcorenamespace{framedlocatorbefore}
-\installcorenamespace{framedlocatorafter}
-
-\newconstant\frameddimensionstate % global state: 0=unknown 1=width 2=height 3=both
-
-\def\pack_framed_fake_box
- {\setbox\scratchbox\emptyhbox
- \wd\scratchbox\wd\b_framed_normal
- \ht\scratchbox\ht\b_framed_normal
- \dp\scratchbox\dp\b_framed_normal
- \setbox\b_framed_normal\box\scratchbox}
-
-\def\installframedlocator#1#2#3%
- {\setvalue{\??framedlocatorbefore#1}{#2}%
- \setvalue{\??framedlocatorafter #1}{#3}}
-
-\def\pack_framed_locator_before#1{\begincsname\??framedlocatorbefore#1\endcsname}
-\def\pack_framed_locator_after #1{\begincsname\??framedlocatorafter #1\endcsname}
-
-\newdimen\d_framed_locator_ht
-\newdimen\d_framed_locator_dp
-\newdimen\d_framed_locator_lo
-\newdimen\d_framed_locator_ro
-
-\def\pack_framed_locator_set#1%
- {\d_framed_locator_ht\dimexpr
- #1+\d_framed_linewidth
- \ifconditional\c_framed_has_offset
- +\framedparameter\c!offset
- \fi
- +\framedparameter\c!toffset
- \relax
- \d_framed_locator_dp\dimexpr\ht\b_framed_normal-\d_framed_locator_ht\relax}
-
-\def\pack_framed_locator_set_lo
- {\global\d_framed_locator_lo\dimexpr
- \d_framed_linewidth
- \ifconditional\c_framed_has_offset
- +\framedparameter\c!offset
- \fi
- +\framedparameter\c!loffset
- \relax}
-
-\def\pack_framed_locator_set_ro
- {\global\d_framed_locator_ro\dimexpr
- \d_framed_linewidth
- \ifconditional\c_framed_has_offset
- +\framedparameter\c!offset
- \fi
- +\framedparameter\c!roffset
- \relax}
-
-% \ruledhbox
-% {A
-% \framed[width=2cm,align=middle,location=hanging]{location\\equals\\hanging}
-% \framed[width=2cm,align=middle,location=depth] {location\\equals\\depth}
-% \framed[width=2cm,align=middle,location=height] {location\\equals\\height}
-% B}
-% \vskip2cm
-% \ruledhbox
-% {A
-% \framed[width=2cm,align=middle,location=low] {location\\equals\\low}
-% \framed[width=2cm,align=middle,location=line] {location\\equals\\line}
-% \framed[width=2cm,align=middle,location=high] {location\\equals\\high}
-% B}
-% \vskip2cm
-% \ruledhbox
-% {A
-% \framed[width=2cm,align=middle,location=top] {location\\equals\\top}
-% \framed[width=2cm,align=middle,location=bottom] {location\\equals\\bottom}
-% \framed[width=2cm,align=middle,location=lohi] {location\\equals\\lohi}
-% \framed[width=2cm,align=middle,location=middle] {location\\equals\\middle}
-% B}
-
-% \installframedlocator \v!hanging % best with strut=no
-% {}
-% {\dp\b_framed_normal\ht\b_framed_normal
-% \ht\b_framed_normal\zeropoint}
-%
-% \installframedlocator \v!depth
-% {}
-% {\ht\b_framed_normal\dimexpr\ht\b_framed_normal-\strutdp\relax
-% \dp\b_framed_normal\strutdp
-% \box\b_framed_normal}
-%
-% \installframedlocator \v!height
-% {}
-% {\dp\b_framed_normal\dimexpr\ht\b_framed_normal-\strutht\relax
-% \ht\b_framed_normal\strutht
-% \box\b_framed_normal}
-
-\installframedlocator \v!hanging % best with strut=no *1* / see mail to list by SB
- {}
- {\scratchdimen\ht\b_framed_normal
- \setbox\b_framed_normal\hpack{\lower\scratchdimen\box\b_framed_normal}%
- \dp\b_framed_normal\scratchdimen
- \ht\b_framed_normal\zeropoint
- \box\b_framed_normal}
-
-\installframedlocator \v!depth % *1*
- {}
- {\setbox\b_framed_normal\hpack{\lower\strutdp\box\b_framed_normal}%
- \ht\b_framed_normal\dimexpr\ht\b_framed_normal-\strutdp\relax
- \dp\b_framed_normal\strutdp
- \box\b_framed_normal}
-
-\installframedlocator \v!height % *1*
- {}
- {\scratchdimen\dimexpr \ht\b_framed_normal - \strutht \relax
- \setbox\b_framed_normal\hpack{\lower\scratchdimen\box\b_framed_normal}%
- \dp\b_framed_normal\dimexpr\ht\b_framed_normal-\strutht\relax
- \ht\b_framed_normal\strutht
- \box\b_framed_normal}
-
-\installframedlocator \v!high
- {}
- {\pack_framed_locator_set\strutht
- \setbox\b_framed_normal\hpack{\lower\d_framed_locator_dp\box\b_framed_normal}%
- \ht\b_framed_normal\strutht
- \dp\b_framed_normal\strutdp
- \hpack{\box\b_framed_normal}} % why do we pack .. dange of loosing?
-
-\installframedlocator \v!line
- {}
- {\setbox\b_framed_normal\hpack{\lower.5\ht\b_framed_normal\box\b_framed_normal}%
- \ht\b_framed_normal.5\lineheight
- \dp\b_framed_normal.5\lineheight
- \hpack{\box\b_framed_normal}} % why do we pack .. dange of loosing?
-
-\installframedlocator \v!low
- {}
- {\pack_framed_locator_set\strutdp
- \setbox\b_framed_normal\hpack{\lower\d_framed_locator_ht\box\b_framed_normal}%
- \ht\b_framed_normal\strutht
- \dp\b_framed_normal\strutdp
- \box\b_framed_normal}
-
-\installframedlocator \v!top
- {}
- {\pack_framed_locator_set\strutht
- \setbox\b_framed_normal\hpack{\lower\d_framed_locator_dp\box\b_framed_normal}%
- \ht\b_framed_normal\d_framed_locator_ht
- \dp\b_framed_normal\d_framed_locator_dp
- \hpack{\box\b_framed_normal}} % why do we pack .. dange of loosing?
-
-\installframedlocator \v!middle
- {}
- {\scratchdimen.5\ht\b_framed_normal
- \setbox\b_framed_normal\hpack{\lower\scratchdimen\box\b_framed_normal}%
- \ht\b_framed_normal\scratchdimen
- \dp\b_framed_normal\scratchdimen
- \hpack{\box\b_framed_normal}} % why do we pack .. dange of loosing?
-
-\installframedlocator \v!lohi % maybe also \v!center
- {\pack_framed_locator_before\v!middle}
- {\pack_framed_locator_after \v!middle}
-
-\installframedlocator \v!bottom
- {}
- {\pack_framed_locator_set\strutdp
- \setbox\b_framed_normal\hpack{\lower\d_framed_locator_ht\box\b_framed_normal}%
- \ht\b_framed_normal\d_framed_locator_dp
- \dp\b_framed_normal\d_framed_locator_ht
- \hpack{\box\b_framed_normal}} % why do we pack .. dange of loosing?
-
-\installframedlocator \v!keep % retains height/depth
- {\pack_framed_remove_depth}
- {\pack_framed_restore_depth}
-
-\newdimen\d_framed_formula
-
-\installframedlocator \v!formula % private, will become a more generic name
- {}
- {\pack_framed_locator_set\d_framed_formula
- \setbox\b_framed_normal\hpack{\lower\d_framed_locator_dp\box\b_framed_normal}%
- \ht\b_framed_normal\d_framed_locator_ht
- \dp\b_framed_normal\d_framed_locator_dp
- \hpack{\box\b_framed_normal}} % why do we pack .. danger of loosing?
-
-% also used in fastlocalframed
-
-\newdimen\d_framed_original_wd
-\newdimen\d_framed_original_ht
-\newdimen\d_framed_original_dp
-
-\def\pack_framed_remove_depth
- {\d_framed_original_wd\wd\b_framed_normal
- \d_framed_original_ht\ht\b_framed_normal
- \d_framed_original_dp\dp\b_framed_normal
- \ifzeropt\d_framed_original_dp\else
- \setbox\b_framed_normal\hpack{\raise\d_framed_original_dp\box\b_framed_normal}%
- \fi
- \wd\b_framed_normal\d_framed_original_wd
- \ht\b_framed_normal\dimexpr\d_framed_original_ht+\d_framed_original_dp\relax
- \dp\b_framed_normal\zeropoint}
-
-\def\pack_framed_restore_depth
- {\ifzeropt\d_framed_original_dp \else
- \setbox\b_framed_normal\hpack{\lower\d_framed_original_dp\box\b_framed_normal}%
- \fi
- \wd\b_framed_normal\d_framed_original_wd
- \ht\b_framed_normal\d_framed_original_ht
- \dp\b_framed_normal\d_framed_original_dp}
-
-% \framed[width=12cm,height=3cm,orientation=0]{\input ward\relax}
-% \framed[width=12cm,height=3cm,orientation=90]{\input ward\relax}
-% \framed[width=12cm,height=3cm,orientation=180]{\input ward\relax}
-% \framed[width=12cm,height=3cm,orientation=270]{\input ward\relax}
-% \framed[width=12cm,height=3cm,orientation=-90]{\input ward\relax}
-% \framed[width=12cm,height=3cm,orientation=-180]{\input ward\relax}
-% \framed[width=12cm,height=3cm,orientation=-270]{\input ward\relax}
-
-\def\pack_framed_start_orientation
- {\ifcase\p_framed_orientation
- \let\pack_framed_stop_orientation\relax
- \else
- \let\pack_framed_stop_orientation\pack_framed_stop_orientation_indeed
- \fi}
-
-\def\pack_framed_stop_orientation_indeed
- {\setbox\b_framed_normal\hpack{\dorotatebox\p_framed_orientation\hpack{\box\b_framed_normal}}%
- \d_framed_height\ht\b_framed_normal
- \d_framed_width \wd\b_framed_normal}
-
-%D The last conditional takes care of the special situation of in||line \inframed
-%D [height=3cm] {framed} boxes. Such boxes have to be \inframed {aligned} with the
-%D running text.
-
-\unexpanded\def\inframed
- {\dosingleempty\pack_framed_inline}
-
-% \def\pack_framed_inline[#1]%
-% {\framed[\c!location=\v!low,#1]}
-%
-% or:
-
-\def\pack_framed_inline[%
- {\framed[\c!location=\v!low,}
-
-%D When we set \type{empty} to \type{yes}, we get ourselves a frame and/or background,
-%D but no content, so actually we have a sort of phantom framed box.
-
-%D \macros
-%D {mframed, minframed}
-%D
-%D When Tobias asked how to frame mathematical elements in formulas, Taco's posted the
-%D next macro:
-%D
-%D \starttyping
-%D \def\mframed#1%
-%D {\relax
-%D \ifmmode
-%D \vcenter{\hbox{\framed{$\ifinner\else\displaystyle\fi#1$}}}%
-%D \else
-%D \framed{$#1$}%
-%D \fi}
-%D \stoptyping
-%D
-%D Because \type {\ifinner} does not (always) reports what one would expect, we move the
-%D test to the outer level. We also want to pass arguments,
-%D
-%D \starttyping
-%D \def\mframed%
-%D {\dosingleempty\domframed}
-%D
-%D \def\domframed[#1]#2% % tzt \dowithnextmathbox ?
-%D {\relax
-%D \ifmmode
-%D \ifinner
-%D \inframed[#1]{$#2$}%
-%D \else
-%D \vcenter{\hbox{\framed[#1]{$\displaystyle#2$}}}%
-%D \fi
-%D \else
-%D \inframed[#1]{$#2$}%
-%D \fi}
-%D \stoptyping
-%D
-%D Still better is the next alternative, if only because it takes care of setting the super-
-%D and subscripts styles
-
-\newcount\c_framed_mstyle
-
-\unexpanded\def\pack_framed_math_strut
- {\Ustartmath
- \triggermathstyle\c_framed_mstyle
- \vphantom{(}%
- \Ustopmath}
-
-\installcorenamespace{mathframed}
-
-\installframedcommandhandler \??mathframed {mathframed} \??mathframed
-
-\appendtoks
- \setuevalue{\currentmathframed}{\pack_framed_mathframed{\currentmathframed}}%
-\to \everydefinemathframed
-
-\unexpanded\def\pack_framed_mathframed#1%
- {\begingroup
- \edef\currentmathframed{#1}%
- \dosingleempty\pack_framed_mathframed_indeed}
-
-\newcount\c_pack_framed_mathframed
-\newtoks \t_pack_framed_mathframed
-
-\def\pack_framed_math_pos
- {\global\advance\c_pack_framed_mathframed\plusone
- \xdef\pack_framed_mc_one{mcf:1:\number\c_pack_framed_mathframed}%
- \xdef\pack_framed_mc_two{mcf:2:\number\c_pack_framed_mathframed}%
- \xypos\pack_framed_mc_two}
-
-\def\pack_framed_mathframed_indeed[#1]#2% no fancy nesting supported here
- {\iffirstargument
- \setupcurrentmathframed[#1]%
- \fi
- \c_framed_mstyle\mathstyle
- \edef\m_framed_location{\mathframedparameter\c!location}%
- \ifx\m_framed_location\v!mathematics
- \let\normalstrut\pack_framed_math_pos
- \orelse\ifx\m_framed_location\v!low\else
- \let\normalstrut\pack_framed_math_strut
- \fi
- \inheritedmathframedframed\bgroup
- \Ustartmath
- \triggermathstyle\c_framed_mstyle
- \the\t_pack_framed_mathframed
- #2%
- \Ustopmath
- \egroup
- \endgroup}
-
-\appendtoks
- \mathraggedstatus\plustwo % makes \startalign work
- \eqalignmode \zerocount % makes \startalign fit
-\to \t_pack_framed_mathframed
-
-\installframedlocator \v!mathematics
- {}
- {\lower\dimexpr\MPy\pack_framed_mc_two-\MPy\pack_framed_mc_one\relax
- \hpack{\xypos\pack_framed_mc_one\box\b_framed_normal}}
-
-\definemathframed[mframed]
-\definemathframed[inmframed][\c!location=\v!low]
-\definemathframed[mcframed] [\c!location=\v!mathematics]
-
-%D So instead of the rather versatile \type {\framed}, we use \type {\mframed}:
-%D
-%D \startbuffer
-%D \startformula
-%D x \times \mframed{y} \times y^{z_z}
-%D x \times \inmframed{y} \times y^{z_z}
-%D \stopformula
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-%D
-%D And:
-%D
-%D \startbuffer
-%D \startformula
-%D x \times \mframed{y} \times y^{\mframed{z}_{\mframed{z}}}
-%D \stopformula
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-%D
-%D As usual, one can specify in what way the text should be framed. One should be
-%D aware of the fact that, inorder to preserve the proper spacing, the \type
-%D {offset} is set to \type {overlay} and \type {frameoffset} is used used instead.
-%D
-%D \startbuffer
-%D \startformula
-%D x \times y^{\mframed[framecolor=red]{z}_{z}}
-%D \stopformula
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-%D
-%D For inline use, we also provide the \type {\inmframed} alternative: we want $x
-%D \times \inmframed{y}$ in inline math, right?
-
-%D This previous framing macros needs a lot of alternatives for putting rules around
-%D boxes, inserting offsets and aligning text. Each step is handled by separate macros.
-
-\newdimen\d_framed_applied_offset
-\newdimen\d_framed_loffset
-\newdimen\d_framed_roffset
-\newdimen\d_framed_toffset
-\newdimen\d_framed_boffset
-
-\def\pack_framed_check_extra_offsets % we could check h and v indepently
- {\setfalse\c_framed_has_extra_offset
- \d_framed_loffset\framedparameter\c!loffset\relax
- \d_framed_roffset\framedparameter\c!roffset\relax
- \d_framed_toffset\framedparameter\c!toffset\relax
- \d_framed_boffset\framedparameter\c!boffset\relax
- \ifzeropt\d_framed_loffset\else \advance\d_framed_width -\d_framed_loffset \settrue\c_framed_has_extra_offset \fi
- \ifzeropt\d_framed_roffset\else \advance\d_framed_width -\d_framed_roffset \settrue\c_framed_has_extra_offset \fi
- \ifzeropt\d_framed_toffset\else \advance\d_framed_height-\d_framed_toffset \settrue\c_framed_has_extra_offset \fi
- \ifzeropt\d_framed_boffset\else \advance\d_framed_height-\d_framed_boffset \settrue\c_framed_has_extra_offset \fi}
-
-\def\pack_framed_apply_extra_offsets
- {\setbox\b_framed_normal\vpack\bgroup
- \advance\d_framed_toffset\d_framed_applied_offset
- \advance\d_framed_boffset\d_framed_applied_offset
- \advance\d_framed_loffset\d_framed_applied_offset
- \advance\d_framed_roffset\d_framed_applied_offset
- \kern\d_framed_toffset
- \hpack\bgroup
- \kern\d_framed_loffset
- \box\b_framed_normal
- \kern\d_framed_roffset
- \egroup
- \kern\d_framed_boffset
- \egroup}
-
-\def\pack_framed_widen_box
- {\setbox\b_framed_normal\vpack
- {\kern\d_framed_applied_offset
- \hpack{\kern\d_framed_applied_offset\box\b_framed_normal\kern\d_framed_applied_offset}%
- \kern\d_framed_applied_offset}}
-
-%D Let's hope that the next few examples show us enough of what needs to be
-%D done by the auxiliary macros.
-%D
-%D \startbuffer
-%D \framed[height=1cm,offset=.5cm] {rule based learning}
-%D \framed[height=1cm,offset=0cm] {rule based learning}
-%D \framed[height=1cm,offset=none] {rule based learning}
-%D \framed[height=1cm,offset=overlay]{rule based learning}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \startlinecorrection
-%D \hbox{\getbuffer}
-%D \stoplinecorrection
-%D
-%D \startbuffer
-%D \framed[offset=.5cm] {rule based learning}
-%D \framed[offset=0cm] {rule based learning}
-%D \framed[offset=none] {rule based learning}
-%D \framed[offset=overlay]{rule based learning}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \startlinecorrection
-%D \hbox{\getbuffer}
-%D \stoplinecorrection
-%D
-%D \startbuffer
-%D \framed[strut=no,offset=.5cm] {rule based learning}
-%D \framed[strut=no,offset=0cm] {rule based learning}
-%D \framed[strut=no,offset=none] {rule based learning}
-%D \framed[strut=no,offset=overlay]{rule based learning}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \startlinecorrection
-%D \hbox{\getbuffer}
-%D \stoplinecorrection
-%D
-%D \startbuffer
-%D \framed[width=3cm,align=left] {rule\\based\\learning}
-%D \framed[width=3cm,align=middle] {rule\\based\\learning}
-%D \framed[width=3cm,align=right] {rule\\based\\learning}
-%D \framed[width=fit,align=middle] {rule\\based\\learning}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \startlinecorrection
-%D \hbox{\dontcomplain\getbuffer}
-%D \stoplinecorrection
-%D
-%D So now we're ready for the complicated stuff. We distinguish between borders with
-%D straight lines and those with round corners. When using the first alternative it
-%D is possible to turn off one or more lines. More fancy shapes are also possible by
-%D specifying dedicated backgrounds. Turning lines on and off is implemented as
-%D efficient as possible and as a result is interface language dependant. This next
-%D implementation evolved from simpler ones. It puts for instance the rules on top
-%D of the content and provides additional offset capabilities. The lot of calls to
-%D other macros makes this mechanism not that easy to comprehend.
-%D
-%D We handle left, right or middle alignment as well as fixed or free widths and
-%D heights. Each combination gets its own macro.
-%D
-%D The following code handles one-liners: \type {align={line,flushright}}. Beware,
-%D since we entered a group and either or not grab the next bgroup token, we need to
-%D finish the group in the oneliner mode.
-
-\ifdefined\raggedonelinerstate \else \newconditional\raggedonelinerstate \fi
-
-\def\doformatonelinerbox % beware: assumes explicit preceding bgroup
- {\ifconditional\raggedonelinerstate
- \expandafter\dodoformatonelinerbox
- \else
- \expandafter\nodoformatonelinerbox
- \fi}
-
-\def\dodoformatonelinerbox
- {\afterassignment\redoformatonelinerbox
- \setbox\nextbox\hbox} % maybe \hpack
-
-\def\redoformatonelinerbox
- {\aftergroup\dododoformatonelinerbox
- \ignorespaces}
-
-\def\dododoformatonelinerbox
- {\hpack to \hsize % was \hbox
- {\ifcase\raggedstatus\or\hss\or\hss \fi
- \unhbox\nextbox \removeunwantedspaces
- \ifcase\raggedstatus\or \or\hss\or\hss\fi}%
- \egroup}
-
-\def\nodoformatonelinerbox % grabs {
- {\let\next=}
-
-%D The handlers:
-
-% Beware, we have a \noindent so an empty line is indeed an empty line and
-% the \synchronizeinlinedirection triggers a vbox instead of a line.
-%
-% \startTEXpage[offset=0.5ex,align={lohi,middle}]
-%
-% \vbox{\hbox{x}}
-% \stopTEXpage
-%
-% \startTEXpage[offset=0.5ex,align={lohi,middle}]
-% \vbox{\hbox{x}}
-% \stopTEXpage
-
-% \def\pack_framed_forgetall{\forgetall}
-
-\def\pack_framed_set_foregroundcolor
- {\edef\p_framed_foregroundcolor{\framedparameter\c!foregroundcolor}%
- \ifx\p_framed_foregroundcolor\empty\else\dousecolorparameter\p_framed_foregroundcolor\fi}
-
-\def\pack_framed_do_setups
- {\ifx\p_framed_setups\empty \else
- \setups[\p_framed_setups]% \texsetup (or only one!)
- % \fastsetup\p_framed_setup % singular would have been better
- \fi}
-
-\def\pack_framed_format_format_yes
- {\vbox to \d_framed_height
- \bgroup
- \let\postprocessframebox\relax
- % \pack_framed_forgetall
- \iftrialtypesetting \else
- \pack_framed_set_foregroundcolor
- \fi
- \oninterlineskip
- \hsize\d_framed_width
- \vsize\d_framed_height
- \pack_framed_do_setups
- \raggedcommand
- \pack_framed_do_top
- \bgroup
- \synchronizeinlinedirection
- \localbegstrut
- \aftergroup\localendstrut
- \aftergroup\pack_framed_do_bottom
- \aftergroup\egroup
- \doformatonelinerbox}
-
-\def\pack_framed_format_format_nop
- {\vbox to \d_framed_height
- \bgroup
- \let\postprocessframebox\relax
- % \pack_framed_forgetall
- \iftrialtypesetting \else
- \pack_framed_set_foregroundcolor
- \fi
- \oninterlineskip
- \hsize\d_framed_width
- \vsize\d_framed_height
- \pack_framed_do_setups
- \raggedcenter
- \vss
- \bgroup
- \synchronizeinlinedirection
- \localbegstrut
- \aftergroup\localendstrut
- \aftergroup\vss
- \aftergroup\egroup
- \doformatonelinerbox}
-
-\def\pack_framed_format_format_height
- {\vbox to \d_framed_height
- \bgroup
- \let\postprocessframebox\relax
- % \pack_framed_forgetall
- \iftrialtypesetting \else
- \pack_framed_set_foregroundcolor
- \fi
- \oninterlineskip
- \pack_framed_do_setups
- \raggedcommand
- \vss
- \bgroup
- \aftergroup\localendstrut
- \aftergroup\vss
- \aftergroup\egroup
- \synchronizeinlinedirection
- \localbegstrut
- \doformatonelinerbox}
-
-\def\pack_framed_format_format_width
- {\vbox
- \bgroup
- \let\postprocessframebox\relax
- % \pack_framed_forgetall
- \iftrialtypesetting \else
- \pack_framed_set_foregroundcolor
- \fi
- \oninterlineskip
- \hsize\d_framed_width
- \pack_framed_do_setups
- \raggedcommand
- \pack_framed_do_top
- \bgroup
- \synchronizeinlinedirection
- \localbegstrut
- \aftergroup\localendstrut
- \aftergroup\pack_framed_do_bottom
- \aftergroup\egroup
- \doformatonelinerbox}
-
-\def\pack_framed_format_format_vsize
- {\vbox to \d_framed_height % no vpack .. maybe grid
- \bgroup
- \let\postprocessframebox\relax
- % \pack_framed_forgetall
- \iftrialtypesetting \else
- \pack_framed_set_foregroundcolor
- \fi
- \vsize\d_framed_height
- \pack_framed_do_setups
- \vss
- \bgroup
- \aftergroup\vss
- \aftergroup\egroup
- \hbox
- \bgroup
- \aftergroup\egroup
- \synchronizeinlinedirection
- \localstrut
- \doformatonelinerbox}
-
-\def\pack_framed_format_format_hsize
- {\hbox to \d_framed_width
- \bgroup
- \let\postprocessframebox\relax
- % \pack_framed_forgetall
- \iftrialtypesetting \else
- \pack_framed_set_foregroundcolor
- \fi
- \pack_framed_do_setups
- \hss
- \synchronizeinlinedirection
- \localstrut
- \bgroup
- \aftergroup\hss
- \aftergroup\egroup
- \doformatonelinerbox}
-
-\def\pack_framed_format_format_no_size
- {\hbox
- \bgroup
- \iftrialtypesetting \else
- \pack_framed_set_foregroundcolor
- \fi
- \let\postprocessframebox\relax
- \pack_framed_do_setups
- \synchronizeinlinedirection
- \localstrut
- \doformatonelinerbox}
-
-%D On the next page we show some examples of how these macros come into action. The
-%D examples show us how \type {fit}, \type {broad} dimensions influence the
-%D formatting. Watch the visualized struts. \footnote {Here we used \type
-%D {\showstruts}.}
-%D
-%D \startpostponing
-%D \bgroup
-%D \showstruts
-%D \dontcomplain
-%D \starttabulate[|c|c|c|c|c|c|]
-%D % \HL
-%D \NC \framed[width=.2\hsize, height=.2\hsize, align=] {a\endgraf b\endgraf c}
-%D \NC \framed[width=.2\hsize, height=broad, align=] {a\endgraf b\endgraf c}
-%D \NC \framed[width=.2\hsize, height=fit, align=] {a\endgraf b\endgraf c}
-%D \NC \framed[width=fit, height=.2\hsize, align=] {a\endgraf b\endgraf c}
-%D \NC \framed[width=fit, height=broad, align=] {a\endgraf b\endgraf c}
-%D \NC \framed[width=fit, height=fit, align=] {a\endgraf b\endgraf c}
-%D \NC \NR
-%D % \HL
-%D \NC \framed[width=.2\hsize, height=.2\hsize, align=yes] {a\endgraf b\endgraf c}
-%D \NC \framed[width=.2\hsize, height=broad, align=yes] {a\endgraf b\endgraf c}
-%D \NC \framed[width=.2\hsize, height=fit, align=yes] {a\endgraf b\endgraf c}
-%D \NC \framed[width=fit, height=.2\hsize, align=yes] {a\endgraf b\endgraf c}
-%D \NC \framed[width=fit, height=broad, align=yes] {a\endgraf b\endgraf c}
-%D \NC \framed[width=fit, height=fit, align=yes] {a\endgraf b\endgraf c}
-%D \NC \NR
-%D % \HL
-%D \NC \framed[width=.2\hsize, height=.2\hsize, align=right] {a\endgraf b\endgraf c}
-%D \NC \framed[width=.2\hsize, height=broad, align=right] {a\endgraf b\endgraf c}
-%D \NC \framed[width=.2\hsize, height=fit, align=right] {a\endgraf b\endgraf c}
-%D \NC \framed[width=fit, height=.2\hsize, align=right] {a\endgraf b\endgraf c}
-%D \NC \framed[width=fit, height=broad, align=right] {a\endgraf b\endgraf c}
-%D \NC \framed[width=fit, height=fit, align=right] {a\endgraf b\endgraf c}
-%D \NC \NR
-%D % \HL
-%D \NC \framed[width=.2\hsize, height=.2\hsize, align=left] {a\endgraf b\endgraf c}
-%D \NC \framed[width=.2\hsize, height=broad, align=left] {a\endgraf b\endgraf c}
-%D \NC \framed[width=.2\hsize, height=fit, align=left] {a\endgraf b\endgraf c}
-%D \NC \framed[width=fit, height=.2\hsize, align=left] {a\endgraf b\endgraf c}
-%D \NC \framed[width=fit, height=broad, align=left] {a\endgraf b\endgraf c}
-%D \NC \framed[width=fit, height=fit, align=left] {a\endgraf b\endgraf c}
-%D \NC \NR
-%D % \HL
-%D \NC \framed[width=.2\hsize, height=.2\hsize, align=middle] {a\endgraf b\endgraf c}
-%D \NC \framed[width=.2\hsize, height=broad, align=middle] {a\endgraf b\endgraf c}
-%D \NC \framed[width=.2\hsize, height=fit, align=middle] {a\endgraf b\endgraf c}
-%D \NC \framed[width=fit, height=.2\hsize, align=middle] {a\endgraf b\endgraf c}
-%D \NC \framed[width=fit, height=broad, align=middle] {a\endgraf b\endgraf c}
-%D \NC \framed[width=fit, height=fit, align=middle] {a\endgraf b\endgraf c}
-%D \NC \NR
-%D % \HL
-%D \stoptabulate
-%D \egroup
-%D \stoppostponing
-
-%D \macros
-%D {framednoflines, framedlastlength}
-%D
-%D It is possible to let the frame macro calculate the width of a centered box
-%D automatically (\type {fit}). When doing so, we need to reshape the box:
-
-\newcount\framednoflines
-\newdimen\framedfirstheight
-\newdimen\framedlastdepth
-\newdimen\framedminwidth
-\newdimen\framedmaxwidth
-\newdimen\framedaveragewidth
-
-\def\pack_framed_reshape_reset
- {\framednoflines \zerocount
- \framedfirstheight \zeropoint
- \framedlastdepth \zeropoint
- \framedminwidth \zeropoint
- \framedmaxwidth \zeropoint
- \framedaveragewidth\zeropoint}
-
-\def\pack_framed_reshape_process{\ifvbox\b_framed_normal\clf_doreshapeframedbox\b_framed_normal\relax\fi}
-\def\pack_framed_reshape_analyze{\ifvbox\b_framed_normal\clf_doanalyzeframedbox\b_framed_normal\relax\fi}
-
-% torture test / strange case (much depth) / method 2 needed
-%
-% \startTEXpage[frame=on]
-% \startformula \startalign \NC A \NC B \NR \intertext{test} \NC C \NC D \NR \stopalign \stopformula
-% test outside formula
-% \startformula \startalign \NC A \NC B \NR \intertext{test} \NC C \NC D \NR \stopalign \stopformula
-% \blank[big]
-% \startformula \startalign \NC \int_01 \NC B \NR \intertext{test} \NC \int_01 \NC D \NR \stopalign \stopformula
-% test outside formula
-% \startformula \startalign \NC \int_01 \NC B \NR \intertext{test} \NC \int_01 \NC D \NR \stopalign \stopformula
-% \stopTEXpage
-
-%D The examples on the next page show how one can give the frame as well as the
-%D background an additional offset and even a bit more depth. The blue outline is
-%D the frame, the red box is the background and the small black outline is the
-%D visualization of the resulting box, that is, we applied \type {\ruledhbox} to
-%D the result.
-%D
-%D \startpostponing
-%D \bgroup
-%D \unprotect
-%D \dontcomplain
-%D
-%D \startbuffer
-%D \unprotect
-%D \vbox to \vsize
-%D \bgroup
-%D \startalignment[middle]
-%D \vss
-%D \dontleavehmode\vbox to .8\vsize
-%D \bgroup
-%D \hsize=300pt
-%D \setupframed
-%D [background=color,
-%D backgroundcolorachtergrondkleur=darkred,
-%D width=300pt,
-%D height=60pt,
-%D framecolorkaderkleur=DemoBlue,
-%D rulethickness=2pt]
-%D \def\status%
-%D {backgroundoffset=\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}}
-%D \vss
-%D \dontleavehmode \ruledhbox{\framed[backgroundoffset=0pt,frameoffset=5pt]{\status}}
-%D \vss
-%D \dontleavehmode \ruledhbox{\framed[backgroundoffset=2pt,frameoffset=5pt]{\status}}
-%D \vss
-%D \dontleavehmode \ruledhbox{\framed[backgroundoffset=5pt,frameoffset=2pt]{\status}}
-%D \vss
-%D \dontleavehmode \ruledhbox{\framed[backgroundoffset=5pt,frameoffset=5pt]{\status}}
-%D \egroup
-%D \vss
-%D \stopalignment
-%D \egroup
-%D \protect
-%D \stopbuffer
-%D
-%D \getbuffer \page
-%D
-%D {\setupframed[depth=4pt]\getbuffer} \page
-%D
-%D \protect
-%D \egroup
-%D \stoppostponing
-
-%D We can draw lines from left to right and top to bottom by using the normal \type
-%D {\hairline} command. Both directions need a different treatment.
-%D
-%D \startbuffer
-%D \framed[width=4cm] {alfa\hairline beta\hairline gamma}
-%D \framed[height=2cm] {alfa\hairline beta\hairline gamma}
-%D \framed[width=4cm,height=2cm]{alfa\hairline beta\hairline gamma}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \startlinecorrection
-%D \hbox{\getbuffer}
-%D \stoplinecorrection
-%D
-%D These macros try to adapt their behaviour as good as possible to the circumstances
-%D and act as natural as possible.
-
-\unexpanded\def\pack_framed_vboxed_hairline % nasty overlay mess .. needed for autowidth
- {\begingroup
- \scratchoffset\ifconditional\c_framed_has_offset \localoffset \else \zeropoint \fi
- \scratchwidth \dimexpr\scratchoffset+\d_framed_linewidth\relax
- \par
- \nointerlineskip
- \kern\scratchoffset
- \dontleavehmode
- \hrule\s!height\d_framed_linewidth\s!depth\zeropoint
- \par
- \kern-\d_framed_linewidth
- \dontleavehmode
- \hpack to \zeropoint{\hss\vrule\s!height\d_framed_linewidth\s!depth\zeropoint\s!width\scratchwidth}%
- \hfill
- \hpack to \zeropoint{\vrule\s!height\d_framed_linewidth\s!depth\zeropoint\s!width\scratchwidth\hss}%
- \par
- \nointerlineskip
- \kern\scratchoffset
- \nointerlineskip
- \endgraf
- \nointerlineskip
- \localbegstrut
- \endgroup}
-
-\unexpanded\def\pack_framed_hboxed_hairline % use framed dimen
- {\bgroup
- \scratchoffset\ifconditional\c_framed_has_offset \localoffset \else \zeropoint \fi
- \ifconditional\c_framed_has_height
- \dimen\scratchheight\dimexpr\localheight/\plustwo+\strutdp-\plustwo\d_framed_linewidth\relax
- \dimen\scratchdepth \dimexpr\localheight/\plustwo-\strutdp+\plustwo\d_framed_linewidth\relax
- \else
- \dimen\scratchheight\dimexpr\strutht+\scratchoffset\relax
- \dimen\scratchdepth \dimexpr\strutdp+\scratchoffset\relax
- \fi
- \unskip
- \setbox\scratchbox\hpack
- {\kern\scratchoffset
- \vrule\s!height\dimen\scratchheight\s!depth\dimen\scratchdepth\s!width\d_framed_linewidth
- \kern\scratchoffset}%
- \ht\scratchbox\strutht
- \dp\scratchbox\strutdp
- \box\scratchbox
- \ignorespaces
- \egroup}
-
-%D The argument of the frame command accepts \type{\\} as a sort of newline signal. In
-%D horizontal boxes it expands to a space.
-
-\unexpanded\def\pack_framed_vboxed_newline
- {\endgraf\ignorespaces}
-
-\unexpanded\def\pack_framed_hboxed_newline
- {\unskip\normalspace\ignorespaces}
-
-%D We can set each rule on or off. The default setting is inherited from
-%D \type {frame}. An earlier implementation use a bit different approach, but the new
-%D one seems more natural:
-%D
-%D \bgroup
-%D \setuptyping[margin=0pt]
-%D \startlinecorrection
-%D \startbuffer
-%D \framed[offset=overlay,frame=on]{\darkred\blackrule}
-%D \stopbuffer
-%D \hbox{\getbuffer\vbox{\typebuffer}}
-%D
-%D \startbuffer
-%D \framed[offset=overlay,frame=on,bottomframe=off]{\darkred\blackrule}
-%D \stopbuffer
-%D \hbox{\getbuffer\vbox{\typebuffer}}
-%D
-%D \startbuffer
-%D \framed[offset=overlay,frame=on,bottomframe=on]{\darkred\blackrule}
-%D \stopbuffer
-%D \hbox{\getbuffer\vbox{\typebuffer}}
-%D
-%D \startbuffer
-%D \framed[offset=overlay,frame=off]{\darkred\blackrule}
-%D \stopbuffer
-%D \hbox{\getbuffer\vbox{\typebuffer}}
-%D
-%D \startbuffer
-%D \framed[offset=overlay,frame=off,bottomframe=off]{\darkred\blackrule}
-%D \stopbuffer
-%D \hbox{\getbuffer\vbox{\typebuffer}}
-%D
-%D \startbuffer
-%D \framed[offset=overlay,frame=off,bottomframe=on]{\darkred\blackrule}
-%D \stopbuffer
-%D \hbox{\getbuffer\vbox{\typebuffer}}
-%D \stoplinecorrection
-%D \egroup
-
-%D \macros
-%D {startframedtext, setupframedtexts, defineframedtext}
-%D
-%D The general framing command we discussed previously, is not entirely suited for
-%D what we call framed texts, as for instance used in intermezzo's. The next
-%D examples show what we have in mind.
-%D
-%D \startbuffer[framed-0]
-%D \setupframedtexts
-%D [frame=off,
-%D width=\hsize,
-%D background=screen]
-%D
-%D \startframedtext
-%D By default the framed text is centered \dots
-%D \stopframedtext
-%D
-%D \startframedtext[right]
-%D \dots\ but we can also align left, middle and right.
-%D \stopframedtext
-%D \stopbuffer
-%D
-%D \startbuffer[framed-1]
-%D \defineframedtext
-%D [Example]
-%D [width=6cm,
-%D height=5cm]
-%D
-%D \startExample
-%D \typebuffer[framed-1]
-%D \stopExample
-%D \stopbuffer
-%D
-%D \startbuffer[framed-2]
-%D \defineframedtext
-%D [Example]
-%D [width=6cm]
-%D
-%D \startExample
-%D \typebuffer[framed-2]
-%D \stopExample
-%D \stopbuffer
-%D
-%D \startbuffer[framed-3]
-%D \defineframedtext
-%D [Example]
-%D [height=5cm]
-%D
-%D \startExample
-%D \typebuffer[framed-3]
-%D \stopExample
-%D \stopbuffer
-%D
-%D \startbuffer[framed-4]
-%D \defineframedtext
-%D [Example]
-%D [width=fit,height=broad]
-%D
-%D \Example{a very exciting example}
-%D \stopbuffer
-%D
-%D \bgroup \setuptyping[margin=0pt] \getbuffer[framed-0] \egroup
-%D \bgroup \setuptyping[margin=0pt] \getbuffer[framed-1] \egroup
-%D \bgroup \setuptyping[margin=0pt] \getbuffer[framed-2] \egroup
-%D \bgroup \setuptyping[margin=0pt] \getbuffer[framed-3] \egroup
-%D \bgroup \setuptyping[margin=0pt] \getbuffer[framed-4] \egroup
-%D
-%D Here we can see that we have a predefined framed text class as well as the
-%D tools for defining our own. So we have:
-%D
-%D \showsetup{setupframedtexts}
-%D
-%D as well as the definition command:
-%D
-%D \showsetup{defineframedtext}
-%D
-%D that generates two commands:
-%D
-%D \showsetup{start<<framedtext>>}
-%D \showsetup{<<framedtext>>}
-%D
-%D The next definition shows the defaults.
-
-\installcorenamespace{framedtext}
-\installcorenamespace{framedtextlocation}
-
-\installframedcommandhandler \??framedtext {framedtext} \??framedtext
-
-\let\setupframedtexts\setupframedtext
-
-\setupframedtext
- [\c!width=.75\hsize,
- \c!height=\v!fit,
- \c!align=\v!yes,
- %\c!top=,
- \c!bottom=\vfill,
- \c!offset=1em,
- %\c!bodyfont=,
- %\c!style=,
- %\c!color=,
- %\c!left=,
- \c!right=\hfill,
- \c!before=\blank,
- \c!after=\blank,
- %\c!inner=,
- \c!frame=\v!on,
- %\c!topframe=,
- %\c!bottomframe=,
- %\c!leftframe=,
- %\c!rightframe=,
- \c!radius=.5\bodyfontsize,
- \c!corner=\v!rectangular,
- %\c!orientation=,
- %\c!indenting=,
- %\c!foregroundcolor=,
- %\c!foregroundstyle=,
- %\c!background=,
- %\c!backgroundcolor=,
- \c!linecorrection=\v!on,
- \c!depthcorrection=\v!on,
- \c!margin=\v!standard]
-
-\appendtoks
- \setuevalue{\e!start\currentframedtext}{\pack_framed_text_start {\currentframedtext}}%
- \setuevalue{\e!stop \currentframedtext}{\pack_framed_text_stop }%
- \setuevalue {\currentframedtext}{\pack_framed_text_direct{\currentframedtext}}%
-\to \everydefineframedtext
-
-\setvalue{\??framedtextlocation\v!left }{\letframedtextparameter\c!left \relax
- \letframedtextparameter\c!right\hfill}
-
-\setvalue{\??framedtextlocation\v!right }{\letframedtextparameter\c!left \hfill
- \letframedtextparameter\c!right\relax}
-
-\setvalue{\??framedtextlocation\v!middle}{\letframedtextparameter\c!left \hfill
- \letframedtextparameter\c!right\hfill}
-
-\setvalue{\??framedtextlocation\v!none }{\letframedtextparameter\c!left \relax
- \letframedtextparameter\c!right\relax
- \settrue\c_framed_text_location_none}
-
-\unexpanded\def\pack_framed_text_start#1%
- {\bgroup
- \edef\currentframedtext{#1}%
- \dodoubleempty\pack_framed_text_start_indeed}
-
-\def\pack_framed_text_start_indeed[#1][#2]%
- {\doifelseassignment{#1}
- {\pack_framed_text_start_continue\empty{#1}}
- {\pack_framed_text_start_continue{#1}{#2}}}
-
-% todo: sort out first/lastline ht/dp
-
-\def\pack_framed_text_start_continue#1#2%
- {\setupframedtexts[\currentframedtext][#2]%
- \doifsomething{#1}{\setframedtextparameter\c!location{#1}}% does not listen to #3
- \setfalse\c_framed_text_location_none
- \csname\??framedtextlocation\framedtextparameter\c!location\endcsname
- \resetframedtextparameter\c!location
- \pack_framed_text_check
- \setbox\b_framed_normal\vbox % \vpack
- \startboxedcontent
- \hsize\localhsize
- % \insidefloattrue % ? better
- \usebodyfontparameter\framedtextparameter
- % \edef\p_framed_text_strut{\letframedtextparameter\c!strut}% to be used
- \letframedtextparameter\c!strut\v!no
- \inheritedframedtextframed\bgroup
- \let\\=\endgraf
- \edef\p_framed_text_depthcorrection{\framedtextparameter\c!depthcorrection}%
- \ifx\p_framed_text_depthcorrection\v!on
- \pack_framed_text_start_depth_correction
- \else
- \bgroup
- \fi
- \vskip-\strutdp % brrr why is this needed ... needs to be sorted out, see testcase 1
- \doinhibitblank
- \useindentingparameter\framedtextparameter
- \useframedtextstyleandcolor\c!style\c!color
- \framedtextparameter\c!inner
- \ignorespaces}
-
-% testcase 1:
-%
-% \showstruts
-% \startframedtext[align={normal,tolerant},offset=0pt] \input tufte \stopframedtext
-% \startframedtext[align={normal,tolerant},offset=0pt,depthcorrection=off] \input tufte \stopframedtext
-% \startframedtext[align={normal,tolerant},offset=0pt,depthcorrection=off] \inframed{x} \stopframedtext
-% \framed[align={normal,tolerant},offset=0pt]{\input tufte }
-
-%D The \type {none} option is handy for nested usage, as in the presentation
-%D styles, where we don't want interference.
-
-\defineplacement[\??framedtext][\s!parent=\??framedtext\currentframedtext]
-
-\unexpanded\def\pack_framed_text_stop % no \baselinecorrection, see faq docs
- {\endgraf
- \removelastskip
- \ifx\p_framed_text_depthcorrection\v!on
- \pack_framed_text_stop_depth_correction
- \else
- \egroup
- \fi
- \stopboxedcontent
- \ifconditional\c_framed_text_location_none
- \egroup
- \box\b_framed_normal
- \orelse\ifinsidefloat
- \egroup
- \box\b_framed_normal
- \else
- \egroup
- \placement[\??framedtext][\c!depthcorrection=\v!off]{\box\b_framed_normal}%
- \fi
- \egroup}
-
-%D We define the general (and original) case by just saying:
-
-\def\pack_framed_text_check % messy dependency
- {\localhsize\hsize
- \ifinsidefloat \orelse \ifdim\d_page_sides_vsize>\zeropoint % also possible: \c_page_sides_checks_done>\zeropoint
- % \strut % rather clean way to invoke the sidefloat OTR
- % \setbox0=\lastbox % and get the widths set, so from now on we
- % \setlocalhsize % can have framed texts alongside sidefloats
- \checksidefloat
- \setlocalhsize
- \fi}
-
-\def\pack_framed_text_start_depth_correction
- {\bgroup
- \ifhmode
- \par
- \fi
- \ifvmode
- \verticalstrut
- % we need \nowhitespace in case of setups setting whitespace
- % nb, not safe, text vs \vbox as next
- \vskip-\struttotal
- \nowhitespace
- \fi} % na vskip ! new 20/05/2004, fails with next content being box (\scale{..})
-
-\def\pack_framed_text_stop_depth_correction
- {\ifhmode
- \par
- \fi
- \ifvmode
- \forgetall
- \vskip-\struttotal
- \verticalstrut
- \egroup
- \forgetall % brrr too often
- \vskip-\lineheight
- \verticalstrut
- \else
- \egroup
- \fi}
-
-%D Placement can be ignored:
-%D
-%D \starttyping
-%D \hbox to \hsize \bgroup
-%D \startframedtext[none][width=.5\textwidth] \input tufte \stopframedtext
-%D \startframedtext[none][width=.5\textwidth] \input zapf \stopframedtext
-%D \egroup
-%D
-%D \hbox to \hsize \bgroup
-%D \setupframedtexts[location=none]%
-%D \startframedtext[width=.5\textwidth] \input zapf \stopframedtext
-%D \startframedtext[width=.5\textwidth] \input tufte \stopframedtext
-%D \egroup
-%D \stoptyping
-
-%D The simple brace (or group) delimited case is typeset slightly different
-%D and is not aligned.
-
-\unexpanded\def\pack_framed_text_direct#1%
- {\bgroup
- \edef\currentframedtext{#1}%
- \dosingleempty\pack_framed_text_start_direct}
-
-\def\pack_framed_text_start_direct[#1]%
- {\usebodyfontparameter\framedtextparameter
- \iffirstargument
- \setupcurrentframedtext[#1]%
- \fi
- \edef\p_framed_text_strut{\framedtextparameter\c!strut}%
- \letframedtextparameter\c!strut\v!no
- \inheritedframedtextframed\bgroup
- \blank[\v!disable]%
- \let\\=\endgraf
- \useframedtextstyleandcolor\c!style\c!color
- \vskip-\strutdp % brrr why is this needed ... needs to be sorted out, see testcase 1
- \framedtextparameter\c!inner
- \ifx\p_framed_text_strut\v!no
- \let\pack_framed_strut\relax
- \else
- \let\pack_framed_strut\strut
- \fi
- \bgroup
- \aftergroup\pack_framed_text_stop_direct
- \afterassignment\ignorespaces
- \afterassignment\pack_framed_strut
- \let\next=}
-
-\def\pack_framed_text_stop_direct
- {\removelastskip
- \egroup
- \egroup}
-
-\defineframedtext
- [\v!framedtext]
-
-%D \macros
-%D {defineframed}
-%D
-%D One can also define simple framed texts, using:
-%D
-%D \showsetup{defineframed}
-%D
-%D As suggested by Wolfgang we can now use the new \MKIV\ inheritance model instead
-%D of passing a combination of arguments. This also also simplified the \type
-%D {\setupframed} command. There are certainly more places where such improvements
-%D can be made.
-
-\appendtoks
- \ifcsname\??regularframedlevel\currentframed\endcsname
- % already defined, keeps settings
- \else
- \expandafter\newcount\csname\??regularframedlevel\currentframed\endcsname
- \fi
-\to \everypresetframed
-
-\appendtoks
- \setuevalue\currentframed{\pack_framed_defined_process[\currentframed]}%
-\to \everydefineframed
-
-\newcount\c_temp_framed_crap
-
-\unexpanded\def\pack_framed_defined_process[#1]% official (not much checking, todo: parent)
- {\bgroup
- \ifcsname\??regularframedlevel#1\endcsname
- %\expandafter\let\expandafter\c_pack_framed_temp\csname\??regularframedlevel#1\endcsname
- \expandafter\let\expandafter\c_pack_framed_temp\lastnamedcs
- \else
- \let\c_pack_framed_temp\c_temp_framed_crap
- \fi
- \advance\c_pack_framed_temp\plusone
- \expandafter\def\csname\??framed#1>\the\c_pack_framed_temp:\s!parent\endcsname{\??framed#1}% \inheritlocalframed
- \bgroup
- \edef\currentframed{#1>\the\c_pack_framed_temp}%
- \pack_framed_initialize
- \dosingleempty\pack_framed_defined_process_indeed}
-
-\def\pack_framed_defined_process_indeed[#1]%
- {\iffirstargument % faster
- \setupcurrentframed[#1]% here !
- \fi
- \pack_framed_process_indeed}
-
-\let\placeframed\pack_framed_defined_process % new per 2012/04/23
-
-%D We can do:
-%D
-%D \starttyping
-%D \defineframed[\v!framed]
-%D \stoptyping
-%D
-%D but the existing one is ok as well (less csname messy too).
-
-%D New, for the moment private; let's see when GB finds out about this one and its
-%D obscure usage. It's used in:
-%D
-%D \startbuffer
-%D \defineframedtext
-%D [tabulateframe]
-%D [offset=overlay,
-%D backgroundoffset=3pt,
-%D background=color,
-%D backgroundcolor=green]
-%D
-%D \setuptabulate
-%D [tabulate]
-%D [frame=tabulateframe]
-%D
-%D \setuptables
-%D [frame=tabulateframe]
-%D
-%D \input tufte
-%D
-%D \starttabulate[|l|l|]
-%D \NC test \NC test \NC \NR \NC test \NC test \NC \NR
-%D \NC test \NC test \NC \NR \NC test \NC test \NC \NR
-%D \stoptabulate
-%D
-%D \input tufte
-%D
-%D \starttable[|l|l|]
-%D \NC test \NC test \NC \AR \NC test \NC test \NC \AR
-%D \NC test \NC test \NC \AR \NC test \NC test \NC \AR
-%D \stoptable
-%D \stopbuffer
-%D
-%D \typebuffer
-
-\installcorenamespace{framedcontent}
-
-\installframedcommandhandler \??framedcontent {framedcontent} \??framedcontent
-
-\setupframedcontent
- [\c!leftoffset=\zeropoint,
- %\c!rightoffset=\framedcontentparameter\c!leftoffset,
- \c!rightoffset=\scratchleftoffset,
- \c!topoffset=\zeropoint,
- %\c!bottomoffset=\framedcontentparameter\c!topoffset,
- \c!bottomoffset=\scratchtopoffset,
- \c!strut=\v!no,
- %\c!linecorrection=\v!no,
- %\c!left=,
- %\c!right=,
- %\c!width=\v!fit,
- \c!offset=\v!overlay]
-
-\unexpanded\def\startframedcontent
- {\dosingleempty\pack_framed_start_content}
-
-\def\pack_framed_start_content[#1]%
- {\bgroup
- \edef\currentframedcontent{#1}%
- \ifx\currentframedcontent\v!off
- \let\stopframedcontent\egroup
- \else
- \checkframedcontentparent
- \let\stopframedcontent\pack_framed_stop_content_indeed
- \expandafter\pack_framed_start_content_indeed
- \fi}
-
-\def\pack_framed_start_content_indeed
- {\setbox\b_framed_normal\hpack\bgroup
- \setlocalhsize
- \hsize\localhsize
- \scratchleftoffset \framedcontentparameter\c!leftoffset \relax
- \scratchrightoffset \framedcontentparameter\c!rightoffset \relax
- \scratchtopoffset \framedcontentparameter\c!topoffset \relax
- \scratchbottomoffset\framedcontentparameter\c!bottomoffset\relax
- \advance\hsize\dimexpr-\scratchleftoffset-\scratchrightoffset \relax
- \advance\vsize\dimexpr-\scratchtopoffset -\scratchbottomoffset\relax
- \kern\scratchleftoffset
- \vpack\bgroup
- \vskip\scratchtopoffset
- \vbox\bgroup
- \forgetall
- \blank[\v!disable]}
-
-\def\pack_framed_stop_content_indeed
- {\removelastskip
- \egroup
- \vskip\scratchbottomoffset
- \egroup
- \kern\scratchrightoffset
- \egroup
- \doif{\framedcontentparameter\c!width}\v!fit
- {\letframedcontentparameter\c!width\v!fixed}% no shapebox
- \ifinsidefloat
- \donefalse
- \else
- \doifelse{\framedcontentparameter\c!linecorrection}\v!yes\donetrue\donefalse
- \fi
- % plaats ?
- \ifdone\startlinecorrection\fi
- \framedcontentparameter\c!left % new
- \inheritedframedcontentframed{\box\b_framed_normal}% hm
- \framedcontentparameter\c!right % new
- \ifdone\stoplinecorrection\fi
- \egroup}
-
-% A shared setting.
-
-\setuplinewidth
- [\v!medium]
-
-%D A Goodie:
-
-\def\v!unframed{unframed}
-
-\defineframed
- [\v!unframed]
- [\c!frame=\v!off,
- \c!rulethickness=\zeropoint,
- \c!foregroundstyle=\framedparameter\c!style,
- \c!foregroundcolor=\framedparameter\c!color]
-
-%D Bonus (as defined in \type {pack-rul.lua}):
-%D
-%D \starttyping
-%D \setbox\scratchbox\vbox{a\par aa\par aaa\par}
-%D \the\dimexpr\themaxboxwidth\scratchbox\relax
-%D \stoptyping
-
-\let\themaxboxwidth\clf_themaxboxwidth
-
-%D New: slow but ok for most cases:
-
-\unexpanded\def\doifelseframed#1%
- {\ifcase\numexpr\zerocount
- \immediateassignment\edef\tempstring{#1\c!frame }\ifx\tempstring\v!on +\plusone\fi
- \immediateassignment\edef\tempstring{#1\c!topframe }\ifx\tempstring\v!on +\plusone\fi
- \immediateassignment\edef\tempstring{#1\c!bottomframe}\ifx\tempstring\v!on +\plusone\fi
- \immediateassignment\edef\tempstring{#1\c!leftframe }\ifx\tempstring\v!on +\plusone\fi
- \immediateassignment\edef\tempstring{#1\c!rightframe }\ifx\tempstring\v!on +\plusone\fi
- \immediateassignment\edef\tempstring{#1\c!background }\ifx\tempstring\empty\else+\plusone\fi
- \relax\expandafter\secondoftwoarguments\else\expandafter\firstoftwoarguments\fi}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-bck.mkiv b/Master/texmf-dist/tex/context/base/mkiv/page-bck.mkiv
index 1ec7cdbb86e..1af681049ac 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-bck.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-bck.mkiv
@@ -269,14 +269,14 @@
\def\page_backgrounds_set_boxes_b
{\ifconditional\c_page_backgrounds_new_left
% \showmessage\m!layouts8\empty
- \page_backgrounds_set_box\leftbackground % \conditionalfalse
+ \page_backgrounds_set_box\leftbackground
\global\setfalse\c_page_backgrounds_new_left
\fi}
\def\page_backgrounds_set_boxes_c
{\ifconditional\c_page_backgrounds_new_right
% \showmessage\m!layouts8\empty
- \page_backgrounds_set_box\rightbackground % \conditionaltrue
+ \page_backgrounds_set_box\rightbackground
\global\setfalse\c_page_backgrounds_new_right
\fi}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-box.mkvi b/Master/texmf-dist/tex/context/base/mkiv/page-box.mkvi
index 4804e83706a..02c190e6558 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-box.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-box.mkvi
@@ -252,7 +252,6 @@
{\setbox#1\vpack to \paperheight
{\hsize\paperwidth
\vkern\topspace
-% \parfillskip\zeropoint
\hkern\doifbothsides\backspace\backspace{\dimexpr\paperwidth-\backspace-\makeupwidth\relax}%
\box#1}%
\dp#1\zeropoint}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-brk.mkiv b/Master/texmf-dist/tex/context/base/mkiv/page-brk.mkiv
index e18c0d9232a..e275c8b41eb 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-brk.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-brk.mkiv
@@ -290,6 +290,13 @@
\installpagebreakmethod \v!start {\global\settrue \c_otr_shipout_enabled}
\installpagebreakmethod \v!stop {\global\setfalse\c_otr_shipout_enabled}
+\installpagebreakmethod{xy}% for Mojca
+ {\page_breaks_handle_direct\v!yes
+ \scratchcounterone \numexpr\rootlayouttargetparameter\c!nx*\rootlayouttargetparameter\c!ny\relax
+ \scratchcountertwo \luaexpr{math.mod(\the\realpageno-1,\the\scratchcounterone)}\relax
+ \scratchcounterthree\numexpr\scratchcounterone-\scratchcountertwo\relax
+ \dorecurse\scratchcounterthree{\page_breaks_handle_direct\v!empty}}
+
% Column breaks.
\installcorenamespace{columnbreakmethod}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-col.mkiv b/Master/texmf-dist/tex/context/base/mkiv/page-col.mkiv
index 272ffe18168..a51406cd900 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-col.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-col.mkiv
@@ -22,7 +22,7 @@
%D We reserve a counter for the number of columns as well as the current
%D column. Both are not to be changed by users!
-\newcount\nofcolumns \nofcolumns\plusone
+%newcount\nofcolumns \nofcolumns\plusone % already in core-ini.mkiv
\newcount\mofcolumns \mofcolumns\plusone
\newconstant\columndirection % 0:lr 1:rl
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-ffl.mkiv b/Master/texmf-dist/tex/context/base/mkiv/page-ffl.mkiv
index 176c4a185e7..b02b908a921 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-ffl.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-ffl.mkiv
@@ -23,6 +23,8 @@
%D \setupfacingfloat
%D [whatever]
%D [style=bold,
+%D width=frame,
+%D offset=10pt,
%D color=white]
%D
%D \setupfacingfloat
@@ -56,6 +58,12 @@
\unprotect
+% width:
+%
+% -- fit : do nothing
+% -- dimension : use that
+% -- frame : use hsize minus frame offsets (based on preroll)
+
\installcorenamespace {facingfloat}
\installframedcommandhandler \??facingfloat {facingfloat} \??facingfloat
@@ -63,6 +71,7 @@
\setupfacingfloat
[\c!spaceinbetween=\v!big,
\c!inbetween={\blank[\v!big]},
+ \c!width=\v!fit,
%\c!style,
%\c!color,
\c!page=\v!left]
@@ -82,7 +91,7 @@
\let\m_strc_floats_state\relax
-\def\strc_floats_facing_flush
+\unexpanded\def\strc_floats_facing_flush
{\ifnum\c_strc_floats_facing_flushed<\c_strc_floats_facing_saved
\ifodd\c_strc_floats_facing_flushed
\ifodd\realpageno
@@ -121,6 +130,8 @@
\resetboxesincache{\currentfacingfloat}%
\fi}
+\let\flushfacingfloats\strc_floats_facing_flush
+
\unexpanded\def\strc_floats_facing_setup
{\edef\currentfacingfloat{\currentfacingfloat:\m_strc_floats_state}%
\usefacingfloatstyleandcolor\c!style\v!color}
@@ -175,9 +186,19 @@
% \page[\p_page]%
% \fi
%
+ \edef\currentfacingfloat{#1}%
+ \edef\p_width{\facingfloatparameter\c!width}%
+ \letfacingfloatparameter\c!width\v!fit
+ \ifx\p_width\v!frame
+ \setbox\scratchbox\hpack{\inheritedfacingfloatframed{}}%
+ \advance\hsize-\wd\scratchbox
+ \else\ifx\p_width\v!fit
+ % whatever
+ \else
+ \hsize\p_width
+ \fi\fi
\let\startcontent\bgroup
\let\stopcontent\egroup
- \def\currentfacingfloat{#1}%
\let\m_strc_floats_state\v!left
\strc_floats_facing_handle}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-flt.mkiv b/Master/texmf-dist/tex/context/base/mkiv/page-flt.mkiv
index 01ee8b689e8..87476adeb3f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-flt.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-flt.mkiv
@@ -48,7 +48,7 @@
\def\page_floats_report_flushed
{\showmessage\m!floatblocks3%
- {\the\numexpr\totalnoffloats-\savednoffloats\relax}}
+ {\the\numexpr\totalnoffloats-\savednoffloats\relax}}
%D Extra float registers.
@@ -131,7 +131,7 @@
\unexpanded\def\page_floats_collect#1#2#3%
{\clf_collectfloat{#1}\dimexpr#2\relax\dimexpr#3\relax}
-\def\nofstackedfloatincategory#1%
+\def\nofstackedfloatsincategory#1%
{\clf_nofstackedfloats{#1}}
\let\page_floats_column_push_saved\page_floats_push_saved % overloaded in page-mul
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-imp.mkiv b/Master/texmf-dist/tex/context/base/mkiv/page-imp.mkiv
index a7ef6ca38f7..829ed24f427 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-imp.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-imp.mkiv
@@ -167,8 +167,13 @@
% \def\page_shipout_box#1{\normalshipout\box#1\relax} % takes a number
+\def\page_shipout_show_box{\scratchcounter}
+
\unexpanded\def\page_shipout_box#1%
- {\clf_shipoutpage#1\relax
+ {\ifcase\tracingoutput\else
+ \page_shipout_show_box#1\relax
+ \fi
+ \clf_shipoutpage#1\relax
\global\setbox#1\emptybox
\global\deadcycles\zerocount}
@@ -322,13 +327,14 @@
\gdef\arrangedrotationO{0}%
\gdef\arrangedrotationE{180}%
\processcommalist[#1]\doinstalledarrangedoption
- \ifx\handlearrangedpage\undefined
+ \ifdefined\handlearrangedpage\else
\global\arrangingpagesfalse
\fi
\setuppapersize
\ifarrangingpages
\ifconditional\c_page_shipouts_use_objects\else
\clf_disablejobsave
+ \clf_synctexdisable
%\disabledirective[job.save]%
\fi
\fi
@@ -356,6 +362,15 @@
\installpagearrangement {\v!normal}
{\global\arrangingpagesfalse}
+%D (WS:) Watch out with 2UP and A4/A5:
+%D
+%D \definepapersize [A4] [width=210mm,height=297mm]
+%D \definepapersize [A5] [width=148mm,height=210mm]
+%D
+%D 297 mm - 2 * 148 mm = 1 mm
+%D
+%D This is only visible when we have a full background.
+
\installpagearrangement 2*16
{\dosetuparrangement{4}{4}{16}{5}{5}%
\pusharrangedpageTHIRTYTWO\poparrangedpagesAB\relax}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/page-ini.lua
index 17f4c44dadd..924e01b2aa8 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-ini.lua
@@ -8,7 +8,7 @@ if not modules then modules = { } end modules ['page-ini'] = {
local tonumber, rawget, rawset, type, next = tonumber, rawget, rawset, type, next
local match = string.match
-local sort, tohash, insert, remove = table.sort, table.tohash, table.insert, table.remove
+local sort, tohash, insert, remove, sortedkeys = table.sort, table.tohash, table.insert, table.remove, table.sortedkeys
local settings_to_array, settings_to_hash = utilities.parsers.settings_to_array, utilities.parsers.settings_to_hash
local texgetcount = tex.getcount
@@ -87,10 +87,23 @@ function pages.mark(name,list)
end
end
+local tobemarked = { }
+
+function pages.markedlist(realpage)
+ if realpage then
+ local m = rawget(tobemarked,realpage) or rawget(data,realpage)
+ return m and next(m) and sortedkeys(m)
+ end
+end
+
local function marked(name)
local realpage = texgetcount("realpageno")
for i=last,realpage-1 do
- rawset(data,i,nil)
+ local di = data[i]
+ if di then
+ tobemarked[i] = di
+ rawset(data,i,nil)
+ end
end
local pagedata = rawget(data,realpage)
return pagedata and pagedata[name] and true or false
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-inj.mkvi b/Master/texmf-dist/tex/context/base/mkiv/page-inj.mkvi
index b1a2913cf6f..f1b520f5e3e 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-inj.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-inj.mkvi
@@ -149,7 +149,7 @@
\stopsetups
\startsetups[\??pageinjectionrenderings:\s!setup]
- \setups[\dummyparameter\c!setup]% kind of redundant but fits in
+ \setups[\dummyparameter\c!setups]% kind of redundant but fits in
\stopsetups
\startsetups[\??pageinjectionrenderings:\v!buffer]
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-ins.lua b/Master/texmf-dist/tex/context/base/mkiv/page-ins.lua
index 0323952d00f..8a68e16ddaa 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-ins.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-ins.lua
@@ -19,6 +19,7 @@ inserts.data = inserts.data or allocate { } -- bytecode storage pool
local variables = interfaces.variables
local v_page = variables.page
+local v_auto = variables.auto
local context = context
local implement = interfaces.implement
@@ -111,3 +112,10 @@ implement {
arguments = "string"
}
+implement {
+ name = "setinsertmigration",
+ arguments = "string",
+ actions = function(state)
+ nodes.migrations.setinserts(state == v_auto)
+ end
+}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-ins.mkiv b/Master/texmf-dist/tex/context/base/mkiv/page-ins.mkiv
index 3b473343afe..6f2b56f8285 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-ins.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-ins.mkiv
@@ -1,6 +1,6 @@
%D \module
-%D [ file=core-ins,
-%D version=2002.04.16,
+%D [ file=page-ins,
+%D version=2002.04.16, % was core-ins
%D title=\CONTEXT\ Insertion Macros,
%D subtitle=Insertions,
%D author=Hans Hagen,
@@ -38,6 +38,26 @@
%c!factor=\plusthousand,
\c!location=\v!page]
+\newconstant\insertionmigrationmode
+
+\def\page_inserts_check_anchoring
+ {\edef\p_anchoring{\namedinsertionparameter\empty\c!anchoring}%
+ \insertionmigrationmode\ifx\p_anchoring\v!auto\plusone\else\zerocount\fi
+ \clf_setinsertmigration{\p_anchoring}}
+
+\appendtoks
+ \ifx\currentinsertionparent\empty
+ \page_inserts_check_anchoring
+ \fi
+\to \everysetupinsertion
+
+\setupinsertion
+ [\c!anchoring=\v!none]
+
+\appendtoks
+ \page_inserts_check_anchoring
+\to \everystarttext % or \everyjob
+
\newcount\currentinsertionnumber % This is a count and not a macro !
\newtoks\t_page_inserts_list
@@ -63,7 +83,9 @@
% \floatingpenalty\zerocount
\appendtoks
- \page_inserts_synchronize_registers
+ \ifx\currentinsertionparent\empty \else
+ \page_inserts_synchronize_registers
+ \fi
\to \everysetupinsertion
\unexpanded\def\page_inserts_process#1% beware, this adapts currentinsertion !
@@ -131,12 +153,14 @@
\to \everydefineinsertion
\appendtoks
- \clf_setupinsertion
- {\currentinsertion}
- {%
- location {\insertionparameter\c!location}%
- }%
- \relax
+ \ifx\currentinsertionparent\empty \else
+ \clf_setupinsertion
+ {\currentinsertion}
+ {%
+ location {\insertionparameter\c!location}%
+ }%
+ \relax
+ \fi
\to \everysetupinsertion
\unexpanded\def\page_inserts_set_location#1#2% fast one
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-lay.mkiv b/Master/texmf-dist/tex/context/base/mkiv/page-lay.mkiv
index d115b588d6f..6f41f3bd85e 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-lay.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-lay.mkiv
@@ -521,6 +521,8 @@
\edef\currentlayouttarget{#1}%
\fi}
+\newdimen\d_page_minimum_paper_size \d_page_minimum_paper_size\luaexpr{math.pi}\onebasepoint
+
\unexpanded\def\page_paper_set_current_indeed[#1][#2]%
{\edef\m_page_asked_paper{#1}% can be the restores
\edef\m_page_asked_print{#2}%
@@ -539,18 +541,18 @@
\processcommacommand[\m_page_asked_paper]\page_paper_handle_page_option
\global\paperwidth \layouttargetparameter\c!width \relax
\global\paperheight\layouttargetparameter\c!height\relax
- \ifdim\paperwidth<\onepoint
- \global\paperwidth\onepoint
+ \ifdim\paperwidth<\d_page_minimum_paper_size
+ \global\paperwidth\d_page_minimum_paper_size
\fi
- \ifdim\paperheight<\onepoint
- \global\paperheight\onepoint
+ \ifdim\paperheight<\d_page_minimum_paper_size
+ \global\paperheight\d_page_minimum_paper_size
\fi
\ifconditional\c_page_target_paper_landscape
\doglobal\swapdimens\paperwidth\paperheight
\fi
\ifinpagebody % local freeze
- \normalexpanded{\setlayouttargetparemeter\c!height{\the\paperheight}}%
- \normalexpanded{\setlayouttargetparemeter\c!width {\the\paperwidth }}%
+ \normalexpanded{\setlayouttargetparameter\c!height{\the\paperheight}}%
+ \normalexpanded{\setlayouttargetparameter\c!width {\the\paperwidth }}%
\fi
%
\page_paper_set_offsets
@@ -1363,7 +1365,6 @@
\fetchruntimecommand \showsetups \f!page_run
\fetchruntimecommand \showmargins \f!page_run
\fetchruntimecommand \showgrid \f!page_run
-\fetchruntimecommand \showusage \f!page_run
\glet\page_grids_add_to_box\gobbleoneargument
\glet\page_grids_add_to_one\gobbleoneargument
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-lin.lua b/Master/texmf-dist/tex/context/base/mkiv/page-lin.lua
index 5ad660460c1..06983ef5c6f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-lin.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-lin.lua
@@ -485,15 +485,6 @@ function boxed.stage_two(n,m)
local m = li[2]
local ti = t[i]
if ti then
- -- local d = getdirection(n)
- -- local l = getlist(n)
- -- if d == 1 then
- -- local w = getwidth(n)
- -- ti = hpack_nodes(linked_nodes(new_kern(-w),ti,new_kern(w)))
- -- end
- -- setnext(ti,l)
- -- setprev(l,ti)
- -- setlist(n,ti)
addtoline(n,ti)
resolve(n,m)
else
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-lin.mkvi b/Master/texmf-dist/tex/context/base/mkiv/page-lin.mkvi
index 6a03d12e45b..e355e3e6017 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-lin.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-lin.mkvi
@@ -16,6 +16,9 @@
%
% to be redone (was experiment) .. can be hooked into margin code
% reshuffle arguments
+%
+% this is early luatex code, 2007 or even before that, and it shows ... we
+% have better tricks now
\writestatus{loading}{ConTeXt Core Macros / Line Numbering}
@@ -43,14 +46,15 @@
\definesystemattribute[linereference][public]
\appendtoksonce
- \attribute\linenumberattribute\attributeunsetvalue
+ \c_attr_linenumber\attributeunsetvalue
\to \everyforgetall
\appendtoks
- \attribute\linenumberattribute \attributeunsetvalue
+ \c_attr_linenumber\attributeunsetvalue
\to \everyinsidefloat
-\newcount \linenumber % not used
+\mutable\let\linenumber\!!zerocount
+
\newbox \b_page_lines_scratch
\newcount \c_page_lines_reference
\newconstant\c_page_lines_nesting
@@ -127,7 +131,7 @@
\unexpanded\def\page_lines_some_reference#1#2#3%
{\dontleavehmode\begingroup
\global\advance\c_page_lines_reference\plusone
- \attribute\linereferenceattribute\c_page_lines_reference
+ \c_attr_linereference\c_page_lines_reference
#3% todo: #3{#1} as there is no need to pass #1 as part of #3
% for the moment we use a simple system i.e. no prefixes etc .. todo: store as number
\c_strc_references_bind_state\zerocount % we don't want the prewordbreak and manage it here
@@ -312,11 +316,11 @@
\or
\page_lines_start_define % only when assignment
\fi
- \attribute\linenumberattribute\csname\??linenumberinginstance\currentlinenumbering\endcsname\relax}
+ \c_attr_linenumber\csname\??linenumberinginstance\currentlinenumbering\endcsname\relax}
\unexpanded\def\stoplinenumbering
{\ifconditional\c_pages_lines_nesting=\plusone
- \attribute\linenumberattribute\attributeunsetvalue
+ \c_attr_linenumber\attributeunsetvalue
\the\aftereverylinenumbering
\ifconditional\c_page_lines_auto_narrow\par\fi
\fi
@@ -348,6 +352,7 @@
\def\page_lines_add_numbers_to_box#box#column#max#nesting%
{\bgroup
+ \strc_tags_enable_indeed
\b_page_lines_number #box\relax
\c_page_lines_column #column\relax
\c_page_lines_last_column#max\relax
@@ -459,24 +464,34 @@
% \def\dodollap{\hbox to \zeropoint{\normalhss\box\nextbox}\endgroup}
\def\page_line_handle_left#align#width#distance%
- {\llap
+ {\dostarttagged\t!linenumber\empty
+ \llap
{\page_lines_number_inject#align#width%
+ \dostarttagged\t!ignore\empty
\kern\dimexpr
#distance+\d_page_lines_distance
\ifconditional\c_page_lines_dir_left_to_right\else+\d_page_lines_line_width\fi
\relax
\the\everylinenumber
- \hss}}
+ \hss
+ \dostoptagged}%
+ \dostoptagged}
\def\page_line_handle_right#align#width#distance%
- {\rlap
- {\kern\dimexpr
+ {\dostarttagged\t!linenumber\empty
+ \rlap
+ {\dostarttagged\t!ignore\empty
+ \kern\dimexpr
#distance+\d_page_lines_distance
\ifconditional\c_page_lines_dir_left_to_right+\d_page_lines_line_width\fi
\relax
+ \dostoptagged
\page_lines_number_inject#align#width%
+ \dostarttagged\t!ignore\empty
\the\everylinenumber
- \hss}}
+ \hss
+ \dostoptagged}%
+ \dostoptagged}
\setuvalue{\??linenumberinghandler\v!left}%
{\page_line_handle_left\p_align\leftmarginwidth\leftmargindistance}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-mix.mkiv b/Master/texmf-dist/tex/context/base/mkiv/page-mix.mkiv
index f54b8ec71d4..e38ad74068d 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-mix.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-mix.mkiv
@@ -125,6 +125,7 @@
\setnewconstant\c_page_mix_routine_error \plusfour
\newconditional\c_page_mix_process_notes
+\newconditional\c_page_mix_grid_snapping
%D The main environment is called as follows:
%D
@@ -253,9 +254,15 @@
%D The error routine is there but unlikely to be called. It is a left-over from
%D the traditional routine that might come in handy some day.
+\def\page_mix_construct_and_shipout#1#2#3%
+ {\ifconditional\c_page_mix_grid_snapping\else\gridsnappingfalse\fi % maybe only for notes (bottom alignment)
+ \page_otr_construct_and_shipout#1#2#3%
+ \ifconditional\c_page_mix_grid_snapping \gridsnappingtrue \fi}
+
+
\def\page_mix_routine_error
{\showmessage\m!columns3\empty
- \page_otr_construct_and_shipout\unvbox\normalpagebox\zerocount} % three arguments
+ \page_mix_construct_and_shipout\unvbox\normalpagebox\zerocount} % three arguments
%D Some settings (and actions) depend on the current output routine and setting the
%D hsize and vsize is among them. The calculation of the hsize is done elsewhere.
@@ -300,9 +307,11 @@
\def\page_mix_enable_grid_snapping
{\edef\p_grid{\mixedcolumnsparameter\c!grid}%
+ \setfalse\c_page_mix_grid_snapping
\ifx\p_grid\empty
% just follow the default grid settings
\else
+ \ifgridsnapping\settrue\c_page_mix_grid_snapping\fi
\gridsnappingtrue
\setsystemmode\v!grid
\spac_grids_snap_value_set\p_grid
@@ -795,7 +804,6 @@
% \hss
% \egroup}
-
\unexpanded\def\page_mix_routine_continue
{\bgroup
\forgetall
@@ -803,7 +811,7 @@
\setbox\b_page_mix_collected\vpack{\unvbox\normalpagebox}% brrr we need to make a tight box (combine this in lua)
\page_mix_routine_construct\v!no
\page_mix_routine_package
- \page_otr_construct_and_shipout\box\b_page_mix_collected\zerocount % three arguments
+ \page_mix_construct_and_shipout\box\b_page_mix_collected\zerocount % three arguments
\clf_mixflushrest
\clf_mixcleanup
\egroup}
@@ -841,7 +849,7 @@
% 1 = we have stuff left, so flush and rebalance
%writestatus\m!columns{flush continue}%
\page_mix_routine_package
- \page_otr_construct_and_shipout\box\b_page_mix_collected\zerocount % three arguments
+ \page_mix_construct_and_shipout\box\b_page_mix_collected\zerocount % three arguments
\setbox\b_page_mix_collected\vpack{\clf_mixflushrest}% we could avoid this
\clf_mixcleanup
\ifdim\ht\b_page_mix_collected=\zeropoint
@@ -1005,7 +1013,7 @@
{\page_one_place_float_force}
\unexpanded\def\page_mix_command_side_float_output
- {\page_otr_construct_and_shipout\unvbox\normalpagebox\zerocount} % three arguments
+ {\page_mix_construct_and_shipout\unvbox\normalpagebox\zerocount} % three arguments
\unexpanded\def\page_mix_command_synchronize_side_floats
{\page_sides_forget_floats}
@@ -1029,7 +1037,7 @@
\begingroup
\scratchdimen\dimexpr#1\lineheight\ifsecondargument+#2\fi\relax
\ifdim\scratchdimen>\zeropoint
- \attribute\checkedbreakattribute\number\scratchdimen
+ \c_attr_checkedbreak\number\scratchdimen % why \number
\penalty\c_page_mix_break_forced\relax
\fi
\endgroup}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-mul.mkiv b/Master/texmf-dist/tex/context/base/mkiv/page-mul.mkiv
index f1d68827ab7..a0a02543e95 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-mul.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-mul.mkiv
@@ -690,17 +690,17 @@
\else
\unvcopy#4%
\fi
- \fuzzysnappedbox\unvbox\scratchbox
+ \unvbox\scratchbox
\fakecolumnfootnotes{#1}}%
\else\ifcase\c_strc_notes_page_location
\global\setbox#1\vsplit#2 to #3%
\global\setbox#1\vbox
- {\fuzzysnappedbox\unvbox{#1}}% % or \box ?
+ {\unvbox{#1}}% % or \box ?
\else
\columnfootnotecorrection{#1}{#3}%
\setbox\scratchbox\vsplit#2 to #3%
\global\setbox#1\vbox to #3%
- {\fuzzysnappedbox\unvbox\scratchbox
+ {\unvbox\scratchbox
\fakecolumnfootnotes{#1}}%
\fi \fi
\egroup}
@@ -714,7 +714,7 @@
\def\page_mul_split_last_column#1#2%
{\global\setbox\lastcolumnbox\vbox
{\unvcopy\lasttopcolumnbox
- \fuzzysnappedbox\unvbox{#1}%
+ \unvbox{#1}%
\fakecolumnfootnotes\lastcolumnbox}}
%D NEW: still to be documented.
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-not.mkiv b/Master/texmf-dist/tex/context/base/mkiv/page-not.mkiv
index d6f63846f6e..6d71539d5dc 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-not.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-not.mkiv
@@ -22,23 +22,6 @@
\unprotect
-% \def\checkbegincolumnfootnotes % should happen inside otr
-% {\ifcase\c_strc_notes_page_location
-% \erasenotebackup
-% \else
-% \flushnotes
-% \savenotecontent
-% \fi
-% \savenotedata}
-
-% \def\checkendcolumnfootnotes
-% {\restorenotedata
-% \ifcase\c_strc_notes_page_location\else
-% \restorenotecontent
-% \fi}
-
-\let\checksinglecolumnfootnotes\relax
-
\newdimen\totalinsertionheight
\unexpanded\def\settotalinsertionheight
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-one.mkiv b/Master/texmf-dist/tex/context/base/mkiv/page-one.mkiv
index 85ed76da180..54e53035f51 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-one.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-one.mkiv
@@ -82,7 +82,12 @@
% 1 = partial page, 2 = whole page, 3 = partial page
-\setnewconstant\kindofpagetextareas\plustwo % \plusone can become default some day
+% We really need a setting! Todo, what key to use?
+
+\pushoverloadmode
+ \setnewconstant\kindofpagetextareas\plustwo % \plusone can become default some day
+ \overloaded\let\kindofpagetextareas\kindofpagetextareas
+\popoverloadmode
\def\page_one_registered_text_area_a % two arguments: (un)vbox n
{\ifconditional\c_page_areas_enabled
@@ -184,8 +189,7 @@
\scratchoffset\ht\b_page_one_contents
\fi
\setbox\b_page_one_bottom_notes\hpack
- {\checksinglecolumnfootnotes % why this check? ***
- \lower\scratchoffset\vbox{\placebottomnotes\par\kern\zeropoint}}% kerns makes notes sit on bottom % pack ?
+ {\lower\scratchoffset\vbox{\placebottomnotes\par\kern\zeropoint}}% kerns makes notes sit on bottom % pack ?
\smashbox\b_page_one_bottom_notes
\ht\b_page_one_contents\zeropoint
\page_one_registered_text_area_b
@@ -486,11 +490,24 @@
\fi\fi
\fi}
+% \def\page_one_place_float_here_indeed
+% {\ifgridsnapping
+% % otherwise real bad outcome
+% \else
+% \baselinecorrection % this has to be done better (and definitely not in column mode)
+% \fi
+% \doplacefloatbox
+% \page_floats_report_total
+% \dohandlenextfloatindent}
+
\def\page_one_place_float_here_indeed
{\ifgridsnapping
% otherwise real bad outcome
\else
- \baselinecorrection % this has to be done better (and definitely not in column mode)
+ % this was not really applied (delayed)
+ % \baselinecorrection % this has to be done better (and definitely not in column mode)
+ % so we now use this:
+ \checkprevdepth
\fi
\doplacefloatbox
\page_floats_report_total
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-otr.lua b/Master/texmf-dist/tex/context/base/mkiv/page-otr.lua
index 30715868426..c87f419b4ff 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-otr.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-otr.lua
@@ -7,6 +7,6 @@ if not modules then modules = { } end modules ['page-otr'] = {
}
interfaces.implement {
- name = "triggerpagebuilder",
- actions = tex.triggerbuildpage,
+ name = "triggerpagebuilder",
+ actions = tex.triggerbuildpage,
}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-otr.mkvi b/Master/texmf-dist/tex/context/base/mkiv/page-otr.mkvi
index 6feb15a9d61..0627612610f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-otr.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-otr.mkvi
@@ -25,8 +25,6 @@
\let\triggerpagebuilder\clf_triggerpagebuilder
-\def\m!otr{otr} % todo
-
\installcorenamespace{outputroutine}
\installswitchcommandhandler \??outputroutine {outputroutine} \??outputroutine
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-pcl.mkiv b/Master/texmf-dist/tex/context/base/mkiv/page-pcl.mkiv
index 09368c53746..43ba4feb326 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-pcl.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-pcl.mkiv
@@ -173,8 +173,7 @@
\scratchoffset\ht\b_page_one_contents
\fi
\setbox\b_page_one_bottom_notes\hpack
- {\checksinglecolumnfootnotes % ?
- \hsize\d_page_col_column_width
+ {\hsize\d_page_col_column_width
\setupnotes[\c!width=\textwidth]%
\lower\scratchoffset\vbox{\placebottomnotes\par\kern\zeropoint}}%
\ht\b_page_one_contents \zeropoint
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-run.lua b/Master/texmf-dist/tex/context/base/mkiv/page-run.lua
index cb8cf03117f..7ad9c8d9fe0 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-run.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-run.lua
@@ -186,38 +186,4 @@ function commands.showlayout(options)
end
-local report = logs.reporter("usage")
-
-function commands.showusage()
- report("")
- report("status after shipping out page %s",tex.getcount("realpageno"))
- report("")
- report(" filename : %s", status.filename)
- report(" inputid : %s", status.inputid)
- report(" linenumber : %s", status.linenumber)
- report(" input pointer : %s", status.input_ptr)
- report("")
- report(" string pointer : %s of %s", status.str_ptr, status.max_strings + status.init_str_ptr)
- report(" pool size : %s", status.pool_size)
- report("")
- report(" node memory usage : %s of %s", status.var_used, status.var_mem_max)
- report(" token memory usage : %s of %s", status.dyn_used, status.fix_mem_max)
- report("")
- report(" cs count : %s of %s", status.cs_count, status.hash_size + status.hash_extra)
- report("")
- report(" stack size : %s of %s", status.max_in_stack, status.stack_size)
- report(" nest size : %s of %s", status.max_nest_stack, status.nest_size)
- report(" parameter size : %s of %s", status.max_param_stack, status.param_size)
- report(" buffer size : %s of %s", status.max_buf_stack, status.buf_size)
- report(" save size : %s of %s", status.max_save_stack, status.save_size)
- report("")
- report(" luabytecode bytes : %s in %s registers", status.luabytecode_bytes, status.luabytecodes)
- report(" luastate bytes : %s of %s", status.luastate_bytes, status.luastate_bytes_max or "unknown")
- report("")
- report(" callbacks : %s", status.callbacks)
- report(" indirect callbacks : %s", status.indirect_callbacks)
- report(" saved callbacks : %s", status.saved_callbacks)
- report(" direct callbacks : %s", status.direct_callbacks)
- report(" function callbacks : %s", status.function_callbacks)
- report("")
-end
+commands.showusage = statistics.showusage
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-run.mkiv b/Master/texmf-dist/tex/context/base/mkiv/page-run.mkiv
index d3efe169816..fc46d8236fb 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-run.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-run.mkiv
@@ -215,10 +215,4 @@
\global\setbox#1\vpack{\noindent\backgroundline[layout:mix]{\box#1}}%
\endgroup}
-%D The next command shows some statistics (we might add more in due time):
-
-\unexpanded\gdef\showusage
- {\gtoksapp\everyaftershipout{\ctxcommand{showusage()}}%
- \glet\showusage\relax}
-
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-spr.mkiv b/Master/texmf-dist/tex/context/base/mkiv/page-spr.mkiv
index bb95ee467b1..2d9e488f558 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-spr.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-spr.mkiv
@@ -121,8 +121,8 @@
\unexpanded\def\page_spread_stop_yes
{\kern\zeropoint
\page
- \setuplayout[\c!textwidth=\textwidth]
- \page[\v!left]
+ \setuplayout[\c!textwidth=\textwidth]%
+ \page[\v!left]%
\egroup}
\unexpanded\def\page_spread_start_nop
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-txt.mklx b/Master/texmf-dist/tex/context/base/mkiv/page-txt.mklx
deleted file mode 100644
index b8184e44367..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/page-txt.mklx
+++ /dev/null
@@ -1,969 +0,0 @@
-% macros=mkvi
-
-%D \module
-%D [ file=page-txt, % copied from main-001,
-%D version=1997.03.31,
-%D title=\CONTEXT\ Page Macros,
-%D subtitle=Texts,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Page Macros / Texts}
-
-\unprotect
-
-\newtoks\toptextcontent \newtoks\leftedgetextcontent
-\newtoks\headertextcontent \newtoks\leftmargintextcontent
-\newtoks\footertextcontent \newtoks\rightmargintextcontent
-\newtoks\bottomtextcontent \newtoks\rightedgetextcontent
-
-\newtoks\texttextcontent
-
-%D \macros
-%D {setuptop, setupheader, setuptext,setupfooter, setupbottom}
-%D
-%D The macros in this module sometimes look a bit more complicated than needed,
-%D which is a direct result of the fact that their ancestors are quite old and
-%D upward compatibility is a must.
-%D
-%D \showsetup{setuptop}
-%D \showsetup{setupheader}
-%D \showsetup{setuptext}
-%D \showsetup{setupfooter}
-%D \showsetup{setupbottom}
-
-\installcorenamespace{layouttexts}
-\installcorenamespace{layouttextsline}
-\installcorenamespace{layouttextsreset}
-\installcorenamespace{layouttextssynchronize}
-\installcorenamespace{layouttextstrut}
-\installcorenamespace{layouttextspecial}
-\installcorenamespace{layouttextcontent}
-
-\installcommandhandler \??layouttexts {layoutelement} \??layouttexts
-
-% \appendtoks
-% \resetlayoutelementparameter\c!lefttext % resolves better
-% \resetlayoutelementparameter\c!middletext
-% \resetlayoutelementparameter\c!righttext
-% \to \everydefinelayoutelement
-
-\definelayoutelement[\v!top ]
-\definelayoutelement[\v!header]
-\definelayoutelement[\v!text ]
-\definelayoutelement[\v!footer]
-\definelayoutelement[\v!bottom]
-
-\definelayoutelement[\v!top :\v!text] [\v!top ][\c!lefttext=,\c!middletext=,\c!righttext=]
-\definelayoutelement[\v!header:\v!text] [\v!header][\c!lefttext=,\c!middletext=,\c!righttext=]
-\definelayoutelement[\v!text :\v!text] [\v!text ][\c!lefttext=,\c!middletext=,\c!righttext=]
-\definelayoutelement[\v!footer:\v!text] [\v!footer][\c!lefttext=,\c!middletext=,\c!righttext=]
-\definelayoutelement[\v!bottom:\v!text] [\v!bottom][\c!lefttext=,\c!middletext=,\c!righttext=]
-
-\definelayoutelement[\v!top :\v!margin][\v!top ][\c!lefttext=,\c!middletext=,\c!righttext=]
-\definelayoutelement[\v!header:\v!margin][\v!header][\c!lefttext=,\c!middletext=,\c!righttext=]
-\definelayoutelement[\v!text :\v!margin][\v!text ][\c!lefttext=,\c!middletext=,\c!righttext=]
-\definelayoutelement[\v!footer:\v!margin][\v!footer][\c!lefttext=,\c!middletext=,\c!righttext=]
-\definelayoutelement[\v!bottom:\v!margin][\v!bottom][\c!lefttext=,\c!middletext=,\c!righttext=]
-
-\definelayoutelement[\v!top :\v!edge] [\v!top ][\c!lefttext=,\c!middletext=,\c!righttext=]
-\definelayoutelement[\v!header:\v!edge] [\v!header][\c!lefttext=,\c!middletext=,\c!righttext=]
-\definelayoutelement[\v!text :\v!edge] [\v!text ][\c!lefttext=,\c!middletext=,\c!righttext=]
-\definelayoutelement[\v!footer:\v!edge] [\v!footer][\c!lefttext=,\c!middletext=,\c!righttext=]
-\definelayoutelement[\v!bottom:\v!edge] [\v!bottom][\c!lefttext=,\c!middletext=,\c!righttext=]
-
-\unexpanded\def\setuplayouttext
- {\dotripleempty\page_layouts_setup_text}
-
-\def\page_layouts_setup_text[#vertical][#horizontal][#settings]%
- {\ifthirdargument
- \setuplayoutelement[#vertical:#horizontal][#settings]%
- \else
- \setuplayoutelement[#vertical][#horizontal]%
- \fi}
-
-\appendtoks
- \ifx\currentlayoutelement\empty\else
- \page_layouts_synchronize_element\currentlayoutelement % brr, can be vertical:horizontal
- \fi
-\to \everysetuplayoutelement
-
-\def\page_layouts_reset_element_status#vertical%
- {\expandafter\normalgdef\csname\??layouttextsreset#vertical\endcsname{\page_layouts_set_element_status_normal#vertical}}
-
-\def\page_layouts_set_element_status_normal#vertical%
- {\expandafter\glet\csname\namedlayoutelementhash#vertical\c!state\endcsname\v!normal
- \expandafter\glet\csname\??layouttextsreset#vertical\endcsname\relax
- \page_layouts_synchronize_element{#vertical}}
-
-\def\page_layouts_synchronize_element#vertical%
- {\xdef\previoustextstate{\csname\??layouttextssynchronize#vertical\endcsname}% can be a let
- \edef\currenttextstate {\namedlayoutelementparameter{#vertical}\c!state}%
- %\writestatus{>>}{[#vertical:\currenttextstate/\previoustextstate]}%
- \ifx\currenttextstate\previoustextstate \else
- \page_layouts_synchronize_element_indeed{#vertical}%
- \fi}
-
-\def\page_layouts_synchronize_element_indeed#vertical%
- {\ifx\currenttextstate \v!high \calculatevsizes\page_backgrounds_recalculate \orelse
- \ifx\previoustextstate\v!high \calculatevsizes\page_backgrounds_recalculate \orelse
- \ifx\currenttextstate \v!none \calculatevsizes\page_backgrounds_recalculate \orelse
- \ifx\previoustextstate\v!none \calculatevsizes\page_backgrounds_recalculate \fi
- \letgvalue{\??layouttextssynchronize#vertical}\currenttextstate}
-
-\unexpanded\def\setuptop {\dotripleempty\page_layouts_setup_text[\v!top ]}
-\unexpanded\def\setupheader{\dotripleempty\page_layouts_setup_text[\v!header]}
-\unexpanded\def\setuptext {\dotripleempty\page_layouts_setup_text[\v!text ]}
-\unexpanded\def\setupfooter{\dotripleempty\page_layouts_setup_text[\v!footer]}
-\unexpanded\def\setupbottom{\dotripleempty\page_layouts_setup_text[\v!bottom]}
-
-%D We inherit some settings:
-
-\setuplayoutelement
- [ \c!leftstyle=\layoutelementparameter\c!style,
- \c!middlestyle=\layoutelementparameter\c!style,
- \c!rightstyle=\layoutelementparameter\c!style,
- \c!leftcolor=\layoutelementparameter\c!color,
- \c!middlecolor=\layoutelementparameter\c!color,
- \c!rightcolor=\layoutelementparameter\c!color,
- \c!leftwidth=\layoutelementparameter\c!width,
- \c!middlewidth=\layoutelementparameter\c!width,
- \c!rightwidth=\layoutelementparameter\c!width]
-
-%D \macros
-%D {noheaderandfooterlines,notopandbottomlines}
-%D
-%D Although not really needed, the following shortcuts sometimes come in handy.
-%D
-%D \showsetup{noheaderandfooterlines}
-%D \showsetup{notopandbottomlines}
-
-\unexpanded\def\noheaderandfooterlines
- {\setuplayoutelement[\v!header][\c!state=\v!empty]%
- \setuplayoutelement[\v!footer][\c!state=\v!empty]}
-
-\unexpanded\def\notopandbottomlines
- {\setuplayoutelement[\v!top ][\c!state=\v!empty]%
- \setuplayoutelement[\v!bottom][\c!state=\v!empty]}
-
-%D \macros
-%D {setuptoptexts,setupheadertexts,setuptexttexts,setupfootertexts,setupbottomtexts}
-%D
-%D The next macros take one or more arguments. The exact setup depends on the number
-%D of arguments. Although not that intuitive, the current scheme evolved out of the
-%D original. When margin and edge texts as well as middle texts showed up, the
-%D current odd|/|even scheme surfaced.
-%D
-%D \showsetup{setuptoptexts}
-%D \showsetup{setupheadertexts}
-%D \showsetup{setuptexttexts}
-%D \showsetup{setupfootertexts}
-%D \showsetup{setupbottomtexts}
-%D
-%D Only the following have checking for pagenumber, date and mark built in, so when
-%D someone uses the key|/|value interface these things have to be set explicitly as
-%D part of the text.
-
-\unexpanded\def\setuptoptexts {\dosixtupleempty\page_layouts_setup_texts[\v!top ]}
-\unexpanded\def\setupheadertexts{\dosixtupleempty\page_layouts_setup_texts[\v!header]}
-\unexpanded\def\setuptexttexts {\dosixtupleempty\page_layouts_setup_texts[\v!text ]}
-\unexpanded\def\setupfootertexts{\dosixtupleempty\page_layouts_setup_texts[\v!footer]}
-\unexpanded\def\setupbottomtexts{\dosixtupleempty\page_layouts_setup_texts[\v!bottom]}
-
-\unexpanded\def\page_layouts_setup_text_six[#vertical][#horizontal][#a][#b][#c][#d]%
- {\edef\currentlayoutelement{#vertical:#horizontal}%
- \setlayoutelementparameter\c!lefttext {\page_layouts_process_element_double{#a}{#d}}%
- \setlayoutelementparameter\c!righttext{\page_layouts_process_element_double{#b}{#c}}}
-
-\unexpanded\def\page_layouts_setup_text_five[#vertical][#horizontal][#a][#b][#c][#d]%
- {\edef\currentlayoutelement{#vertical:\v!text}%
- \setlayoutelementparameter\c!lefttext {\page_layouts_process_element_double{#horizontal}{#c}}%
- \setlayoutelementparameter\c!righttext{\page_layouts_process_element_double{#a}{#b}}}
-
-\unexpanded\def\page_layouts_setup_text_four[#vertical][#horizontal][#a][#b][#c][#d]%
- {\edef\currentlayoutelement{#vertical:#horizontal}%
- \setlayoutelementparameter\c!lefttext {\page_layouts_process_element_single{#a}}%
- \setlayoutelementparameter\c!righttext{\page_layouts_process_element_single{#b}}}
-
-\unexpanded\def\page_layouts_setup_text_three[#vertical][#horizontal][#a][#b][#c][#d]%
- {\edef\currentlayoutelement{#vertical:\v!text}%
- \setlayoutelementparameter\c!lefttext {\page_layouts_process_element_single{#horizontal}}%
- \setlayoutelementparameter\c!righttext{\page_layouts_process_element_single{#a}}}
-
-\unexpanded\def\page_layouts_setup_text_two[#vertical][#horizontal][#a][#b][#c][#d]%
- {\edef\currentlayoutelement{#vertical:\v!text}%
- \resetlayoutelementparameter\c!lefttext
- \resetlayoutelementparameter\c!righttext
- \setlayoutelementparameter \c!middletext{\page_layouts_process_element_single{#horizontal}}}
-
-\unexpanded\def\page_layouts_setup_text_one[#vertical][#horizontal][#a][#b][#c][#d]%
- {\edef\currentlayoutelement{#vertical:\v!text}%
- \resetlayoutelementparameter\c!lefttext
- \resetlayoutelementparameter\c!righttext
- \resetlayoutelementparameter\c!middletext
- \edef\currentlayoutelement{#vertical:\v!margin}%
- \resetlayoutelementparameter\c!lefttext
- \resetlayoutelementparameter\c!righttext
- \resetlayoutelementparameter\c!middletext
- \edef\currentlayoutelement{#vertical:\v!edge}%
- \resetlayoutelementparameter\c!lefttext
- \resetlayoutelementparameter\c!righttext
- \resetlayoutelementparameter\c!middletext}
-
-\unexpanded\def\page_layouts_setup_texts
- {\ifsixthargument \expandafter\page_layouts_setup_text_six \orelse
- \iffifthargument \expandafter\page_layouts_setup_text_five \orelse
- \iffourthargument\expandafter\page_layouts_setup_text_four \orelse
- \ifthirdargument \expandafter\page_layouts_setup_text_three\orelse
- \ifsecondargument\expandafter\page_layouts_setup_text_two \else
- \expandafter\page_layouts_setup_text_one \fi}
-
-%D Left and right texts are swapped on odd and even pages, but only when double
-%D sided typesetting is enabled.
-
-\setvalue{\??layouttextstrut\v!yes}{\setstrut\strut} % maybe more variants
-
-\let\m_page_layouts_element_content\empty
-
-\unexpanded\def\page_layouts_process_element_single#content%
- {\edef\m_page_layouts_element_content{\detokenize{#content}}% so no \v!xxx
- \ifcsname\??layouttextspecial\m_page_layouts_element_content\endcsname
- \lastnamedcs
- \else
- \doifelsemarking\m_page_layouts_element_content
- {\getmarking[\m_page_layouts_element_content][\v!first]}%
- {#content}%
- \fi}
-
-\unexpanded\def\page_layouts_process_element_double#first#second%
- {\doifelseoddpage
- {\page_layouts_process_element_single{#first}}
- {\page_layouts_process_element_single{#second}}}
-
-\unexpanded\def\page_layouts_process_element_indeed#style#color#width%
- {\begingroup
- \uselayoutelementstyleandcolor#style#color%
- \begincsname\??layouttextstrut\layoutelementparameter\c!strut\endcsname
- \ignorecrlf
- \edef\currentlayoutelementwidth{\layoutelementparameter#width}%
- \ifx\currentlayoutelementwidth\empty\else
- \expandafter\page_layouts_process_element_limited
- \fi\p_text
- \endgroup}
-
-\def\page_layouts_process_element_limited#content% are the {}{}{} still needed?
-% {\limitatetext{#content{}{}{}}\currentlayoutelementwidth\unknown}
- {\limitated
- left \currentlayoutelementwidth
- text {#content}
- sentinel {\unknown}
- \relax}
-
-\setvalue{\??layouttextspecial\v!pagenumber}{\page_layouts_place_page_number}
-\setvalue{\??layouttextspecial\v!date }{\currentdate}
-
-%D When specified, the texts are automatically limited in length.
-
-\appendtoks \page_layouts_place_text_line\v!top \topheight \to \toptextcontent
-\appendtoks \page_layouts_place_text_line\v!header\headerheight \to \headertextcontent
-\appendtoks \page_layouts_place_text_line\v!text \textheight \to \texttextcontent
-\appendtoks \page_layouts_place_text_line\v!footer\footerheight \to \footertextcontent
-\appendtoks \page_layouts_place_text_line\v!bottom\bottomheight \to \bottomtextcontent
-
-%D Texts can be disabled, moved up and ignored, depending in the \type {status}
-%D variable. This is handled by the next couple of macros.
-
-\newcount\c_page_layouts_element_state_n
-
-\def\page_layouts_set_element_status#vertical%
- {\c_page_layouts_element_state_n=0\namedlayoutelementparameter#vertical\c!n\relax
- \ifcase\c_page_layouts_element_state_n
- \edef\textlinestatus{\namedlayoutelementparameter#vertical\c!state}%
- \else
- \setxvalue{\namedlayoutelementhash#vertical\c!n}{\the\numexpr\c_page_layouts_element_state_n+\minusone}%
- \let\textlinestatus\v!stop
- \fi}
-
-\appendtoks
- \doifinset\v!header\floatspecification{\setxvalue{\namedlayoutelementhash\v!header\c!n}{1}}%
- \doifinset\v!footer\floatspecification{\setxvalue{\namedlayoutelementhash\v!footer\c!n}{1}}%
-\to \everybeforeflushedpagefloat
-
-\unexpanded\def\page_layouts_place_text_line#vertical%
- {\page_layouts_set_element_status#vertical\relax
- \ifcsname\??layouttextsline\textlinestatus\endcsname
- \expandafter\lastnamedcs
- \else
- \expandafter\page_layouts_place_text_line_unknown
- \fi#vertical}
-
-\unexpanded\def\doifelselayouttextline#vertical% shown or not
- {\edef\currentlayoutelementstate{\namedlayoutelementparameter{#vertical}\c!state}%
- \ifx\currentlayoutelementstate\v!normal
- \expandafter\firstoftwoarguments
- \orelse\ifx\currentlayoutelementstate\v!start
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\unexpanded\def\doifelselayoutsomeline#vertical% present or not
- {\edef\currentlayoutelementstate{\namedlayoutelementparameter{#vertical}\c!state}%
- \ifx\currentlayoutelementstate\v!none
- \expandafter\secondoftwoarguments
- \orelse\ifx\currentlayoutelementstate\v!high
- \expandafter\secondoftwoarguments
- \else
- \expandafter\firstoftwoarguments
- \fi}
-
-\let\doiflayouttextlineelse\doifelselayouttextline
-\let\doiflayoutsomelineelse\doifelselayoutsomeline
-
-\newconditional\resyncaftertextline
-
-\setvalue{\??layouttextsline\v!normal}{\page_layouts_place_text_line_indeed}
-\setvalue{\??layouttextsline\empty }{\page_layouts_place_text_line_indeed}
-
-\letvalue{\??layouttextsline\v!none}\gobbletwoarguments
-\letvalue{\??layouttextsline\v!stop}\gobbletwoarguments
-
-\setvalue{\??layouttextsline\v!high}#vertical#height%
- {\global\settrue\resyncaftertextline
- \page_layouts_reset_element_status#vertical}
-
-\setvalue{\??layouttextsline\v!empty}#vertical#height%
- {\page_layouts_reset_element_status#vertical}
-
-\setvalue{\??layouttextsline\v!start}#vertical#height%
- {\page_layouts_reset_element_status#vertical%
- \page_layouts_place_text_line_indeed#vertical#height}
-
-\setvalue{\??layouttextsline\v!nomarking}#vertical#height%
- {\bgroup
- \page_layouts_reset_element_status#vertical%
- \settrue\inhibitgetmarking
- \page_layouts_place_text_line_indeed#vertical#height%
- \egroup}
-
-% \setupheadertexts [11]
-% \definetext [title] [header] [aa]
-% \setupheadertexts [11] [22]
-% \definetext [title] [header] [aa] [bb]
-% \setupheadertexts [text] [11] [22]
-% \definetext [title] [header] [text] [aa] [bb]
-% \setupheadertexts [11] [22] [33] [44]
-% \definetext [title] [header] [aa] [bb] [cc] [dd]
-% \setupheadertexts [text] [11] [22] [33] [44]
-% \definetext [title] [header] [text] [aa] [bb] [cc] [dd]
-
-\def\page_layouts_place_text_line_unknown#vertical#height%
- {\global\settrue\resyncaftertextline
- \begingroup % new
- \page_layouts_reset_element_status#vertical%
- \begincsname\namedlayoutelementhash{#vertical}\textlinestatus\endcsname
- \begincsname\namedlayoutelementhash{#vertical:\v!text}\textlinestatus\endcsname
- \begincsname\namedlayoutelementhash{#vertical:\v!margin}\textlinestatus\endcsname
- \begincsname\namedlayoutelementhash{#vertical:\v!edge}\textlinestatus\endcsname
- \page_layouts_place_text_line_indeed#vertical#height%
- \endgroup}
-
-\letvalue{\??layouttextsline\s!unknown}\page_layouts_place_text_line_unknown
-
-%D The following macro has to be called after a page is flushed.
-
-\unexpanded\def\resetlayouttextlines % public
- {\begincsname\??layouttextsreset\v!top \endcsname
- \begincsname\??layouttextsreset\v!header\endcsname
- \begincsname\??layouttextsreset\v!text \endcsname
- \begincsname\??layouttextsreset\v!footer\endcsname
- \begincsname\??layouttextsreset\v!bottom\endcsname
- \ifconditional\resyncaftertextline
- \calculateglobalvsizes
- \page_backgrounds_recalculate
- \global\setfalse\resyncaftertextline
- \fi}
-
-\def\getspecificlayouttext#vertical#horizontal#what%
- {\begincsname\namedlayoutelementhash{#vertical:#horizontal}#what\endcsname}
-
-% \settext[header][text][middle][xxx][yyy]
-
-\unexpanded\def\settextcontent
- {\doquintupleempty\page_layouts_set_text_content}
-
-\def\page_layouts_set_text_content[#vertical][#horizontal][#one][#two][#three]% header text middle text/text
- {\iffifthargument
- \setvalue{\namedlayoutelementhash{#vertical:#horizontal}\begincsname\??layouttextcontent\v!text:#one\endcsname\c!middletext}%
- {\page_layouts_process_element_double{#two}{#three}}%
- \orelse\iffourthargument
- \setvalue{\namedlayoutelementhash{#vertical:#horizontal}\begincsname\??layouttextcontent\v!text:#one\endcsname\c!middletext}%
- {\page_layouts_process_element_double{#two}{#two}}%
- \orelse\ifthirdargument
- \setvalue{\namedlayoutelementhash{#vertical:#horizontal}\c!middletext}%
- {\page_layouts_process_element_double{#one}{#one}}%
- \fi}
-
-\let\currentlayoutelement\relax
-
-\unexpanded\def\resettextcontent
- {\dotripleempty\page_layouts_reset_text_content}
-
-\def\page_layouts_reset_text_content[#vertical][#horizontal][#tag]% header text middle
- {\edef\currentlayoutelement{#vertical:#horizontal}%
- \ifthirdargument
- \letvalueempty{\layoutelementhash\begincsname\??layouttextcontent\v!text:#tag\endcsname\c!middletext}%
- \orelse\ifsecondargument
- \resetlayoutelementparameter\c!lefttext
- \resetlayoutelementparameter\c!middletext
- \resetlayoutelementparameter\c!righttext
- \fi}
-
-\letvalue{\??layouttextcontent\v!text:\c!middle}\c!middletext
-\letvalue{\??layouttextcontent\v!text:\c!left }\c!lefttext
-\letvalue{\??layouttextcontent\v!text:\c!right }\c!righttext
-
-%D The placement of a whole line is handled by the next two macros. These are hooked
-%D into the general purpose token list registers mentioned before.
-
-\let\currentlayouttextline\relax
-
-\def\page_layouts_place_text_line_indeed#vertical#height%
- {\let\currentlayouttextline#vertical%
- \ifdim#height>\zeropoint\relax % prevents pagenumbers when zero height
- \page_layouts_place_text_line_left_or_right{#height}%
- \fi}
-
-\def\page_layouts_place_text_line_left_or_right#height%
- {\goleftonpage
- \setbox\b_page_layouts_element\vbox to #height
- {\vsize#height\relax
- %\hsize\zeropoint % hack so that e.g. after=\hairline gives predictable results
- \hsize\totaltextwidth
- \normalbaselines
- \let\\\ignoredlinebreak
- \let\crlf\ignoredlinebreak
- \namedlayoutelementparameter\currentlayouttextline\c!before
- \doifbothsidesoverruled
- \page_layouts_place_text_line_right
- \page_layouts_place_text_line_right
- \page_layouts_place_text_line_left
- \namedlayoutelementparameter\currentlayouttextline\c!after
- \vkern\zeropoint}% keep the \dp, beware of \vtops, never change this!
- \dp\b_page_layouts_element\zeropoint
- \box\b_page_layouts_element
- \vkern-#height\relax}
-
-\let\page_layouts_place_extra_text_left \empty % historic
-\let\page_layouts_place_extra_text_right\empty % historic
-
-\def\page_layouts_place_text_line_right
- {\hpack
- {\ifdim\leftedgewidth>\zeropoint
- \page_layouts_left_edge_element\c!lefttext\c!leftstyle\c!leftcolor\c!leftwidth
- \fi
- \ifdim\leftmarginwidth>\zeropoint
- \page_layouts_left_margin_element\c!lefttext\c!leftstyle\c!leftcolor\c!leftwidth\zerocount
- \fi
- \ifdim\makeupwidth>\zeropoint
- \page_layouts_text_body_element_l_m_r_e
- \fi
- \ifdim\rightmarginwidth>\zeropoint
- \page_layouts_right_margin_element\c!righttext\c!rightstyle\c!rightcolor\c!rightwidth\plusone
- \fi
- \ifdim\rightedgewidth>\zeropoint
- \page_layouts_right_edge_element\c!righttext\c!rightstyle\c!rightcolor\c!rightwidth
- \fi}}
-
-\def\page_layouts_place_text_line_left
- {\hpack
- {\ifdim\leftedgewidth>\zeropoint
- \page_layouts_left_edge_element\c!righttext\c!rightstyle\c!rightcolor\c!rightwidth
- \fi
- \ifdim\leftmarginwidth>\zeropoint
- \page_layouts_left_margin_element\c!righttext\c!rightstyle\c!rightcolor\c!rightwidth\zerocount
- \fi
- \ifdim\makeupwidth>\zeropoint
- \page_layouts_text_body_element_e_r_m_l
- \fi
- \ifdim\rightmarginwidth>\zeropoint
- \page_layouts_right_margin_element\c!lefttext\c!leftstyle\c!leftcolor\c!leftwidth\plusone
- \fi
- \ifdim\rightedgewidth>\zeropoint
- \page_layouts_right_edge_element\c!lefttext\c!leftstyle\c!leftcolor\c!leftwidth
- \fi}}
-
-\def\page_layouts_left_edge_element_indeed#text#style#color#width%
- {\letfromlayoutelementparameter\p_text#text%
- \ifx\p_text\empty
- \kern\leftedgewidth
- \else
- \hbox to \leftedgewidth\bgroup
- \hss
- \page_layouts_process_element_indeed#style#color#width%
- \egroup
- \fi}
-
-\def\page_layouts_left_edge_element#text#style#color#width%
- {\edef\currentlayoutelement{\currentlayouttextline:\v!edge}%
- \page_layouts_place_element_indeed\leftedgewidth
- {\page_layouts_left_edge_element_indeed#text#style#color#width}%
- \kern\leftedgedistance}
-
-\def\page_layouts_right_edge_element_indeed#text#style#color#width%
- {\letfromlayoutelementparameter\p_text#text%
- \ifx\p_text\empty
- \kern\rightedgewidth
- \else
- \hbox to \rightedgewidth\bgroup
- \page_layouts_process_element_indeed#style#color#width%
- \hss
- \egroup
- \fi}
-
-\def\page_layouts_right_edge_element#text#style#color#width%
- {\edef\currentlayoutelement{\currentlayouttextline:\v!edge}%
- \kern\rightedgedistance
- \page_layouts_place_element_indeed\rightedgewidth
- {\page_layouts_right_edge_element_indeed#text#style#color#width}}
-
-% margin needs checking!
-
-\def\page_layouts_left_margin_element_indeed#text#style#color#width#margintoo%
- {\letfromlayoutelementparameter\p_text#text%
- \ifx\p_text\empty
- \kern\leftmarginwidth
- \else
- \hbox to \leftmarginwidth\bgroup
- \hss
- \page_layouts_process_element_indeed#style#color#width%
- \egroup
- \fi
- \ifcase#margintoo\or
- \letfromlayoutelementparameter\p_text\c!margintext
- \ifx\p_text\empty\else
- \kern-\leftmarginwidth
- \hbox to \leftmarginwidth\bgroup
- \hss
- \p_text % styling ?
- \egroup
- \fi
- \fi}
-
-\def\page_layouts_left_margin_element#text#style#color#width#margintoo%
- {\edef\currentlayoutelement{\currentlayouttextline:\v!margin}%
- \page_layouts_place_element_indeed\leftmarginwidth
- {\page_layouts_left_margin_element_indeed#text#style#color#width#margintoo}%
- \kern\leftmargindistance}
-
-\def\page_layouts_right_margin_element_indeed#text#style#color#width#margintoo%
- {\letfromlayoutelementparameter\p_text#text%
- \ifx\p_text\empty
- \kern\rightmarginwidth
- \else
- \hbox to \rightmarginwidth\bgroup
- \page_layouts_process_element_indeed#style#color#width%
- \hss
- \egroup
- \fi
- \ifcase#margintoo\or
- \letfromlayoutelementparameter\p_text\c!margintext
- \ifx\p_text\empty\else
- \kern-\rightmarginwidth
- \hbox to \rightmarginwidth\bgroup
- \p_text % ? styling
- \hss
- \egroup
- \fi
- \fi}
-
-\def\page_layouts_right_margin_element#text#style#color#width#margintoo%
- {\edef\currentlayoutelement{\currentlayouttextline:\v!margin}%
- \kern\rightmargindistance
- \page_layouts_place_element_indeed\rightmarginwidth
- {\page_layouts_right_margin_element_indeed#text#style#color#width#margintoo}}
-
-\def\page_layouts_text_body_element_indeed_l_m_r_e
- {\letfromlayoutelementparameter\p_text\c!lefttext
- \ifx\p_text\empty
- \ifx\page_layouts_place_extra_text_left\empty\else
- \hbox to \makeupwidth\bgroup
- \page_layouts_place_extra_text_left
- \hss
- \egroup
- \kern-\makeupwidth
- \fi
- \else
- \hbox to \makeupwidth\bgroup
- \page_layouts_place_extra_text_left
- \page_layouts_process_element_indeed\c!leftstyle\c!leftcolor\c!leftwidth
- \hss
- \egroup
- \kern-\makeupwidth
- \fi
- \letfromlayoutelementparameter\p_text\c!middletext
- \ifx\p_text\empty\else
- \hbox to \makeupwidth\bgroup
- \hss
- \page_layouts_process_element_indeed\c!middlestyle\c!middlecolor\c!middlewidth
- \hss
- \egroup
- \kern-\makeupwidth
- \fi
- \letfromlayoutelementparameter\p_text\c!righttext
- \ifx\p_text\empty
- \kern\makeupwidth
- \else
- \hbox to \makeupwidth\bgroup
- \hss
- \page_layouts_process_element_indeed\c!rightstyle\c!rightcolor\c!rightwidth
- \egroup
- \fi}
-
-\def\page_layouts_text_body_element_indeed_e_r_m_l
- {\letfromlayoutelementparameter\p_text\c!righttext
- \ifx\p_text\empty\else
- \hbox to \makeupwidth\bgroup
- \page_layouts_process_element_indeed\c!rightstyle\c!rightcolor\c!rightwidth
- \hss
- \egroup
- \kern-\makeupwidth
- \fi
- \letfromlayoutelementparameter\p_text\c!middletext
- \ifx\p_text\empty\else
- \hbox to \makeupwidth\bgroup
- \hss
- \page_layouts_process_element_indeed\c!middlestyle\c!middlecolor\c!middlewidth
- \hss
- \egroup
- \kern-\makeupwidth
- \fi
- \letfromlayoutelementparameter\p_text\c!lefttext
- \ifx\p_text\empty
- \ifx\page_layouts_place_extra_text_right\empty
- \kern\makeupwidth
- \else
- \hbox to \makeupwidth\bgroup
- \hss
- \page_layouts_place_extra_text_right
- \egroup
- \fi
- \else
- \hbox to \makeupwidth\bgroup
- \hss
- \page_layouts_process_element_indeed\c!leftstyle\c!leftcolor\c!leftwidth
- \page_layouts_place_extra_text_right
- \egroup
- \fi}
-
-\def\page_layouts_text_body_element_l_m_r_e
- {\edef\currentlayoutelement{\currentlayouttextline:\v!text}%
- \page_layouts_place_element_indeed\makeupwidth\page_layouts_text_body_element_indeed_l_m_r_e}
-
-\def\page_layouts_text_body_element_e_r_m_l
- {\edef\currentlayoutelement{\currentlayouttextline:\v!text}%
- \page_layouts_place_element_indeed\makeupwidth\page_layouts_text_body_element_indeed_e_r_m_l}
-
-\def\page_layouts_place_element_indeed#width#content%
- {\vbox % to \vsize
- {\hsize#width\relax
- \layoutelementparameter\c!before
- \setlayoutcomponentattribute\currentlayoutelement
- \hbox \layoutcomponentboxattribute to #width{#content}%
- \layoutelementparameter\c!after}}
-
-%D Although it is far better to use backgrounds for this purpose, one can add a rule
-%D in the following way. This method makes the rules disappear in case of an empty
-%D text line. Consider this a feature.
-%D
-%D \starttyping
-%D \setupheadertexts[left][right]
-%D
-%D \setupheader[text][after=\hrule,style=bold]
-%D
-%D \starttext
-%D \input tufte \page
-%D \setupheader[state=empty]
-%D \input tufte \page
-%D \stoptext
-%D \stoptyping
-
-%D This code will move to \type {page-flt.tex}.
-
-\appendtoks \placerightmarginblock \kern-\rightmarginwidth \to \rightmargintextcontent
-\appendtoks \placeleftmarginblock \kern-\leftmarginwidth \to \leftmargintextcontent
-
-%D \macros
-%D {definetext}
-%D
-%D Some macros ago, we implemented the \type {status} option \type {unknown}. This
-%D one is used to take care of symbolic texts handlers.
-%D
-%D \showsetup{definetext}
-%D
-%D The next example demonstrates how we can use this mechanism to provide page
-%D (event) dependent text lines.
-%D
-%D \starttyping
-%D \definetext[chapter][footer][pagenumber]
-%D \setuphead[chapter][header=high,footer=chapter]
-%D \setupheadertexts[pagenumber]
-%D \setupfootertexts[left][right]
-%D \chapter{eerste} \dorecurse{20}{\input tufte \relax}
-%D \chapter{tweede} \dorecurse{20}{\input tufte \relax}
-%D \stoptyping
-
-\unexpanded\def\definetext
- {\doseventupleempty\page_layouts_define_text}
-
-\def\page_layouts_define_text[#tag][#vertical][#horizontal][#a][#b][#c][#d]%
- {\ifseventhargument
- \setvalue{\namedlayoutelementhash{#vertical:#horizontal}#tag}{\page_layouts_setup_text_six [#vertical][#horizontal][#a][#b][#c][#d]}%
- \orelse\ifsixthargument
- \setvalue{\namedlayoutelementhash {#vertical}#tag}{\page_layouts_setup_text_five [#vertical][#horizontal][#a][#b][#c][]}%
- \orelse\iffifthargument
- \setvalue{\namedlayoutelementhash{#vertical:#horizontal}#tag}{\page_layouts_setup_text_four [#vertical][#horizontal][#a][#b][][]}%
- \orelse\iffourthargument
- \setvalue{\namedlayoutelementhash {#vertical}#tag}{\page_layouts_setup_text_three[#vertical][#horizontal][#a][][][]}%
- \else
- \setvalue{\namedlayoutelementhash {#vertical}#tag}{\page_layouts_setup_text_two [#vertical][#horizontal][][][][]}%
- \fi}
-
-%D A few more page breakers:
-
-\installpagebreakmethod \v!empty
- {\page_otr_flush_all_floats
- \page_otr_command_next_page
- \doifnot{\namedlayoutelementparameter\v!header\c!state}\v!stop{\setuplayoutelement[\v!header][\c!state=\v!empty]}%
- \doifnot{\namedlayoutelementparameter\v!footer\c!state}\v!stop{\setuplayoutelement[\v!footer][\c!state=\v!empty]}%
- \page_otr_insert_dummy_page}
-
-\installpagebreakmethod \v!header
- {\doifnot{\namedlayoutelementparameter\v!header\c!state}\v!stop{\setuplayoutelement[\v!header][\c!state=\v!empty]}}
-
-\installpagebreakmethod \v!footer
- {\doifnot{\namedlayoutelementparameter\v!footer\c!state}\v!stop{\setuplayoutelement[\v!footer][\c!state=\v!empty]}}
-
-%D While the header and footer lines are moved away from the main text, the top and
-%D bottom lines are centered.
-
-\setuplayoutelement[\v!top ][\c!state=\v!normal,\c!n=0,\c!before=\vss,\c!after=\vss,\c!strut=]
-\setuplayoutelement[\v!header][\c!state=\v!normal,\c!n=0,\c!before=, \c!after=\vss,\c!strut=\v!yes]
-\setuplayoutelement[\v!text ][\c!state=\v!normal,\c!n=0,\c!before=\vss,\c!after=\vss,\c!strut=]
-\setuplayoutelement[\v!footer][\c!state=\v!normal,\c!n=0,\c!before=\vss,\c!after=, \c!strut=\v!yes]
-\setuplayoutelement[\v!bottom][\c!state=\v!normal,\c!n=0,\c!before=\vss,\c!after=\vss,\c!strut=]
-
-%D Moved here from strc-pag:
-%D
-%D We reset a previous location but only when it has a pagenumber associated. This
-%D is a rather messy test but better than the MkII way where we use states and keep
-%D settings.
-
-\let\m_page_layouts_page_number_location \relax
-\let\m_page_layouts_page_number_location_v\relax
-\let\m_page_layouts_page_number_location_h\relax
-\let\m_page_layouts_page_number_location_x\relax
-
-\def\page_layouts_place_page_number % also elsewhere .. beware, not \unexpanded else
- {\strc_pagenumbers_place_location} % test below fails
-
-\def\page_layouts_reset_page_number_location
- {\ifx\m_page_layouts_page_number_location_v\relax\else
- \edef\currentlayoutelement{\m_page_layouts_page_number_location_v:\m_page_layouts_page_number_location_h}%
- \edef\page_layouts_previous_page_number_locator{\detokenizedlayoutelementparameter\m_page_layouts_page_number_location_x}%
- \doif{\meaning\page_layouts_previous_page_number_locator}{\meaning\page_layouts_place_page_number}
- {\resetlayoutelementparameter\m_page_layouts_page_number_location_x}%
- \fi}
-
-\def\page_layouts_set_page_number_location
- {\edef\currentlayoutelement{\m_page_layouts_page_number_location_v:\m_page_layouts_page_number_location_h}%
- \letlayoutelementparameter\m_page_layouts_page_number_location_x\page_layouts_place_page_number
- \ifx\m_page_layouts_page_number_location_x\c!marginedgetext
- \let\page_layouts_place_extra_text_left \page_layouts_place_page_number_left
- \let\page_layouts_place_extra_text_right\page_layouts_place_page_number_right
- \else
- \let\page_layouts_place_extra_text_left \empty
- \let\page_layouts_place_extra_text_right\empty
- \fi}
-
-\def\page_layouts_identify_page_number_location
- {\let\m_page_layouts_page_number_location_v\v!footer
- \let\m_page_layouts_page_number_location_h\v!text
- \let\m_page_layouts_page_number_location_x\c!middletext
- \processallactionsinset[\directpagenumberingparameter\c!location]
- [ \v!header=>\let\m_page_layouts_page_number_location_v\v!header,
- \v!footer=>\let\m_page_layouts_page_number_location_v\v!footer,
- \v!middle=>\let\m_page_layouts_page_number_location_h\v!text
- \let\m_page_layouts_page_number_location_x\c!middletext,
- \v!left=>\let\m_page_layouts_page_number_location_h\v!text
- \let\m_page_layouts_page_number_location_x\c!lefttext,
- \v!right=>\let\m_page_layouts_page_number_location_h\v!text
- \let\m_page_layouts_page_number_location_x\c!righttext,
- \v!inleft=>\let\m_page_layouts_page_number_location_h\v!margin
- \let\m_page_layouts_page_number_location_x\c!lefttext,
- \v!inright=>\let\m_page_layouts_page_number_location_h\v!margin
- \let\m_page_layouts_page_number_location_x\c!righttext,
- \v!inmargin=>\let\m_page_layouts_page_number_location_h\v!margin
- \def\m_page_layouts_page_number_location_x{\ifdoublesided\c!margintext\else\c!righttext\fi},
- \v!margin=>\let\m_page_layouts_page_number_location_h\v!margin
- \def\m_page_layouts_page_number_location_x{\ifdoublesided\c!margintext\else\c!righttext\fi},
- \v!atmargin=>\let\m_page_layouts_page_number_location_h\v!text
- \let\m_page_layouts_page_number_location_x\c!marginedgetext,
- \v!marginedge=>\let\m_page_layouts_page_number_location_h\v!text
- \let\m_page_layouts_page_number_location_x\c!marginedgetext]}
-
-\unexpanded\def\strc_pagenumbers_set_location
- {\edef\p_strc_pagenumbers_location{\directpagenumberingparameter\c!location}%
- \ifx\p_strc_pagenumbers_location\m_page_layouts_page_number_location
- % unchanged
- \else
- \let\m_page_layouts_page_number_location\p_strc_pagenumbers_location
- \page_layouts_reset_page_number_location
- \ifx\p_strc_pagenumbers_location\empty
- % set otherwise
- \orelse\ifx\p_strc_pagenumbers_location\v!none
- % set otherwise
- \else
- \page_layouts_identify_page_number_location
- \page_layouts_set_page_number_location
- \fi
- \fi}
-
-\def\page_layouts_place_page_number_left % historic
- {\begingroup
- \setbox\scratchbox\hbox{\ignorespaces\layoutelementparameter\c!marginedgetext\removeunwantedspaces}%
- \ifzeropt\wd\scratchbox\else
- \edef\p_strc_pagenumbers_width{\directpagenumberingparameter\c!width}%
- \ifx\p_strc_pagenumbers_width\empty
- \box\scratchbox\tfskip
- \else
- \hpack to \p_strc_pagenumbers_width{\box\scratchbox\hss}%
- \fi
- \fi
- \endgroup}
-
-\def\page_layouts_place_page_number_right % historic
- {\begingroup
- \setbox\scratchbox\hbox{\ignorespaces\layoutelementparameter\c!marginedgetext\removeunwantedspaces}%
- \ifzeropt\wd\scratchbox\else
- \edef\p_strc_pagenumbers_width{\directpagenumberingparameter\c!width}%
- \ifx\p_strc_pagenumbers_width\empty
- \tfskip\box\scratchbox
- \else
- \hpack to \p_strc_pagenumbers_width{\hss\box\scratchbox}%
- \fi
- \fi
- \endgroup}
-
-\strc_pagenumbers_set_location % initializes
-
-\newbox\b_page_layouts_element
-
-\def\page_layouts_insert_elements
- {\ifcase\pageornamentstate
- \page_layouts_place_elements_indeed % we could have a special flag for always ignored
- \fi}
-
-\def\page_layouts_place_elements_indeed
- {\setbox\b_page_layouts_element\vpack
- {\dontcomplain
- \calculatereducedvsizes
- \swapmargins
- \offinterlineskip
- \vkern\dimexpr-\topheight-\topdistance\relax
- \the\toptextcontent
- \vkern\dimexpr\topheight+\topdistance\relax
- \the\headertextcontent
- \vkern\dimexpr\headerheight+\headerdistance+\textdistance\relax
- \anch_positions_place_anchors
- \vkern\dimexpr-\textdistance-\textheight\relax
- \the\texttextcontent
- \vkern\textheight
- \the\everyendoftextbody
- \vkern\footerdistance
- \the\footertextcontent
- \vkern\dimexpr\footerheight+\bottomdistance\relax
- \the\bottomtextcontent
- \vkern\bottomheight
- \vfilll}%
- \smashbox\b_page_layouts_element
- \box\b_page_layouts_element}
-
-% \ifdefined\page_prepare_backgrounds\else
-% \let\page_prepare_backgrounds\gobbleoneargument
-% \fi
-
-% only for very special controlled cases or experiments:
-
-\let\page_scale_text_box\gobbleoneargument
-
-\def\page_insert_body#1#2%
- {\setbox\b_page_layouts_element\vpack
- {\offinterlineskip
- \calculatereducedvsizes
- \calculatehsizes
- \swapmargins
- \vkern\dimexpr\headerheight+\headerdistance+\textdistance\relax
- \dontleavehmode
- %\page_prepare_backgrounds{#2}%
- \hpack to \makeupwidth
- {\begingroup
- \swapmargins
- \goleftonpage
- \ifdim\leftedgewidth>\zeropoint
- \the\leftedgetextcontent
- \kern\dimexpr\leftedgewidth+\leftedgedistance\relax
- \fi
- \ifdim\leftmarginwidth>\zeropoint
- \the\leftmargintextcontent
- \kern\dimexpr\leftmarginwidth+\leftmargindistance\relax
- \fi
- \endgroup
- \page_apply_postprocessors_page{#2}%
- \settextpagecontent\b_page_layouts_element{#1}{#2}%
- \page_backgrounds_add_to_text\b_page_layouts_element
- \page_grids_add_to_box\b_page_layouts_element
- \page_scale_text_box\b_page_layouts_element
- \box\b_page_layouts_element
- \begingroup
- \ifdim\rightmarginwidth>\zeropoint
- \kern\rightmargindistance
- \the\rightmargintextcontent
- \kern\rightmarginwidth
- \fi
- \ifdim\rightedgewidth>\zeropoint
- \kern\rightedgedistance
- \the\rightedgetextcontent
- \kern\rightedgewidth
- \fi
- \endgroup
- \hss}}%
- \smashbox\b_page_layouts_element
- \box\b_page_layouts_element}
-
-%D The main text area has to be combined with some additional (tracing) information.
-%D
-%D This will be stored as normal and overloaded in page-lyr and later in page-spr we
-%D overload the the stored version .. evenatually i will clear up the experimental
-%D mess.
-
-\def\settextpagecontent#1#2#3% #2 and #3 will disappear / is overloaded
- {\setbox#1\hpack to \makeupwidth
- {\hss % so don't change this
- \setlayoutcomponentattribute{\v!page:\v!text}%
- \vpack \layoutcomponentboxattribute to \textheight
- {\offinterlineskip
- \freezetextwidth
- \hsize\textwidth % local variant of \sethsize <<< in columns?
- \boxmaxdepth\maxdepth
- \noindent % content can be < \hsize
- \page_otr_command_package_contents#2#3}% this will vbox
- \hss}%
- \dp#1\zeropoint}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-txt.mkvi b/Master/texmf-dist/tex/context/base/mkiv/page-txt.mkvi
index 8b021acca5d..9bc78ec9298 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-txt.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-txt.mkvi
@@ -463,10 +463,19 @@
\unexpanded\def\resettextcontent
{\dotripleempty\page_layouts_reset_text_content}
+% \def\page_layouts_reset_text_content[#vertical][#horizontal][#tag]% header text middle
+% {\edef\currentlayoutelement{#vertical:#horizontal}%
+% \ifthirdargument
+% \letvalueempty{\layoutelementhash\executeifdefined{\??layouttextcontent\v!text:#tag}\c!middletext}%
+% \else\ifsecondargument
+% \resetlayoutelementparameter\c!lefttext
+% \resetlayoutelementparameter\c!middletext
+% \resetlayoutelementparameter\c!righttext
+% \fi\fi}
+
\def\page_layouts_reset_text_content[#vertical][#horizontal][#tag]% header text middle
- {\edef\currentlayoutelement{#vertical:#horizontal}%
- \ifthirdargument
- \letvalueempty{\layoutelementhash\executeifdefined{\??layouttextcontent\v!text:#tag}\c!middletext}%
+ {\ifthirdargument
+ \letvalueempty{\namedlayoutelementhash{#vertical:#horizontal}\executeifdefined{\??layouttextcontent\v!text:#tag}\c!middletext}%
\else\ifsecondargument
\resetlayoutelementparameter\c!lefttext
\resetlayoutelementparameter\c!middletext
diff --git a/Master/texmf-dist/tex/context/base/mkiv/phys-dim.lua b/Master/texmf-dist/tex/context/base/mkiv/phys-dim.lua
index 363b4a79cc4..e0cea7babde 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/phys-dim.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/phys-dim.lua
@@ -41,7 +41,7 @@ if not modules then modules = { } end modules ['phys-dim'] = {
local rawset, next = rawset, next
local V, P, S, R, C, Cc, Cs, matchlpeg = lpeg.V, lpeg.P, lpeg.S, lpeg.R, lpeg.C, lpeg.Cc, lpeg.Cs, lpeg.match
-local format, lower = string.format, string.lower
+local format, lower, gsub = string.format, string.lower, string.gsub
local appendlpeg = lpeg.append
local utfchartabletopattern = lpeg.utfchartabletopattern
local mergetable, mergedtable, keys, loweredkeys = table.merge, table.merged, table.keys, table.loweredkeys
@@ -68,7 +68,10 @@ local math_one = Cs((P("$") /"") * (1-P("$"))^1 * (P("$")/"")) / contex
local math_two = Cs((P("\\m {")/"") * (1-P("}"))^1 * (P("}")/"")) / context.m -- watch the space after \m
local digit = R("09")
-local sign = S("+-")
+local plus = P("+")
+local minus = P("-")
+local plusminus = P("±")
+local sign = plus + minus
local power = S("^e")
local digitspace = S("~@_")
local comma = P(",")
@@ -80,8 +83,6 @@ local positive = P("++") -- was p
local negative = P("--") -- was n
local highspace = P("//") -- was s
local padding = P("=")
-local plus = P("+")
-local minus = P("-")
local space = P(" ")
local lparent = P("(")
local rparent = P(")")
@@ -111,6 +112,7 @@ local dnegative = negative / "" / context.digitsnegative
local dhighspace = highspace / "" / context.digitshighspace
local dsomesign = plus / "" / context.digitsplus
+ minus / "" / context.digitsminus
+ + plusminus / "" / context.digitsplusminus
local dpower = power / "" * ( powerdigits + lbrace * powerdigits * rbrace )
local dpadding = padding / "" / context.digitszeropadding -- todo
@@ -152,7 +154,8 @@ local c_p = (ddigitspace^1 * dskipcomma)^0 -- ___,
* (ddigitspace^0 * ddigit * dintercomma)^0 -- _00, 000,
* ddigitspace^0 * ddigit^0 -- _00 000
* (
- dfinalperiod * ddigit * (dintercomma * ddigit)^0 -- .00
+ dfinalperiod * ddigit^1 * dpadding^1 -- .0=
+ + dfinalperiod * ddigit * (dintercomma * ddigit)^0 -- .00
+ dskipperiod * dpadding^1 -- .==
+ dsemiperiod * ddigit * (dintercomma * ddigit)^0 -- :00
+ dsemiperiod * dpadding^1 -- :==
@@ -163,7 +166,8 @@ local p_c = (ddigitspace^1 * dskipperiod)^0 -- ___.
* (ddigitspace^0 * ddigit * dinterperiod)^0 -- _00. 000.
* ddigitspace^0 * ddigit^0 -- _00 000
* (
- dfinalcomma * ddigit * (dinterperiod * ddigit)^0 -- 00
+ dfinalcomma * ddigit^1 * dpadding^1 -- ,0=
+ + dfinalcomma * ddigit * (dinterperiod * ddigit)^0 -- 00
+ dskipcomma * dpadding^1 -- ,==
+ dsemicomma * ddigit * (dinterperiod * ddigit)^0 -- :00
+ dsemicomma * dpadding^1 -- :==
@@ -265,7 +269,7 @@ local long_units = {
Celsius = "celsius",
Lumen = "lumen",
Lux = "lux",
- Bequerel = "bequerel",
+ Becquerel = "becquerel",
Gray = "gray",
Sievert = "sievert",
Katal = "katal",
@@ -531,9 +535,14 @@ local ctx_unitsO = context.unitsO
local ctx_unitsN = context.unitsN
local ctx_unitsC = context.unitsC
local ctx_unitsQ = context.unitsQ
+local ctx_unitsRPM = context.unitsRPM
+local ctx_unitsRTO = context.unitsRTO
+local ctx_unitsRabout = context.unitsRabout
local ctx_unitsNstart = context.unitsNstart
local ctx_unitsNstop = context.unitsNstop
local ctx_unitsNspace = context.unitsNspace
+local ctx_unitsPopen = context.unitsPopen
+local ctx_unitsPclose = context.unitsPclose
local labels = languages.data.labels
@@ -599,7 +608,7 @@ labels.units = allocate {
celsius = { labels = { en = [[\checkedtextcelsius]] } }, -- 0x2103
lumen = { labels = { en = [[lm]] } },
lux = { labels = { en = [[lx]] } },
- bequerel = { labels = { en = [[Bq]] } },
+ becquerel = { labels = { en = [[Bq]] } },
gray = { labels = { en = [[Gy]] } },
sievert = { labels = { en = [[Sv]] } },
katal = { labels = { en = [[kat]] } },
@@ -856,35 +865,60 @@ local function update_parsers() -- todo: don't remap utf sequences
)^1,
}
+ -- todo: avoid \ctx_unitsNstart\ctx_unitsNstop (weird that it can happen .. now catched at tex end)
+ local letter = R("az","AZ")
+ local bound = #(1-letter)
-- local number = lpeg.patterns.number
-
local number = Cs( P("$") * (1-P("$"))^1 * P("$")
+ P([[\m{]]) * (1-P("}"))^1 * P("}")
- + (1-R("az","AZ")-P(" "))^1 -- todo: catch { } -- not ok
+ + (1-letter-P(" "))^1 -- todo: catch { } -- not ok
) / ctx_unitsN
- local start = Cc(nil) / ctx_unitsNstart
- local stop = Cc(nil) / ctx_unitsNstop
- local space = Cc(nil) / ctx_unitsNspace
-
- -- todo: avoid \ctx_unitsNstart\ctx_unitsNstop (weird that it can happen .. now catched at tex end)
-
- local p_c_combinedparser = P { "start",
- number = start * dleader * (p_c_dparser + number) * stop,
- rule = V("number")^-1 * unitparser,
- space = space,
- start = V("rule") * (V("space") * V("rule"))^0 + V("number")
- }
-
- local c_p_combinedparser = P { "start",
- number = start * dleader * (c_p_dparser + number) * stop,
- rule = V("number")^-1 * unitparser,
- space = space,
- start = V("rule") * (V("space") * V("rule"))^0 + V("number")
- }
+ local start = Cc(nil) / ctx_unitsNstart
+ local stop = Cc(nil) / ctx_unitsNstop
+ local space = P(" ") * Cc(nil) / ctx_unitsNspace
+ local open = P("(") * Cc(nil) / ctx_unitsPopen
+ local close = P(")") * Cc(nil) / ctx_unitsPclose
+
+ local range = somespace
+ * ( (P("±") + P("pm") * bound) / "" / ctx_unitsRPM
+ + (P("–") + P("to") * bound) / "" / ctx_unitsRTO )
+ * somespace
+
+ local about = (P("±") + P("pm") * bound) / "" / ctx_unitsRabout
+ * somespace
+
+ -- todo: start / stop
+
+ local function combine(parser)
+ return P { "start",
+ number = start * dleader * (parser + number) * stop,
+ anumber = space
+ * open
+ * V("about")^-1
+ * V("number")
+ * close,
+ rule = V("number")^-1
+ * (V("range") * V("number") + V("anumber"))^-1,
+ unit = unitparser,
+ about = about,
+ range = range,
+ space = space,
+ start = V("rule")
+ * V("unit")
+ * (V("space") * V("rule") * V("unit"))^0
+ + open
+ * V("number")
+ * (V("range") * V("number"))^-1
+ * close
+ * dtrailer^-1
+ * V("unit")
+ + V("number")
+ }
+ end
- return p_c_combinedparser, c_p_combinedparser
+ return combine(p_c_dparser), combine(c_p_dparser)
end
local p_c_parser = nil
@@ -967,3 +1001,15 @@ implement { name = "digits_reverse", actions = makedigits, arguments = { "stri
implement { name = "unit_normal", actions = makeunit, arguments = "string"}
implement { name = "unit_reverse", actions = makeunit, arguments = { "string", true } }
implement { name = "registerunit", actions = registerunit, arguments = "2 strings" }
+
+implement {
+ name = "hyphenateddigits",
+ public = true,
+ protected = true,
+ arguments = { "optional", "string" },
+ actions = function(filler, digits)
+ digits = gsub(digits,"(%d)","%1\\digitsbreak")
+ digits = gsub(digits,"\\-$",filler)
+ context(digits)
+ end
+}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/phys-dim.mkiv b/Master/texmf-dist/tex/context/base/mkiv/phys-dim.mkiv
index 1eb1f37f76b..b390ce64aef 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/phys-dim.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/phys-dim.mkiv
@@ -86,7 +86,6 @@
%D the grouped call.
%D
%D \starttabulate[|l|l|l|]
-%D \starttabulate[|l|l|l|]
%D \NC \type{.} \NC , . \NC comma or period \NC \NR
%D \NC \type{,} \NC , . \NC comma or period \NC \NR
%D \NC \type{:} \NC \NC invisible period \NC \NR
@@ -100,7 +99,6 @@
%D \NC \type{++} \NC $\positive$ \NC high plus sign \NC \NR
%D \NC \type{=} \NC $\zeroamount$ \NC zero padding \NC \NR
%D \stoptabulate
-%D \stoptabulate
%D
%D These triggers are used in the following examples.
%D
@@ -172,10 +170,10 @@
% \definesymbol[units][times][\ifmmode\cdot\else\kern.2\emwidth\cdot\kern.2\emwidth\fi]
\unexpanded\def\digitstextbinop#1% assumes preceding
- {\fourperemspace\nobreak\times\fourperemspace}
+ {\ifmmode#1\else\fourperemspace\nobreak#1\fourperemspace\fi}
%def\digitstimessymbol{\ifmmode\cdot\else\digitstextbinop\cdot\fi}
-\def\digitstimessymbol{\ifmmode\times\else\digitstextbinop\times\fi}
+\def\digitstimessymbol{\digitstextbinop\times}
\unexpanded\def\digitszeropadding {\hphantom{0}}
\unexpanded\def\digitsnegative {\phys_digits_normalized{0}{\phys_digits_raised{\textminus}}}
@@ -185,7 +183,8 @@
%unexpanded\def\digitsminus {\phys_digits_normalized{0}{\mathematics{-}}}
%unexpanded\def\digitsplus {\phys_digits_normalized{0}{\mathematics{+}}}
\unexpanded\def\digitsminus {\phys_digits_normalized{0}{\mathminus}}
-\unexpanded\def\digitsplus {\phys_digits_normalized{0}{\mathplus }}
+\unexpanded\def\digitsplus {\phys_digits_normalized{0}{\mathplus}}
+\unexpanded\def\digitsplusminus {\phys_digits_normalized{0}{\mathplusminus}}
\unexpanded\def\digitsspace {\hphantom{0}}
\unexpanded\def\digitsseparatorspace{\hphantom{.}}
\unexpanded\def\digitssignspace {\hphantom{\digitsminus}}
@@ -522,6 +521,9 @@
{\edef\p_order{\unitparameter\c!order}%
\ifx\p_order\v!reverse\expandafter\clf_unit_reverse\else\expandafter\clf_unit_normal\fi{\detokenize{#1}}}
+\unexpanded\def\digitstextbinnop#1%
+ {\ifmmode#1\else#1\fourperemspace\fi}
+
\unexpanded\def\unitsPUS#1#2#3{\phys_units_next\prefixtext{#1}\unittext{#2}\unitsraise{\suffixtext{#3}}\c_phys_units_state\plusone} % suffix
\unexpanded\def\unitsPU #1#2{\phys_units_next\prefixtext{#1}\unittext{#2}\c_phys_units_state\plusthree} % unit
\unexpanded\def\unitsPS #1#2{\phys_units_next\prefixtext{#1}\unitsraise{\suffixtext{#2}}\c_phys_units_state\plusone} % suffix
@@ -531,8 +533,28 @@
\unexpanded\def\unitsS #1{\phys_units_start{}\unitsraise{\suffixtext{#1}}\c_phys_units_state\plusone} % suffix
\unexpanded\def\unitsO #1{\phys_units_start\operatortext{#1}\c_phys_units_state\plustwo} % operator
\unexpanded\def\unitsN #1{\phys_units_start#1\c_phys_units_state\plusfive} % number
-\unexpanded\def\unitsC #1{\removeunwantedspaces\unittext{#1}\c_phys_units_state\plussix} % connected
-\unexpanded\def\unitsQ #1{\removeunwantedspaces\unitslower{#1}\c_phys_units_state\zerocount} %
+\unexpanded\def\unitsC #1{\removeunwantedspaces\unittext{#1}\c_phys_units_state\plussix} % connected
+\unexpanded\def\unitsQ #1{\removeunwantedspaces\unitslower{#1}\c_phys_units_state\zerocount}
+\unexpanded\def\unitsR #1#2{% todo: tagging
+ \ifmmode
+ #2%
+ \else\ifnum#1=\plusone
+ \digitstextbinop{#2}% before and after
+ \else
+ \digitstextbinnop{#2}% after
+ \fi\fi
+ \c_phys_units_state\zerocount
+ \setfalse\c_phys_units_dospace
+ \setfalse\c_phys_units_number
+ \setfalse\c_phys_units_quantity}
+
+\unexpanded\def\unitsRPM {\unitsR\plusone {±}} % todo: symbols
+\unexpanded\def\unitsRTO {\unitsR\plusone {–}} % todo: symbols
+\unexpanded\def\unitsRabout {\unitsR\zerocount{±}} % todo: symbols
+\unexpanded\def\unitsPopen {(}
+\unexpanded\def\unitsPclose {)}
+
+\unexpanded\def\unitrange#1{}
% Fonts can have a celsius and lack a fahrenheit symbol and as we want
% to be consistent so we check for the counterparts as well. It's slow
@@ -610,7 +632,7 @@
\def\phys_units_start
{\ifmmode
- \dostarttagged\t!mathaction\t!unit
+ \dostarttagged\t!maction\t!unit
\bgroup % make an mrow
\else
\dostarttagged\t!unit\empty
diff --git a/Master/texmf-dist/tex/context/base/mkiv/prop-ini.mkiv b/Master/texmf-dist/tex/context/base/mkiv/prop-ini.mkiv
deleted file mode 100644
index 3b1c59b245c..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/prop-ini.mkiv
+++ /dev/null
@@ -1,64 +0,0 @@
-%D \module
-%D [ file=prop-ini,
-%D version=2003.04.20,
-%D title=\CONTEXT\ Property Macros,
-%D subtitle=Initialization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Property Macros / Initialization}
-
-%D This module is replaced by dedicated mechanisms. Originally properties were
-%D a sort of attributes in \MKII, but now we do things different anyway. We keep
-%D a surrogate mechanism around for compatibility reasons but even this will
-%D become obsolete some day.
-
-\unprotect
-
-\installcorenamespace{propertytypes}
-\installcorenamespace{propertydefiners}
-\installcorenamespace{propertystarters}
-
-\def\properties_obsolete_message
- {\writestatus\m!system{properties are obsolete, use dedicated commands}%
- \glet\properties_obsolete_message\donothing}
-
-\setvalue{\??propertydefiners\v!layer }[#1][#2][#3]{\defineviewerlayer[#1][#3]}
-\setvalue{\??propertydefiners\s!effect }[#1][#2][#3]{\defineeffect [#1][#3]}
-\setvalue{\??propertydefiners\v!negative}[#1][#2][#3]{}
-
-\unexpanded\def\defineproperty
- {\dotripleempty\properties_define}
-
-\def\properties_define[#1][#2][#3]%
- {\properties_obsolete_message
- \setevalue{\??propertytypes#1}{#2}%
- \getvalue{\??propertydefiners#2}[#1][#2][#3]}
-
-\setvalue{\??propertystarters\v!layer }#1{\let\properties_stop\stopviewerlayer\startviewerlayer[#1]}
-\setvalue{\??propertystarters\s!effect }#1{\let\properties_stop\stopeffect \starteffect [#1]}
-\setvalue{\??propertystarters\v!negative}#1{\let\properties_stop\stopnegative \startnegative }
-
-\unexpanded\def\property[#1]%
- {\groupedcommand{\properties_start{#1}}\properties_stop}
-
-\unexpanded\def\startproperty[#1]%
- {\properties_start{#1}}
-
-\unexpanded\def\stopproperty
- {\properties_stop}
-
-\unexpanded\def\properties_start#1%
- {\pushmacro\properties_stop
- \getvalue{\??propertystarters\getvalue{\??propertytypes#1}}{#1}}
-
-\unexpanded\def\properties_stop
- {\properties_stop
- \popmacro\properties_stop}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/publ-aut.lua b/Master/texmf-dist/tex/context/base/mkiv/publ-aut.lua
index e74c7ee18b5..123a67009d4 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/publ-aut.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/publ-aut.lua
@@ -530,9 +530,9 @@ implement {
name = "btxauthor",
actions = btxauthor,
arguments = {
- "string",
- "string",
- "string",
+ "argument",
+ "argument",
+ "argument",
{
{ "combiner" },
{ "kind" },
diff --git a/Master/texmf-dist/tex/context/base/mkiv/publ-imp-apa.mkvi b/Master/texmf-dist/tex/context/base/mkiv/publ-imp-apa.mkvi
index 5603b79a5f1..c7c00fd1436 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/publ-imp-apa.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/publ-imp-apa.mkvi
@@ -846,7 +846,7 @@
% #title can be title or booktitle
-\starttexdefinition unexpanded btx:apa:translated-title #title
+\starttexdefinition mutable protected btx:apa:translated-title #title
\ifx\currentbtxlanguage\empty
% no need for an extra
\else\ifx\mainbtxlanguage\currentbtxlanguage
@@ -865,7 +865,7 @@
\fi\fi
\stoptexdefinition
-\starttexdefinition unexpanded btx:apa:composed-title #title
+\starttexdefinition mutable protected btx:apa:composed-title #title
\btxstartstyleandcolor[apa:\s!list:#title:\currentbtxcategory]
\begingroup
\language[\currentbtxlanguage]
@@ -884,7 +884,7 @@
\btxstopstyleandcolor
\stoptexdefinition
-\starttexdefinition unexpanded btx:apa:title
+\starttexdefinition mutable protected btx:apa:title
\setmode{btx:apa:title-placed}
% we make the title active, opening "file"
\btxdoifelse {file} {
@@ -925,7 +925,7 @@
}
\stoptexdefinition
-\starttexdefinition unexpanded btx:apa:title-if-not-placed
+\starttexdefinition mutable protected btx:apa:title-if-not-placed
\doifelsemode {btx:apa:title-placed} {
\resetmode{btx:apa:title-placed}
} {
@@ -940,7 +940,7 @@
\btxlabeltext{apa:nd}
\stopsetups
-\starttexdefinition unexpanded btx:apa:suffixedyear
+\starttexdefinition mutable protected btx:apa:suffixedyear
\btxdoifelse {year} {
\btxflush{year}
\btxflushsuffix
@@ -965,7 +965,7 @@
% #author may be author(set) or editor
-\starttexdefinition unexpanded btx:apa:author-or-editor #author
+\starttexdefinition mutable protected btx:apa:author-or-editor #author
\btxdoifelse {#author} {
\btxstartstyleandcolor[apa:\s!list:#author]
\btxusecommand[apa:\s!list:#author]{
@@ -1048,7 +1048,7 @@
}
\stoptexdefinition
-\starttexdefinition unexpanded btx:apa:authoryear
+\starttexdefinition mutable protected btx:apa:authoryear
% we make the authoryear active, pointing to the citation
\texdefinition{btx:format:inject}
{internal(\currentbtxinternal)}
@@ -1073,7 +1073,7 @@
}
\stoptexdefinition
-\starttexdefinition unexpanded btx:apa:editor-in
+\starttexdefinition mutable protected btx:apa:editor-in
\btxdoif {booktitle} {
\btxlabeltext{In}
\btxspace
@@ -1086,7 +1086,7 @@
}
\stoptexdefinition
-\starttexdefinition unexpanded btx:apa:organization-if-not-author
+\starttexdefinition mutable protected btx:apa:organization-if-not-author
\btxdoif {organization} {
\doifnot {\btxfoundname{author}} {organization} {
\btxspace
@@ -1099,7 +1099,7 @@
% TODO: The title is terminated with period. However,
% we probably don't want this before the parenthesis.
-\starttexdefinition unexpanded btx:apa:leftparenthesis-or-comma
+\starttexdefinition mutable protected btx:apa:leftparenthesis-or-comma
\doifelsemode {btx:apa:editionset-is-empty} {
\btxleftparenthesis
\resetmode{btx:apa:editionset-is-empty}
@@ -1108,7 +1108,7 @@
}
\stoptexdefinition
-\starttexdefinition unexpanded btx:apa:editionset
+\starttexdefinition mutable protected btx:apa:editionset
\setmode{btx:apa:editionset-is-empty}
\doif {\currentbtxcategory} {techreport} {
\texdefinition{btx:apa:leftparenthesis-or-comma}
@@ -1157,7 +1157,7 @@
}
\stoptexdefinition
-\starttexdefinition unexpanded btx:apa:journal
+\starttexdefinition mutable protected btx:apa:journal
\btxstartstyleandcolor[apa:\s!list:journal]
\btxusecommand [apa:\s!list:journal] {
\btxflush{journal}
@@ -1165,7 +1165,7 @@
\btxstopstyleandcolor
\stoptexdefinition
-\starttexdefinition unexpanded btx:apa:volume
+\starttexdefinition mutable protected btx:apa:volume
\btxstartstyleandcolor[apa:\s!list:volume]
\btxflush{volume}
\btxstopstyleandcolor
@@ -1173,7 +1173,7 @@
% this could be simplified!
-\starttexdefinition unexpanded btx:apa:journal-volume-number-pages
+\starttexdefinition mutable protected btx:apa:journal-volume-number-pages
\btxdoif {journal} {
\btxspace
\texdefinition{btx:apa:journal}
@@ -1222,7 +1222,7 @@
}
\stoptexdefinition
-\starttexdefinition unexpanded btx:apa:wherefrom-publisher
+\starttexdefinition mutable protected btx:apa:wherefrom-publisher
\btxdoifelse {address} {
\btxflush{address}
\btxdoif {country} {
@@ -1256,7 +1256,7 @@
% use \btxentry here?
-\starttexdefinition unexpanded btx:apa:url
+\starttexdefinition mutable protected btx:apa:url
\begingroup
\setbreakpoints[doi]
\ifconditional\btxinteractive
@@ -1273,7 +1273,7 @@
% use \btxentry here?
-\starttexdefinition unexpanded btx:apa:doi
+\starttexdefinition mutable protected btx:apa:doi
\begingroup
\setbreakpoints[doi]
\ifconditional\btxinteractive
@@ -1288,7 +1288,7 @@
\endgroup
\stoptexdefinition
-\starttexdefinition unexpanded btx:apa:note
+\starttexdefinition mutable protected btx:apa:note
\btxdoif {note} {
\btxleftparenthesis
\btxflush{note}
@@ -1296,7 +1296,7 @@
}
\stoptexdefinition
-\starttexdefinition unexpanded btx:apa:url-doi-note
+\starttexdefinition mutable protected btx:apa:url-doi-note
\doif {\btxfoundname{doi}} {url} {
\btxspace
\btxlabeltext{apa:Retrieved}
@@ -1311,7 +1311,7 @@
\removeunwantedspaces
\stoptexdefinition
-\starttexdefinition unexpanded btx:apa:type
+\starttexdefinition mutable protected btx:apa:type
\btxdoif {type} {
\btxleftbracket
\btxflush{type}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/publ-imp-aps.mkvi b/Master/texmf-dist/tex/context/base/mkiv/publ-imp-aps.mkvi
index d085b96eb63..e16279222a6 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/publ-imp-aps.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/publ-imp-aps.mkvi
@@ -596,7 +596,7 @@
%D returned. In lua syntax, it can be understood as
%D author or editor or publisher or title or ""
-\starttexdefinition unexpanded btx:aps:composed-title #title
+\starttexdefinition mutable protected btx:aps:composed-title #title
\btxstartstyleandcolor [aps:\s!list:title:\currentbtxcategory]
\begingroup
\language[\currentbtxlanguage]
@@ -611,7 +611,7 @@
\btxstopstyleandcolor
\stoptexdefinition
-\starttexdefinition unexpanded btx:aps:title
+\starttexdefinition mutable protected btx:aps:title
\btxdoif {title} {
% we make the title active, opening file
\btxdoifelse {file} {
@@ -627,13 +627,13 @@
}
\stoptexdefinition
-\starttexdefinition unexpanded btx:aps:optional-title
+\starttexdefinition mutable protected btx:aps:optional-title
\doif{\btxparameter{\c!title}}\v!yes {
\texdefinition {btx:aps:title}
}
\stoptexdefinition
-\starttexdefinition unexpanded btx:aps:year
+\starttexdefinition mutable protected btx:aps:year
\btxdoifelse {year} {
\btxflush{year}
} {
@@ -643,7 +643,7 @@
% #author may be author(set) or editor
-\starttexdefinition unexpanded btx:aps:author-or-editor #author
+\starttexdefinition mutable protected btx:aps:author-or-editor #author
\btxdoif {#author} {
\btxflush{#author}
\doifelse {\btxfoundname{#author}} {editor} {
@@ -664,14 +664,14 @@
}
\stoptexdefinition
-\starttexdefinition unexpanded btx:aps:author
+\starttexdefinition mutable protected btx:aps:author
\btxdoif {author} {
\btxflush{author}
\btxcomma
}
\stoptexdefinition
-\starttexdefinition unexpanded btx:aps:organization-if-not-author
+\starttexdefinition mutable protected btx:aps:organization-if-not-author
\btxdoif {organization} {
\doifnot {\btxfoundname{author}} {organization} {
\btxspace
@@ -681,7 +681,7 @@
}
\stoptexdefinition
-\starttexdefinition unexpanded btx:aps:editor-in
+\starttexdefinition mutable protected btx:aps:editor-in
\btxdoif {booktitle} {
\btxlabeltext{In}
\doifnot {\btxfoundname{author}} {editor} {
@@ -694,7 +694,7 @@
}
\stoptexdefinition
-\starttexdefinition unexpanded btx:aps:editionset
+\starttexdefinition mutable protected btx:aps:editionset
\doif {\currentbtxcategory} {techreport} {
\btxdoifelse {type} {
\btxusecommand [\currentbtx:type] {
@@ -739,7 +739,7 @@
}
\stoptexdefinition
-\starttexdefinition unexpanded btx:aps:journal-volume-year
+\starttexdefinition mutable protected btx:aps:journal-volume-year
\btxdoif {journal} {
\btxspace
\btxstartstyleandcolor [aps:\s!list:journal]
@@ -773,7 +773,7 @@
\btxrightparenthesis
\stoptexdefinition
-\starttexdefinition unexpanded btx:aps:publisher-wherefrom-year
+\starttexdefinition mutable protected btx:aps:publisher-wherefrom-year
\removeunwantedspaces
\removepunctuation
\btxleftparenthesis
@@ -797,7 +797,7 @@
\btxrightparenthesis
\stoptexdefinition
-\starttexdefinition unexpanded btx:aps:note
+\starttexdefinition mutable protected btx:aps:note
\btxperiod
\btxdoif {note} {
\btxleftparenthesis
@@ -806,7 +806,7 @@
}
\stoptexdefinition
-\starttexdefinition unexpanded btx:aps:doi-url #text
+\starttexdefinition mutable protected btx:aps:doi-url #text
\ifconditional\btxinteractive
\btxdoifelse {doi} {
\goto {#text} [url(http://dx.doi.org/\btxflush{doi})]
diff --git a/Master/texmf-dist/tex/context/base/mkiv/publ-imp-author.mkvi b/Master/texmf-dist/tex/context/base/mkiv/publ-imp-author.mkvi
index b524331867c..8ee7835996f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/publ-imp-author.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/publ-imp-author.mkvi
@@ -23,7 +23,7 @@
% \currentbtxsurnames : \btxauthorfield{surnames}
% \currentbtxjuniors : \btxauthorfield{juniors}
-\starttexdefinition unexpanded \s!btx:\s!cite:\s!author:\s!de
+\starttexdefinition mutable protected \s!btx:\s!cite:\s!author:\s!de
\ifx\currentbtxlanguage\s!de
\setmode{\s!btx:\s!de}
\fi
diff --git a/Master/texmf-dist/tex/context/base/mkiv/publ-imp-chicago.mkvi b/Master/texmf-dist/tex/context/base/mkiv/publ-imp-chicago.mkvi
index 867535ca6be..315d686129d 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/publ-imp-chicago.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/publ-imp-chicago.mkvi
@@ -702,20 +702,20 @@
chicago:edition={Utgåva},
chicago:Editor=Redaktör,
chicago:Editors=Redaktörer,
- chicago:Volume=Band,
+ chicago:Volume=Band,
chicago:Volumes=Band,
chicago:nd={u.å.}, % utan årtal
chicago:supplement=Bilaga, % Supplement
chicago:MotionPicture=Spelfilm, % ?
chicago:Writer={Manusförfattare}, % Assuming for a movie
- chicago:Writers={Manusförfattare}, %
+ chicago:Writers={Manusförfattare}, %
chicago:Producer=Producent, % Assuming for a movie
- chicago:Producers=Producenter, %
+ chicago:Producers=Producenter, %
chicago:Director={Regissör}, % Assuming for a movie
- chicago:Directors={Regissörer}, %
+ chicago:Directors={Regissörer}, %
chicago:Recordedby={Inspelad av}, % Assuming for a movie
chicago:Author={Författare},
- chicago:Translator={Översättare},
+ chicago:Translator={Översättare},
chicago:Advanced={Avancerad onlinepublikation}, % ?
chicago:Retrieved={Hämtad från}]
@@ -845,7 +845,7 @@
% #title can be title or booktitle
-\starttexdefinition unexpanded btx:chicago:translated-title #title
+\starttexdefinition mutable protected btx:chicago:translated-title #title
\ifx\currentbtxlanguage\empty
% no need for an extra
\else\ifx\mainbtxlanguage\currentbtxlanguage
@@ -864,7 +864,7 @@
\fi\fi
\stoptexdefinition
-\starttexdefinition unexpanded btx:chicago:composed-title #title
+\starttexdefinition mutable protected btx:chicago:composed-title #title
\btxstartstyleandcolor[chicago:\s!list:#title:\currentbtxcategory]
\begingroup
\language[\currentbtxlanguage]
@@ -883,7 +883,7 @@
\btxstopstyleandcolor
\stoptexdefinition
-\starttexdefinition unexpanded btx:chicago:title
+\starttexdefinition mutable protected btx:chicago:title
\setmode{btx:chicago:title-placed}
% we make the title active, opening "file"
\btxdoifelse {file} {
@@ -924,7 +924,7 @@
}
\stoptexdefinition
-\starttexdefinition unexpanded btx:chicago:title-if-not-placed
+\starttexdefinition mutable protected btx:chicago:title-if-not-placed
\doifelsemode {btx:chicago:title-placed} {
\resetmode{btx:chicago:title-placed}
} {
@@ -939,7 +939,7 @@
\btxlabeltext{chicago:nd}
\stopsetups
-\starttexdefinition unexpanded btx:chicago:suffixedyear
+\starttexdefinition mutable protected btx:chicago:suffixedyear
\btxdoifelse {year} {
\btxflush{year}
\btxflushsuffix
@@ -964,7 +964,7 @@
% #author may be author(set) or editor
-\starttexdefinition unexpanded btx:chicago:author-or-editor #author
+\starttexdefinition mutable protected btx:chicago:author-or-editor #author
\btxdoifelse {#author} {
\btxstartstyleandcolor[chicago:\s!list:#author]
\btxusecommand[chicago:\s!list:#author]{
@@ -1047,7 +1047,7 @@
}
\stoptexdefinition
-\starttexdefinition unexpanded btx:chicago:authoryear
+\starttexdefinition mutable protected btx:chicago:authoryear
% we make the authoryear active, pointing to the citation
\texdefinition{btx:format:inject}
{internal(\currentbtxinternal)}
@@ -1070,7 +1070,7 @@
}
\stoptexdefinition
-\starttexdefinition unexpanded btx:chicago:editor-in
+\starttexdefinition mutable protected btx:chicago:editor-in
\btxdoif {booktitle} {
\btxlabeltext{In}
\btxspace
@@ -1083,7 +1083,7 @@
}
\stoptexdefinition
-\starttexdefinition unexpanded btx:chicago:organization-if-not-author
+\starttexdefinition mutable protected btx:chicago:organization-if-not-author
\btxdoif {organization} {
\doifnot {\btxfoundname{author}} {organization} {
\btxspace
@@ -1096,7 +1096,7 @@
% TODO: The title is terminated with period. However,
% we probably don't want this before the parenthesis.
-\starttexdefinition unexpanded btx:chicago:leftparenthesis-or-comma
+\starttexdefinition mutable protected btx:chicago:leftparenthesis-or-comma
\doifelsemode {btx:chicago:editionset-is-empty} {
\btxleftparenthesis
\resetmode{btx:chicago:editionset-is-empty}
@@ -1105,7 +1105,7 @@
}
\stoptexdefinition
-\starttexdefinition unexpanded btx:chicago:editionset
+\starttexdefinition mutable protected btx:chicago:editionset
\setmode{btx:chicago:editionset-is-empty}
\doif {\currentbtxcategory} {techreport} {
\texdefinition{btx:chicago:leftparenthesis-or-comma}
@@ -1154,7 +1154,7 @@
}
\stoptexdefinition
-\starttexdefinition unexpanded btx:chicago:journal
+\starttexdefinition mutable protected btx:chicago:journal
\btxstartstyleandcolor[chicago:\s!list:journal]
\btxusecommand [chicago:\s!list:journal] {
\btxflush{journal}
@@ -1162,7 +1162,7 @@
\btxstopstyleandcolor
\stoptexdefinition
-\starttexdefinition unexpanded btx:chicago:volume
+\starttexdefinition mutable protected btx:chicago:volume
\btxstartstyleandcolor[chicago:\s!list:volume]
\btxflush{volume}
\btxstopstyleandcolor
@@ -1170,7 +1170,7 @@
% this could be simplified!
-\starttexdefinition unexpanded btx:chicago:journal-volume-number-pages
+\starttexdefinition mutable protected btx:chicago:journal-volume-number-pages
\btxdoif {journal} {
\btxspace
\texdefinition{btx:chicago:journal}
@@ -1219,7 +1219,7 @@
}
\stoptexdefinition
-\starttexdefinition unexpanded btx:chicago:wherefrom-publisher
+\starttexdefinition mutable protected btx:chicago:wherefrom-publisher
\btxdoifelse {address} {
\btxflush{address}
\btxdoif {country} {
@@ -1253,7 +1253,7 @@
% use \btxentry here?
-\starttexdefinition unexpanded btx:chicago:url
+\starttexdefinition mutable protected btx:chicago:url
\begingroup
\setbreakpoints[doi]
\ifconditional\btxinteractive
@@ -1270,7 +1270,7 @@
% use \btxentry here?
-\starttexdefinition unexpanded btx:chicago:doi
+\starttexdefinition mutable protected btx:chicago:doi
\begingroup
\setbreakpoints[doi]
\ifconditional\btxinteractive
@@ -1285,7 +1285,7 @@
\endgroup
\stoptexdefinition
-\starttexdefinition unexpanded btx:chicago:note
+\starttexdefinition mutable protected btx:chicago:note
\btxdoif {note} {
\btxleftparenthesis
\btxflush{note}
@@ -1293,7 +1293,7 @@
}
\stoptexdefinition
-\starttexdefinition unexpanded btx:chicago:url-doi-note
+\starttexdefinition mutable protected btx:chicago:url-doi-note
\doif {\btxfoundname{doi}} {url} {
\btxspace
\btxlabeltext{chicago:Retrieved}
@@ -1308,7 +1308,7 @@
\removeunwantedspaces
\stoptexdefinition
-\starttexdefinition unexpanded btx:chicago:type
+\starttexdefinition mutable protected btx:chicago:type
\btxdoif {type} {
\btxleftbracket
\btxflush{type}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/publ-imp-cite.mkvi b/Master/texmf-dist/tex/context/base/mkiv/publ-imp-cite.mkvi
index 3a01b219a65..721985499b6 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/publ-imp-cite.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/publ-imp-cite.mkvi
@@ -13,7 +13,7 @@
\unprotect
-\starttexdefinition unexpanded btx:cite:inject #content
+\starttexdefinition mutable protected btx:cite:inject #content
\ifconditional\btxinteractive
\ifx\currentbtxinternal\empty
#content
@@ -29,7 +29,7 @@
\fi
\stoptexdefinition
-\starttexdefinition unexpanded btx:cite:checkconcat
+\starttexdefinition mutable protected btx:cite:checkconcat
\ifnum\currentbtxcount>\zerocount
\let\currentbtxinternal\empty
\let\currentbtxbacklink\empty
diff --git a/Master/texmf-dist/tex/context/base/mkiv/publ-imp-commands.mkvi b/Master/texmf-dist/tex/context/base/mkiv/publ-imp-commands.mkvi
index 281b8324a3e..a5e6bd6de43 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/publ-imp-commands.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/publ-imp-commands.mkvi
@@ -2,6 +2,8 @@
% for tugboat
+\mutable\protected\def\acro#1{\dontleavehmode{\smallcaps#1}} % can be redefined
+
\definebtxcommand\hbox {\hbox}
\definebtxcommand\vbox {\vbox}
\definebtxcommand\llap {\llap}
@@ -9,7 +11,7 @@
\definebtxcommand\url #1{\hyphenatedurl{#1}}
\definebtxcommand\acro #1{\dontleavehmode{\smallcaps#1}}
-\let\<<
-\let\>>
+\mutable\let\<< % for now \mutable, maybe \definebtxcommand\<{<}
+\mutable\let\>> % for now \mutable, maybe \definebtxcommand\>{>}
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/publ-imp-default.mkvi b/Master/texmf-dist/tex/context/base/mkiv/publ-imp-default.mkvi
index fef993fe052..8d9d24b5947 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/publ-imp-default.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/publ-imp-default.mkvi
@@ -365,7 +365,7 @@
[\s!default:and=och,
\s!default:number={nr.},
\s!default:edition={Utgåva},
- \s!default:Editor=Redaktör,
+ \s!default:Editor=Redaktör,
\s!default:Editors=Redaktörer,
\s!default:Volume=Band,
\s!default:Volumes=Band,
@@ -374,7 +374,7 @@
% First some helpers:
-\starttexdefinition btx:default:composed-title
+\starttexdefinition mutable protected btx:default:composed-title
\begingroup
\language[\currentbtxlanguage]
\btxflush{title}
@@ -385,7 +385,7 @@
\endgroup
\stoptexdefinition
-\starttexdefinition btx:default:title
+\starttexdefinition mutable protected btx:default:title
\btxdoif {title} {
\btxspace
\btxstartstyleandcolor [default:list:title:\currentbtxcategory]
@@ -397,7 +397,7 @@
}
\stoptexdefinition
-\starttexdefinition btx:default:author
+\starttexdefinition mutable protected btx:default:author
\btxdoif {author} {
\btxflush{author}
\doif {\btxfoundname{author}} {editor} {
@@ -412,12 +412,12 @@
}
\stoptexdefinition
-\starttexdefinition btx:default:year
+\starttexdefinition mutable protected btx:default:year
\btxflush{year}
\btxflushsuffix
\stoptexdefinition
-\starttexdefinition btx:default:journal
+\starttexdefinition mutable protected btx:default:journal
\btxdoif {journal} {
\btxspace
\btxstartstyleandcolor [default:list:journal]
@@ -450,7 +450,7 @@
}
\stoptexdefinition
-\starttexdefinition btx:default:editionset
+\starttexdefinition mutable protected btx:default:editionset
\btxdoif {editionset} {
\removeunwantedspaces
\removepunctuation
@@ -483,7 +483,7 @@
}
\stoptexdefinition
-\starttexdefinition btx:default:publisher
+\starttexdefinition mutable protected btx:default:publisher
\btxdoif {publisher} {
\btxflush{publisher}
\btxcomma
diff --git a/Master/texmf-dist/tex/context/base/mkiv/publ-imp-definitions.mkvi b/Master/texmf-dist/tex/context/base/mkiv/publ-imp-definitions.mkvi
index 295586f60fb..1e9f8ea9bb1 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/publ-imp-definitions.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/publ-imp-definitions.mkvi
@@ -27,7 +27,7 @@
\btxfield{short}
\stopxmlsetups
-\starttexdefinition unexpanded btx:format:inject #link #content
+\starttexdefinition mutable protected btx:format:inject #link #content
\ifx\currentbtxinternal\empty
#content
\else\ifconditional\btxinteractive
@@ -86,7 +86,7 @@
% macros:
-\starttexdefinition unexpanded btx:style:italic #content
+\starttexdefinition mutable protected btx:style:italic #content
\dontleavehmode
\begingroup
\it
@@ -95,7 +95,7 @@
\endgroup
\stoptexdefinition
-\starttexdefinition unexpanded btx:style:bold #content
+\starttexdefinition mutable protected btx:style:bold #content
\dontleavehmode
\begingroup
\bf
@@ -103,14 +103,14 @@
\endgroup
\stoptexdefinition
-\starttexdefinition unexpanded btx:style:quote #content
+\starttexdefinition mutable protected btx:style:quote #content
\dontleavehmode
\startquote
#content
\stopquote
\stoptexdefinition
-\starttexdefinition unexpanded btx:style #style #content
+\starttexdefinition mutable protected btx:style #style #content
\doifelsedefined {btx:style:#style} {
\texdefinition{btx:style:#style} {
#content
diff --git a/Master/texmf-dist/tex/context/base/mkiv/publ-imp-list.mkvi b/Master/texmf-dist/tex/context/base/mkiv/publ-imp-list.mkvi
index b00c4bd4012..eec63e515c6 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/publ-imp-list.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/publ-imp-list.mkvi
@@ -13,7 +13,7 @@
\unprotect
-\starttexdefinition unexpanded btx:list:inject:text #content
+\starttexdefinition mutable protected btx:list:inject:text #content
\ifconditional\btxinteractivetext
\ifx\currentbtxinternal\empty
#content
@@ -39,7 +39,7 @@
}
\stopsetups
-\starttexdefinition unexpanded btx:list:inject:number #content
+\starttexdefinition mutable protected btx:list:inject:number #content
\ifconditional\btxinteractivenumber
\ifx\currentbtxinternal\empty
#content
@@ -55,7 +55,7 @@
\fi
\stoptexdefinition
-\starttexdefinition unexpanded btx:list:helpers:concat
+\starttexdefinition mutable protected btx:list:helpers:concat
\space
\stoptexdefinition
@@ -66,7 +66,7 @@
}
\stopsetups
-\starttexdefinition unexpanded btx:list:numbering #variant
+\starttexdefinition mutable protected btx:list:numbering #variant
\btxstartstyleandcolor [\currentbtxspecification:\s!list:\s!numbering:#variant]
\btxusecommand[\currentbtxspecification:\s!list:\s!numbering:#variant] {
\fastsetup{\s!btx:\s!list:\s!numbering}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/publ-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/publ-ini.lua
index da6c74b2e46..ec36be89ad7 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/publ-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/publ-ini.lua
@@ -3500,7 +3500,7 @@ do
function publications.prerollcmdstring(str)
btxstring = str or ""
- tex.runtoks("t_btx_cmd")
+ tex.runlocal("t_btx_cmd")
return nodes.toutf(tex.getbox("b_btx_cmd").list) or str
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/publ-ini.mkiv b/Master/texmf-dist/tex/context/base/mkiv/publ-ini.mkiv
index 996b6d3cab7..dfed53c7374 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/publ-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/publ-ini.mkiv
@@ -59,22 +59,24 @@
\startcontextdefinitioncode
-\def\s!btx {btx}
-
-\def\v!btxcite {btxcite}
-\def\v!btxlist {btxlist}
-\def\v!btxrendering {btxrendering}
-
-\def\s!btxset {btxset}
-\def\s!btxref {btxref}
-\def\s!btxint {btxint}
-\def\s!btxltx {btxltx}
-\def\s!btxrtx {btxrtx}
-\def\s!btxatx {btxatx}
-\def\s!btxbtx {btxbtx}
-\def\s!btxspc {btxspc}
-\def\s!btxlst {btxlst}
-\def\s!btxcom {btxcom}
+%D These are currently not interfaced.
+
+\definesystemconstant {btx}
+
+\definesystemconstant {btxset}
+\definesystemconstant {btxref}
+\definesystemconstant {btxint}
+\definesystemconstant {btxltx}
+\definesystemconstant {btxrtx}
+\definesystemconstant {btxatx}
+\definesystemconstant {btxbtx}
+\definesystemconstant {btxspc}
+\definesystemconstant {btxlst}
+\definesystemconstant {btxcom}
+
+\defineinterfacevariable {btxcite} {btxcite}
+\defineinterfacevariable {btxlist} {btxlist}
+\defineinterfacevariable {btxrendering} {btxrendering}
\definelabelclass[btxlabel][2]
@@ -394,6 +396,10 @@
\let\btxsetup\fastsetup
+% This fails when we check field values:
+
+\let\btxrawfield\btxfield
+
\def\btxfield #1{\dostarttagged\t!pubfld{#1}\clf_btxfield {\currentbtxdataset}{\currentbtxtag}{#1}\dostoptagged}
\def\btxdetail #1{\dostarttagged\t!pubfld{#1}\clf_btxdetail{\currentbtxdataset}{\currentbtxtag}{#1}\dostoptagged}
\def\btxflush #1{\dostarttagged\t!pubfld{#1}\clf_btxflush {\currentbtxdataset}{\currentbtxtag}{#1}\dostoptagged}
@@ -679,7 +685,7 @@
\dostarttagged\t!publication\empty
\dotagpublication\currentbtxdataset\currentbtxtag
\redoconvertfont % see (**) in strc-lst, this will become an configuration option
- \edef\currentbtxcategory{\btxfield{category}}%
+ \edef\currentbtxcategory{\btxrawfield{category}}%
\ignorespaces
\ifconditional\c_btx_list_texts
\dostarttagged\t!listtext\s!left
@@ -917,7 +923,7 @@
%D \starttyping
%D % #1 is number of entries
%D
-%D \starttexdefinition unexpanded btx:for:alan:wrapper #1
+%D \starttexdefinition mutable protected btx:for:alan:wrapper #1
%D \bTABLE
%D % we can have a command or setups
%D \flushbtxentries[command=\texdefinition{btx:for:alan:content}]
@@ -926,7 +932,7 @@
%D
%D % #1 is tag
%D
-%D \starttexdefinition unexpanded btx:for:alan:content #1
+%D \starttexdefinition mutable protected btx:for:alan:content #1
%D \bTR
%D \bTD
%D \btxsettag{#1}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/publ-usr.mkiv b/Master/texmf-dist/tex/context/base/mkiv/publ-usr.mkiv
deleted file mode 100644
index cb078f424d5..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/publ-usr.mkiv
+++ /dev/null
@@ -1,2 +0,0 @@
-% todo
-
diff --git a/Master/texmf-dist/tex/context/base/mkiv/scrn-bar.mkvi b/Master/texmf-dist/tex/context/base/mkiv/scrn-bar.mkvi
index c089eb94576..4b50a437d00 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/scrn-bar.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/scrn-bar.mkvi
@@ -343,13 +343,13 @@
\ifnum\scratchcounterthree<\plusone \scratchcounterthree\plusone \fi
\scratchcounterfive\zerocount
\dostepwiserecurse\firstsubpage\lastsubpage\plusone
- {\!!doneafalse
+ {\donefalse
\advance\scratchcounterfive \plusone
- \ifnum\recurselevel=\firstsubpage\relax \!!doneatrue \fi
- \ifnum\recurselevel=\lastsubpage \relax \!!doneatrue \fi
+ \ifnum\recurselevel=\firstsubpage\relax \donetrue \fi
+ \ifnum\recurselevel=\lastsubpage \relax \donetrue \fi
\scratchcountersix\therealsubpageno\recurselevel\relax
\c_scrn_bar_mode
- \if!!donea
+ \ifdone
\ifnum\scratchcountersix<\realpageno
\zerocount
\else\ifnum\scratchcountersix>\realpageno
diff --git a/Master/texmf-dist/tex/context/base/mkiv/scrn-but.mkvi b/Master/texmf-dist/tex/context/base/mkiv/scrn-but.mkvi
index 0c9b4cfb51b..6c279dfc487 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/scrn-but.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/scrn-but.mkvi
@@ -155,7 +155,7 @@
\def\scrn_button_make#currentparameter#inheritedframed#letparameter#setparameter#text#action%
{\begingroup
- \attribute\referenceattribute\attributeunsetvalue
+ \c_attr_reference\attributeunsetvalue
\global\setfalse\c_scrn_button_skipped
\chardef\locationboxpagestate\csname\??buttonlocation#currentparameter\c!samepage\endcsname % ?? bt: todo
\doifelsereferencefound{#action}\scrn_button_make_yes\scrn_button_make_nop
@@ -337,7 +337,7 @@
\let\scrn_menu_define_original\defineinteractionmenu
-\unexpanded\def\defineinteractionmenu
+\unexpanded\overloaded\def\defineinteractionmenu
{\dotripleempty\scrn_menu_define}
\def\scrn_menu_define[#tag][#category][#settings]% category reflects location, settings can be parent
diff --git a/Master/texmf-dist/tex/context/base/mkiv/scrn-fld.mkvi b/Master/texmf-dist/tex/context/base/mkiv/scrn-fld.mkvi
index 7710a32dcb5..6c0e97a9af0 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/scrn-fld.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/scrn-fld.mkvi
@@ -235,7 +235,7 @@
fontsize {\fontbody}%
fontsymbol {\fieldbodyparameter\c!symbol}%
color {\fieldbodyparameter\c!color}%
- colorvalue \attribute\colorattribute
+ colorvalue \c_attr_color
\ifx\currentfieldbackgroundcolor\empty \else
backgroundcolor {\currentfieldbackgroundcolor}%
backgroundcolorvalue \numexpr\currentfieldbackgroundcolorvalue\relax
@@ -390,6 +390,8 @@
\installparameterhandler \??fieldcontent {fieldcontentframed}
\installparameterhandler \??fieldtotal {fieldtotalframed}
+\installparametersethandler \??fieldcontent {fieldcontentframed}
+
\installsetuphandler \??fieldlabel {fieldlabelframed}
\installsetuphandler \??fieldcontent {fieldcontentframed}
\installsetuphandler \??fieldtotal {fieldtotalframed}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/scrn-ini.mkvi b/Master/texmf-dist/tex/context/base/mkiv/scrn-ini.mkvi
index 557ceb5631a..39fef740c24 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/scrn-ini.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/scrn-ini.mkvi
@@ -231,7 +231,7 @@
% this comes before starttext
\def\scrn_identity_document#1#2%
- {\doifvariable{document}{metadata:#1}{\setupinteraction[#2=\documentvariable{metadata:#1}]}}
+ {\doifdocumentvariable{metadata:#1}{\setupinteraction[#2=\documentvariable{metadata:#1}]}}
\appendtoks % not interfaced i.e. english
\scrn_identity_document {title}\c!title
@@ -242,7 +242,7 @@
\scrn_identity_document {keyword}\c!keyword
\scrn_identity_document{keywords}\c!keyword
\scrn_identity_document {date}\c!date
-\to \everysetupdocument
+\to \everystartdocument % or stop
\setupinteraction
[\c!title=,
diff --git a/Master/texmf-dist/tex/context/base/mkiv/scrn-wid.mkvi b/Master/texmf-dist/tex/context/base/mkiv/scrn-wid.mkvi
index 6808bd0b3e4..d0b0fb006a2 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/scrn-wid.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/scrn-wid.mkvi
@@ -202,7 +202,7 @@
height \dimexpr\currentattachmentheight\relax
depth \dimexpr\currentattachmentdepth \relax
color {\attachmentparameter\c!color}%
- colormodel \attribute\colormodelattribute
+ colormodel \c_attr_colormodel
colorvalue \numexpr\thecolorattribute{\attachmentparameter\c!color}\relax % or are these chardefs
transparencyvalue \numexpr\thetransparencyattribute{\attachmentparameter\c!color}\relax % or are these chardefs
symbol {\currentattachmentsymbol}%
@@ -501,7 +501,7 @@
depth \dimexpr\currentcommentdepth\relax
nx {\commentparameter\c!nx}%
ny {\commentparameter\c!ny}%
- colormodel \attribute\colormodelattribute
+ colormodel \c_attr_colormodel
colorvalue \numexpr\thecolorattribute{\commentparameter\c!color}\relax
transparencyvalue \numexpr\thetransparencyattribute{\commentparameter\c!color}\relax
option {\commentparameter\c!option}% % todo
@@ -605,7 +605,7 @@
{\iflocation
\clf_insertsoundclip
tag {#tag}%
- repeat {\directexternalsoundtrackparameter\c!option}%
+ repeat {\directexternalsoundtracksparameter\c!option}%
\relax
\fi}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/scrp-cjk.lua b/Master/texmf-dist/tex/context/base/mkiv/scrp-cjk.lua
index 83eecf6a3b3..9e6e24f4d02 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/scrp-cjk.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/scrp-cjk.lua
@@ -30,7 +30,6 @@ local getprev = nuts.getprev
local getfont = nuts.getfont
local getchar = nuts.getchar
local getid = nuts.getid
-local getattr = nuts.getattr
local getsubtype = nuts.getsubtype
local getwidth = nuts.getwidth
@@ -51,13 +50,11 @@ local userskip_code = gluecodes.userskip
local spaceskip_code = gluecodes.spaceskip
local xspaceskip_code = gluecodes.xspaceskip
-local a_scriptstatus = attributes.private('scriptstatus')
-local a_scriptinjection = attributes.private('scriptinjection')
-
-local categorytonumber = scripts.categorytonumber
-local numbertocategory = scripts.numbertocategory
local hash = scripts.hash
-local numbertodataset = scripts.numbertodataset
+
+local getscriptstatus = scripts.getstatus
+local getscriptdata = scripts.getdata
+local scriptcolors = scripts.colors
local fonthashes = fonts.hashes
local quaddata = fonthashes.quads
@@ -440,6 +437,21 @@ local injectors = { -- [previous] [current]
half_width_close = korean_5,
}
+scriptcolors.korean = "trace:0"
+scriptcolors.chinese = "trace:0"
+scriptcolors.katakana = "trace:0"
+scriptcolors.hiragana = "trace:0"
+scriptcolors.full_width_open = "trace:1"
+scriptcolors.full_width_close = "trace:2"
+scriptcolors.half_width_open = "trace:3"
+scriptcolors.half_width_close = "trace:4"
+scriptcolors.full_width_punct = "trace:5"
+------------.hyphen = "trace:5"
+scriptcolors.non_starter = "trace:6"
+scriptcolors.jamo_initial = "trace:7"
+scriptcolors.jamo_medial = "trace:8"
+scriptcolors.jamo_final = "trace:9"
+
local function process(head,first,last)
if first ~= last then
local lastfont = nil
@@ -449,8 +461,7 @@ local function process(head,first,last)
local upcoming = getnext(first)
local id = getid(first)
if id == glyph_code then
- local a = getattr(first,a_scriptstatus)
- local current = numbertocategory[a]
+ local current = getscriptstatus(first)
local action = injectors[previous]
if action then
action = action[current]
@@ -458,7 +469,7 @@ local function process(head,first,last)
local font = getfont(first)
if font ~= lastfont then
lastfont = font
- set_parameters(font,numbertodataset[getattr(first,a_scriptinjection)])
+ set_parameters(font,getscriptdata(first))
end
action(head,first)
end
@@ -471,10 +482,8 @@ local function process(head,first,last)
local pid = getid(p)
local nid = getid(n)
if pid == glyph_code and nid == glyph_code then
- local pa = getattr(p,a_scriptstatus)
- local na = getattr(n,a_scriptstatus)
- local pcjk = pa and numbertocategory[pa]
- local ncjk = na and numbertocategory[na]
+ local pcjk = getscriptstatus(p)
+ local ncjk = getscriptstatus(n)
if not pcjk or not ncjk
or pcjk == "korean" or ncjk == "korean"
or pcjk == "other" or ncjk == "other"
@@ -711,8 +720,7 @@ local function process(head,first,last)
local upcoming = getnext(first)
local id = getid(first)
if id == glyph_code then
- local a = getattr(first,a_scriptstatus)
- local current = numbertocategory[a]
+ local current = getscriptstatus(first)
local action = injectors[previous]
if action then
action = action[current]
@@ -720,7 +728,7 @@ local function process(head,first,last)
local font = getfont(first)
if font ~= lastfont then
lastfont = font
- set_parameters(font,numbertodataset[getattr(first,a_scriptinjection)])
+ set_parameters(font,getscriptdata(first))
end
action(head,first)
end
@@ -733,10 +741,8 @@ local function process(head,first,last)
local pid = getid(p)
local nid = getid(n)
if pid == glyph_code and nid == glyph_code then
- local pa = getattr(p,a_scriptstatus)
- local na = getattr(n,a_scriptstatus)
- local pcjk = pa and numbertocategory[pa]
- local ncjk = na and numbertocategory[na]
+ local pcjk = getscriptstatus(p)
+ local ncjk = getscriptstatus(n)
if not pcjk or not ncjk
or pcjk == "korean" or ncjk == "korean"
or pcjk == "other" or ncjk == "other"
@@ -940,8 +946,7 @@ local function process(head,first,last)
local upcoming = getnext(first)
local id = getid(first)
if id == glyph_code then
- local a = getattr(first,a_scriptstatus)
- local current = numbertocategory[a]
+ local current = getscriptstatus(first)
local action = injectors[previous]
if action then
action = action[current]
@@ -949,7 +954,7 @@ local function process(head,first,last)
local font = getfont(first)
if font ~= lastfont then
lastfont = font
- set_parameters(font,numbertodataset[getattr(first,a_scriptinjection)])
+ set_parameters(font,getscriptdata(first))
end
action(head,first)
end
@@ -965,10 +970,8 @@ local function process(head,first,last)
local pid = getid(p)
local nid = getid(n)
if pid == glyph_code and nid == glyph_code then
- local pa = getattr(p,a_scriptstatus)
- local na = getattr(n,a_scriptstatus)
- local pcjk = pa and numbertocategory[pa]
- local ncjk = na and numbertocategory[na]
+ local pcjk = getscriptstatus(p)
+ local ncjk = getscriptstatus(n)
if not pcjk or not ncjk
or pcjk == "korean" or ncjk == "korean"
or pcjk == "other" or ncjk == "other"
diff --git a/Master/texmf-dist/tex/context/base/mkiv/scrp-eth.lua b/Master/texmf-dist/tex/context/base/mkiv/scrp-eth.lua
index f6a994b884b..f20d4b9f50b 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/scrp-eth.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/scrp-eth.lua
@@ -18,10 +18,10 @@ local getattr = nuts.getattr
local nodecodes = nodes.nodecodes
local glyph_code = nodecodes.glyph
-local a_scriptstatus = attributes.private('scriptstatus')
+local getscriptstatus = scripts.getstatus
-local numbertocategory = scripts.numbertocategory
local inserters = scripts.inserters
+local colors = scripts.colors
-- syllable [zerowidthspace] syllable
-- syllable [zerowidthspace] word
@@ -33,7 +33,6 @@ local inserters = scripts.inserters
-- sentence [space] word
-- sentence [space] sentence
-
local injectors = { -- [previous] [current]
ethiopic_syllable = {
ethiopic_syllable = inserters.zerowidthspace_before,
@@ -52,6 +51,10 @@ local injectors = { -- [previous] [current]
},
}
+colors.ethiopic_syllable = "trace:1"
+colors.ethiopic_word = "trace:2"
+colors.ethiopic_sentence = "trace:3"
+
local function process(head,first,last)
if first ~= last then
local injector = false
@@ -59,8 +62,7 @@ local function process(head,first,last)
while current do
local char, id = ischar(current)
if char then
- local scriptstatus = getattr(current,a_scriptstatus)
- local category = numbertocategory[scriptstatus]
+ local category = getscriptstatus(current)
if injector then
local action = injector[category]
if action then
diff --git a/Master/texmf-dist/tex/context/base/mkiv/scrp-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/scrp-ini.lua
index 3d3aa44066e..ab6fca4dbef 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/scrp-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/scrp-ini.lua
@@ -10,6 +10,9 @@ if not modules then modules = { } end modules ['scrp-ini'] = {
-- is finished.
local tonumber, next = tonumber, next
+local setmetatableindex = table.setmetatableindex
+local utfbyte, utfsplit = utf.byte, utf.split
+local gmatch = string.gmatch
local trace_analyzing = false trackers.register("scripts.analyzing", function(v) trace_analyzing = v end)
local trace_injections = false trackers.register("scripts.injections", function(v) trace_injections = v end)
@@ -19,17 +22,12 @@ local trace_splitdetails = false trackers.register("scripts.splitting.details",
local report_preprocessing = logs.reporter("scripts","preprocessing")
local report_splitting = logs.reporter("scripts","splitting")
-local utfbyte, utfsplit = utf.byte, utf.split
-local gmatch = string.gmatch
local attributes = attributes
local nodes = nodes
local context = context
-local texsetattribute = tex.setattribute
-
local nodecodes = nodes.nodecodes
-local unsetvalue = attributes.unsetvalue
local implement = interfaces.implement
@@ -39,14 +37,11 @@ local glue_code = nodecodes.glue
local emwidths = fonts.hashes.emwidths
local exheights = fonts.hashes.exheights
-local a_scriptinjection = attributes.private('scriptinjection')
-local a_scriptsplitting = attributes.private('scriptsplitting')
-local a_scriptstatus = attributes.private('scriptstatus')
+local a_script = attributes.private('script')
local fontdata = fonts.hashes.identifiers
local allocate = utilities.storage.allocate
local setnodecolor = nodes.tracers.colors.set
-local setmetatableindex = table.setmetatableindex
local enableaction = nodes.tasks.enableaction
local disableaction = nodes.tasks.disableaction
@@ -58,9 +53,7 @@ local getchar = nuts.getchar
local getfont = nuts.getfont
local getid = nuts.getid
local getglyphdata = nuts.getglyphdata
-
-local getattr = nuts.getattr
-local setattr = nuts.setattr
+local setglyphdata = nuts.setglyphdata
local isglyph = nuts.isglyph
@@ -69,8 +62,6 @@ local insert_node_before = nuts.insert_before
local first_glyph = nuts.first_glyph
------ traverse_id = nuts.traverse_id
------ traverse_char = nuts.traverse_char
local nextglyph = nuts.traversers.glyph
local nextchar = nuts.traversers.char
@@ -95,6 +86,36 @@ scripts.injectors = handlers
local splitters = allocate()
scripts.splitters = splitters
+-- we need to fake it in luatex
+
+local getscript = node.direct.getscript
+local texsetglyphscript = tex.setglyphscript
+
+if not getscript then
+
+ local getattr = nuts.getattr
+ local texsetattribute = tex.setattribute
+ local unsetvalue = attributes.unsetvalue
+
+ getscript = function(n)
+ local a = getattr(n,a_script)
+ if a and a ~= unsetvalue and a > 0 then
+ return a
+ end
+ end
+
+ texsetglyphscript = function(a)
+ if not a or a == 0 then
+ a = unsetvalue
+ end
+ texsetattribute(a_script,a)
+ end
+
+ nuts.getscript = getscript
+ tex .setglyphscript = texsetglyphscript
+
+end
+
local hash = { -- we could put these presets in char-def.lua
--
-- half width opening parenthesis
@@ -200,10 +221,12 @@ local hash = { -- we could put these presets in char-def.lua
[0x30A5] = "non_starter", [0x30A7] = "non_starter", [0x30A9] = "non_starter", [0x30C3] = "non_starter", [0x30E3] = "non_starter",
[0x30E5] = "non_starter", [0x30E7] = "non_starter", [0x30EE] = "non_starter", [0x30F5] = "non_starter", [0x30F6] = "non_starter",
[0x30FC] = "non_starter", [0x30FD] = "non_starter", [0x30FE] = "non_starter", [0x31F0] = "non_starter", [0x31F1] = "non_starter",
- [0x30F2] = "non_starter", [0x30F3] = "non_starter", [0x30F4] = "non_starter", [0x31F5] = "non_starter", [0x31F6] = "non_starter",
- [0x30F7] = "non_starter", [0x30F8] = "non_starter", [0x30F9] = "non_starter", [0x31FA] = "non_starter", [0x31FB] = "non_starter",
- [0x30FC] = "non_starter", [0x30FD] = "non_starter", [0x30FE] = "non_starter", [0x31FF] = "non_starter",
+ [0x31F2] = "non_starter", [0x31F3] = "non_starter", [0x31F4] = "non_starter", [0x31F5] = "non_starter", [0x31F6] = "non_starter",
+ [0x31F7] = "non_starter", [0x31F8] = "non_starter", [0x31F9] = "non_starter", [0x31FA] = "non_starter", [0x31FB] = "non_starter",
+ [0x31FC] = "non_starter", [0x31FD] = "non_starter", [0x31FE] = "non_starter", [0x31FF] = "non_starter",
--
+ [0x301C] = "non_starter", [0x303B] = "non_starter", [0x303C] = "non_starter", [0x309B] = "non_starter", [0x30FB] = "non_starter",
+ [0x30FE] = "non_starter",
-- hyphenation
--
[0x2026] = "hyphen", -- … ellipsis
@@ -270,6 +293,8 @@ local defaults = {
scripts.defaults = defaults -- so we can add more
+-- todo: copy more efficient than metatable
+
function scripts.installmethod(handler)
local name = handler.name
handlers[name] = handler
@@ -283,20 +308,18 @@ function scripts.installmethod(handler)
for k, v in next, datasets do
setmetatableindex(v,defaults)
end
- setmetatable(attributes, {
- __index = function(t,k)
- local v = datasets[k] or datasets.default
- local a = unsetvalue
- if v then
- v.name = name -- for tracing
- a = #numbertodataset + 1
- numbertodataset[a] = v
- numbertohandler[a] = handler
- end
- t[k] = a
- return a
+ setmetatableindex(attributes, function(t,k)
+ local v = datasets[k] or datasets.default
+ local a = 0
+ if v then
+ v.name = name -- for tracing
+ a = #numbertodataset + 1
+ numbertodataset[a] = v
+ numbertohandler[a] = handler
end
- } )
+ t[k] = a
+ return a
+ end)
handler.attributes = attributes
end
@@ -346,96 +369,124 @@ end
local injectorenabled = false
local splitterenabled = false
+local function getscriptdata(n)
+ local s = getscript(n)
+ if s then
+ return s and numbertodataset[s]
+ end
+end
+
+local function getinjector(n)
+ local s = getscript(n)
+ if s then
+ s = numbertohandler[s]
+ return s and s.injector
+ end
+end
+
+local function getsplitter(n)
+ local s = getscript(n)
+ if s then
+ s = numbertodataset[s]
+ return s and s.splitter
+ end
+end
+
+scripts.getdata = getscriptdata
+scripts.getinjector = getinjector
+scripts.getsplitter = getsplitter
+
function scripts.set(name,method,preset)
local handler = handlers[method]
if handler then
+ local index = handler.attributes[preset]
if handler.injector then
if not injectorenabled then
enableaction("processors","scripts.injectors.handler")
injectorenabled = true
end
- texsetattribute(a_scriptinjection,handler.attributes[preset] or unsetvalue)
end
if handler.splitter then
if not splitterenabled then
enableaction("processors","scripts.splitters.handler")
splitterenabled = true
end
- texsetattribute(a_scriptsplitting,handler.attributes[preset] or unsetvalue)
end
if handler.initializer then
handler.initializer(handler)
handler.initializer = nil
end
+ texsetglyphscript(index)
else
- texsetattribute(a_scriptinjection,unsetvalue)
- texsetattribute(a_scriptsplitting,unsetvalue)
+ texsetglyphscript()
end
end
function scripts.reset()
- texsetattribute(a_scriptinjection,unsetvalue)
- texsetattribute(a_scriptsplitting,unsetvalue)
+ texsetglyphscript()
end
--- the following tables will become a proper installer (move to cjk/eth)
---
-- 0=gray 1=red 2=green 3=blue 4=yellow 5=magenta 6=cyan 7=x-yellow 8=x-magenta 9=x-cyan
-local scriptcolors = allocate { -- todo: just named colors
- korean = "trace:0",
- chinese = "trace:0",
- katakana = "trace:0",
- hiragana = "trace:0",
- full_width_open = "trace:1",
- full_width_close = "trace:2",
- half_width_open = "trace:3",
- half_width_close = "trace:4",
- full_width_punct = "trace:5",
- hyphen = "trace:5",
- non_starter = "trace:6",
- jamo_initial = "trace:7",
- jamo_medial = "trace:8",
- jamo_final = "trace:9",
- ethiopic_syllable = "trace:1",
- ethiopic_word = "trace:2",
- ethiopic_sentence = "trace:3",
- breaking_tsheg = "trace:1",
- nonbreaking_tsheg = "trace:2",
+-- local categories = allocate { -- rather bound to cjk ... will be generalized
+-- "korean",
+-- "chinese",
+-- "katakana",
+-- "hiragana",
+-- "full_width_open",
+-- "full_width_close",
+-- "half_width_open",
+-- "half_width_close",
+-- "full_width_punct",
+-- "hyphen",
+-- "non_starter",
+-- "jamo_initial",
+-- "jamo_medial",
+-- "jamo_final",
+-- "ethiopic_syllable",
+-- "ethiopic_word",
+-- "ethiopic_sentence",
+-- "breaking_tsheg",
+-- "nonbreaking_tsheg",
+-- }
+--
+-- scripts.categories = categories
+
+local scriptcolors = allocate {
+ -- todo: just named colors
+ hyphen = "trace:5",
}
scripts.colors = scriptcolors
-local numbertocategory = allocate { -- rather bound to cjk ... will be generalized
- "korean",
- "chinese",
- "katakana",
- "hiragana",
- "full_width_open",
- "full_width_close",
- "half_width_open",
- "half_width_close",
- "full_width_punct",
- "hyphen",
- "non_starter",
- "jamo_initial",
- "jamo_medial",
- "jamo_final",
- "ethiopic_syllable",
- "ethiopic_word",
- "ethiopic_sentence",
- "breaking_tsheg",
- "nonbreaking_tsheg",
-}
+-- this can become setprop ...
-local categorytonumber = allocate(table.swapped(numbertocategory)) -- could be one table
+local propertydata = nodes.properties.data
-scripts.categorytonumber = categorytonumber
-scripts.numbertocategory = numbertocategory
+local function setscriptstatus(n,s)
+ local p = propertydata[n]
+ if p then
+ p.scriptstatus = s
+ else
+ propertydata[n] = { scriptstatus = s }
+ end
+end
+
+function getscriptstatus(n)
+ local p = propertydata[n]
+ if p then
+ return p.scriptstatus
+ end
+end
+
+scripts.setstatus = setscriptstatus
+scripts.getstatus = getscriptstatus
+
+--
local function colorize(start,stop)
for n in nextglyph, start do
- local kind = numbertocategory[getattr(n,a_scriptstatus)]
+ local kind = getscriptstatus(n)
if kind then
local ac = scriptcolors[kind]
if ac then
@@ -459,13 +510,6 @@ local function traced_process(head,first,last,process,a)
end
end
--- eventually we might end up with more extensive parsing
--- todo: pass t[start..stop] == original
---
--- one of the time consuming functions:
-
--- we can have a fonts.hashes.originals
-
function scripts.injectors.handler(head)
local start = first_glyph(head) -- we already have glyphs here (subtype 1)
if not start then
@@ -476,7 +520,8 @@ function scripts.injectors.handler(head)
while start do
local char, id = isglyph(start)
if char then
- local a = getattr(start,a_scriptinjection)
+ -- local a = getinjector(start)
+ local a = getscript(start)
if a then
if a ~= last_a then
if first then
@@ -494,8 +539,8 @@ function scripts.injectors.handler(head)
first, last = nil, nil
end
last_a = a
- local handler = numbertohandler[a]
- normal_process = handler.injector
+ -- normal_process = a
+ normal_process = getinjector(start)
end
if normal_process then
-- id == font
@@ -513,7 +558,7 @@ function scripts.injectors.handler(head)
end
local h = hash[char]
if h then
- setattr(start,a_scriptstatus,categorytonumber[h])
+ setscriptstatus(start,h)
if not first then
first, last = start, start
else
@@ -750,13 +795,13 @@ function splitters.handler(head) -- todo: also first_glyph test
local current = head
while current do
if getid(current) == glyph_code then
- local a = getattr(current,a_scriptsplitting)
+ local a = getsplitter(current)
if a then
if a ~= attr then
local handler = numbertohandler[a]
tree = handler.tree or { }
attr = a
- proc = handler.splitter
+ proc = a
end
if proc then
local root = tree[getchar(current)]
@@ -813,10 +858,10 @@ end
local last_a, last_f, last_s, last_q
function splitters.insertafter(handler,head,first,last,detail)
- local a = getattr(first,a_scriptsplitting)
+ local a = getscriptdata(first)
local f = getfont(first)
- if a ~= last_a or f ~= last_f then
- last_s = emwidths[f] * numbertodataset[a].inter_word_stretch_factor
+ if a and a ~= last_a or f ~= last_f then
+ last_s = emwidths[f] * data.inter_word_stretch_factor
last_a = a
last_f = f
end
@@ -892,7 +937,7 @@ setmetatableindex(cache_nop,function(t,k) local v = { } t[k] = v return v end)
function autofontfeature.handler(head)
for n, char, font in nextchar, head do
- -- if getattr(n,a_scriptinjection) then
+ -- if getscript(n) then
-- -- already tagged by script feature, maybe some day adapt
-- else
local script = otfscripts[char]
@@ -923,7 +968,7 @@ function autofontfeature.handler(head)
end
end
if attr ~= 0 then
- setattr(n,0,attr)
+ setglyphdata(n,attr)
-- maybe set scriptinjection when associated
end
end
@@ -965,7 +1010,6 @@ implement {
-- some common helpers
-
do
local parameters = fonts.hashes.parameters
@@ -977,7 +1021,8 @@ do
local inter_character_shrink_factor = 1
local function space_glue(current)
- local data = numbertodataset[getattr(current,a_scriptinjection)]
+ -- local data = numbertodataset[getattr(current,a_scriptinjection)]
+ local data = getscriptdata(current)
if data then
inter_character_space_factor = data.inter_character_space_factor or 1
inter_character_stretch_factor = data.inter_character_stretch_factor or 1
diff --git a/Master/texmf-dist/tex/context/base/mkiv/scrp-ini.mkiv b/Master/texmf-dist/tex/context/base/mkiv/scrp-ini.mkiv
index f2d1da62741..4eb3f29e373 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/scrp-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/scrp-ini.mkiv
@@ -11,7 +11,30 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-% here we collect code from other places (was organized differently)
+%D The script handler has been upgraded mid June 2020 so there might be issues as I
+%D didn't test everything (yet). It should all be a bit more efficient now in
+%D \LUAMETATEX, although not spectacular. We use no attributes in \LUAMETATEX\ and
+%D only one in \LUATEX\ now.
+%D
+%D A glyph can have (an dget) all kind of properties. Except from the state, these
+%D are assigned within \TEX's grouping model!
+%D
+%D \startitemize
+%D \startitem font \stopitem
+%D \startitem character \stopitem
+%D \startitem language (4 properties packed in an unsigned integer) \stopitem
+%D \startitem data (used for dynamics) \stopitem
+%D \startitem script (used for special script processing) \stopitem
+%D \startitem state (used for analyzing, related to font features) \stopitem
+%D \stopitemize
+%D
+%D Additional properties are set via node list handlers. The state is stored in the
+%D glyph, but additional properties are stored in a node's property table. In the
+%D future the state might get used for something else, in which case we will stire
+%D the state in the property table too. On the other hand, we can now (if we want)
+%D influence the state at the\TEX\ end (not that we do that yet).
+
+%D Todo: as in bidi mode we need a way to globally keep the setting.
\registerctxluafile{scrp-ini}{}
\registerctxluafile{scrp-cjk}{}
@@ -19,13 +42,10 @@
\registerctxluafile{scrp-tha}{}
\registerctxluafile{scrp-tib}{}
-\definesystemattribute[scriptinjection][public,pickup]
-\definesystemattribute[scriptsplitting][public,pickup]
-\definesystemattribute[scriptstatus] [public,pickup]
+\definesystemattribute[script][public,pickup]
-%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
-%D proper define macro too.
+%D Since scripts need specific \LUA\ code we use hard coded attribute values, but we
+%D might have more tricks at some time, so we use a proper define macro too.
\unprotect
@@ -37,23 +57,17 @@
% presets are global and are currently defined in lua
-\appendtoks
- \setuevalue\currentscript{\setscript[\currentscript]}%
-\to \everydefinescript
+% \appendtoks
+% \setuevalue\currentscript{\setscript[\currentscript]}%
+% \to \everydefinescript
\unexpanded\def\scripts_basics_set
{\clf_setscript{\currentscript}{\scriptparameter\c!method}{\scriptparameter\c!preset}}
-% \unexpanded\def\setscript[#1]%
-% {\edef\currentscript{#1}%
-% \scripts_basics_set}
-
\unexpanded\def\setglobalscript[#1]%
{\edef\currentscript{#1}%
\scripts_basics_set
- \pickupscriptinjectionattribute
- \pickupscriptsplittingattribute
- \pickupscriptstatusattribute}
+ \pickupscriptattribute}
\unexpanded\def\setlocalscript[#1]%
{\edef\currentscript{#1}%
@@ -80,7 +94,7 @@
% \def\scripts_basics_set_splitter_list[#1][#2]%
% {\ctxcommand{setscriptsplitterlist("#1","#2")}
-% \setscript[hangul] \hangul \startscript[hangul]
+% \setscript[hangul] \startscript[hangul]
\definescript [hangul] [\c!method=hangul]
\definescript [hanzi] [\c!method=hanzi]
diff --git a/Master/texmf-dist/tex/context/base/mkiv/scrp-tib.lua b/Master/texmf-dist/tex/context/base/mkiv/scrp-tib.lua
index b67f6964800..b1d50a469a4 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/scrp-tib.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/scrp-tib.lua
@@ -12,25 +12,17 @@ local getnext = nuts.getnext
local getattr = nuts.getattr
local ischar = nuts.ischar
-local a_scriptstatus = attributes.private('scriptstatus')
+local getscriptstatus = scripts.getstatus
-local numbertocategory = scripts.numbertocategory
local inserters = scripts.inserters
+local colors = scripts.colors
local injectors = {
- breaking_tsheg = inserters.space_after,
+ breaking_tsheg = inserters.space_after
}
--- more efficient is to check directly
---
--- local b_tsheg = 0x0F0B -- breaking
--- local n_tsheg = 0x0F0C -- nonbreaking
---
--- if char == b_tsheg then
--- head, current = insert_space_after(head,current)
--- end
---
--- but this is more general
+colors.breaking_tsheg = "trace:1"
+colors.nonbreaking_tsheg = "trace:2"
local function process(head,first,last)
if first ~= last then
@@ -38,14 +30,11 @@ local function process(head,first,last)
while current do
local char, id = ischar(current)
if char then
- local scriptstatus = getattr(current,a_scriptstatus)
- if scriptstatus and scriptstatus > 0 then
- local category = numbertocategory[scriptstatus]
- if category then
- local injector = injectors[category]
- if injector then
- head, current = injector(head,current)
- end
+ local category = getscriptstatus(current)
+ if category then
+ local injector = injectors[category]
+ if injector then
+ head, current = injector(head,current)
end
end
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/sort-lan.lua b/Master/texmf-dist/tex/context/base/mkiv/sort-lan.lua
index b277989664b..35116f1f648 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/sort-lan.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/sort-lan.lua
@@ -11,10 +11,9 @@ if not modules then modules = { } end modules ['sort-lan'] = {
-- to finish in winter.
-- todo: U+1E9E (german SS)
--- Many vectors were supplied by Wolfgang Schuster and Philipp
--- Gesang. However this is a quite adapted and reformatted variant
--- so it needs some checking. Other users provides tables and
--- corrections as well.
+-- Many vectors were supplied by Wolfgang Schuster and Philipp Gesang. However this is
+-- a quite adapted and reformatted variant so it needs some checking. Other users
+-- provides tables and corrections as well.
local utfchar, utfbyte = utf.char, utf.byte
local sorters = sorters
@@ -973,3 +972,42 @@ definitions["jp"] = {
"ら", "り", "る", "れ", "ろ", "わ", "ゐ", "ゑ", "を", "ん",
}
}
+
+-- Hebrew and Jiddish (Marc Trius)
+
+definitions['he'] = {
+ entries = {
+ ['א'] = 'א', ['ב'] = 'ב', ['ג'] = 'ג', ['ד'] = 'ד', ['ה'] = 'ה',
+ ['ו'] = 'ו', ['ז'] = 'ז', ['ח'] = 'ח', ['ט'] = 'ט', ['י'] = 'י',
+ ['כ'] = 'כ', ['ל'] = 'ל', ['מ'] = 'מ', ['נ'] = 'נ', ['ס'] = 'ס',
+ ['ע'] = 'ע', ['פ'] = 'פ', ['צ'] = 'צ', ['ק'] = 'ק', ['ר'] = 'ר',
+ ['ש'] = 'ש', ['ת'] = 'ת',
+ },
+ orders = {
+ "א", "ב", "ג", "ד", "ה", "ו", "ז", "ח", "ט", "י", "כ",
+ "ל", "מ", "נ", "ס", "ע", "פ", "צ", "ק", "ר", "ש", "ת",
+ }
+}
+
+definitions["yi"] = {
+ parent = "he",
+ entries = {
+ ['א'] = 'א', ['ב'] = 'ב', ['בֿ'] = 'בֿ', ['ג'] = 'ג', ['ד'] = 'ד',
+ ['ה'] = 'ה', ['ו'] = 'ו', ['ז'] = 'ז', ['ח'] = 'ח', ['ט'] = 'ט',
+ ['י'] = 'י', ['כּ'] = 'כּ', ['כ'] = 'כ', ['ל'] = 'ל', ['מ'] = 'מ',
+ ['נ'] = 'נ', ['ס'] = 'ס', ['ע'] = 'ע', ['פ'] = 'פ', ['פֿ'] = 'פֿ',
+ ['צ'] = 'צ', ['ק'] = 'ק', ['ר'] = 'ר', ['ש'] = 'ש', ['שׂ'] = 'שׂ',
+ ['תּ'] = 'תּ', ['ת'] = 'ת',
+ },
+ orders = {
+ "א", "ב", "בֿ", "ג", "ד", "ה", "ו", "ז", "ח", "ט", "י", "כּ", "כ", "ל",
+ "מ", "נ", "ס", "ע", "פּ", "פֿ", "צ", "ק", "ר", "ש", "שׂ", "תּ", "ת",
+ },
+ replacements = {
+ { "אַ", "א" }, { "אָ", "א" }, { "בּ", "ב" }, { "בֿ", "בֿ" }, { "וּ", "ו" },
+ { "װ", "וו" }, { "ױ", "וי" }, { "יִ", "י" }, { "ײ", "יי" }, { "ײַ", "יי" },
+ { "כּ", "כּ" }, { "ך", "כ" }, { "ם", "מ" }, { "ן", "נ" }, { "פּ", "פּ" },
+ { "פ", "פּ" }, { "פֿ", "פֿ" }, { "ף", "פֿ" }, { "ץ", "צ" }, { "שׁ", "ש" },
+ { "שׂ", "שׂ" }, { "תּ", "תּ" },
+ },
+}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/spac-ali.lua b/Master/texmf-dist/tex/context/base/mkiv/spac-ali.lua
index c30a4fa942d..2e2650f3b7a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/spac-ali.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/spac-ali.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['spac-ali'] = {
version = 1.001,
+ optimize = true,
comment = "companion to spac-ali.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
@@ -111,7 +112,7 @@ local function handler(head,leftpage,realpageno) -- traverse_list
local head = setlink(new_stretch(3),list) -- prepend
setlist(current,hpack_nodes(head,getwidth(current),"exactly",direction))
if trace_realign then
- report_realign("flushing right. align %a, page %a, realpage %a",align,pageno,realpageno)
+ report_realign("flushing right, align %a, page %a, realpage %a",align,pageno,realpageno)
end
elseif trace_realign then
report_realign("invalid flushing, align %a, page %a, realpage %a",align,pageno,realpageno)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/spac-ali.mkiv b/Master/texmf-dist/tex/context/base/mkiv/spac-ali.mkiv
index 8451e2494f9..2467f83525b 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/spac-ali.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/spac-ali.mkiv
@@ -33,11 +33,11 @@
\definesystemattribute[alignstate][public] % will make a single attributes for several states
\appendtoks
- \attribute\realignattribute \attributeunsetvalue
- \attribute\alignstateattribute\attributeunsetvalue
+ \c_attr_realign \attributeunsetvalue
+ \c_attr_alignstate\attributeunsetvalue
\to \everyforgetall
-\unexpanded\def\resetrealignsignal{\attribute\realignattribute\attributeunsetvalue}
+\unexpanded\def\resetrealignsignal{\c_attr_realign\attributeunsetvalue}
\unexpanded\def\signalinnerrealign{\clf_setrealign\plustwo}
\unexpanded\def\signalouterrealign{\clf_setrealign\plusone}
@@ -293,7 +293,7 @@
\unexpanded\def\spac_align_set_horizontal_none % should also relax \updateraggedskips
{\raggedstatus\zerocount
- \attribute\alignstateattribute\attributeunsetvalue
+ \c_attr_alignstate\attributeunsetvalue
\leftskip \plusone\leftskip
\rightskip \plusone\rightskip
\spaceskip \zeropoint
@@ -305,7 +305,7 @@
\unexpanded\def\spac_align_set_horizontal_left
{\setraggedness\spac_align_set_raggedness_left
\raggedstatus\plusone
- \attribute\alignstateattribute\plusone
+ \c_attr_alignstate\plusone
\leftskip \plusone\leftskip \s!plus\spac_align_set_raggedness_left
\rightskip \plusone\rightskip\s!plus\zeropoint
\spaceskip \v_spac_align_space_amount
@@ -317,7 +317,7 @@
\unexpanded\def\spac_align_set_horizontal_center
{\setraggedness\spac_align_set_raggedness_middle
\raggedstatus\plustwo
- \attribute\alignstateattribute\plustwo
+ \c_attr_alignstate\plustwo
\leftskip \plusone\leftskip \s!plus\spac_align_set_raggedness_middle
\rightskip \plusone\rightskip\s!plus\spac_align_set_raggedness_middle
\spaceskip \v_spac_align_space_amount
@@ -329,7 +329,7 @@
\unexpanded\def\spac_align_set_horizontal_right
{\setraggedness\spac_align_set_raggedness_right
\raggedstatus\plusthree
- \attribute\alignstateattribute\plusthree
+ \c_attr_alignstate\plusthree
\leftskip \plusone\leftskip \s!plus\zeropoint
\rightskip \plusone\rightskip\s!plus\spac_align_set_raggedness_right
\spaceskip \v_spac_align_space_amount
@@ -340,7 +340,7 @@
\unexpanded\def\spac_align_set_horizontal_very_left
{\raggedstatus\plusone
- \attribute\alignstateattribute\plusone
+ \c_attr_alignstate\plusone
\leftskip \plusone\leftskip \s!plus\v_spac_align_fill_amount
\rightskip \plusone\rightskip\s!plus\zeropoint
\spaceskip \v_spac_align_space_amount
@@ -351,7 +351,7 @@
\unexpanded\def\spac_align_set_horizontal_very_center
{\raggedstatus\plustwo
- \attribute\alignstateattribute\plustwo
+ \c_attr_alignstate\plustwo
\leftskip \plusone\leftskip \s!plus\v_spac_align_fill_amount
\rightskip \plusone\rightskip\s!plus\v_spac_align_fill_amount
\spaceskip \v_spac_align_space_amount
@@ -362,7 +362,7 @@
\unexpanded\def\spac_align_set_horizontal_very_right
{\raggedstatus\plusthree
- \attribute\alignstateattribute\plusthree
+ \c_attr_alignstate\plusthree
\leftskip \plusone\leftskip \s!plus\zeropoint
\rightskip \plusone\rightskip\s!plus\v_spac_align_fill_amount
\spaceskip \v_spac_align_space_amount
@@ -374,7 +374,7 @@
\unexpanded\def\spac_align_set_horizontal_wide_center
{\setraggedness\spac_align_set_raggedness_middle
\raggedstatus\plustwo
- \attribute\alignstateattribute\plustwo
+ \c_attr_alignstate\plustwo
\leftskip \plusone\leftskip \s!plus\v_spac_align_fill_amount_half
\rightskip \plusone\rightskip\s!plus\v_spac_align_fill_amount_half
\spaceskip \v_spac_align_space_amount
@@ -385,7 +385,7 @@
\unexpanded\def\spac_align_set_horizontal_centered_last_line
{\raggedstatus\zerocount
- \attribute\alignstateattribute\attributeunsetvalue
+ \c_attr_alignstate\attributeunsetvalue
\leftskip \plusone\leftskip \s!plus\v_spac_align_fill_amount\relax
\rightskip \plusone\rightskip\s!plus\v_spac_align_fill_amount_negative\relax
\spaceskip \zeropoint\relax
@@ -396,7 +396,7 @@
\unexpanded\def\spac_align_set_horizontal_flushedright_last_line
{\raggedstatus\zerocount
- \attribute\alignstateattribute\attributeunsetvalue
+ \c_attr_alignstate\attributeunsetvalue
\leftskip \plusone\leftskip \s!plus\v_spac_align_fill_amount\relax
\rightskip \plusone\rightskip\s!plus\v_spac_align_fill_amount_negative\relax
\spaceskip \zeropoint\relax
@@ -410,7 +410,7 @@
\unexpanded\def\spac_align_set_horizontal_right_tt % a plain command
{\tttf % brrr
\raggedstatus\plusthree
- \attribute\alignstateattribute\plusthree
+ \c_attr_alignstate\plusthree
\leftskip \plusone\leftskip \s!plus\zeropoint\relax
\rightskip \plusone\rightskip\s!plus\spac_align_set_raggedness_right\relax
\spaceskip \zeropoint\relax
@@ -797,7 +797,7 @@
\unexpanded\def\ibox
{\vbox\bgroup
\forgetall
- \let\\=\endgraf
+ \let\\\endgraf
\ifdoublesided\signalinnerrealign\fi
\doifelserightpage\spac_align_set_horizontal_right\spac_align_set_horizontal_left
\let\next}
@@ -805,9 +805,9 @@
\unexpanded\def\obox
{\vbox\bgroup
\forgetall
- \let\\=\endgraf
+ \let\\\endgraf
\ifdoublesided\signalouterrealign\fi
- \doifelserightpage\c_spac_align_state_horizontal_left\spac_align_set_horizontal_right
+ \doifelserightpage\spac_align_set_horizontal_left\spac_align_set_horizontal_right
\let\next}
\let\raggedbox\relax
@@ -882,7 +882,7 @@
\xspaceskip #5\relax
\parfillskip \zeropoint\s!plus#6\relax
\parindent #7\relax
- \attribute\alignstateattribute\ifcase\raggedstatus\attributeunsetvalue\else\raggedstatus\fi}
+ \c_attr_alignstate\ifcase\raggedstatus\attributeunsetvalue\else\raggedstatus\fi}
% older (context) names:
@@ -956,7 +956,7 @@
\dontleavehmode % added in marrakesch at TUG 2006\begingroup
\begingroup
\setlocalhsize % new
- \def\\{\egroup\par\doalignline{#1}{#2}\bgroup}%
+ \protected\def\\{\egroup\par\doalignline{#1}{#2}\bgroup}%
\dowithnextbox
{\hbox to \localhsize
{\ifcase\alignstrutmode\or\strut\fi
@@ -1036,7 +1036,7 @@
\dontleavehmode % added in marrakesch at TUG 2006\begingroup
\begingroup
\setlocalhsize
- \def\\{\egroup\par\doxalignline#1#2#3#4#5#6\bgroup}% inefficient
+ \protected\def\\{\egroup\par\doxalignline#1#2#3#4#5#6\bgroup}% inefficient
\dowithnextbox
{\hbox to \localhsize
{#1\hskip\ifdone#2\else#3\fi#4%
@@ -1230,10 +1230,6 @@
\setvalue{\??reverse\v!normal }{\ifconditional\inlinelefttoright\else\s!reverse\fi}
\setvalue{\??reverse\v!reverse}{\ifconditional\inlinelefttoright \s!reverse\fi}
-\ifcase\contextlmtxmode
- \let\usedirectionparameterreverse\gobbleoneargument
-\else
- \def\usedirectionparameterreverse#1{\begincsname\??reverse#1\c!direction\endcsname}
-\fi
+\let\usedirectionparameterreverse\gobbleoneargument
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/spac-chr.lua b/Master/texmf-dist/tex/context/base/mkiv/spac-chr.lua
index 9b8453ca690..fa6eb18a576 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/spac-chr.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/spac-chr.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['spac-chr'] = {
version = 1.001,
+ optimize = true,
comment = "companion to spac-chr.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
@@ -32,12 +33,11 @@ local getnext = nuts.getnext
local getprev = nuts.getprev
local getattr = nuts.getattr
local setattr = nuts.setattr
-local getlang = nuts.getlang
+local getlanguage = nuts.getlanguage
local setchar = nuts.setchar
local setattrlist = nuts.setattrlist
local getfont = nuts.getfont
local setsubtype = nuts.setsubtype
-local setdisc = nuts.setdisc
local isglyph = nuts.isglyph
local setcolor = nodes.tracers.colors.set
@@ -57,7 +57,6 @@ local new_penalty = nodepool.penalty
local new_glue = nodepool.glue
local new_kern = nodepool.kern
local new_rule = nodepool.rule
-local new_disc = nodepool.disc
local nodecodes = nodes.nodecodes
local gluecodes = nodes.gluecodes
@@ -82,7 +81,7 @@ local fontquads = fonthashes.quads
local setmetatableindex = table.setmetatableindex
-local a_character = attributes.private("characters")
+local a_character = attributes.private("characters") -- this will become a property (or maybe even a field)
local a_alignstate = attributes.private("alignstate")
local c_zero = byte('0')
@@ -130,7 +129,8 @@ end
local function nbsp(head,current)
local para = fontparameters[getfont(current)]
- if getattr(current,a_alignstate) == 1 then -- flushright
+ local attr = getattr(current,a_alignstate) or 0
+ if attr >= 1 or attr <= 3 then -- flushright
head, current = inject_nobreak_space(0x00A0,head,current,para.space,0,0)
else
head, current = inject_nobreak_space(0x00A0,head,current,para.space,para.spacestretch,para.spaceshrink)
@@ -295,30 +295,6 @@ local methods = {
characters.methods = methods
--- function characters.handler(head) -- todo: use traverse_id
--- local current = head
--- while current do
--- local char, id = isglyph(current)
--- if char then
--- local next = getnext(current)
--- local method = methods[char]
--- if method then
--- if trace_characters then
--- report_characters("replacing character %C, description %a",char,lower(chardata[char].description))
--- end
--- local h = method(head,current)
--- if h then
--- head = remove_node(h,current,true)
--- end
--- end
--- current = next
--- else
--- current = getnext(current)
--- end
--- end
--- return head
--- end
-
-- this also works ok in math as we run over glyphs and these stay glyphs ... not sure
-- about scripts and such but that is not important anyway ... some day we can consider
-- special definitions in math
diff --git a/Master/texmf-dist/tex/context/base/mkiv/spac-chr.mkiv b/Master/texmf-dist/tex/context/base/mkiv/spac-chr.mkiv
index 23f4ac8dd64..9113dc6a110 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/spac-chr.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/spac-chr.mkiv
@@ -29,7 +29,7 @@
%D them in a string. So this needs thinking. Not that we can compare the
%D nobreakspace now anyway.
-% \unexpanded\def\specialspacecharacter#1{\begingroup\attribute\charactersattribute#1\ \endgroup}
+% \unexpanded\def\specialspacecharacter#1{\begingroup\c_attr_characters#1\ \endgroup}
%
% \unexpanded\edef\nobreakspace {\specialspacecharacter{"00A0}} % 1 = left
% \unexpanded\edef\ideographicspace {\specialspacecharacter{"2000}}
@@ -54,6 +54,8 @@
% Making them active is also not an option unless we do that in every
% catcode vector.
+\pushoverloadmode
+
% \nobreakspace {\begingroup\setalignstateattribute\normalUchar"00A0\endgroup} % 1 = left
\edef\nobreakspace {\normalUchar"00A0} % space
\edef\softhyphen {\normalUchar"00AD} % softhyohen
@@ -63,6 +65,9 @@
\let\ideographicspace \enquad
\let\ideographichalffillspace \emquad
+\unletfrozen\hairspace
+\unletfrozen\sixperemspace
+
\edef\twoperemspace {\normalUchar"2002} % quad/2
% % "2003 % quad == \quad == \hskip\emwidth
\edef\threeperemspace {\normalUchar"2004} % quad/3
@@ -88,6 +93,8 @@
\let\zwj \zerowidthjoiner
\let\nbsp \nobreakspace
+\popoverloadmode
+
\chardef\optionalspace"1F % will be space unless before punctuation
% Shortcuts:
diff --git a/Master/texmf-dist/tex/context/base/mkiv/spac-flr.mkiv b/Master/texmf-dist/tex/context/base/mkiv/spac-flr.mkiv
index 4c3c0c0421f..a64171247e3 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/spac-flr.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/spac-flr.mkiv
@@ -168,6 +168,23 @@
[\c!alternative=\v!space,
\c!distance=3\emwidth]
+% bonus:
+
+\definefiller
+ [dotfill]
+ [\c!symbol=\textperiod,
+ \c!style=\v!normal,
+ \c!method=\v!middle,
+ \c!width=.5\emwidth,
+ \c!leftmargin=.2\emwidth,
+ \c!rightmargin=.2\emwidth]
+
+\let\mathdotfill\dotfill
+
+\unexpanded\def\textdotfill{\filler[dotfill]}
+
+\unexpanded\def\dotfill{\mathortext\mathdotfill\textdotfill}
+
% maybe box -> symbol
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/spac-grd.mkiv b/Master/texmf-dist/tex/context/base/mkiv/spac-grd.mkiv
index 72d017836f6..482d0cf2ef6 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/spac-grd.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/spac-grd.mkiv
@@ -300,6 +300,14 @@
\normalstartbaselinecorrection
\fi}
+%D Different in LMTX, maybe here we can use this in \MKIV:
+%D
+%D \let\checkprevdepth\forcestrutdepth % mlv only
+%D
+%D as we have sync issues that makes it not work otherwise.
+
+\let\checkprevdepth\baselinecorrection
+
% This is new (and experimental) and might replace some of the above. beware it doesn't always work
% out well, e.g. when used grouped and such (e.g. before display math doesn't work out well).
diff --git a/Master/texmf-dist/tex/context/base/mkiv/spac-hor.mkiv b/Master/texmf-dist/tex/context/base/mkiv/spac-hor.mkiv
index 0f65eea3310..16a1a0d4e9a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/spac-hor.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/spac-hor.mkiv
@@ -210,12 +210,12 @@
%D Here come the handlers (still rather messy ... we need states).
-\newif\ifindentation \indentationtrue % will become a mode
+%newif\ifindentation \indentationtrue % will become a mode
\let\checkindentation\relax
\installmacrostack\checkindentation
-\installmacrostack\ifindentation
+%installmacrostack\ifindentation
\def\spac_indentation_remove
{\ifzeropt\parindent \else
@@ -225,20 +225,20 @@
\fi}
\def\spac_indentation_kill_indeed
- {\global\indentationfalse
+ {%\global\indentationfalse
\spac_indentation_remove}
\def\spac_indentation_do_toggle_indeed
- {\global\indentationfalse
+ {%\global\indentationfalse
\glet\checkindentation\spac_indentation_no_toggle_indeed
\spac_indentation_remove}
\def\spac_indentation_no_toggle_indeed
- {\global\indentationtrue
+ {%\global\indentationtrue
\glet\checkindentation\spac_indentation_do_toggle_indeed}
\def\spac_indentation_do_indeed
- {\global\indentationtrue}
+ {}%\global\indentationtrue}
\def\spac_indentation_do_toggle
{\glet\checkindentation\spac_indentation_do_toggle_indeed}
@@ -264,13 +264,13 @@
\def\spac_indentation_variant_no % made global
{\ifinpagebody \else
- \global\indentationfalse
+ %\global\indentationfalse
\glet\checkindentation\spac_indentation_no_next_check
\fi}
\def\nonoindentation % bv bij floats
{\ifinpagebody \else
- \global\indentationtrue
+ %\global\indentationtrue
\glet\checkindentation\spac_indentation_do_indeed
\fi}
@@ -478,11 +478,20 @@
%D from now on we treat it as a normal space and not as a space with \type
%D {sfcode} 1000.
+% \unexpanded\def\specialspaceprimitive
+% {\begingroup
+% % so, no fancy extra spacing after: foo i.e.\ bar
+% \nonfrenchspacing\normalspaceprimitive
+% \endgroup}
+
\unexpanded\def\specialspaceprimitive
- {\begingroup
- % so, no fancy extra spacing after: foo i.e.\ bar
- \nonfrenchspacing\normalspaceprimitive
- \endgroup}
+ {% is a current state, set explicitly or when a character is appended
+ \ifhmode
+ \spacefactor\plusthousand
+ \else
+ \dontleavehmode
+ \fi
+ \normalspaceprimitive}
\unexpanded\def\normalnotobeyedspace
{\mathortext\normalspaceprimitive\specialspaceprimitive} % no \dontleavehmode\space (else no frenchspacing)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/spac-lin.mkiv b/Master/texmf-dist/tex/context/base/mkiv/spac-lin.mkiv
index d862f6d8109..aaa73d19490 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/spac-lin.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/spac-lin.mkiv
@@ -74,6 +74,42 @@
\let\spac_lines_break \relax
\let\spac_after_first_obeyed_line\relax
+\let\spac_lines_indent \relax
+
+%D See \type {indentation-005.tex}:
+%D
+%D \starttyping
+%D \setuplines[indentlist={0pt,10pt,15pt,20pt}]
+%D
+%D \setupindenting[yes,1em]
+%D \setuplines[indentlist={0pt,*,*}]
+%D
+%D \setuplines[indentlist={0pt,1em,*}]
+%D \starttyping
+
+\newcount\c_spac_lines_indent_cnt
+\newcount\c_spac_lines_indent_max
+\newdimen\d_spac_lines_indent
+
+\def\spac_lines_indent_indeed
+ {\ifnum\c_spac_lines_indent_cnt=\c_spac_lines_indent_max
+ \c_spac_lines_indent_cnt\plusone
+ \else
+ \advance\c_spac_lines_indent_cnt\plusone
+ \fi
+ \getfromcommacommand[\m_spac_lines_indentlist][\c_spac_lines_indent_cnt]%
+ \ifx\commalistelement\wildcardsymbol
+ \hskip\d_spac_lines_indent
+ \else
+ \scratchdimen\dimexpr\commalistelement\relax
+ \hskip\ifdim\scratchdimen=\zeropoint
+ \zeropoint
+ \else
+ \scratchdimen
+ \d_spac_lines_indent\scratchdimen
+ \fi
+ \fi
+ \relax}
\def\spac_lines_start_indeed[#1]% new: optional second argument (WS)
{\iffirstargument
@@ -96,23 +132,38 @@
\typesettinglinestrue
\setupwhitespace[\v!none]% todo use fast variant
%\obeylines % move upwards to keep spaces in the first line due to optional argument
+ %
+ \edef\m_spac_lines_indentlist{\linesparameter\c!indentlist}%
+ \getcommacommandsize[\m_spac_lines_indentlist]%
+ \c_spac_lines_indent_max\commalistsize
+ \c_spac_lines_indent_cnt\zerocount
+ \ifnum\c_spac_lines_indent_max>\plusone
+ \let\spac_lines_indent\spac_lines_indent_indeed
+ \d_spac_lines_indent\d_spac_indentation_par
+ \else
+ \let\spac_lines_indent\relax
+ \fi
+ %
\ignorespaces
\glet\spac_after_first_obeyed_line\spac_lines_after_first_obeyed_line_a
- \let\obeyedline\spac_lines_obeyed_line
+ \enforced\let\obeyedline\spac_lines_obeyed_line
\activatespacehandler{\linesparameter\c!space}%
\dostarttagged\t!line\empty
- \GotoPar} % this will become a nice lowercased helper
+ \ignorepars}
+
% we could have states instead and handle option in there
\def\spac_lines_after_first_obeyed_line_a % tzt two pass, like itemize
{\linesparameter\c!command
+ \spac_lines_indent
\linesparameter\c!left
\glet\spac_after_first_obeyed_line\spac_lines_after_first_obeyed_line_b}
\def\spac_lines_after_first_obeyed_line_b
{\spac_lines_break
\linesparameter\c!command
+ \spac_lines_indent
\linesparameter\c!left}
\def\spac_lines_obeyed_line
@@ -120,7 +171,7 @@
\dostoptagged % can be a dummy one as we don't look ahead
\par
\dostarttagged\t!line\empty
- \futurelet\next\spac_lines_between}
+ \futurelet\nexttoken\spac_lines_between}
\unexpanded\def\spac_lines_stop
{\dostoptagged
@@ -131,10 +182,10 @@
\egroup}
\def\spac_lines_between
- {\ifx\next\spac_lines_stop
+ {\ifx\nexttoken\spac_lines_stop
\donefalse
\else
- \doifelsemeaning\next\obeyedline % brrr
+ \doifelsemeaning\nexttoken\obeyedline % brrr
{\donefalse\linesparameter\c!inbetween}
{\donetrue\spac_after_first_obeyed_line}%
\fi}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/spac-par.mkiv b/Master/texmf-dist/tex/context/base/mkiv/spac-par.mkiv
index 7678cc34bdd..752d5c05904 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/spac-par.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/spac-par.mkiv
@@ -15,13 +15,19 @@
\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).
+%D The dreadful sequence \type {\bgroup} \unknown\ \type {\carryoverpar} \unknown\
+%D \type {\egroup} is needed when for instance sidefloats are used in combination
+%D with something that starts with a group. This is because otherwise the
+%D indentation as set (by the output routine) inside the group are forgotten
+%D afterwards. (I must not forget its existence).
+
+% Todo (maybe):
+%
+% \parshape \getparshape\relax
+% \interlinepenalties \getinterlinepenalties\relax
+% \clubpenalties \getclubpenalties\relax
+% \widowpenalties \getwidowpenalties\relax
+% \displaywidowpenalties\getdisplaywidowpenalties\relax
\def\carryoverpar#1% #1 can be \endgroup or \egroup or ... expandable !
{\normalexpanded
@@ -30,7 +36,8 @@
\hangafter \the\hangafter
\parskip \the\parskip
\leftskip \the\leftskip
- \rightskip \the\rightskip}}
+ \rightskip \the\rightskip
+ \relax}}
\unexpanded\def\pushparagraphproperties
{\edef\currentparagraphproperties{\carryoverpar\relax}%
@@ -43,8 +50,27 @@
\unexpanded\def\flushparagraphproperties
{\popmacro\currentparagraphproperties}
-% Beware, changing this will break some code (like pos/backgrounds) but
-% it has been changed anyway so let's see where things go wrong.
+%D New experimental stuff, not supported in \MKIV:
+
+\let\freezeparagraphproperties \relax
+\let\defrostparagraphproperties\relax
+\let\setparagraphfreezing \relax
+\let\forgetparagraphfreezing \relax
+\let\updateparagraphproperties \relax
+\let\updateparagraphpenalties \relax
+\let\updateparagraphdemerits \relax
+\let\updateparagraphshapes \relax
+
+\let\updateparwrapper \relax
+\let\forgetparwrapper \relax
+\let\registerparwrapper\gobblethreearguments
+\let\directparwrapper \gobbletwoarguments
+
+\let\spac_paragraph_wrap \relax
+\let\spac_paragraph_freeze\relax
+
+%D Beware, changing this will break some code (like pos/backgrounds) but it has been
+%D changed anyway so let's see where things go wrong.
\installcorenamespace{paragraphintro}
@@ -133,11 +159,11 @@
\gtoksapp\t_spac_paragraphs_intro_first{#1}%
\glet\insertparagraphintro\spac_paragraphs_flush_intro}
-%D Here comes the flusher (we misuse the one level expansion of token
-%D registers to feed a nice stream into the paragraph.)
+%D Here comes the flusher (we misuse the one level expansion of token registers to
+%D feed a nice stream into the paragraph.)
-\unexpanded\def\spac_paragraphs_flush_intro % we make sure that the token lists expand directly after another
- {\normalexpanded{% % so the first code is there twice
+\unexpanded\def\spac_paragraphs_flush_intro % we make sure that the token lists expand directly
+ {\normalexpanded{% % after another so the first code is there twice
\ifconditional\c_spac_paragraphs_intro_each
\ifconditional\c_spac_paragraphs_intro_next
\glet\insertparagraphintro\spac_paragraphs_flush_intro_next
@@ -180,8 +206,8 @@
%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).
+%D This macro collects data that will be flushed at the next paragraph. By using
+%D this macro you can avoid interfering nodes (writes, etc).
\let\flushpostponednodedata\relax % hook into everypar
diff --git a/Master/texmf-dist/tex/context/base/mkiv/spac-prf.lua b/Master/texmf-dist/tex/context/base/mkiv/spac-prf.lua
index 7731b21f7e1..2223c77302d 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/spac-prf.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/spac-prf.lua
@@ -17,7 +17,6 @@ local formatters = string.formatters
local nodecodes = nodes.nodecodes
local gluecodes = nodes.gluecodes
local listcodes = nodes.listcodes
-local leadercodes = nodes.leadercodes
local glyph_code = nodecodes.glyph
local disc_code = nodecodes.disc
@@ -31,8 +30,7 @@ local math_code = nodecodes.math
local rule_code = nodecodes.rule
local marginkern_code = nodecodes.marginkern
-local leaders_code = leadercodes.leaders
-
+local leaders_code = gluecodes.leaders
local lineskip_code = gluecodes.lineskip
local baselineskip_code = gluecodes.baselineskip
diff --git a/Master/texmf-dist/tex/context/base/mkiv/spac-prf.mkvi b/Master/texmf-dist/tex/context/base/mkiv/spac-prf.mkvi
index 9a00da395e2..ac0a2f4e15c 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/spac-prf.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/spac-prf.mkvi
@@ -70,7 +70,7 @@
\relax}
\unexpanded\def\resetprofile
- {\attribute\profilemethodattribute\attributeunsetvalue}
+ {\c_attr_profilemethod\attributeunsetvalue}
\unexpanded\def\useprofileparameter#getparameter%
{\edef\m_spac_profile_asked{#getparameter\c!profile}%
diff --git a/Master/texmf-dist/tex/context/base/mkiv/spac-ver.lua b/Master/texmf-dist/tex/context/base/mkiv/spac-ver.lua
index 33b81e5c7e8..2fc9263213c 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/spac-ver.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/spac-ver.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['spac-ver'] = {
version = 1.001,
+ optimize = true,
comment = "companion to spac-ver.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
@@ -38,6 +39,7 @@ local unpack = unpack or table.unpack
local allocate = utilities.storage.allocate
local todimen = string.todimen
local formatters = string.formatters
+local abs = math.abs
local nodes = nodes
local trackers = trackers
@@ -180,11 +182,10 @@ local gluecodes = nodes.gluecodes
local penalty_code = nodecodes.penalty
local kern_code = nodecodes.kern
local glue_code = nodecodes.glue
-local insert_code = nodecodes.ins
local hlist_code = nodecodes.hlist
local vlist_code = nodecodes.vlist
local rule_code = nodecodes.rule
-local localpar_code = nodecodes.localpar
+local par_code = nodecodes.par
local userskip_code = gluecodes.userskip
local lineskip_code = gluecodes.lineskip
@@ -292,7 +293,7 @@ end
local function validvbox(parentid,list)
if parentid == hlist_code then
local id = getid(list)
- if id == localpar_code and start_of_par(list) then
+ if id == par_code and start_of_par(list) then
list = getnext(list)
if not next then
return nil
@@ -328,7 +329,7 @@ local function already_done(parentid,list,a_snapmethod) -- todo: done when only
-- problem: any snapped vbox ends up in a line
if list and parentid == hlist_code then
local id = getid(list)
- if id == localpar_code and start_of_par(list) then
+ if id == par_code and start_of_par(list) then
list = getnext(list)
if not list then
return false
@@ -1262,7 +1263,7 @@ do
end
end
-- in fact, we could try again later ... so then no remove (a few tries)
- return remove_node(head, current, true)
+ return remove_node(head,current,true)
end
local function collapser(head,where,what,trace,snap,a_snapmethod) -- maybe also pass tail
@@ -1500,7 +1501,7 @@ do
-- if trace then
-- trace_done("removed penalty",current)
-- end
- -- head, current = remove_node(head, current, true)
+ -- head, current = remove_node(head,current,true)
current = getnext(current)
elseif id == kern_code then
if snap and trace_vsnapping and getkern(current) ~= 0 then
@@ -1538,7 +1539,7 @@ do
if trace then
trace_skip("penalty in skip",sc,so,sp,current)
end
- head, current = remove_node(head, current, true)
+ head, current = remove_node(head,current,true)
elseif not sc then -- if not sc then
if glue_data then
if trace then
@@ -1561,7 +1562,7 @@ do
if trace then
trace_natural("removed",current)
end
- head, current = remove_node(head, current, true)
+ head, current = remove_node(head,current,true)
if trace then
trace_natural("collapsed",previous)
end
@@ -1586,7 +1587,7 @@ do
if trace then
trace_skip(sc == disable and "disable" or "enable",sc,so,sp,current)
end
- head, current = remove_node(head, current, true)
+ head, current = remove_node(head,current,true)
else
current = next
end
@@ -1595,12 +1596,12 @@ do
trace_skip("packed",sc,so,sp,current)
end
-- can't happen !
- head, current = remove_node(head, current, true)
+ head, current = remove_node(head,current,true)
elseif sc == nowhite then
local next = getnext(current)
if next then
ignore_whitespace = true
- head, current = remove_node(head, current, true)
+ head, current = remove_node(head,current,true)
else
current = next
end
@@ -1608,7 +1609,7 @@ do
if trace then
trace_skip("discard",sc,so,sp,current)
end
- head, current = remove_node(head, current, true)
+ head, current = remove_node(head,current,true)
elseif sc == overlay then
-- todo (overlay following line over previous
if trace then
@@ -1621,20 +1622,20 @@ do
if trace then
trace_skip("disabled",sc,so,sp,current)
end
- head, current = remove_node(head, current, true)
+ 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)
+ 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
flush_node(glue_data)
- head, current, glue_data = remove_node(head, current)
+ 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
@@ -1650,7 +1651,7 @@ do
if trace then
trace_skip("remove smallest",sc,so,sp,current)
end
- head, current = remove_node(head, current, true)
+ head, current = remove_node(head,current,true)
end
elseif sc == goback then
if trace then
@@ -1665,34 +1666,34 @@ do
trace_skip("force",sc,so,sp,current)
end
flush_node(glue_data)
- head, current, glue_data = remove_node(head, current)
+ head, current, glue_data = remove_node(head,current)
elseif sc == penalty then
if trace then
trace_skip("penalty",sc,so,sp,current)
end
flush_node(glue_data)
glue_data = nil
- head, current = remove_node(head, current, true)
+ head, current = remove_node(head,current,true)
elseif sc == add then
if trace then
trace_skip("add",sc,so,sp,current)
end
local cwidth, cstretch, cshrink = getglue(current)
local gwidth, gstretch, gshrink = getglue(glue_data)
- setglue(old,gwidth + cwidth, gstretch + cstretch, gshrink + cshrink)
+ setglue(glue_data,gwidth + cwidth, gstretch + cstretch,gshrink + cshrink)
-- toto: order
- head, current = remove_node(head, current, true)
+ 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)
+ 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)
+ head, current = remove_node(head,current,true)
end
if sc == force then
force_glue = true
@@ -1747,7 +1748,7 @@ do
if trace then
trace_natural("ignored parskip",current)
end
- head, current = remove_node(head, current, true)
+ head, current = remove_node(head,current,true)
elseif glue_data then
local w = getwidth(current)
if (w ~= 0) and (w > getwidth(glue_data)) then
@@ -1755,18 +1756,18 @@ do
if trace then
trace_natural("taking parskip",current)
end
- head, current = remove_node(head, current)
+ head, current = remove_node(head,current)
else
if trace then
trace_natural("removed parskip",current)
end
- head, current = remove_node(head, current, true)
+ head, current = remove_node(head,current,true)
end
else
if trace then
trace_natural("honored parskip",current)
end
- head, current, glue_data = remove_node(head, current)
+ head, current, glue_data = remove_node(head,current)
end
elseif subtype == topskip_code or subtype == splittopskip_code then
local next = getnext(current)
@@ -1901,18 +1902,6 @@ do
return head
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
-
- -- do
-
local stackhead, stacktail, stackhack = nil, nil, false
local function report(message,where,lst)
@@ -1929,7 +1918,6 @@ do
local forceflush = false
function vspacing.pagehandler(newhead,where)
- -- local newhead = texlists.contrib_head
if newhead then
local newtail = find_node_tail(newhead) -- best pass that tail, known anyway
local flush = false
@@ -1971,11 +1959,9 @@ do
if stackhack then
stackhack = false
if trace_collect_vspacing then report("%s > processing %s nodes: %s",where,newhead) end
- -- texlists.contrib_head = collapser(newhead,"page",where,trace_page_vspacing,true,a_snapmethod)
newhead = collapser(newhead,"page",where,trace_page_vspacing,true,a_snapmethod)
else
if trace_collect_vspacing then report("%s > flushing %s nodes: %s",where,newhead) end
- -- texlists.contrib_head = newhead
end
return newhead
else
@@ -1992,20 +1978,6 @@ do
return nil
end
- -- function vspacing.flushpagestack()
- -- if stackhead then
- -- local head = texlists.contrib_head
- -- if head then
- -- local tail = find_node_tail(head)
- -- setlink(tail,stackhead)
- -- else
- -- texlists.contrib_head = tonode(stackhead)
- -- end
- -- stackhead, stacktail = nil, nil
- -- end
- --
- -- end
-
function vspacing.pageoverflow()
local h = 0
if stackhead then
@@ -2156,32 +2128,49 @@ do
end
end
- local trace = false
+ local trace = false
+ local last = nil
+ local vmode_code = tex.modelevels.vertical
+ local temp_code = nodecodes.temp
+ local getnest = tex.getnest
+ local getlist = tex.getlist
trackers.register("vspacing.forcestrutdepth",function(v) trace = v end)
- local last = nil
+ -- abs : negative is inner
- -- function vspacing.forcestrutdepth(n,depth,trace_mode,plus)
- -- local box = texgetbox(n)
- -- if box then
- -- box = tonut(box)
- -- local head = getlist(box)
- -- if head then
- -- local tail = find_node_tail(head)
- -- if tail and getid(tail) == hlist_code then
- -- local dp = getdepth(tail)
- -- if dp < depth then
- -- setdepth(tail,depth)
- -- outer.prevdepth = depth
- -- if trace or trace_mode > 0 then
- -- nuts.setvisual(tail,"depth")
- -- end
- -- end
- -- end
- -- end
- -- end
- -- end
+ function vspacing.checkstrutdepth(depth)
+ local nest = getnest()
+ if abs(nest.mode) == vmode_code and nest.head then
+ local tail = nest.tail
+ local id = tail.id
+ if id == hlist_code then
+ if tail.depth < depth then
+ tail.depth = depth
+ end
+ nest.prevdepth = depth
+ elseif id == temp_code and getnest("ptr") == 0 then
+ local head = getlist("page_head")
+ if head then
+ tail = nodes.tail(head)
+ if tail and tail.id == hlist_code then
+ if tail.depth < depth then
+ tail.depth = depth
+ end
+ nest.prevdepth = depth
+ -- only works in lmtx
+ texset("pagedepth",depth)
+ end
+ end
+ end
+ end
+ end
+
+ interfaces.implement {
+ name = "checkstrutdepth",
+ arguments = "dimension",
+ actions = vspacing.checkstrutdepth,
+ }
function vspacing.forcestrutdepth(n,depth,trace_mode,plus)
local box = texgetbox(n)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/spac-ver.mkiv b/Master/texmf-dist/tex/context/base/mkiv/spac-ver.mkiv
index 6ed1847c577..3f330a267f4 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/spac-ver.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/spac-ver.mkiv
@@ -66,7 +66,7 @@
\def\normalskipamount
{\openlineheight
- \ifgridsnapping \else \ifblankflexible
+ \ifgridsnapping \else \ifconditional\c_spac_whitespace_flexible
\s!plus \skipgluefactor\openlineheight
\s!minus\skipgluefactor\openlineheight
\fi \fi
@@ -166,17 +166,11 @@
\installmacrostack\currentinterlinespace
\unexpanded\def\setupinterlinespace
- {\dodoubleempty\spac_linespacing_setup}
+ {\dosingleempty\spac_linespacing_setup}
-\ifdefined\setupinterlinespace_double \else
- \let\setupinterlinespace_double\setup_interlinespace % for a while
-\fi
-
-\def\spac_linespacing_setup[#1][#2]%
+\def\spac_linespacing_setup[#1]%
{\settrue\interlinespaceisset % reset has to be done when needed
- \ifsecondargument
- \setupinterlinespace_double[#1][#2]%
- \else\iffirstargument
+ \iffirstargument
\ifcsname\namedinterlinespacehash{#1}\s!parent\endcsname
\edef\currentinterlinespace{#1}%
\spac_linespacing_setup_specified_interline_space
@@ -187,7 +181,7 @@
\else
\let\currentinterlinespace\empty
\spac_linespacing_synchronize_local
- \fi\fi}
+ \fi}
\def\spac_linespacing_setup_specified_or_relative[#1]%
{\doifelseassignment{#1}\setupspecifiedinterlinespace\setuprelativeinterlinespace[#1]%
@@ -738,19 +732,19 @@
\unexpanded\def\setmaxdepth
{\maxdepth\systemmaxdepthfactor\globalbodyfontsize}
-\let\normalbaselineskip \relax \newskip \normalbaselineskip % these got lost in the transition to mkiv due
-\let\normallineskip \relax \newskip \normallineskip % to auto-\normal* definitions and registers
-\let\normallineskiplimit\relax \newdimen\normallineskiplimit % being protected
+\newskip \usedbaselineskip
+\newskip \usedlineskip
+\newdimen\usedlineskiplimit
\unexpanded\def\normalbaselines
- {\baselineskip \normalbaselineskip
- \lineskip \normallineskip
- \lineskiplimit\normallineskiplimit}
+ {\baselineskip \usedbaselineskip
+ \lineskip \usedlineskip
+ \lineskiplimit\usedlineskiplimit}
\unexpanded\def\flexiblebaselines
- {\baselineskip \normalbaselineskip
- \lineskip 1\normallineskip \s!plus 1\s!fill
- \lineskiplimit\normallineskiplimit}
+ {\baselineskip \usedbaselineskip
+ \lineskip 1\usedlineskip \s!plus 1\s!fill
+ \lineskiplimit\usedlineskiplimit}
\unexpanded\def\setnormalbaselines
{\ifdim\normallineheight>\zeropoint
@@ -770,13 +764,13 @@
\ifdim\dimexpr\minimumstrutdepth+\minimumstrutheight\relax>\zeropoint
\openlineheight\dimexpr\openstrutheight+\openstrutdepth\relax % new
\fi
- \normalbaselineskip\openlineheight
+ \usedbaselineskip\openlineheight
\ifgridsnapping\else
\s!plus \m_spac_vertical_baseline_stretch_factor\openlineheight
\s!minus\m_spac_vertical_baseline_shrink_factor \openlineheight
\fi
- \normallineskip\minimumlinedistance\relax % \onepoint\relax
- \normallineskiplimit\zeropoint\relax
+ \usedlineskip\minimumlinedistance\relax % \onepoint\relax
+ \usedlineskiplimit\zeropoint\relax
\normalbaselines}
\unexpanded\def\spacing#1% vertical
@@ -818,9 +812,9 @@
\openstrutheight \the\openstrutheight
\openstrutdepth \the\openstrutdepth
\openlineheight \the\openlineheight
- \normalbaselineskip \the\normalbaselineskip
- \normallineskip \the\normallineskip
- \normallineskiplimit\the\normallineskiplimit
+ \usedbaselineskip \the\usedbaselineskip
+ \usedlineskip \the\usedlineskip
+ \usedlineskiplimit \the\usedlineskiplimit
\noexpand\def\noexpand\normallineheight{\the\dimexpr\normallineheight}%
\noexpand\normalbaselines}}
@@ -1351,11 +1345,6 @@
\let\oninterlineskip\relax
-\unexpanded\def\leaveoutervmode
- {\ifvmode\ifinner\else
- \leavevmode
- \fi\fi}
-
\unexpanded\def\resetpenalties#1%
{\ifdefined#1%
#1\minusone
@@ -1500,14 +1489,14 @@
\newdimen \globalbodyfontstrutheight
\newdimen \globalbodyfontstrutdepth
-\def\snappedvboxattribute{\ifgridsnapping attr \snapvboxattribute \attribute\snapmethodattribute\fi}
-\def\setlocalgridsnapping{\ifgridsnapping \attribute \snapvboxattribute \attribute\snapmethodattribute\fi}
+\def\snappedvboxattribute{\ifgridsnapping attr\snapvboxattribute\c_attr_snapmethod\fi}
+\def\setlocalgridsnapping{\ifgridsnapping \c_attr_snapvbox \c_attr_snapmethod\fi}
\def\spac_grids_set_local_snapping#1%
{\ifgridsnapping
\doifsomething{#1}%
{\spac_grids_snap_value_set{#1}%
- \attribute \snapvboxattribute \attribute\snapmethodattribute}%
+ \c_attr_snapvbox\c_attr_snapmethod}%
\fi}
% \unexpanded\def\installsnapvalues#1#2% todo: a proper define
@@ -1515,7 +1504,7 @@
% \ifcsname\??gridsnapperattributes\currentsnapper\endcsname \else
% \setevalue{\??gridsnapperattributes\currentsnapper}{\clf_definesnapmethod{#1}{#2}}%
% \fi
-% \setevalue{\??gridsnappers#1}{\attribute\snapmethodattribute\csname\??gridsnapperattributes\currentsnapper\endcsname\space}}
+% \setevalue{\??gridsnappers#1}{\c_attr_snapmethod\csname\??gridsnapperattributes\currentsnapper\endcsname\space}}
\def\spac_grids_expand_snapper#1%
{\edef\m_spac_snapper
@@ -1534,7 +1523,7 @@
\scratchcounter\clf_definesnapmethod{#1}{\m_spac_snapper}%
\setevalue{\??gridsnapperattributes\currentsnapper}{\the\scratchcounter}%
\fi
- \setevalue{\??gridsnappers#1}{\attribute\snapmethodattribute\the\scratchcounter\relax}%
+ \setevalue{\??gridsnappers#1}{\c_attr_snapmethod\the\scratchcounter\relax}%
\letvalue{\??gridsnappersets#1}\m_spac_snapper}
\def\theexpandedsnapperset#1{\begincsname\??gridsnappersets#1\endcsname} % only for manuals
@@ -1542,10 +1531,10 @@
\unexpanded\def\usegridparameter#1% no checking here
{\edef\m_spac_grid_asked{#1\c!grid}%
\ifx\m_spac_grid_asked\empty
- \attribute \snapvboxattribute\attributeunsetvalue
+ \c_attr_snapvbox\attributeunsetvalue
\else
\spac_grids_snap_value_set\m_spac_grid_asked
- \attribute \snapvboxattribute\attribute\snapmethodattribute
+ \c_attr_snapvbox\c_attr_snapmethod
\fi}
\unexpanded\def\definegridsnapping
@@ -1556,7 +1545,7 @@
\edef\spac_grids_snap_value_reset
{%\gridsnappingfalse
- \attribute\snapmethodattribute\attributeunsetvalue}
+ \c_attr_snapmethod\attributeunsetvalue}
\def\spac_grids_snap_value_set#1%
{%\gridsnappingtrue
@@ -1605,9 +1594,9 @@
%D We're not downward compatible with \MKII ! Not yet in interface file:
-\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!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]
@@ -1717,7 +1706,7 @@
\clf_vspacingcollapse\nextbox\relax % isn't that already done?
\fi
\doifelsenothing{#1}{\spac_grids_snap_value_set\v!normal}{\spac_grids_snap_value_set{#1}}%
- \clf_vspacingsnap\nextbox\attribute\snapmethodattribute\relax
+ \clf_vspacingsnap\nextbox\c_attr_snapmethod\relax
\ifvbox\nextbox\vbox\else\hbox\fi attr \snapmethodattribute \zerocount {\box\nextbox}% no pack (?), we snap
\egroup}
@@ -1883,11 +1872,8 @@
%D This has become obsolete:
-\def\fuzzysnappedbox#1#2% \box<n> \unvbox<n>
- {#1#2}
-
-\def\moveboxontogrid#1#2#3% will become obsolete, but it needs checking
- {}
+% \def\moveboxontogrid#1#2#3% will become obsolete, but it needs checking
+% {}
%D Helper:
@@ -1948,7 +1934,7 @@
\clf_vspacingsetamount{#1}}
\def\spac_vspacing_no_topskip % use grouped
- {\attribute\skipcategoryattribute\plusten}
+ {\c_attr_skipcategory\pluseleven}
% \installcorenamespace{vspacingamountnormal}
% \installcorenamespace{vspacingamountgrid}
@@ -1979,9 +1965,9 @@
\appendtoks
\s_spac_vspacing_temp\zeropoint
- \attribute\skipcategoryattribute\plusone
- \attribute\skippenaltyattribute \attributeunsetvalue
- \attribute\skiporderattribute \attributeunsetvalue
+ \c_attr_skipcategory\plusone
+ \c_attr_skippenalty \attributeunsetvalue
+ \c_attr_skiporder \attributeunsetvalue
\ifgridsnapping
\settrue\c_space_vspacing_fixed
\else
@@ -2003,10 +1989,10 @@
\unexpanded\def\setblankcategory#1%
{\settrue\c_space_vspacing_done
- \attribute\skipcategoryattribute#1\relax}
+ \c_attr_skipcategory#1\relax}
\unexpanded\def\setblankorder#1%
- {\attribute\skiporderattribute#1\relax}
+ {\c_attr_skiporder#1\relax}
\unexpanded\def\fixedblankskip
{\settrue\c_space_vspacing_fixed}
@@ -2021,8 +2007,8 @@
\unexpanded\def\setblankpenalty#1%
{\flushblankhandling
\settrue\c_space_vspacing_done
- \attribute\skipcategoryattribute \plusthree
- \attribute\skippenaltyattribute #1\relax
+ \c_attr_skipcategory\plusthree
+ \c_attr_skippenalty #1\relax
\flushblankhandling}
\unexpanded\def\startblankhandling % move this to \vspacing
@@ -2181,17 +2167,17 @@
\unexpanded\def\directvpenalty#1%
{\begingroup
- \attribute\skipcategoryattribute \plusthree
- \attribute\skippenaltyattribute #1\relax
- \attribute\skiporderattribute \attributeunsetvalue
+ \c_attr_skipcategory\plusthree
+ \c_attr_skippenalty #1\relax
+ \c_attr_skiporder \attributeunsetvalue
\vskip\zeropoint
\endgroup}
\unexpanded\def\directvskip#1%
{\begingroup
- \attribute\skipcategoryattribute \plusone
- \attribute\skippenaltyattribute \attributeunsetvalue
- \attribute\skiporderattribute \attributeunsetvalue
+ \c_attr_skipcategory\plusone
+ \c_attr_skippenalty \attributeunsetvalue
+ \c_attr_skiporder \attributeunsetvalue
\vskip#1\relax
\endgroup}
@@ -2343,7 +2329,7 @@
\unexpanded\def\inhibitblank
{\ifvmode
\begingroup
- \attribute\skipcategoryattribute\plusfive
+ \c_attr_skipcategory\plusfive
\vskip\zeropoint
\endgroup
\fi}
@@ -2655,6 +2641,8 @@
% test \par
% test \par
+% only main vertical list
+
\unexpanded\def\ignoreparskip{\c_spac_vspacing_ignore_parskip\plusone}
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/spac-ver.mkxl b/Master/texmf-dist/tex/context/base/mkiv/spac-ver.mkxl
deleted file mode 100644
index c56352077f3..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/spac-ver.mkxl
+++ /dev/null
@@ -1,2605 +0,0 @@
-%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 ADE \& \CONTEXT\ Development Team}]
-%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}{optimize}
-
-% todo: use usernodes ?
-
-% todo: itemize : intro ... only when there is one or two lines preceding and then
-% keep these together i.e. \blank[intro]
-
-% Isn't it about time to get rid of topskip i.e. make it equivalent to
-% \openstrutheight so that we can remove delta code.
-%
-% There might be more namespace protection.
-
-%D There are two ways to influence the interline spacing. The most general and often
-%D 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 instance saying
-%D
-%D \starttyping
-%D \setupinterlinespace[line=12pt]
-%D \stoptyping
-%D
-%D sets things fixed for all sizes, which is definitely not what we want. Therefore
-%D one can also say:
-%D
-%D \starttyping
-%D \definebodyfontenvironment[9pt][interlinespace=11pt]
-%D \stoptyping
-%D
-%D One can still use \type {\setupinterlinespace} (without arguments) to set the
-%D interline space according to the current font, e.g. a \type {\bfa}.
-
-% will be cleaned up but it will stay messy because we accept so
-% many variants
-
-\newif\iflocalinterlinespace
-
-\newskip \s_spac_vspacing_temp \s_spac_vspacing_temp\bigskipamount
-
-\def\skipfactor {.75}
-\def\skipgluefactor{.25}
-
-% \def\normalskipamount
-% {\openlineheight
-% \ifgridsnapping \else \ifblankflexible
-% \s!plus \skipgluefactor\openlineheight
-% \s!minus\skipgluefactor\openlineheight
-% \fi \fi
-% \relax}
-
-\def\normalskipamount
- {\openlineheight
- \ifgridsnapping \orelse \ifblankflexible
- \s!plus \skipgluefactor\openlineheight
- \s!minus\skipgluefactor\openlineheight
- \fi
- \relax}
-
-\ifdefined\bodyfontinterlinespace \else
- \let\bodyfontinterlinespace\empty
-\fi
-
-\unexpanded\def\presetnormallineheight % each bodyfont
- {\edef\normallineheight{\interlinespaceparameter\c!line}%
- \iflocalinterlinespace \else
- \edef\m_spac_normallineheight{\bodyfontinterlinespace}%
- \ifx\m_spac_normallineheight\empty \else
- \let\normallineheight\m_spac_normallineheight
- \fi
- \fi}
-
-\unexpanded\def\setupspecifiedinterlinespace[#1]%
- {\setupcurrentinterlinespace[#1]%
- \spac_linespacing_setup_specified_interline_space}
-
-\def\spac_linespacing_setup_specified_interline_space
- {\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\m_spac_vertical_baseline_stretch_factor{\interlinespaceparameter\c!stretch }%
- \edef\m_spac_vertical_baseline_shrink_factor {\interlinespaceparameter\c!shrink }%
- % 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
-
-\installcorenamespace{interlinespacerelative}
-
-\let\setrelativeinterlinespace \relax % used elsewhere
-\let\currentrelativeinterlinespace\empty
-
-\setvalue{\??interlinespacerelative\v!on }{\oninterlineskip}
-\setvalue{\??interlinespacerelative\v!off }{\offinterlineskip}
-\setvalue{\??interlinespacerelative\v!reset}{\let\currentrelativeinterlinespace\empty
- \let\setrelativeinterlinespace\relax
- \setfontparameters}
-\setvalue{\??interlinespacerelative\v!auto }{\let\setrelativeinterlinespace\spac_linespacing_set_relative_interlinespace}
-
-\def\spac_linespacing_set_specified_relative_interlinespace#1% fragile?
- {\doifelsedimenstring{#1}
- {\setupspecifiedinterlinespace[\c!line=#1]}
- {\assignvalue{#1}\currentrelativeinterlinespace{1.00}{1.25}{1.50}%
- \spacing\currentrelativeinterlinespace}}
-
-\unexpanded\def\setuprelativeinterlinespace[#1]%
- {\processcommalist[#1]\spac_linespacing_setup_relative_interlinespace}
-
-\def\spac_linespacing_setup_relative_interlinespace#1%
- {\ifcsname\??interlinespacerelative#1\endcsname
- \lastnamedcs
- \else
- \spac_linespacing_set_specified_relative_interlinespace{#1}%
- \fi}
-
-\def\spac_linespacing_set_relative_interlinespace
- {\ifx\currentrelativeinterlinespace\empty\else
- \spacing\currentrelativeinterlinespace
- \fi}
-
-\unexpanded\def\spac_linespacing_setup_use
- {\ifcsname\namedinterlinespacehash\m_spac_interlinespace\s!parent\endcsname
- \let\currentinterlinespace\m_spac_interlinespace
- \spac_linespacing_setup_specified_interline_space
- % \else
- % we only support named interlinespaces
- \fi}
-
-\unexpanded\def\useinterlinespaceparameter#1% see footnotes
- {\edef\m_spac_interlinespace{#1\c!interlinespace}%
- \ifx\m_spac_interlinespace\empty \else
- \spac_linespacing_setup_use
- \fi}
-
-\newtoks\everysetupglobalinterlinespace
-\newtoks\everysetuplocalinterlinespace
-
-\newconditional\interlinespaceisset
-
-\installcorenamespace{interlinespace}
-
-\installcommandhandler \??interlinespace {interlinespace} \??interlinespace
-
-\installmacrostack\currentinterlinespace
-
-\unexpanded\def\setupinterlinespace
- {\dodoubleempty\spac_linespacing_setup}
-
-\ifdefined\setupinterlinespace_double \else
- \let\setupinterlinespace_double\setup_interlinespace % for a while
-\fi
-
-\def\spac_linespacing_setup[#1][#2]%
- {\settrue\interlinespaceisset % reset has to be done when needed
- \ifsecondargument
- \setupinterlinespace_double[#1][#2]%
- \orelse\iffirstargument
- \ifcsname\namedinterlinespacehash{#1}\s!parent\endcsname
- \edef\currentinterlinespace{#1}%
- \spac_linespacing_setup_specified_interline_space
- %\dosetupspecifiedinterlinespaceindeed
- \else
- \spac_linespacing_setup_specified_or_relative[#1]%
- \fi
- \else
- \let\currentinterlinespace\empty
- \spac_linespacing_synchronize_local
- \fi}
-
-\def\spac_linespacing_setup_specified_or_relative[#1]%
- {\doifelseassignment{#1}\setupspecifiedinterlinespace\setuprelativeinterlinespace[#1]%
- \the\iflocalinterlinespace\everysetuplocalinterlinespace\else\everysetupglobalinterlinespace\fi}
-
-\def\spac_linespacing_synchronize_local % adapts to the font
- {\localinterlinespacetrue
- \setfontparameters
- \updateraggedskips % funny one here
- \the\everysetuplocalinterlinespace
- \localinterlinespacefalse}
-
-\unexpanded\def\dosetupcheckedinterlinespace#1% often a chain
- {\edef\p_spac_checked_interlinespace{#1}%
- \ifx\p_spac_checked_interlinespace\empty
- \spac_linespacing_synchronize_local
- \orelse\ifcsname\namedinterlinespacehash\p_spac_checked_interlinespace\s!parent\endcsname % we could have a \s!check
- \push_macro_currentinterlinespace
- \let\currentinterlinespace\p_spac_checked_interlinespace
- \spac_linespacing_setup_specified_interline_space % \dosetupspecifiedinterlinespaceindeed
- \iflocalinterlinespace
- \the\everysetuplocalinterlinespace
- \else
- \localinterlinespacetrue
- \the\everysetuplocalinterlinespace
- \localinterlinespacefalse
- \fi
- \pop_macro_currentinterlinespace
- \else
- \normalexpanded{\noexpand\doifelseassignment{\p_spac_checked_interlinespace}%
- \setupspecifiedinterlinespace\setuprelativeinterlinespace[\p_spac_checked_interlinespace]}%
- \iflocalinterlinespace
- \the\everysetuplocalinterlinespace
- \else
- \localinterlinespacetrue
- \the\everysetuplocalinterlinespace
- \localinterlinespacefalse
- \fi
- \fi}
-
-\unexpanded\def\setuplocalinterlinespace[#1]%
- {\localinterlinespacetrue
- \push_macro_currentinterlinespace
- \setupinterlinespace[#1]%
- \pop_macro_currentinterlinespace
- \localinterlinespacefalse}
-
-\let\switchtointerlinespace\setuplocalinterlinespace
-
-%D Helpers
-
-\newskip \s_spac_lastskip
-\newdimen\d_spac_prevdepth
-\newcount\c_spac_spacefactor
-\newdimen\d_spac_prevcontent % set by lua
-
-\unexpanded\def\removelastskip
- {\ifvmode\ifzeropt\lastskip\else\vskip-\lastskip\fi\fi}
-
-\def\doifoutervmode
- {\ifvmode
- \ifinner
- \doubleexpandafter\gobbleoneargument
- \else
- \doubleexpandafter\firstofoneargument
- \fi
- \else
- \expandafter\gobbleoneargument
- \fi}
-
-\unexpanded\def\dosomebreak#1%
- {\doifoutervmode
- {\s_spac_lastskip\lastskip
- \removelastskip
- #1\relax
- \ifzeropt\s_spac_lastskip
- % avoid interference with footnotes
- \else
- \vskip\s_spac_lastskip
- \fi}}
-
-\unexpanded\def\packed
- {\nointerlineskip}
-
-\unexpanded\def\godown[#1]%
- {\relax
- \ifhmode\endgraf\fi
- \ifvmode\nointerlineskip\vskip#1\relax\fi}
-
-\unexpanded\def\smallskip{\vskip\smallskipamount}
-\unexpanded\def\medskip {\vskip\medskipamount}
-\unexpanded\def\bigskip {\vskip\bigskipamount}
-
-\unexpanded\def\smallbreak
- {\par
- \ifvmode\ifdim\lastskip<\smallskipamount
- \removelastskip
- \penalty-\plusfifty
- \smallskip
- \fi\fi}
-
-\unexpanded\def\medbreak
- {\par
- \ifvmode\ifdim\lastskip<\medskipamount
- \removelastskip
- \penalty-\plusonehundred
- \medskip
- \fi\fi}
-
-\unexpanded\def\bigbreak
- {\par
- \ifvmode\ifdim\lastskip<\bigskipamount
- \removelastskip
- \penalty-\plustwohundred
- \bigskip
- \fi\fi}
-
-\unexpanded\def\break {\penalty-\plustenthousand} % can be hmode or vmode
-\unexpanded\def\nobreak {\penalty \plustenthousand} % can be hmode or vmode
-\unexpanded\def\allowbreak{\penalty \zerocount} % can be hmode or vmode
-
-\unexpanded\def\goodbreak {\par\ifvmode\penalty-\plusfivehundred\relax\fi} % forces vmode
-\unexpanded\def\filbreak {\par\ifvmode\vfil\penalty-\plustwohundred\vfilneg\fi} % forces vmode
-
-%D Made slightly more readable:
-
-\unexpanded\def\vglue {\afterassignment\spac_helpers_vglue_indeed\s_spac_lastskip=}
-\unexpanded\def\hglue {\afterassignment\spac_helpers_hglue_indeed\s_spac_lastskip=}
-\unexpanded\def\topglue{\par\ifvmode\nointerlineskip\vglue-\topskip\vglue\fi}
-
-\def\spac_helpers_vglue_indeed
- {\par
- \ifvmode
- \d_spac_prevdepth\prevdepth
- \hrule\s!height\zeropoint
- \nobreak
- \vskip\s_spac_lastskip
- \prevdepth\d_spac_prevdepth
- \fi}
-
-\def\spac_helpers_hglue_indeed
- {\dontleavehmode
- \c_spac_spacefactor\spacefactor
- \vrule\s!width\zeropoint
- \nobreak
- \hskip\s_spac_lastskip
- \spacefactor\c_spac_spacefactor}
-
-%D We adapt plain's \type {\removelastskip} a bit:
-
-\unexpanded\def\removelastskip % also in supp-box
- {\ifvmode\ifzeropt\lastskip\else\vskip-\lastskip\fi\fi}
-
-% The whitespace handler. We could cache settings but normally there are not
-% that many in a set.
-
-\installcorenamespace{whitespacemethod}
-
-\newskip \s_spac_whitespace_parskip \s_spac_whitespace_parskip\zeropoint
-\newconditional\c_spac_whitespace_flexible \settrue\c_spac_whitespace_flexible
-\newconstant \c_spac_whitespace_grid_mode % option in layout / 1=permit_half_lines
-
-%def\v_spac_whitespace_current{\zeropoint}
-\let\v_spac_whitespace_current\v!none
-
-\unexpanded\def\setupwhitespace
- {\doifelsenextoptionalcs\spac_whitespace_setup_yes\spac_whitespace_setup_nop}
-
-\def\spac_whitespace_setup_nop
- {\ifx\v_spac_whitespace_current\v!none\else
- \spac_whitespace_setup
- \fi}
-
-\let\synchronizewhitespace\spac_whitespace_setup_nop
-
-\def\spac_whitespace_setup_yes[#1]%
- {\edef\m_spac_whitespace_asked{#1}%
- \ifx\m_spac_whitespace_asked\empty
- \spac_whitespace_setup_nop
- \else
- \let\v_spac_whitespace_current\m_spac_whitespace_asked
- \spac_whitespace_setup
- \fi}
-
-\def\spac_whitespace_setup % quick test for no list
- {\ifcsname\??whitespacemethod\v_spac_whitespace_current\endcsname
- \lastnamedcs
- \else
- \expandafter\processcommalist\expandafter[\v_spac_whitespace_current]\spac_whitespace_setup_method % can be raw
- \fi\relax
- \ifgridsnapping
- \spac_whitespace_setup_grid
- \else
- \spac_whitespace_setup_normal
- \fi
- \parskip\s_spac_whitespace_parskip}
-
-\def\spac_whitespace_setup_normal
- {\ifconditional\c_spac_whitespace_flexible \else
- \s_spac_whitespace_parskip\plusone\s_spac_whitespace_parskip
- \fi}
-
-\def\spac_whitespace_setup_grid
- {\setfalse\c_spac_whitespace_flexible
- \ifdim\s_spac_whitespace_parskip>\zeropoint
- \s_spac_whitespace_parskip
- \ifcase\c_spac_whitespace_grid_mode
- \baselineskip
- \or
- \ifdim\scratchdimen=\baselineskip % maybe range
- \baselineskip
- \else
- \numexpr\s_spac_whitespace_parskip/\dimexpr.5\lineheight\relax\relax\dimexpr.5\lineheight\relax
- \fi
- \else
- \baselineskip
- \fi
- \fi}
-
-\unexpanded\def\installwhitespacemethod#1#2%
- {\setvalue{\??whitespacemethod#1}{#2}}
-
-\installwhitespacemethod \v!fix {}
-\installwhitespacemethod \v!fixed {\setfalse\c_spac_whitespace_flexible}
-\installwhitespacemethod \v!flexible {\settrue \c_spac_whitespace_flexible}
-
-\installwhitespacemethod \v!line {\s_spac_whitespace_parskip \baselineskip}
-\installwhitespacemethod \v!halfline {\s_spac_whitespace_parskip .5\baselineskip}
-\installwhitespacemethod \v!quarterline {\s_spac_whitespace_parskip.25\baselineskip}
-\installwhitespacemethod \v!none {\s_spac_whitespace_parskip \zeropoint}
-\installwhitespacemethod \v!big {\s_spac_whitespace_parskip \bigskipamount}
-\installwhitespacemethod \v!medium {\s_spac_whitespace_parskip \medskipamount}
-\installwhitespacemethod \v!small {\s_spac_whitespace_parskip \smallskipamount}
-
-\installwhitespacemethod \s!default {\spac_whitespace_setup_nop} % also covers none
-
-\def\spac_whitespace_setup_method#1%
- {\ifcsname\??whitespacemethod#1\endcsname
- \lastnamedcs
- \else
- \s_spac_whitespace_parskip#1\fi
- \relax}
-
-\unexpanded\def\forgetparskip
- {\s_spac_whitespace_parskip\zeropoint
- \parskip\zeropoint
- \let\v_spac_whitespace_current\v!none}
-
-\appendtoks
- \forgetparskip
-\to \everyforgetall
-
-% \installwhitespacemethod \s!unknown {\s_spac_whitespace_parskip\commalistelement\relax}
-%
-% \def\spac_whitespace_setup_method#1%
-% {\csname\??whitespacemethod\ifcsname\??whitespacemethod#1\endcsname#1\else\s!unknown\endcsname\relax}
-
-\unexpanded\def\nowhitespace{\directcheckedvspacing\v!nowhite} % {\vspacing[\v!nowhite]}
-\unexpanded\def\whitespace {\directcheckedvspacing\v!white} % {\vspacing[\v!white]}
-
-\setupwhitespace
- [\v!none]
-
-% Packed:
-
-% todo: when packed blocks blank, we need to enable forced
-
-\newconditional\c_spac_packed_blank \settrue\c_spac_packed_blank
-\newcount \c_spac_packed_level
-
-\unexpanded\def\startpacked
- {\dosingleempty\spac_packed_start}
-
-\def\spac_packed_start[#1]% nesting afvangen
- {\global\advance\c_spac_packed_level\plusone
- \par
- \ifnum\c_spac_packed_level=\plusone \ifvmode
- \begingroup
- \whitespace % not combined
- \directcheckedvspacing\v!disable % \blank[\v!disable]% or \inhibitblank
- \doifelse{#1}\v!blank\settrue\setfalse\c_spac_packed_blank
- \setupwhitespace[\v!none]% or \forgetparskip
- \fi \fi}
-
-\unexpanded\def\stoppacked
- {\par
- \ifnum\c_spac_packed_level=\plusone \ifvmode
- \endgroup
- \fi \fi
- \global\advance\c_spac_packed_level\minusone}
-
-\unexpanded\def\startunpacked
- {\directdefaultvspacing % \blank
- \begingroup}
-
-\unexpanded\def\stopunpacked
- {\endgroup
- \directdefaultvspacing}% \blank}
-
-% \prevdepth crosses pageboundaries!
-%
-% todo: a version that works ok inside a box
-
-% global : outer hsize + keep skips
-% local : inner hsize + reset skips
-
-\installcorenamespace{linesaround}
-
-\let\spac_lines_vbox\vbox
-
-\installtextracker
- {linecorrection.boxes}
- {\let\spac_lines_vbox\ruledvbox}
- {\let\spac_lines_vbox\vbox}
-
-\let\v_spac_lines_around_action_set\relax
-\let\m_spac_lines_around \empty
-
-\newconstant\c_spac_lines_correction_mode
-
-\setvalue{\??linesaround\v!blank }{\blank}
-\letvalue{\??linesaround\empty }\relax
-\setvalue{\??linesaround\s!unknown}{\directcheckedvspacing\m_spac_lines_around} % \blank[\m_spac_lines_around]}
-
-\def\spac_lines_action_around % we used to let this one but it's cleaner this way
- {\csname\??linesaround % i.e. do it twice
- \ifcsname\??linesaround\m_spac_lines_around\endcsname\m_spac_lines_around\else\s!unknown\fi
- \endcsname}
-
-\unexpanded\def\startlinecorrection
- {\endgraf
- \begingroup
- \setconstant\c_spac_lines_correction_mode\plusone
- \dosingleempty\spac_lines_start_correction}
-
-\unexpanded\def\startlocallinecorrection
- {\endgraf
- \begingroup
- \setconstant\c_spac_lines_correction_mode\plustwo
- \dosingleempty\spac_lines_start_correction}
-
-\unexpanded\def\spac_lines_start_correction[#1]%
- {\edef\m_spac_lines_around{#1}%
- \spac_lines_action_around
- \d_spac_prevdepth\prevdepth
- \spac_lines_initialize_corrections
- \offbaselinecorrection % ???
- \setbox\scratchbox\spac_lines_vbox\bgroup
- \ifcase\c_spac_lines_correction_mode
- % nothing
- \or
- % global
- \or
- % local
- \setlocalhsize
- \hsize\localhsize
- \forgetbothskips
- \fi
- \ignorespaces}
-
-\unexpanded\def\spac_lines_stop_correction
- {\removeunwantedspaces
- \egroup
- \ifgridsnapping
- \spac_lines_stop_correction_ongrid
- \else
- \spac_lines_stop_correction_normal
- \fi
- \endgroup}
-
-\unexpanded\def\spac_lines_stop_correction_ongrid
- {\directcheckedvspacing\v!white % \blank[\v!white]%
- \spac_lines_action_around
- \snaptogrid\hpack{\box\scratchbox}%
- \directcheckedvspacing\v!white
- \spac_lines_action_around}
-
-\unexpanded\def\spac_lines_stop_correction_normal
- {\directcheckedvspacing\v!nowhite % \blank[\v!nowhite]%
- \ifdim\parskip>\zeropoint
- % too fuzzy otherwise
- \else
- % doesn't like whitespace
- \ifdim\d_spac_prevdepth<\maxdimen
- \unless\ifdim\d_spac_prevdepth<\zeropoint
- \ifdim\d_spac_prevdepth<\strutdp \relax
- \pushlastnode
- \ifdim\d_spac_prevdepth>\zeropoint
- \kern-\d_spac_prevdepth
- \fi
- \kern\strutdp
- \prevdepth\strutdp
- \poplastnode
- \fi
- \fi
- \fi
- \fi
- \ifdim\pagegoal<\maxdimen
- % \blank[\v!white,\the\d_spac_lines_correction_before]% \blank[\v!white]\dotopbaselinecorrection
- \directcheckedvspacing{\v!white,\the\d_spac_lines_correction_before}% \blank[\v!white]\dotopbaselinecorrection
- \fi
- \nointerlineskip % new
- \noindent % not \dontleavehmode !
- \ifcase\c_spac_lines_correction_mode
- % nothing
- \or
- % global
- \hskip-\leftskip % more tricky would be hangindent so we ignore that one
- \or
- % local
- \fi
- \box\scratchbox
- \endgraf
- %
- % eventually i'll get it right ... (i also need to check all whitespace code elsewhere)
- %
- % \blank[\the\d_spac_lines_correction_after]% \dobotbaselinecorrection
- % \directcheckedvspacing{\the\d_spac_lines_correction_after}% \dobotbaselinecorrection
- \directcheckedvspacing{\v!white,\the\d_spac_lines_correction_after}% \dobotbaselinecorrection
- % \allowbreak % new, otherwise problems when many in a row
- \prevdepth\strutdp
- \spac_lines_action_around}
-
-\let\stoplinecorrection \spac_lines_stop_correction
-\let\stoplocallinecorrection\spac_lines_stop_correction
-
-% todo:
-
-\unexpanded\def\correctwhitespace
- {\dowithnextboxcs\correctwhitespacefinish\vbox}
-
-\unexpanded\def\correctwhitespacefinish
- {\startbaselinecorrection
- \flushnextbox
- \stopbaselinecorrection}
-
-\unexpanded\def\verticalstrut {\vpack{\hsize\zeropoint\forgetall\strut}}
-\unexpanded\def\horizontalstrut{\hpack {\strut}}
-
-%D Here follow some presets related to interline spacing and therefore also struts.
-%D The values 2.8, 0.07, 0.72 and 0.28 originate in \INRSTEX, a package that we used
-%D a while after we decided that \LATEX\ was not flexible enough. After that
-%D \CONTEXT\ evolved, from some wrapper code around (old) \LATEX\ (on a floppy
-%D disk), to using modules from \INRSTEX\ (which also fit on a floppy) and finally
-%D all written from scratch. I simply didn't understand all that \TEX\ code at that
-%D time, and it was easier to figure it out myself. But \unknown\ some settings
-%D stayed, as the height|/|depth ratios, and they never proved to be bad ones! The
-%D same is true for the font size relations.
-
-%D \starttabulate
-%D \NC \type {\lineheight} \NC the height of a line \NC \NR
-%D \NC \type {\spacing{number}} \NC adapting the interline space \NC \NR
-%D \NC \type {\normalbaselines} \NC initialize the interline spacing \NC \NR
-%D \NC \type {\setstrut} \NC initialize \type {\strut} \NC \NR
-%D \NC \type {\setnostrut} \NC disable the \type {\strut}, \type {\endstrut}, \type {\begstrut} \NC \NR
-%D \NC \type {\setteststrut} \NC initialize the visual \type {\strut} \NC \NR
-%D \NC \type {\resetteststrut} \NC disable the visual \type {\strut} \NC \NR
-%D \NC \type {\setfontparameters} \NC synchronize parameters with foints \NC \NR
-%D \stoptabulate
-%D
-%D \unknown\ and many more (this is a decades old list).
-%D
-%D The lineheight is the sum of the height and depth of \type {strut}, which is
-%D an invisible blob that can be used to enforce the proper dimensions.
-%D
-%D Such a blob, when placed at the beginning of a paragraph can have side effects
-%D that can be prevented with \type {\dontleavehmode}. Never use \type
-%D {\leavevmode}!
-
-\newdimen\strutdimen
-\newdimen\lineheight
-\newdimen\openlineheight
-\newdimen\openstrutheight
-\newdimen\openstrutdepth
-\newdimen\topskipgap
-\newdimen\struttotal
-
-\def\strutheightfactor {.72}
-\def\strutdepthfactor {.28}
-
-\def\baselinefactor {2.8}
-
-\let\m_spac_vertical_baseline_stretch_factor \zerocount
-\let\m_spac_vertical_baseline_shrink_factor \zerocount
-
-\def\minimumstrutheight {\zeropoint}
-\def\minimumstrutdepth {\zeropoint}
-
-\def\normallineheight {\baselinefactor\exheight}
-\def\minimumlinedistance {\lineskip}
-
-\def\strutheight {\zeropoint}
-\def\strutdepth {\zeropoint}
-\def\strutwidth {\zeropoint}
-
-\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
-
-\unexpanded\def\topskipcorrection
- {\simpletopskipcorrection
- \vskip-\struttotal
- \verticalstrut}
-
-\unexpanded\def\simpletopskipcorrection
- {\ifdim\topskip>\openstrutheight
- % == \vskip\topskipgap
- \vskip\topskip
- \vskip-\openstrutheight
- \fi}
-
-\unexpanded\def\settopskip % the extra test is needed for the lbr family
- {\topskip
- \ifgridsnapping
- \zeropoint
- \else
- \systemtopskipfactor\globalbodyfontsize
- \ifcase\bottomraggednessmode % ragged bottom
- \s!plus5\globalbodyfontsize
- \fi
- \fi
- %\relax
- \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}
-
-\unexpanded\def\setmaxdepth
- {\maxdepth\systemmaxdepthfactor\globalbodyfontsize}
-
-\let\normalbaselineskip \relax \newskip \normalbaselineskip % these got lost in the transition to mkiv due
-\let\normallineskip \relax \newskip \normallineskip % to auto-\normal* definitions and registers
-\let\normallineskiplimit\relax \newdimen\normallineskiplimit % being protected
-
-\unexpanded\def\normalbaselines
- {\baselineskip \normalbaselineskip
- \lineskip \normallineskip
- \lineskiplimit\normallineskiplimit}
-
-\unexpanded\def\flexiblebaselines
- {\baselineskip \normalbaselineskip
- \lineskip 1\normallineskip \s!plus 1\s!fill
- \lineskiplimit\normallineskiplimit}
-
-\unexpanded\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
- \s!plus \m_spac_vertical_baseline_stretch_factor\openlineheight
- \s!minus\m_spac_vertical_baseline_shrink_factor \openlineheight
- \fi
- \normallineskip\minimumlinedistance\relax % \onepoint\relax
- \normallineskiplimit\zeropoint\relax
- \normalbaselines}
-
-\unexpanded\def\spacing#1% vertical
- {\ifgridsnapping
- \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}
-
-% \unexpanded\def\forgetverticalstretch % \forgetspacing
-% {\spacing\plusone}
-
-\unexpanded\def\forgetverticalstretch
- {\let\spacingfactor \plusone
- \let\systemtopskipfactor \topskipfactor
- \let\systemmaxdepthfactor\maxdepthfactor
- \setnormalbaselines
- \setstrut}
-
-\appendtoks
- \forgetverticalstretch
-\to \everyforgetall % needed in otr
-
-%D Sometimes one needs to freeze the interlinespacing
-%D
-%D \starttyping
-%D \rm \saveinterlinespace .... {\ss \restoreinterlinespace .... \endgraf}
-%D \stoptyping
-
-\let\restoreinterlinespace\relax
-
-\unexpanded\def\saveinterlinespace
- {\unexpanded\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}}
-
-%D This is the plain definition:
-%D
-%D \starttyping
-%D \def\strut{\relax\ifmmode\copy\strutbox\else\unhcopy\strutbox\fi}
-%D \stoptyping
-%D
-%D which could be:
-%D
-%D \starttyping
-%D \def\strut{\relax\ifmmode\copy\else\unhcopy\fi\strutbox}
-%D \stoptyping
-%D
-%D But we do things differently.
-
-\newbox\strutbox
-
-\setbox\strutbox\hpack{\vrule\s!height8.5pt\s!depth3.5pt\s!width\zeropoint} % just a start
-
-\def\strut{\relax\ifmmode\copy\else\unhcopy\fi\strutbox}
-
-% \unexpanded\def\strut
-% {\relax
-% \ifmmode\copy\else\dontleavehmode\unhcopy\fi\strutbox}
-
-\let\normalstrut\strut
-
-%D The double \type {\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\hbox{#1}% no \hpack, in case we have smallcaps
- \strutht\ht\strutbox
- \strutdp\dp\strutbox
- \dosetstrut}
-
-\unexpanded\def\settightstrut
- {\setcharstrut{(}}
-
-\unexpanded\def\setfontstrut
- {\setcharstrut{(gplQT}}
-
-\unexpanded\def\setcapstrut% could be M, but Q has descender
- {\setcharstrut{Q}}
-
-%D Handy for math (used in mathml):
-
-\unexpanded\def\charhtstrut
- {\begingroup
- \setcharstrut{GJY}%
- \vrule\s!width\zeropoint\s!depth\zeropoint\s!height\strutht
- \endgroup}
-
-\unexpanded\def\chardpstrut
- {\begingroup
- \setcharstrut{gjy}%
- \vrule\s!width\zeropoint\s!depth\strutdp\s!height\zeropoint
- \endgroup}
-
-%D Because of all the callbacks in mkiv, we avoid unnecessary boxes ... maybe use an
-%D attribute so that we can tag boxes that don't need a treatment; tests with using
-%D an attribute so far have shown that it's slower because testing the attribute
-%D takes time too.
-
-\unexpanded\def\dosetstrut
- {\let\strut\normalstrut
- \ifabsnum\dimexpr\strutht+\strutdp-\lineheight\relax<\plustwo
- % compensate rounding error /- 1sp to avoid too many
- % 1sp baselineskips in for instance verbatim
- % \strutht\dimexpr\lineheight-\strutdp\relax
- % better:
- \strutdp\dimexpr\lineheight-\strutht\relax
- \struttotal\lineheight
- \else
- \struttotal\dimexpr\strutht+\strutdp\relax
- \fi
- \edef\strutheight{\the\strutht}%
- \edef\strutdepth {\the\strutdp}%
- \ifdim\strutwidth=\zeropoint
- \spac_struts_set_hide
- \else
- \spac_struts_set_vide
- \fi}
-
-\def\spac_struts_set_hide
- {\setbox\strutbox\hpack
- {\vrule
- \s!width \zeropoint
- \s!height\strutht
- \s!depth \strutdp}}
-
-\newconstant\c_strut_visual_mode
-
-\def\spac_struts_set_vide
- {\setbox\strutbox\hpack % at some time this extra wrapping was needed
- {\spac_struts_vide_hbox to \zeropoint
- {\ifcase\c_strut_visual_mode
- \spac_struts_black
- \or
- \spac_struts_color
- \else
- \spac_struts_black
- \fi}}}
-
-\def\spac_struts_black
- {\vrule
- \s!width \strutwidth
- \s!height\strutht
- \s!depth \strutdp
- \hss}
-
-\def\spac_struts_color
- {\hss % new, will be option
- \scratchwidth.1\struthtdp
- \begingroup
- \directcolor[f:b:t]%
- \vrule
- \s!width \scratchwidth
- \s!height\strutht
- \s!depth \strutdp
- \kern-\scratchwidth
- \vrule
- \s!width \scratchwidth
- \s!height\zeropoint
- \s!depth \strutdp
- \endgroup
- \kern-.625\scratchwidth
- \vrule
- \s!width .25\scratchwidth
- \s!height\strutht
- \s!depth \strutdp
- \hss}
-
-\let\spac_struts_vide_hbox\hbox % overloaded in trac-vis.mkiv
-
-%D The dimen \type {\struttotal} holds the exact size of the strut; occasionally a
-%D one scaled point difference can show up with the lineheight. This is more
-%D efficient (less callbacks):
-
-\newbox\b_spac_struts_empty \setbox\b_spac_struts_empty\emptyhbox
-
-\def\spac_struts_set_hide
- {\setbox\strutbox\copy\b_spac_struts_empty
- \ht\strutbox\strutht
- \dp\strutbox\strutdp}
-
-\unexpanded\def\strut % still callbacks for \hbox{\strut}
- {\relax
- \dontleavehmode
- \copy\strutbox}
-
-% \unexpanded\def\strut % slightly faster
-% {\relax
-% \ifmmode\copy\else\dontleavehmode\unhcopy\fi\strutbox}
-
-\let\normalstrut\strut
-
-\unexpanded\def\halfstrut
- {\relax
- \dontleavehmode
- \begingroup
- \setbox\scratchbox\copy\strutbox
- \ht\scratchbox\dimexpr\strutht/\plustwo\relax
- \dp\scratchbox\dimexpr\strutdp/\plustwo\relax
- \box\scratchbox
- \endgroup}
-
-\unexpanded\def\quarterstrut
- {\relax
- \dontleavehmode
- \begingroup
- \setbox\scratchbox\copy\strutbox
- \ht\scratchbox\dimexpr\strutht/\plusfour\relax
- \dp\scratchbox\dimexpr\strutdp/\plusfour\relax
- \box\scratchbox
- \endgroup}
-
-\unexpanded\def\depthstrut
- {\relax
- \dontleavehmode
- \begingroup
- \setbox\scratchbox\copy\strutbox
- \ht\scratchbox\dimexpr\strutht-\struthtdp/\plustwo\relax % assumes that ht > lineheight/2
- \box\scratchbox
- \endgroup}
-
-\unexpanded\def\halflinestrut
- {\relax
- \dontleavehmode
- \begingroup
- \setbox\scratchbox\copy\strutbox
- \ht\scratchbox\dimexpr\strutht-.5\strutht-.5\strutdp\relax
- \box\scratchbox
- \endgroup}
-
-\unexpanded\def\noheightstrut
- {\relax
- \dontleavehmode
- \begingroup
- \setbox\scratchbox\copy\strutbox
- \ht\scratchbox\zeropoint
- \box\scratchbox
- \endgroup}
-
-%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
-%D
-%D Beware: using an unknown value results in char struts.
-
-\installcorenamespace{struts}
-
-\unexpanded\def\setupstrut
- {\dosingleempty\spac_struts_setup}
-
-\def\spac_struts_setup[#1]%
- {\edef\m_strut{#1}%
- \ifcsname\??struts\m_strut\endcsname
- \lastnamedcs
- \else
- \setcharstrut\m_strut
- \fi}
-
-\unexpanded\def\synchronizestrut#1% no [] parsing, faster for internal
- {\edef\m_strut{#1}%
- \ifcsname\??struts\m_strut\endcsname
- \lastnamedcs
- \else
- \setcharstrut\m_strut
- \fi}
-
-\unexpanded\def\dosynchronizestrut#1% no [] parsing, faster for internal
- {\ifcsname\??struts#1\endcsname
- \lastnamedcs
- \else
- \setcharstrut{#1}%
- \fi}
-
-\unexpanded\def\showstruts % adapts .. is wrong
- {\c_strut_visual_mode\zerocount
- \setteststrut
- \settestcrlf}
-
-\unexpanded\def\showcolorstruts % adapts .. is wrong
- {\c_strut_visual_mode\plusone
- \setteststrut
- \settestcrlf}
-
-\unexpanded\def\setteststrut
- {\def\strutwidth{.8pt}%
- \setstrut}
-
-\unexpanded\def\dontshowstruts
- {\unsetteststrut
- \settestcrlf}
-
-\unexpanded\def\unsetteststrut
- {\let\strutwidth\zeropoint
- \setstrut}
-
-\def\autostrutfactor{1.1}
-
-\unexpanded\def\setautostrut
- {\begingroup
- \setbox\scratchbox\copy\strutbox
- \setstrut
- \ifdim\strutht>\autostrutfactor\ht\scratchbox
- \endgroup \setstrut
- \orelse\ifdim\strutdp>\autostrutfactor\dp\scratchbox
- \endgroup \setstrut
- \else
- \endgroup
- \fi}
-
-\newbox\nostrutbox \setbox\nostrutbox\emptyhbox
-
-\newtoks\everysetnostrut
-
-\unexpanded\def\setnostrut
- {\the\everysetnostrut}
-
-\appendtoks
- \setbox\strutbox\copy\nostrutbox
- \let\strut\empty
- \let\endstrut\empty
- \let\begstrut\empty
-\to \everysetnostrut
-
-%D When enabled, sigstruts will remove themselves if nothing goes inbetween. For
-%D practical reasons we define some boundary characters here.
-
-\unexpanded\def\leftboundary {\protrusionboundary\plusone}
-\unexpanded\def\rightboundary {\protrusionboundary\plustwo}
-\unexpanded\def\signalcharacter{\boundary\plusone\char\zerocount\boundary\plustwo} % not the same as strut signals
-
-\newsignal\strutsignal \setfalse\sigstruts
-
-\unexpanded\def\begstrut
- {\relax\ifcase\strutht
- % \ignorespaces % maybe
- \else
- \spac_struts_beg
- \fi}
-
-\def\spac_struts_beg
- {\ifconditional\sigstruts
- \spac_struts_beg_signal
- \else
- \spac_struts_beg_normal
- \fi
- \ignorespaces}
-
-\def\spac_struts_beg_signal
- {\noindent\horizontalstrut
- \penalty\plustenthousand
- \hskip-\strutsignal
- \hskip\strutsignal}
-
-\def\spac_struts_beg_normal
- {\boundary\plusone
- \strut
- %\boundary\plusone
- \penalty\plustenthousand
- %\boundary\plusone
- \hskip\zeropoint}
-
-\unexpanded\def\endstrut
- {\relax\ifhmode
- \ifcase\strutht
- % \removeunwantedspaces % maybe
- \else
- \spac_struts_end
- \fi
- \fi}
-
-\def\spac_struts_end
- {\ifconditional\sigstruts
- \spac_struts_end_signal
- \else
- \spac_struts_end_normal
- \fi}
-
-\def\spac_struts_end_signal
- {\ifdim\lastskip=\strutsignal
- \unskip
- \unskip
- \unpenalty
- \setbox\scratchbox\lastbox
- \else
- \penalty\plustenthousand
- \hskip\zeropoint
- \strut
- \fi}
-
-\def\spac_struts_end_normal
- {\removeunwantedspaces
- \penalty\plustenthousand
- %\boundary\plustwo
- \hskip\zeropoint
- %\boundary\plustwo
- \strut
- \boundary\plustwo}
-
-% unsave:
-%
-% \def\pseudostrut
-% {\bgroup
-% \setnostrut
-% \normalstrut
-% \egroup}
-%
-% try:
-%
-% \startchemie
-% \chemie[ONE,Z0,SB15,MOV1,SB15,Z0][C,C]
-% \stopchemie
-%
-% so:
-
-\unexpanded\def\pseudostrut
- {\noindent} % better: \dontleavehmode
-
-\let\pseudobegstrut\pseudostrut
-\let\pseudoendstrut\removeunwantedspaces
-
-\unexpanded\def\resetteststrut
- {\def\strutwidth{\zeropoint}% no let
- \setstrut}
-
-\ifdefined\setfontparameters \else
- \def\setfontparameters{\the\everybodyfont}
-\fi
-
-%D Keyword based strutting:
-
-\letvalue{\??struts\v!yes }\setstrut
-\letvalue{\??struts\v!auto }\setautostrut
-\letvalue{\??struts\v!no }\setnostrut
-\letvalue{\??struts\v!cap }\setcapstrut
-\letvalue{\??struts\v!fit }\setfontstrut
-\letvalue{\??struts\v!line }\setstrut
-\letvalue{\??struts\s!default}\setstrut
-\letvalue{\??struts\empty }\setstrut
-
-%D Handy:
-
-\def\baselinedistance{\the\lineheight}
-
-%D We need \type {\normaloffinterlineskip} because the new definition contains an
-%D assignment, and |<|don't ask me why|>| this assignment gives troubles in for
-%D instance the visual debugger.
-
-\unexpanded\def\offinterlineskip
- {\baselineskip-\thousandpoint
- \lineskip \zeropoint
- \lineskiplimit\maxdimen
- % We also need this here now; thanks to taco for figuring that out!
- \def\minimumlinedistance{\zeropoint}}
-
-\unexpanded\def\nointerlineskip
- {\prevdepth-\thousandpoint}
-
-\let\normaloffinterlineskip\offinterlineskip % knuth's original
-
-%D This is tricky. The prevdepth value is still set to the last one even if there is
-%D nothing on the page. The same is true for prevgraf, which doesn't resemble the
-%D value on the current page.
-%D
-%D So, here we kick in a checker but it has to happen after the output group and it
-%D only has to be done once (output can trigger itself!).
-%D
-%D However, prevgraf is somehow bound to hangindent so we can get very nasty side
-%D effects. So, in tne end we use our own variable!
-
-\ifdefined\getnofpreviouslines
- % defined public at the lua end
-\else
- \let\getnofpreviouslines\!!zerocount
-\fi
-
-\unexpanded\def\page_otr_synchronize_page_yes
- {\aftergroup\page_otr_synchronize_page_indeed
- \glet\page_otr_synchronize_page\relax}
-
-% \unexpanded\def\page_otr_synchronize_page_indeed
-% {\clf_synchronizepage
-% \glet\page_otr_synchronize_page\page_otr_synchronize_page_yes}
-%
-% This has to become an otr method: \s!page_otr_command_synchonize_page
-
-\unexpanded\def\page_otr_synchronize_page_indeed
- {\ifx\currentoutputroutine\s!multicolumn\else\clf_synchronizepage\fi
- \glet\page_otr_synchronize_page\page_otr_synchronize_page_yes}
-
-\let\page_otr_synchronize_page\page_otr_synchronize_page_yes
-
-\appendtoks
- \page_otr_synchronize_page
-\to \everyaftershipout
-
-%D My own one:
-
-\unexpanded\def\spac_helpers_push_interlineskip_yes
- {\edef\oninterlineskip
- {\baselineskip \the\baselineskip
- \lineskip \the\lineskip
- \lineskiplimit\the\lineskiplimit
- \noexpand\edef\noexpand\minimumlinedistance{\the\dimexpr\minimumlinedistance}%
- \let\noexpand\offinterlineskip\noexpand\normaloffinterlineskip}} % \noexpand not needed
-
-\unexpanded\def\spac_helpers_push_interlineskip_nop
- {\let\oninterlineskip\setnormalbaselines}
-
-\unexpanded\def\offinterlineskip
- {\ifdim\baselineskip>\zeropoint
- \spac_helpers_push_interlineskip_yes
- \else
- \spac_helpers_push_interlineskip_nop
- \fi
- \normaloffinterlineskip}
-
-\let\oninterlineskip\relax
-
-\unexpanded\def\leaveoutervmode
- {\ifvmode\ifinner\else
- \leavevmode
- \fi\fi}
-
-\unexpanded\def\resetpenalties#1%
- {\ifdefined#1%
- #1\minusone
- \fi}
-
-\unexpanded\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}
-
-%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\c_spac_keep_lines_together
-\let\restoreinterlinepenalty\relax
-
-\unexpanded\def\spac_penalties_restore
- {\glet\restoreinterlinepenalty\relax
- \global\resetpenalties\interlinepenalties
- \global\c_spac_keep_lines_together\zerocount}
-
-\unexpanded\def\keeplinestogether#1%
- {\ifnum#1>\c_spac_keep_lines_together
- \global\c_spac_keep_lines_together#1%
- \global\setpenalties\interlinepenalties\c_spac_keep_lines_together\plustenthousand
- \glet\restoreinterlinepenalty\spac_penalties_restore
- \fi}
-
-\def\defaultdisplaywidowpenalty {50}
-\def\defaultwidowpenalty {2000} % was: 1000
-\def\defaultclubpenalty {2000} % was: 800
-\def\defaultbrokenpenalty {100}
-\def\defaultdoublehyphendemerits {10000}
-\def\defaultfinalhyphendemerits {5000}
-\def\defaultadjdemerits {10000}
-
-\def\defaultgriddisplaywidowpenalty {0}
-\def\defaultgridwidowpenalty {0}
-\def\defaultgridclubpenalty {0}
-\def\defaultgridbrokenpenalty {0}
-\def\defaultgriddoublehyphendemerits{10000} % always was so
-\def\defaultgridfinalhyphendemerits {5000} % always was so
-\def\defaultgridadjdemerits {10000} % always was so
-
-\unexpanded\def\nopenalties
- {\widowpenalty \zerocount
- \clubpenalty \zerocount
- \brokenpenalty \zerocount
- \doublehyphendemerits\zerocount
- \finalhyphendemerits \zerocount
- \adjdemerits \zerocount}
-
-\unexpanded\def\setdefaultpenalties
- {\directsetup{\systemsetupsprefix\s!default}}
-
-\startsetups [\systemsetupsprefix\s!reset]
- \resetpenalties\widowpenalties
- \resetpenalties\clubpenalties
- \resetpenalties\interlinepenalties
-\stopsetups
-
-%D 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
- \doublehyphendemerits\defaultdoublehyphendemerits
- \finalhyphendemerits \defaultfinalhyphendemerits
- \adjdemerits \defaultadjdemerits
-
-\stopsetups
-
-\startsetups [\v!grid] [\systemsetupsprefix\s!default]
-
- \directsetup{\systemsetupsprefix\s!reset}
-
- \widowpenalty \defaultgridwidowpenalty
- \clubpenalty \defaultgridclubpenalty
- \displaywidowpenalty \defaultgriddisplaywidowpenalty
- \brokenpenalty \defaultgridbrokenpenalty
- \doublehyphendemerits\defaultgriddoublehyphendemerits
- \finalhyphendemerits \defaultgridfinalhyphendemerits
- \adjdemerits \defaultgridadjdemerits
-
-\stopsetups
-
-%D As an illustration:
-
-\startsetups [\systemsetupsprefix\v!strict]
-
- \directsetup{\systemsetupsprefix\s!reset}
-
- \setpenalties \widowpenalties \plustwo \maxdimen
- \setpenalties \clubpenalties \plustwo \maxdimen
- \brokenpenalty \maxdimen
- \doublehyphendemerits \defaultdoublehyphendemerits
- \finalhyphendemerits \defaultfinalhyphendemerits
- \adjdemerits \defaultadjdemerits
-
-\stopsetups
-
-\setdefaultpenalties % will happen later in \setuplayout
-
-%D To be checked:
-
-\newbox\b_spac_struts_saved
-
-\unexpanded\def\savestrut {\setbox\b_spac_struts_saved\copy\strutbox}
-\unexpanded\def\savedstrut{\copy \b_spac_struts_saved}
-
-%D Good old blank redone:
-
-%definesystemattribute[kernchars] [public]
-\definesystemattribute[skipcategory] [public]
-\definesystemattribute[skippenalty] [public]
-\definesystemattribute[skiporder] [public]
-\definesystemattribute[snapmethod] [public]
-\definesystemattribute[snapvbox] [public]
-%definesystemattribute[snapcategory] [public]
-
-% TODO: NAMED SNAPPERS
-
-\installcorenamespace{gridsnappers}
-\installcorenamespace{gridsnapperattributes}
-\installcorenamespace{gridsnappersets}
-
-\newskip \bodyfontlineheight
-\newdimen \bodyfontstrutheight
-\newdimen \bodyfontstrutdepth
-
-\newskip \globalbodyfontlineheight % why a skip
-\newdimen \globalbodyfontstrutheight
-\newdimen \globalbodyfontstrutdepth
-
-\def\snappedvboxattribute{\ifgridsnapping attr \snapvboxattribute \attribute\snapmethodattribute\fi}
-\def\setlocalgridsnapping{\ifgridsnapping \attribute \snapvboxattribute \attribute\snapmethodattribute\fi}
-
-\def\spac_grids_set_local_snapping#1%
- {\ifgridsnapping
- \doifsomething{#1}%
- {\spac_grids_snap_value_set{#1}%
- \attribute \snapvboxattribute \attribute\snapmethodattribute}%
- \fi}
-
-\def\spac_grids_expand_snapper#1%
- {\edef\m_spac_snapper
- {\ifx\m_spac_snapper\empty\else\m_spac_snapper,\fi
- \ifcsname\??gridsnappersets#1\endcsname
- \lastnamedcs\else#1%
- \fi}}
-
-\unexpanded\def\installsnapvalues#1#2%
- {\let\m_spac_snapper\empty
- \rawprocesscommacommand[#2]\spac_grids_expand_snapper
- \edef\currentsnapper{#1:\m_spac_snapper}%
- \ifcsname\??gridsnapperattributes\currentsnapper\endcsname
- \scratchcounter\lastnamedcs % already defined
- \else
- \scratchcounter\clf_definesnapmethod{#1}{\m_spac_snapper}%
- \setevalue{\??gridsnapperattributes\currentsnapper}{\the\scratchcounter}%
- \fi
- \setevalue{\??gridsnappers#1}{\attribute\snapmethodattribute\the\scratchcounter\relax}%
- \letvalue{\??gridsnappersets#1}\m_spac_snapper}
-
-\def\theexpandedsnapperset#1{\begincsname\??gridsnappersets#1\endcsname} % only for manuals
-
-\unexpanded\def\usegridparameter#1% no checking here
- {\edef\m_spac_grid_asked{#1\c!grid}%
- \ifx\m_spac_grid_asked\empty
- \attribute \snapvboxattribute\attributeunsetvalue
- \else
- \spac_grids_snap_value_set\m_spac_grid_asked
- \attribute \snapvboxattribute\attribute\snapmethodattribute
- \fi}
-
-\unexpanded\def\definegridsnapping
- {\dodoubleargument\spac_grids_define}
-
-\def\spac_grids_define[#1][#2]%
- {\installsnapvalues{#1}{#2}}
-
-\edef\spac_grids_snap_value_reset
- {%\gridsnappingfalse
- \attribute\snapmethodattribute\attributeunsetvalue}
-
-\def\spac_grids_snap_value_set#1%
- {%\gridsnappingtrue
- \begincsname\??gridsnappers#1\endcsname}
-
-% maybe:
-%
-% \def\spac_grids_snap_value_set#1%
-% {%\gridsnappingtrue
-% \ifcsname\??gridsnappers#1\endcsname
-% \lastnamedcs
-% \else
-% \definegridsnapping[#1][#1]%
-% \begincsname\??gridsnappers#1\endcsname
-% \fi}
-
-\def\spac_grids_snap_value_auto#1%
- {\ifcsname\??gridsnappers#1\endcsname
- \lastnamedcs
- \else
- \installsnapvalues\s!dummy{#1}%
- \csname\??gridsnappers\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
-% offset:-3tp vertical shift within box
-% bottom:lines
-% top:lines
-% box centers a box rounded upwards (box:.5 -> tolerance)
-% min centers a box rounded downwards
-% max centers a box rounded upwards
-
-%D We're not downward compatible with \MKII ! Not yet in interface file:
-
-\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!verytolerant] [\v!maxdepth:1.4,\v!maxheight:1.4,\v!strut]
-
-\definegridsnapping[\v!tolerant:10] [\v!maxdepth:1.1,\v!maxheight:1.1,\v!strut] % 10 pct tolerance
-\definegridsnapping[\v!tolerant:20] [\v!maxdepth:1.2,\v!maxheight:1.2,\v!strut] % 20 pct tolerance
-\definegridsnapping[\v!tolerant:30] [\v!maxdepth:1.3,\v!maxheight:1.3,\v!strut] % 30 pct tolerance
-\definegridsnapping[\v!tolerant:40] [\v!maxdepth:1.4,\v!maxheight:1.4,\v!strut] % 40 pct tolerance
-
-\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!one] [\v!minheight,\v!mindepth]
-\definegridsnapping[\v!low] [\v!maxheight,\v!mindepth,\v!none]
-\definegridsnapping[\v!none] [\v!none]
-\definegridsnapping[\v!line] [\v!line]
-\definegridsnapping[\v!strut] [\v!strut]
-\definegridsnapping[\v!box] [\v!box]
-\definegridsnapping[\v!min] [\v!min]
-\definegridsnapping[\v!max] [\v!max]
-
-\definegridsnapping[\v!middle] [\v!maxheight,\v!maxdepth] % used in placement
-
-\definegridsnapping[\v!math] [\v!maxdepth:1.05,\v!maxheight:1.05,\v!strut] % experimental, maybe 1.1
-\definegridsnapping[\v!math:\v!line] [\v!math,\v!line,\v!split]
-\definegridsnapping[\v!math:\v!halfline] [\v!math,\v!halfline,\v!split]
-\definegridsnapping[\v!math:-\v!line] [\v!math,-\v!line,\v!split]
-\definegridsnapping[\v!math:-\v!halfline][\v!math,-\v!halfline,\v!split]
-
-\unexpanded\def\synchronizelocallinespecs
- {\bodyfontlineheight \normallineheight
- \bodyfontstrutheight\strutht
- \bodyfontstrutdepth \strutdp}
-
-\unexpanded\def\synchronizegloballinespecs
- {\global\globalbodyfontlineheight \normallineheight
- \global\globalbodyfontstrutheight\strutht
- \global\globalbodyfontstrutdepth \strutdp}
-
-\appendtoks
- \synchronizegloballinespecs
- \synchronizelocallinespecs
-\to \everysetupglobalinterlinespace
-
-\appendtoks
- \synchronizelocallinespecs
-\to \everysetuplocalinterlinespace
-
-%D We still have to synchronize these:
-
-\unexpanded\def\synchronizeskipamounts
- {\bigskipamount
- \skipfactor\baselineskip
- \s!plus\skipgluefactor\baselineskip
- \s!minus\skipgluefactor\baselineskip
- \relax
- \medskipamount \bigskipamount \divide\medskipamount \plustwo
- \smallskipamount\bigskipamount \divide\smallskipamount\plusfour}
-
-%D Snapping.
-
-\newif\ifgridsnapping
-
-%unexpanded\def\moveongrid {\dosingleempty\spac_grids_move_on}
-\unexpanded\def\snaptogrid {\dosingleempty\spac_grids_snap_to}
-\unexpanded\def\placeongrid{\dosingleempty\spac_grids_place_on}
-
-\unexpanded\def\startgridsnapping
- {\dosingleempty\spac_grids_start_snapping}
-
-\unexpanded\def\spac_grids_start_snapping[#1]%
- {\snaptogrid[#1]\vbox\bgroup}
-
-\unexpanded\def\stopgridsnapping
- {\egroup}
-
-% \def\spac_grids_move_on[#1]%
-% {[obsolete]} % gone, unless we set an attribute
-
-\def\spac_grids_place_on[#1]%
- {\snaptogrid[#1]\vbox} % mark as done
-
-\def\spac_grids_snap_to[#1]% list or predefined
- {\ifgridsnapping
- \expandafter\spac_grids_snap_to_indeed
- \else
- \expandafter\gobbleoneargument
- \fi{#1}}
-
-\def\spac_grids_snap_to_indeed#1%
- {\bgroup
- \spac_grids_snap_value_reset
- \dowithnextbox{\spac_grids_snap_to_finish{#1}}}
-
-% eventually there will always be a line snap
-
-\def\spac_grids_snap_to_finish#1%
- {\ifvbox\nextbox % this will go away
- \clf_vspacingcollapse\nextbox\relax % isn't that already done?
- \fi
- \doifelsenothing{#1}{\spac_grids_snap_value_set\v!normal}{\spac_grids_snap_value_set{#1}}%
- \clf_vspacingsnap\nextbox\attribute\snapmethodattribute\relax
- \ifvbox\nextbox\vbox\else\hbox\fi attr \snapmethodattribute \zerocount {\box\nextbox}% no pack (?), we snap
- \egroup}
-
-\def\spac_grids_check_nop
- {\gridsnappingfalse
- \resetsystemmode\v!grid
- \spac_grids_snap_value_reset}
-
-\def\spac_grids_check_yes
- {\gridsnappingtrue
- \setsystemmode\v!grid
- \spac_grids_snap_value_set\askedgridmode}
-
-\unexpanded\def\synchronizegridsnapping
- {\edef\askedgridmode{\layoutparameter\c!grid}%
- \ifx\askedgridmode\v!no % official
- \spac_grids_check_nop
- \orelse\ifx\askedgridmode\v!off % for taco and luigi
- \spac_grids_check_nop
- \orelse\ifx\askedgridmode\empty % to be sure
- \spac_grids_check_nop
- \else
- \spac_grids_check_yes
- \fi}
-
-\unexpanded\def\setupgridsnapping[#1]% less overhead than setuplayout (needs testing)
- {\setlayoutparameter\c!grid{#1}\synchronizegridsnapping}
-
-\unexpanded\def\checkgridmethod#1%
- {\edef\p_grid{#1}%
- \ifx\p_grid\empty
- \let\checkedgridmethod\empty
- \let\checkedgridscope \v!local
- \else
- \splitatcolon\p_grid\checkedgridscope\checkedgridmethod
- \ifx\checkedgridmethod\empty
- \ifx\checkedgridscope\v!local\orelse\ifx\checkedgridscope\v!global\else
- \let\checkedgridmethod\checkedgridscope
- \let\checkedgridscope \v!local
- \fi
- \fi
- \fi}
-
-\unexpanded\def\applygridmethod#1#2#3% content localsettings (used in head rendering)
- {\checkgridmethod{#1}%
- \ifx\checkedgridscope\v!global
- \ifx\checkedgridmethod\empty \else
- % we assume that the call is grouped because grouping here has the side
- % effect that the eventually constructed line will get the value outside
- % the group
- %
- % overkill: \setupgridsnapping[\checkedgridmethod]%
- % maybe : \spac_grids_snap_value_auto\checkedgridmethod
- \spac_grids_snap_value_set\checkedgridmethod
- \fi
- \hbox{#3}%
- \else
- % the extra hbox will trigger the global snapper on top of the local and
- % we really need that in this case (compatibility etc etc) so here we don't
- % het an already done hit (otherwise we would not snap)
- \hbox\bgroup
- \ifx\checkedgridmethod\empty\orelse\ifconditional\headisdisplay
- #2%
- \fi
- \snaptogrid[\checkedgridmethod]\hbox{#3}%
- \egroup
- \fi}
-
-\unexpanded\gdef\page_layouts_calculate_overshoot
- {\ifgridsnapping\ifcase\layoutlines
- \getnoflines\textheight
- \textovershoot\dimexpr\noflines\globalbodyfontlineheight-\textheight\relax
- \fi\fi}
-
-\unexpanded\def\page_layouts_report_overshoot
- {\page_layouts_calculate_overshoot
- \ifdim\textovershoot>\zeropoint
- \writestatus\m!layouts{gridmode,\space
- noflines: \the\noflines,\space
- textheight: \the\textheight,\space
- textovershoot: \the\textovershoot\space
- (maybe set number of lines instead)%
- }%
- \fi
- \glet\page_layouts_report_overshoot\page_layouts_calculate_overshoot}
-
-\appendtoks
- \page_layouts_report_overshoot
-\to \everybeforepagebody
-
-%D Visualization:
-
-\definepalet
- [grid]
- [ one=red,
- two=green,
- three=blue,
- four=gray]
-
-\unexpanded\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}}}
-
-\setnewconstant\gridboxlinenomode\plusone % 0:nothing 1:all 2:lines 3:frame 4:l/r
-\setnewconstant\gridboxlinemode \plusone
-
-\unexpanded\def\gridboxvbox
- {\ifcase\gridboxlinemode
- \vpack
- \or
- \ruledvpack
- \or
- \vpack
- \or
- \ruledvpack
- \else
- \ruledvpack
- \fi}
-
-\def\gridboxwidth{\ifcase\gridboxlinemode0\or.5\or.5\or0\else.5\fi\linewidth}
-
-\unexpanded\def\setgridbox#1#2#3% maybe ifgridsnapping at outer level
- {\setbox#1\gridboxvbox to #3 % given size
- {\forgetall
- \resetvisualizers
- \resetteststrut
- \offinterlineskip
- \hsize#2%
- \ifcase\gridboxlinenomode\or\or\or
- \gridboxlinenomode\doifoddpageelse\plusone\plustwo % 3: outer
- \or
- \gridboxlinenomode\doifoddpageelse\plustwo\plusone % 4: inner
- \fi
- \topskipcorrection
- \gridboxvbox % calculated size
- {\getrawnoflines{#3}% \getnoflines{#3}%
- \scratchdimen\dimexpr#2+\lineheight\relax
- \dorecurse\noflines
- {\strut
- \hskip-.5\lineheight\relax
- \ifcase\gridboxlinenomode\or
- \rlap
- {\hskip\dimexpr.2\bodyfontsize+\scratchdimen\relax
- \infofont\hbox to \emwidth{\hss\recurselevel}}%
- \or
- \llap
- {\infofont\hbox to \emwidth{\hss\recurselevel}%
- \hskip.2\bodyfontsize}%
- \fi
- \vrule
- \s!height \gridboxwidth
- \s!depth \gridboxwidth
- \s!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, but it needs checking
- {}
-
-%D Helper:
-
-\unexpanded\def\spac_helpers_assign_skip#1#2% ook nog \v!halfline+fuzzysnap
- {\doifelse{#2}\v!line
- {#1\ifgridsnapping
- \bodyfontlineheight
- \else
- \openlineheight
- \fi}
- {\ifgridsnapping
- \assigndimension{#2}{#1}{.25\bodyfontlineheight}{.5\bodyfontlineheight}\bodyfontlineheight
- \else
- \assigndimension{#2}{#1}\smallskipamount\medskipamount\bigskipamount
- \fi}%
- \relax}
-
-% \start \dosetstretch{.25em} \setuptolerance[tolerant,stretch] \input tufte \endgraf \stop
-% \start \dosetstretch{.5em} effe flink doorfietsen \stop
-
-% 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
-% 10 == no topskip
-%
-% 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: builders.vspacing.fixed = false
-%
-% \ifgridsnapping will go
-
-\installcorenamespace{vspacingamount}
-
-\unexpanded\def\definevspacingamount
- {\dotripleempty\spac_vspacing_define_amount}
-
-\def\spac_vspacing_define_amount[#1][#2][#3]% can be combined
- {\ifthirdargument
- \setvalue{\??vspacingamount#1}{\ifgridsnapping#3\else#2\fi}%
- \orelse\ifsecondargument
- \setvalue{\??vspacingamount#1}{\ifgridsnapping\lineheight\else#2\fi}%
- \else
- \setvalue{\??vspacingamount#1}{\lineheight}%
- \fi
- \clf_vspacingsetamount{#1}}
-
-\def\spac_vspacing_no_topskip % use grouped
- {\attribute\skipcategoryattribute\plusten}
-
-% \installcorenamespace{vspacingamountnormal}
-% \installcorenamespace{vspacingamountgrid}
-
-% \def\spac_vspacing_define_amount[#1][#2][#3]% can be combined
-% {\ifcsname n>#1\endcsname\else
-% \expandafter\newtoks\csname n>#1\endcsname
-% \expandafter\newtoks\csname g>#1\endcsname
-% \fi
-% \csname n>#1\endcsname{#2}%
-% \csname g>#1\endcsname{#3}%
-% \clf_vspacingsetamount{#1}}
-
-\unexpanded\def\definevspacing
- {\dodoubleempty\spac_vspacing_define}
-
-\def\spac_vspacing_define[#1][#2]%
- {\clf_vspacingdefine{#1}{#2}}
-
-%D The injector code (generated at the \LUA\ end):
-
-\newtoks\everybeforeblankhandling
-\newtoks\everyafterblankhandling
-
-\newconditional\c_space_vspacing_done
-\newconditional\c_space_vspacing_fixed
-\newconditional\c_space_ignore_parskip
-
-\appendtoks
- \s_spac_vspacing_temp\zeropoint
- \attribute\skipcategoryattribute\plusone
- \attribute\skippenaltyattribute \attributeunsetvalue
- \attribute\skiporderattribute \attributeunsetvalue
- \ifgridsnapping
- \settrue\c_space_vspacing_fixed
- \else
- \setfalse\c_space_vspacing_fixed
- \fi
-\to \everybeforeblankhandling
-
-\appendtoks
- \s_spac_vspacing_temp\plusone\s_spac_vspacing_temp
- \ifconditional\c_space_vspacing_fixed \else
- \s!plus \skipgluefactor\s_spac_vspacing_temp
- \s!minus\skipgluefactor\s_spac_vspacing_temp
- \fi
- \relax
-\to \everyafterblankhandling
-
-\unexpanded\def\setblankpacked
- {\settrue\c_space_ignore_parskip}
-
-\unexpanded\def\setblankcategory#1%
- {\settrue\c_space_vspacing_done
- \attribute\skipcategoryattribute#1\relax}
-
-\unexpanded\def\setblankorder#1%
- {\attribute\skiporderattribute#1\relax}
-
-\unexpanded\def\fixedblankskip
- {\settrue\c_space_vspacing_fixed}
-
-\unexpanded\def\flexibleblankskip
- {\setfalse\c_space_vspacing_fixed}
-
-% \unexpanded\def\addblankskip#1#2#3%
-% {\settrue\c_space_vspacing_done
-% \advance\s_spac_vspacing_temp#1\dimexpr\ifgridsnapping#3\else#2\fi\relax\relax}
-
-\unexpanded\def\setblankpenalty#1%
- {\flushblankhandling
- \settrue\c_space_vspacing_done
- \attribute\skipcategoryattribute \plusthree
- \attribute\skippenaltyattribute #1\relax
- \flushblankhandling}
-
-\unexpanded\def\startblankhandling % move this to \vspacing
- {\par
- \ifvmode
- \expandafter\dostartblankhandling
- \else
- \expandafter\nostartblankhandling
- \fi}
-
-\unexpanded\def\nostartblankhandling#1\stopblankhandling
- {}
-
-\def\dostartblankhandling
- {\begingroup
- \setfalse\c_space_vspacing_done
- \setfalse\c_space_ignore_parskip
- \the\everybeforeblankhandling}
-
-\unexpanded\def\stopblankhandling
- {\the\everyafterblankhandling
- \ifconditional\c_space_vspacing_done
- \vskip\s_spac_vspacing_temp
- \fi
- \ifconditional\c_space_ignore_parskip
- \endgroup\ignoreparskip
- \else
- \endgroup
- \fi}
-
-\unexpanded\def\flushblankhandling
- {\the\everyafterblankhandling
- \ifconditional\c_space_vspacing_done
- \vskip\s_spac_vspacing_temp
- \fi
- \setfalse\c_space_vspacing_done
- \the\everybeforeblankhandling}
-
-\unexpanded\def\addpredefinedblankskip#1#2%
- {\settrue\c_space_vspacing_done
- \advance\s_spac_vspacing_temp#1\dimexpr\csname\??vspacingamount#2\endcsname\relax}
-
-% \unexpanded\def\addpredefinedblankskip#1#2%
-% {\settrue\c_space_vspacing_done
-% \advance\s_spac_vspacing_temp#1\dimexpr\the\csname\ifgridsnapping g\else n\fi>#2\endcsname\relax}
-
-\unexpanded\def\addaskedblankskip#1#2%
- {\settrue\c_space_vspacing_done
- \advance\s_spac_vspacing_temp#1\dimexpr#2\relax}
-
-% The main spacer:
-
-\unexpanded\def\vspacing
- {\doifelsenextoptionalcs\spac_vspacing_yes\spac_vspacing_nop}
-
-\def\spac_vspacing_yes
- {\ifinpagebody % somewhat weird
- \expandafter\spac_vspacing_yes_indeed
- \orelse\ifconditional\c_spac_packed_blank
- \expandafter\spac_vspacing_yes_indeed
- \else
- \expandafter\spac_vspacing_yes_ignore
- \fi}
-
-\def\spac_vspacing_nop
- {\ifinpagebody % somewhat weird
- \expandafter\spac_vspacing_nop_indeed
- \orelse\ifconditional\c_spac_packed_blank
- \expandafter\spac_vspacing_nop_indeed
- \else
- \expandafter\spac_vspacing_nop_ignore
- \fi}
-
-\def\spac_vspacing_yes_indeed[#1]%
- {\ifmmode\else\par\clf_vspacing{#1}\fi}
-
-\def\spac_vspacing_yes_ignore[#1]%
- {\ifmmode\else\par\fi}
-
-\def\spac_vspacing_nop_indeed
- {\ifmmode\else\par\clf_vspacing{\currentvspacing}\fi}
-
-\def\spac_vspacing_nop_ignore
- {\ifmmode\else\par\fi}
-
-\installcorenamespace{vspacing}
-
-\unexpanded\def\directvspacing#1%
- {\par
- \ifchkdim#1\or
- \spac_vspacing_dim_preset{\the\dimexpr#1}%
- \orelse\ifcsname\??vspacing#1\endcsname
- \lastnamedcs
- \else
- \spac_vspacing_yes_preset{#1}%
- \fi}
-
-\def\spac_vspacing_dim_preset#1%
- {\ifcsname\??vspacing#1\endcsname
- \lastnamedcs
- \else
- \spac_vspacing_yes_preset{#1}%
- \fi}
-
-\def\spac_vspacing_yes_preset#1%
- {\setxvalue{\??vspacing#1}{\clf_vspacing{#1}}%
- %\writestatus{}{}%
- %\writestatus{#1}{\expandafter\meaning\csname\??vspacing#1\endcsname}%
- %\writestatus{}{}%
- \csname\??vspacing#1\endcsname}
-
-\def\spac_vspacing_yes_indeed[#1]%
- {\ifmmode\else
- \directvspacing{#1}%
- \fi}
-
-\def\spac_vspacing_nop_indeed
- {\ifmmode\else
- \directvspacing\currentvspacing
- \fi}
-
-\def\directdefaultvspacing
- {\ifinpagebody % somewhat weird
- \directvspacing\currentvspacing
- \orelse\ifconditional\c_spac_packed_blank
- \directvspacing\currentvspacing
- \fi}
-
-\def\directcheckedvspacing
- {\ifinpagebody % somewhat weird
- \expandafter\directvspacing
- \orelse\ifconditional\c_spac_packed_blank
- \expandafter\directvspacing
- \else
- \expandafter\gobbleoneargument
- \fi}
-
-\unexpanded\def\useblankparameter#1% faster local variant
- {\edef\m_spac_blank_asked{#1\c!blank}%
- \ifx\m_spac_blank_asked\empty\else
- \directvspacing\m_spac_blank_asked
- \fi}
-
-%D Handy (and faster):
-
-\unexpanded\def\directvpenalty#1%
- {\begingroup
- \attribute\skipcategoryattribute \plusthree
- \attribute\skippenaltyattribute #1\relax
- \attribute\skiporderattribute \attributeunsetvalue
- \vskip\zeropoint
- \endgroup}
-
-\unexpanded\def\directvskip#1%
- {\begingroup
- \attribute\skipcategoryattribute \plusone
- \attribute\skippenaltyattribute \attributeunsetvalue
- \attribute\skiporderattribute \attributeunsetvalue
- \vskip#1\relax
- \endgroup}
-
-%D These depend on bigskipamount cum suis so we'd better sync them:
-
-\unexpanded\def\setupvspacing
- {\doifelsenextoptionalcs\setupvspacing_yes\setupvspacing_nop}
-
-\let\currentvspacing\s!default % hm, default, standard ...
-
-\def\setupvspacing_yes[#1]%
- {\edef\currentvspacing{#1}%
- \spac_whitespace_setup_nop % yes or no, was forgotten
- }
-
-\def\setupvspacing_nop
- {\ifx\empty\currentvspacing % mistakenly had an \else
- \let\currentvspacing\s!default
- \fi
- \spac_whitespace_setup_nop}
-
-\unexpanded\def\restorestandardblank % or default ?
- {\let\currentvspacing\v!standard}
-
-\let\synchronizevspacing\setupvspacing_nop
-
-%D The \type {category:4} is default.
-
-\definevspacingamount[\v!none] [\zeropoint] [\zeropoint]
-\definevspacingamount[\v!big] [\bigskipamount] [\bodyfontlineheight]
-\definevspacingamount[\v!medium] [\medskipamount] [.5\bodyfontlineheight]
-\definevspacingamount[\v!small] [\smallskipamount] [.25\bodyfontlineheight]
-\definevspacingamount[\v!line] [\openlineheight] [\bodyfontlineheight]
-\definevspacingamount[\v!halfline] [.5\openlineheight] [.5\bodyfontlineheight]
-\definevspacingamount[\v!quarterline] [.25\openlineheight] [.25\bodyfontlineheight]
-\definevspacingamount[\v!formula] [\medskipamount] [.5\bodyfontlineheight]
-\definevspacingamount[\v!white] [\parskip] [\bodyfontwhitespace]
-\definevspacingamount[\v!height] [\strutht] [\bodyfontstrutheight]
-\definevspacingamount[\v!depth] [\strutdp] [\bodyfontstrutdepth]
-
-\definevspacingamount[\v!standard] [.75\openlineheight] [.75\openlineheight] % mkii compatible
-
-\def\bodyfontwhitespace
- {\dimexpr
- \ifzeropt\parskip
- \zeropoint
- \orelse\ifgridsnapping
- \bodyfontlineheight
- \else
- \parskip
- \fi
- \relax}
-
-%D used in itemize \unknown\ always test this:
-
-\newdimen\d_spac_overlay
-
-\def\spac_overlay_lines
- {\directcheckedvspacing{\v!back,\v!overlay}% \blank[\v!back,\v!overlay]%
- \nointerlineskip}
-
-% \startitemize[n]
-% \item \input zapf
-% \item \startitemize[a]
-% \item \input knuth
-% \stopitemize
-% \stopitemize
-%
-% \strut \hfill first line \blank[overlay] second line \hfill \strut
-%
-% \ruledvbox {
-% \strut \hfill line 1 \blank[overlay]
-% line 2 \hfill \strut \blank[overlay]
-% \strut \hfill line 3 \hfill \strut
-% }
-%
-% \dorecurse{50}
-% {\startitemize[n] \startitem \startitemize[a] \item #1 \stopitemize \stopitem \stopitemize}
-
-\definevspacing[\v!preference][penalty:-500] % goodbreak
-\definevspacing[\v!samepage] [penalty:10000] % nobreak
-
-\definevspacing[\v!always] [category:0] % hm, internally it's discard
-\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!packed] [category:8] % noparskip (kind of special)
-\definevspacing[\v!overlay] [category:9]
-\definevspacing[\v!enable] [category:10]
-
-%definevspacing[\v!noparskip] [category:8]
-%definevspacing[\v!notopskip] [category:11]
-
-\definevspacing[\v!weak] [order:0]
-\definevspacing[\v!strong] [order:100]
-
-\definevspacing[\s!default] [\v!white] % was big for a while
-
-\newcount\c_spac_vspacing_special_base \c_spac_vspacing_special_base = 32250 % 4000
-\newcount\c_spac_vspacing_special_step \c_spac_vspacing_special_step = 10 % 250
-\newcount\c_spac_vspacing_special_done
-
-% 2019-05-31 : upgraded a bit to more distinctive samepage-[level]-[0|1|2] names
-
-\unexpanded\def\spac_vspacing_define_same_step#1#2% alternatively we could have samepage-n-m
- {\begingroup
- \scratchcounterone\numexpr\plusthree*#1+#2\relax
- \scratchcountertwo\numexpr\c_spac_vspacing_special_base+\c_spac_vspacing_special_step*\scratchcounterone\relax
- %\writestatus{defined}{\v!samepage-\number#1-\number#2\space=>\space penalty:\the\scratchcountertwo}%
- \normalexpanded{\definevspacing[\v!samepage-\number#1-\number#2][penalty:\the\scratchcountertwo]}%
- \endgroup}
-
-\unexpanded\def\spac_vspacing_define_same_page#1%
- {\dostepwiserecurse\c_spac_vspacing_special_done{#1}\plusone
- {\spac_vspacing_define_same_step\recurselevel\zerocount % before
- \spac_vspacing_define_same_step\recurselevel\plusone % after
- \spac_vspacing_define_same_step\recurselevel\plustwo}% % whatever
- \global\c_spac_vspacing_special_done#1\relax}
-
-\spac_vspacing_define_same_page{12} % 12 levels should be more than enough as a start
-
-\def\spac_vspacing_same_page#1#2% level offset (starts at 0)
- {\ifnum#1>\c_spac_vspacing_special_done
- \spac_vspacing_define_same_page{#1}%
- \fi
- %\writestatus{used}{\v!samepage-\number#1-\number#2}%
- \vspacing[\v!samepage-\number#1-\number#2]}
-
-\definevspacing[\v!default] [\v!big] % todo: needs to adapt to \setupblank
-\definevspacing[\v!before] [\v!default] % but we need to avoid circular references
-\definevspacing[\v!inbetween][\v!default] % then
-\definevspacing[\v!after] [\v!before]
-
-\setupvspacing
- [\v!big] % alternatively [\v!standard]
-
-%D Maybe at some point we will differ between \type {\vspacing} and \type {\blank}
-%D (we needed the first one while playing with the new code).
-
-% We keep this one as reference
-%
-% \unexpanded\def\inhibitblank
-% {\vspacing[\v!disable]}
-%
-% but use the following more efficient variant instead:
-
-\unexpanded\def\inhibitblank
- {\ifvmode
- \begingroup
- \attribute\skipcategoryattribute\plusfive
- \vskip\zeropoint
- \endgroup
- \fi}
-
-\let\doinhibitblank\inhibitblank % keep this command, used in styles
-
-\let\defineblank \definevspacing
-\let\setupblank \setupvspacing
-\let\blank \vspacing
-\let\synchronizeblank \synchronizevspacing
-\let\defineblankmethod\definevspacingamount
-
-%D The following command is for Wolfgang. It has to be used with care as it does
-%D {\em not} work in tandem with the other spacing commands.
-
-\installcorenamespace{vspace}
-
-\unexpanded\def\definevspace
- {\dotripleempty\spac_vspace_define}
-
-\def\spac_vspace_define[#1][#2][#3]%
- {\ifthirdargument
- \setvalue{\??vspace#1:#2}{#3}%
- \else
- \setvalue{\??vspace:#1}{#2}%
- \fi}
-
-\letvalue{\??vspace:\s!unknown}\zeropoint
-
-\unexpanded\def\vspace
- {\dodoubleempty\spac_vspace_inject}
-
-\def\spac_vspace_unknown
- {\csname\??vspace:\s!unknown\endcsname}
-
-\def\spac_vspace_inject[#1][#2]% use \lastnamedcs
- {\par
- \ifvmode
- \removelastskip
- \vskip
- \ifsecondargument
- \ifcsname\??vspace#1:#2\endcsname
- \lastnamedcs
- \orelse\ifcsname\??vspace:#2\endcsname
- \lastnamedcs
- \else
- \spac_vspace_unknown
- \fi
- \orelse\iffirstargument
- \ifcsname\??vspace:#1\endcsname
- \lastnamedcs
- \else
- \spac_vspace_unknown
- \fi
- \else
- \ifcsname\??vspace:\s!default\endcsname
- \lastnamedcs
- \else
- \spac_vspace_unknown
- \fi
- \fi
- \relax
- \fi}
-
-%D Some preliminary code: a simple and fast hanger, for usage in macros.
-
-\installcorenamespace {hanging}
-
-\installdirectcommandhandler \??hanging {hanging}
-
-\setuphanging
- [\c!distance=.5\emwidth,
- \c!location=\v!left,
- \c!n=\zerocount]
-
-\unexpanded\def\starthanging
- {\dontleavehmode\bgroup
- \dosingleempty\spac_hanging_start}
-
-\unexpanded\def\stophanging
- {\endgraf
- \egroup}
-
-\let\m_spac_hanging_location\empty
-
-\def\spac_hanging_start[#1]%
- {\doifelseassignment{#1}
- {\let\m_spac_hanging_location\empty
- \setupcurrenthanging[#1]}%
- {\edef\m_spac_hanging_location{#1}}%
- \ifx\m_spac_hanging_location\empty
- \edef\m_spac_hanging_location{\directhangingparameter\c!location}%
- \fi
- \dowithnextboxcs\spac_hanging_finish\hbox}
-
-\def\spac_hanging_finish
- {\scratchdistance\directhangingparameter\c!distance\relax
- \ifdim\ht\nextbox>\strutht
- \setbox\nextbox\tbox{\box\nextbox}%
- \fi
- \scratchcounter\directhangingparameter\c!n\relax
- \ifnum\scratchcounter>\zerocount
- \hangafter-\scratchcounter
- \else
- \getboxheight\scratchdimen\of\box\nextbox
- \getnoflines\scratchdimen
- \hangafter-\noflines
- \fi
- \ht\nextbox\strutht
- \dp\nextbox\strutdp
- \scratchwidth\dimexpr\wd\nextbox+\scratchdistance\relax
- \ifx\m_spac_hanging_location\v!right
- \hangindent\ifconditional\displaylefttoright-\fi\scratchwidth
- \rlap{\hskip\dimexpr\hsize-\leftskip-\wd\nextbox\relax\box\nextbox}% \leftskip is new
- \else
- \hangindent\ifconditional\displaylefttoright\else-\fi\scratchwidth
- \llap{\box\nextbox\hskip\scratchdistance}%
- \fi
- \ignorespaces}
-
-
-%D \macros
-%D {startfixed}
-%D
-%D \starttyping
-%D \startitemize
-%D \startitem \externalfigure[cow][height=1cm] \stopitem
-%D \startitem \externalfigure[cow][height=1cm] \stopitem
-%D
-%D \startitem \startfixed \externalfigure[cow][height=1cm]\stopfixed \stopitem
-%D \startitem \startfixed[high]\externalfigure[cow][height=1cm]\stopfixed \stopitem
-%D \startitem \startfixed[low] \externalfigure[cow][height=1cm]\stopfixed \stopitem
-%D \startitem \startfixed[lohi]\externalfigure[cow][height=1cm]\stopfixed \stopitem
-%D
-%D \startitem test \par \startfixed \externalfigure[koe][height=1cm]\stopfixed \stopitem
-%D \startitem test \par \startfixed[high]\externalfigure[koe][height=1cm]\stopfixed \stopitem
-%D \startitem test \par \startfixed[low] \externalfigure[koe][height=1cm]\stopfixed \stopitem
-%D \startitem test \par \startfixed[lohi]\externalfigure[koe][height=1cm]\stopfixed \stopitem
-%D \stopitemize
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-
-\installcorenamespace{fixedalternatives}
-
-\unexpanded\def\startfixed
- {\bgroup
- \dosingleempty\typo_fixed_start}
-
-\def\typo_fixed_start
- {\ifhmode
- \expandafter\typo_fixed_start_h
- \else
- \expandafter\typo_fixed_start_v
- \fi}
-
-\def\typo_fixed_start_h[#1]%
- {\let\stopfixed\typo_fixed_stop_h
- \dowithnextbox{\typo_fixed_finish{#1}}%
- \vbox\bgroup
- %ignorespaces
- \setlocalhsize}
-
-\unexpanded\def\typo_fixed_stop_h
- {%removeunwantedspaces
- \egroup
- \egroup}
-
-\def\typo_fixed_start_v[#1]%
- {\let\stopfixed\typo_fixed_stop_v
- \startbaselinecorrection}
-
-\unexpanded\def\typo_fixed_stop_v
- {\stopbaselinecorrection
- \egroup}
-
-\letvalue{\??fixedalternatives \v!high}\bbox
-\letvalue{\??fixedalternatives \v!low}\tbox
-\letvalue{\??fixedalternatives \v!middle}\vcenter
-\letvalue{\??fixedalternatives \v!lohi}\vcenter
-\letvalue{\??fixedalternatives\s!unknown}\tbox
-\letvalue{\??fixedalternatives\s!default}\tbox
-
-\unexpanded\def\typo_fixed_finish#1%
- {\expandnamespacevalue\??fixedalternatives{#1}\s!default{\box\nextbox}}
-
-% %D Forgotten already:
-%
-% \def\shapefill{\vskip\zeropoint\s!plus\lineheight\s!minus\lineheight\relax}
-
-%D Nasty:
-
-% \writestatus{1}{\the\prevdepth} \blank[force,5*big] { \writestatus{1}{\the\prevdepth} \baselineskip1cm xxxxxxxxx \par } \page
-% \writestatus{2}{\the\prevdepth} \blank[force,5*big] { \writestatus{2}{\the\prevdepth} \baselineskip1cm xxxxxxxxx \par } \page
-% \writestatus{3}{\the\prevdepth} \blank[force,5*big] { \writestatus{3}{\the\prevdepth} \baselineskip5cm xxxxxxxxx \par } \page
-% \writestatus{4}{\the\prevdepth} \input tufte \page
-% \writestatus{5}{\the\prevdepth} \input tufte \page
-% \writestatus{6}{\the\prevdepth} \blank[force,5*big] { \writestatus{6}{\the\prevdepth} \baselineskip1cm xxxxxxxxx \par } \page
-
-% \writestatus{1}{\the\prevdepth} \null\vskip4cm { \writestatus{1}{\the\prevdepth} \baselineskip1cm xxxxxxxxx \par } \page
-% \writestatus{2}{\the\prevdepth} \null\vskip4cm { \writestatus{2}{\the\prevdepth} \baselineskip1cm xxxxxxxxx \par } \page
-% \writestatus{3}{\the\prevdepth} \null\vskip4cm { \writestatus{3}{\the\prevdepth} \baselineskip5cm xxxxxxxxx \par } \page
-% \writestatus{4}{\the\prevdepth} \input tufte \page
-% \writestatus{5}{\the\prevdepth} \input tufte \page
-% \writestatus{6}{\the\prevdepth} \null\vskip4cm { \writestatus{6}{\the\prevdepth} \baselineskip1cm xxxxxxxxx \par } \page
-
-\appendtoks
- \ifvmode\prevdepth\zeropoint\fi % consistent, else first page -1000pt .. needed for fixed,3*big first/successive pages consistency
-\to \everystarttext
-
-\prevdepth\zeropoint
-
-%D Helper:
-
-\unexpanded\def\checkedblank[#1]%
- {\edef\p_blank{#1}%
- \ifx\p_blank\empty
- % ignore
- \orelse\ifx\p_blank\v!none
- % ignore
- \else
- \blank[\p_blank]%
- \fi}
-
-% \setupwhitespace[line]
-% \prerollblank[2*line] \the\prerolledblank
-% \prerollblank[-2*line] \the\prerolledblank
-
-\newskip\prerolledblank
-
-\unexpanded\def\prerollblank[#1]%
- {\begingroup
- \edef\p_blank{#1}%
- \ifx\p_blank\empty
- \global\prerolledblank\zeropoint
- \orelse\ifx\p_blank\v!none
- \global\prerolledblank\zeropoint
- \else
- % don't mess with \arskip here!
- \scratchskip\plusten\lineheight
- \setbox\scratchbox\vbox
- {\vskip\scratchskip
- \kern\zeropoint
- \blank[\p_blank]}%
- % \dimexpr doesn't work well with skips
- \advance\scratchskip-\ht\scratchbox
- \global\prerolledblank-\scratchskip
- \fi
- \endgroup}
-
-\newcount\c_spac_vspacing_ignore_parskip
-
-% \setupwhitespace[line]
-% \setuphead[subject][after={\blank[packed]},style=\bfb]
-% \subject{foo}
-% test \par
-% test \par
-% \blank[packed] % \ignoreparskip
-% test \par
-% test \par
-% \ignoreparskip
-% test \par
-% test \par
-% \setuphead[subject][after={\blank[nowhite]},style=\bfb]
-% \subject{foo}
-% test \par
-% test \par
-
-\unexpanded\def\ignoreparskip{\c_spac_vspacing_ignore_parskip\plusone}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/status-files.pdf b/Master/texmf-dist/tex/context/base/mkiv/status-files.pdf
index 01dde89ff97..e890fa88c93 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/status-files.pdf
+++ b/Master/texmf-dist/tex/context/base/mkiv/status-files.pdf
Binary files differ
diff --git a/Master/texmf-dist/tex/context/base/mkiv/status-lua.pdf b/Master/texmf-dist/tex/context/base/mkiv/status-lua.pdf
index 105405cc41e..ffeb01fef65 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/status-lua.pdf
+++ b/Master/texmf-dist/tex/context/base/mkiv/status-lua.pdf
Binary files differ
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-con.mkvi b/Master/texmf-dist/tex/context/base/mkiv/strc-con.mkvi
index 8c75eb6df5e..81e28f67fd5 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-con.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-con.mkvi
@@ -226,7 +226,7 @@
{\begingroup
\iftrialtypesetting \else
\currentconstructionsynchronize
- \attribute\destinationattribute\currentconstructionattribute\relax
+ \c_attr_destination\currentconstructionattribute\relax
\fi
#1%
\endgroup}
@@ -235,7 +235,7 @@
{\begingroup
\iftrialtypesetting \else
\currentconstructionsynchronize
- \attribute\destinationattribute\currentconstructionattribute\relax
+ \c_attr_destination\currentconstructionattribute\relax
\fi
\currentconstructiontext
\endgroup}
@@ -244,7 +244,7 @@
{\iftrialtypesetting \else
\begingroup
\currentconstructionsynchronize % reinstated
- \attribute\destinationattribute\currentconstructionattribute\relax % todo, whole text
+ \c_attr_destination\currentconstructionattribute\relax % todo, whole text
\signalcharacter
\endgroup
\fi#1}
@@ -418,6 +418,8 @@
%
\dostoptagged % tag
\dostarttagged\t!constructioncontent\empty
+ %\freezeparagraphproperties
+ \updateparagraphshapes
\ignorespaces} % args not needed
\unexpanded\setvalue{\??constructionstophandler\v!construction}%
@@ -433,7 +435,7 @@
\dorechecknextindentation}
\unexpanded\def\boxedconstructionhead#1%
- {\vtop
+ {\doifelse{\constructionalternativeparameter\c!alignbottom}{\v!yes}\vbox\vtop
{\hsize\constructionsheadwidth
\edef\p_strc_constructions_headalign{\constructionparameter\c!headalign}%
\ifx\p_strc_constructions_headalign\empty \else
@@ -618,7 +620,7 @@
\stopsetups
\startsetups[\??constructionrenderings:\v!left:\v!none]
- \let\\=\crlf
+ \let\\\crlf
\noindent
\strc_constructions_set_pure_box\v!flushleft
\leftskip\dimexpr\leftconstructionskip+\constructionsheadwidth+\constructionsheaddistance\relax
@@ -644,7 +646,7 @@
\stopsetups
\startsetups[\??constructionrenderings:\v!right:\v!none]
- \let\\=\crlf
+ \let\\\crlf
\noindent
\leftskip\leftconstructionskip
\rightskip\dimexpr\rightconstructionskip+\constructionsheadwidth\relax
@@ -670,7 +672,7 @@
\stopsetups
\startsetups[\??constructionrenderings:\v!left:\v!margin]%
- \let\\=\crlf
+ \let\\\crlf
\noindent
\strc_constructions_set_pure_box\v!flushleft
\llap {
@@ -685,7 +687,7 @@
\stopsetups
\startsetups[\??constructionrenderings:\v!right:\v!margin]%
- \let\\=\crlf
+ \let\\\crlf
\noindent
\strc_constructions_set_pure_box\v!flushright
\rlap {
@@ -700,7 +702,7 @@
\stopsetups
\startsetups[\??constructionrenderings:\v!left:\v!hanging]%
- \let\\=\crlf
+ \let\\\crlf
\dontcomplain
\advance\constructionsheadwidth \constructionsheaddistance
\strc_constructions_set_hang_box\v!flushleft
@@ -717,7 +719,7 @@
\stopsetups
\startsetups[\??constructionrenderings:\v!right:\v!hanging]%
- \let\\=\crlf
+ \let\\\crlf
\dontcomplain
\advance\constructionsheadwidth \constructionsheaddistance
\strc_constructions_set_hang_box\v!flushright
@@ -738,7 +740,7 @@
\startsetups[\??constructionrenderings:\v!top]
% \strc_sectioning_prevent_page_break % commented per 31/5/2019
- \let\\=\space
+ \let\\\space
\noindent
\copy\constructionheadbox % why copy ?
\par
@@ -756,7 +758,7 @@
% why copy? historic reason?
\startsetups[\??constructionrenderings:\v!margin]
- \let\\=\crlf
+ \let\\\crlf
\noindent
\inmargin[\c!scope=\v!local]{\flushconstructionheadbox}%
\useconstructionstyleandcolor\c!style\c!color
@@ -764,7 +766,7 @@
\stopsetups
\startsetups[\??constructionrenderings:\v!leftmargin]
- \let\\=\crlf
+ \let\\\crlf
\noindent
\inleft[\c!scope=\v!local]{\flushconstructionheadbox}%
\useconstructionstyleandcolor\c!style\c!color
@@ -772,7 +774,7 @@
\stopsetups
\startsetups[\??constructionrenderings:\v!rightmargin]
- \let\\=\crlf
+ \let\\\crlf
\noindent
\inright[\c!scope=\v!local]{\flushconstructionheadbox}%
\useconstructionstyleandcolor\c!style\c!color
@@ -780,7 +782,7 @@
\stopsetups
\startsetups[\??constructionrenderings:\v!innermargin]
- \let\\=\crlf
+ \let\\\crlf
\noindent
\ininner[\c!scope=\v!local]{\flushconstructionheadbox}%
\useconstructionstyleandcolor\c!style\c!color
@@ -788,7 +790,7 @@
\stopsetups
\startsetups[\??constructionrenderings:\v!outermargin]
- \let\\=\crlf
+ \let\\\crlf
\noindent
\inouter[\c!scope=\v!local]{\flushconstructionheadbox}%
\useconstructionstyleandcolor\c!style\c!color
@@ -818,7 +820,7 @@
\stopsetups
\startsetups[\??constructionrenderings:\v!serried:\v!fit]
- \let\\=\crlf
+ \let\\\crlf
\noindent
\flushconstructionheadbox
\nobreak
@@ -828,7 +830,7 @@
\stopsetups
\startsetups[\??constructionrenderings:\v!serried:\v!broad]
- \let\\=\crlf
+ \let\\\crlf
\noindent
\flushconstructionheadbox
\ifconditional\c_strc_constructions_distance_none \else
@@ -847,7 +849,7 @@
\stopsetups
\startsetups[\??constructionrenderings:\v!serried:\v!wide]
- \let\\=\crlf
+ \let\\\crlf
\noindent
\hbox to \constructionsheadwidth {
\flushconstructionheadbox
@@ -861,7 +863,7 @@
\startsetups[\??constructionrenderings:\v!hanging]
% tricky: leftskipadaption is somewhat unpredictable
- \let\\=\crlf
+ \let\\\crlf
\noindent
\advance\leftskip-\leftskipadaption\relax
\ifdim\leftskipadaption=\zeropoint
@@ -919,6 +921,43 @@
\endgroup
\stopsetups
+\ifcase\contextlmtxmode \else
+ % just an empty check so that we can grep for contextlmtxmode in mkiv files
+\fi
+
+% \definedescription[whatever][alternative=right:bottom]
+%
+% \startwhatever{just a small\\example}
+% \input ward
+% \stopwhatever
+
+\defineconstructionalternative
+ [\v!right:\v!bottom]
+ [%\c!width=7em,
+ %\c!distance=1em,
+ \c!alignbottom=\v!yes,
+ \c!renderingsetup=\??constructionrenderings:\v!right:\v!bottom]
+
+\startsetups[\??constructionrenderings:\v!right:\v!bottom]
+ \let\\\crlf
+ \noindent
+ \leftskip\leftconstructionskip
+ \rightskip\dimexpr\rightconstructionskip+\constructionsheadwidth+\constructionsheaddistance\relax
+ \parfillskip\zeropoint
+ \strc_constructions_set_pure_box\v!flushright
+ \directparwrapper \relax {%
+ \hfilll
+ \rlap
+ {\kern\constructionsheaddistance
+ \copy\constructionheadbox}%
+ }%
+ \useconstructionstyleandcolor\c!style\c!color
+ \ignorespaces
+\stopsetups
+
+%D This next feature will get an lmtx implementation (probably by using a new generic
+%D close mechanism).
+
% you can use \placeclosesymbol or \qed to place a symbol at the end of a
% construction
@@ -1013,7 +1052,7 @@
\begingroup
\simplifycommands
\xdef\currentconstructionbookmark{\detokenize\expandafter{\normalexpanded{\constructionparameter\c!title}}}%
- \endgroup
+ \endgroup
\fi \fi
\fi
\ifx\currentconstructionlist\empty
@@ -1085,7 +1124,7 @@
\relax
% \writestatus{constructions}{registering \currentconstruction: \number\scratchcounter}%
\clf_setinternalreference
- prefix {\referenceprefix}%
+ prefix {\currentconstructionreferenceprefix}%
reference {\currentconstructionreference}%
internal \locationcount
view {\interactionparameter\c!focus}%
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-des.mkvi b/Master/texmf-dist/tex/context/base/mkiv/strc-des.mkvi
index 76f878f5f03..5ae4c25eb97 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-des.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-des.mkvi
@@ -221,8 +221,8 @@
{\csname\??constructionstophandler \v!construction\endcsname\endgroup}}
\unexpanded\setvalue{\??constructionstarthandler\v!description}%
- {\BeforePar{\csname\??constructionstarthandler\v!construction\endcsname}%
- \GotoPar}
+ {\dogotopar
+ {\csname\??constructionstarthandler\v!construction\endcsname}}
\unexpanded\setvalue{\??constructionstophandler\v!description}%
{\csname\??constructionstophandler\v!construction\endcsname
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-doc.lua b/Master/texmf-dist/tex/context/base/mkiv/strc-doc.lua
index 9877a0f9c0e..5cb207c38bf 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-doc.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-doc.lua
@@ -1103,9 +1103,9 @@ implement { name = "namedstructureuservariable", actions = sections.userdata,
implement { name = "setstructurelevel", actions = sections.setlevel, arguments = "2 strings" }
implement { name = "getstructurelevel", actions = sections.getcurrentlevel, arguments = "string" }
implement { name = "setstructurenumber", actions = sections.setnumber, arguments = { "integer", "string" } } -- string as we support +-
-implement { name = "getstructurenumber", actions = sections.getnumber, arguments = { "integer" } }
+implement { name = "getstructurenumber", actions = sections.getnumber, arguments = "integer" }
implement { name = "getsomestructurenumber", actions = sections.getnumber, arguments = { "integer", "string" } }
-implement { name = "getfullstructurenumber", actions = sections.fullnumber, arguments = { "integer" } }
+implement { name = "getfullstructurenumber", actions = sections.fullnumber, arguments = "integer" }
implement { name = "getsomefullstructurenumber", actions = sections.fullnumber, arguments = { "integer", "string" } }
implement { name = "getspecificstructuretitle", actions = sections.structuredata, arguments = { "string", "'titledata.title'",false,"string" } }
@@ -1160,6 +1160,7 @@ implement {
{ "bookmark" },
{ "marking" },
{ "list" },
+ { "reference" },
}
},
{ "numberdata", {
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-flt.lua b/Master/texmf-dist/tex/context/base/mkiv/strc-flt.lua
index e3a0ea30edb..59c67efa1ad 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-flt.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-flt.lua
@@ -31,13 +31,13 @@ function builders.checksidefloat(mode,indented)
return indented
end
-appendaction ("newgraf","system","builders.checksidefloat")
-disableaction("newgraf","builders.checksidefloat")
+appendaction ("paragraph","system","builders.checksidefloat")
+disableaction("paragraph","builders.checksidefloat")
interfaces.implement {
name = "enablesidefloatchecker",
onlyonce = true,
actions = function()
- enableaction("newgraf","builders.checksidefloat")
+ enableaction("paragraph","builders.checksidefloat")
end,
}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-flt.mkvi b/Master/texmf-dist/tex/context/base/mkiv/strc-flt.mkvi
index d6a6723d7be..d9fd359c668 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-flt.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-flt.mkvi
@@ -211,7 +211,7 @@
\let\strc_floats_define_saved\definefloat
-\unexpanded\def\definefloat
+\unexpanded\overloaded\def\definefloat
{\dotripleempty\strc_floats_define}
\def\strc_floats_define[#1][#2][#3]% name+plural+parent | name+parent+settings
@@ -397,7 +397,7 @@
\glet\currentfloatsynchronize\m_strc_counters_last_registered_synchronize
%
% \iflocation
- % \attribute\destinationattribute\currentfloatattribute\relax
+ % \c_attr_destination\currentfloatattribute\relax
% \fi
\currentfloatsynchronize
\strc_floats_make_complete_caption
@@ -844,7 +844,8 @@
{\strc_floats_set_local_hsize
\floatparameter\c!inner
\postponenotes} % new
- {\dostoptagged
+ {\page_postprocessors_linenumbers_box\nextbox % for aditya
+ \dostoptagged
\strc_floats_finish_placement}
\vbox}
@@ -1229,7 +1230,7 @@
\let\doifoddpagefloatelse \doifelseoddpagefloat
\appendtoks
- \let\rightorleftpageaction\doifelserightpagefloat
+ \overloaded\frozen\let\rightorleftpageaction\doifelserightpagefloat
\to \everyinsidefloat
% \let\movesidefloat\gobbleoneargument
@@ -1623,7 +1624,7 @@
\setbox\b_strc_floats_caption\hbox % text
{\floatcaptionparameter\c!command{\box\b_strc_floats_caption}}%
\strc_floats_set_caption_dimensions\b_strc_floats_caption
- \moveboxontogrid\b_strc_floats_caption{\floatcaptionparameter\c!grid}\d_strc_floats_caption_height
+ %\moveboxontogrid\b_strc_floats_caption{\floatcaptionparameter\c!grid}\d_strc_floats_caption_height
%\page_backgrounds_add_local_to_box\b_strc_floats_caption
\strc_floats_build_box
\fi
@@ -2202,6 +2203,8 @@
{\box\floatbox}}}
% special purpose: used in floatcombinations
+%
+% todo : keep float content and caption separated in local
\newbox\b_strc_floats_separate_content
\newbox\b_strc_floats_separate_caption
@@ -2210,37 +2213,44 @@
{\settrue\c_floats_adapt_to_caption_width
\settrue\c_floats_store_minimal_package}
+% \def\strc_floats_build_box_separate_make
+% {\offinterlineskip
+% \vpack to \onepoint{\box\b_strc_floats_content}\break
+% \vpack to \onepoint{\box\b_strc_floats_caption}}
+
+%D Remark for \LMTX: we don't want to migrate inserts here so we unpack
+%D (could be a flag). When migrated, the inserts end up in the vertical
+%D list and we no longer have just a box (but inserts and lines again).
+
+% \def\strc_floats_build_box_separate_split#1%
+% {\setbox\scratchbox\vpack{#1}%
+% \setbox\scratchbox\vbox\bgroup
+% \unvpack\scratchbox
+% \setbox\scratchbox\lastbox % can have (unmigrated) inserts
+% \unvpack\scratchbox
+% \setbox\scratchbox\lastbox % can have (unmigrated) inserts
+% \unvpack\scratchbox
+% \setbox\scratchbox\lastbox % can have (unmigrated) inserts
+% \splittopskip\zeropoint
+% \global\setbox\b_strc_floats_separate_content\vsplit\scratchbox to \onepoint
+% \global\setbox\b_strc_floats_separate_caption\vsplit\scratchbox to \onepoint
+% \egroup
+% \global\setbox\b_strc_floats_separate_content\vpack
+% {\unvbox\b_strc_floats_separate_content
+% \setbox\scratchbox\lastbox
+% \unvbox\scratchbox}%
+% \global\setbox\b_strc_floats_separate_caption\tpack
+% {\unvbox\b_strc_floats_separate_caption
+% \setbox\scratchbox\lastbox
+% \unvbox\scratchbox}}
+
\def\strc_floats_build_box_separate_make
- {\offinterlineskip
- \vpack to \onepoint{\box\b_strc_floats_content}\break
- \vpack to \onepoint{\box\b_strc_floats_caption}}
-
-\def\strc_floats_build_box_separate_split#1%
- {\setbox\scratchbox\vbox\bgroup
- \setbox\scratchbox\vpack{#1}%
- \unvbox\scratchbox\relax
- \setbox\scratchbox\lastbox
- %\doloop{%
- \unvbox\scratchbox
- \setbox\scratchbox\lastbox
- % \ifdim\ht\scratchbox=2\onepoint
- \unvbox\scratchbox
- \setbox\scratchbox\lastbox
- % \exitloop
- % \fi
- %}%
- \splittopskip\zeropoint
- \global\setbox\b_strc_floats_separate_content\vsplit\scratchbox to \onepoint
- \global\setbox\b_strc_floats_separate_caption\vsplit\scratchbox to \onepoint
- \egroup
- \global\setbox\b_strc_floats_separate_content\vpack
- {\unvbox\b_strc_floats_separate_content
- \setbox\scratchbox\lastbox
- \unvbox\scratchbox}%
- \global\setbox\b_strc_floats_separate_caption\tpack
- {\unvbox\b_strc_floats_separate_caption
- \setbox\scratchbox\lastbox
- \unvbox\scratchbox}}
+ {\savebox\??localfloatstack{\number\numexpr\c_strc_localfloats_n+1\relax:a}{\box\b_strc_floats_content}%
+ \savebox\??localfloatstack{\number\numexpr\c_strc_localfloats_n+1\relax:b}{\box\b_strc_floats_caption}}
+
+\unexpanded\def\strc_floats_build_box_separate_split#1%
+ {\global\setbox\b_strc_floats_separate_content\vpack{\foundbox\??localfloatstack{\number#1:a}}%
+ \global\setbox\b_strc_floats_separate_caption\tpack{\foundbox\??localfloatstack{\number#1:b}}}
% \def\strc_floats_build_box_step#1%
% {\doifdefined{\??floatbuilder#1}{\def\floatcaptionarrangement{#1}\quitcommalist}}
@@ -2339,7 +2349,7 @@
\strc_floats_check_caption_content
\strc_floats_prepare_side_caption
\setbox\b_strc_floats_caption\hbox{\floatcaptionparameter\c!command{\box\b_strc_floats_caption}}% \hpack ?
- \moveboxontogrid\b_strc_floats_caption{\floatcaptionparameter\c!grid}\d_strc_floats_caption_height
+ %\moveboxontogrid\b_strc_floats_caption{\floatcaptionparameter\c!grid}\d_strc_floats_caption_height
%\page_backgrounds_add_local_to_box\b_strc_floats_caption
\strc_floats_build_side_box
\fi
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-itm.mklx b/Master/texmf-dist/tex/context/base/mkiv/strc-itm.mklx
deleted file mode 100644
index 60fe3ee746a..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-itm.mklx
+++ /dev/null
@@ -1,1882 +0,0 @@
-%D \module
-%D [ file=strc-itm,
-%D version=2008.10.20,
-%D title=\CONTEXT\ Structure Macros,
-%D subtitle=Itemgroups,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Structure Macros / Itemgroups}
-
-\registerctxluafile{strc-itm}{}
-
-%D As we analyze/register widths and such we could as well push and pop the numbers
-%D at the \LUA\ end (which saves a few calls).
-%D
-%D Cleaning up this module happened around the time when Kate Bush came up with the
-%D nicest numbered list of words: 50 Words For Snow. It's therefore no surprise that
-%D I had that cd running several times when updating this code. One of the
-%D highlights of 2011.
-%D
-%D This module needs to be rewritten but that is tricky with respect to
-%D compatibilitity. Basically each major variant (regular, text, columns,
-%D horizontal, etc) needs to be on its own.
-
-% todo: check breaks
-% todo: check grouping
-% todo: fixedconversion
-
-% \startitemize[n,packed]
-% \item test \item test \item test
-% \stopitemize
-%
-% \startitemize[n,packed,reverse]
-% \item test \item test \item test
-% \stopitemize
-%
-% \startitemize[n,packed,reverse] \item test \item test \stopitemize
-% \startitemize[continue]
-% \item test \startitemize[n,packed] \item test \item test \stopitemize
-% \item test
-% \item test
-% \stopitemize
-% \startitemize[continue] \item test \stopitemize
-%
-% \startitemize[n,packed] \item test \item test \stopitemize
-% \startitemize[continue] \item test \stopitemize
-% \startitemize[continue] \item test \stopitemize
-%
-% \setupwhitespace[big]
-% \starttext
-% test \startitemize[joinedup] \item test \item test \stopitemize test \par
-% test \startitemize[joinedup,nowhite] \item test \item test \stopitemize test \par
-% test \startitemize[joinedup,nowhite,before] \item test \item test \stopitemize test \par
-% test \startitemize[joinedup,nowhite,after] \item test \item test \stopitemize test \par
-% \stoptext
-%
-% test / example
-%
-% \startnarrower[left] \startcolumns[n=3] \startitemize
-% \item \input ward \item \input ward \item \input ward
-% \stopitemize \stopcolumns\stopnarrower \blank
-%
-% \startnarrower[left] \startitemize[columns,three]
-% \item \input ward \item \input ward \item \input ward
-% \stopitemize \stopnarrower \blank
-%
-% \setupitemize[leftmargin=1.5em] \startitemize[columns,three]
-% \item \input ward \item \input ward \item \input ward
-% \stopitemize \blank
-%
-% 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
-%
-% \startitemize
-% \starthead {xx} test \stophead
-% \startitem test \stopitem
-% \startitem test \stopitem
-% \stopitemize
-%
-% Sometimes the user demands get pretty weird:
-%
-% \startitemize
-% \item test
-% \item test
-% \headsym{xx} test \par test
-% \stopitemize
-%
-% aligned items
-%
-% \startitemize[n,fit,broad][itemalign=flushright]
-% \dorecurse{100}{\item The first item.}
-% \stopitemize
-%
-% \setupitemgroup[itemize][each][fit]
-% \setupitemgroup[itemize][each][distance=.5em,factor=1,itemalign=flushright]
-%
-% \startitemize[n]
-% \dorecurse{100}{\item The first item.}
-% \stopitemize
-%
-% \defineitemgroup[gbitemize]
-% \setupitemgroup[gbitemize][each][headstyle=bold]
-%
-% \startgbitemize
-% \txt{italian} some italians like this kind of cross||breed between
-% an itemize and a description
-% \txt{sicilians} i wonder how many sicilian mathematicians do a thesis
-% on the math involved in predicting the next big bang of the vulcano
-% \stopgbitemize
-%
-% \startitemize[n,repeat]
-% \noitem \startitemize[a] \item Item 1.a. \item Item 1.b. \stopitemize
-% \noitem \startitemize[a] \item Item 2.a. \item Item 2.b. \stopitemize
-% \stopitemize
-%
-% \startitemize[n,repeat][width=0pt]
-% \noitem \startitemize[a][width=2em] \item Item 1.a. \item Item 1.b. \stopitemize
-% \noitem \startitemize[a][width=2em] \item Item 2.a. \item Item 2.b. \stopitemize
-% \stopitemize
-%
-% \startbuffer
-% \item
-% \startitemize[n]
-% \item item 1.1
-% \item item 1.2
-% \startitemize[n] \item item 1.2.1 \item item 1.2.2 \stopitemize
-% \item item 1.3
-% \stopitemize
-% \item
-% \startitemize[n] \item item 2.1 \item item 2.2 \stopitemize
-% \item item 3
-% \startitemize[n] \item item 3.1 \item item 3.2 \stopitemize
-% \item
-% \startitemize[n] \item item 4.1 \item item 4.2 \stopitemize
-% \stopbuffer
-%
-% \startitemize[n,repeat,6*broad,packed] \getbuffer \stopitemize \blank[3*big]
-% \startitemize[n,repeat,packed] \getbuffer \stopitemize \blank[3*big]
-% \setupitemize[each][atmargin][width=3em]
-% \startitemize[n,repeat,packed] \getbuffer \stopitemize
-%
-% todo: assume startitem ... stopitem and do an autostopitem .. cleaner for
-% elements
-%
-% \startitemize[text][space=medium]
-% \item one \item two \item three
-% \stopitemize
-%
-% For Giuseppe "Oblomov" Bilotta, inspired on a suggestion by Taco
-% Hoekwater.
-%
-% \def\MyItemCommand#1{{\bf#1}\quad}
-% \setupitemgroup[itemize][command=\MyItemCommand]
-%
-% \startitemize
-% \item {test} is this okay?
-% \item {test} is this okay?
-% \item {test} is this okay?
-% \stopitemize
-
-\unprotect
-
-\newconditional\c_strc_itemgroups_sub
-\newconditional\c_strc_itemgroups_head
-\newconditional\c_strc_itemgroups_intro
-\newconditional\c_strc_itemgroups_randomize
-\newconditional\c_strc_itemgroups_horizontal
-\newconditional\c_strc_itemgroups_collecting
-\newconditional\c_strc_itemgroups_auto_intro
-\newconditional\c_strc_itemgroups_pack
-\newconditional\c_strc_itemgroups_paragraph
-\newconditional\c_strc_itemgroups_text
-\newconditional\c_strc_itemgroups_text_saved
-\newconditional\c_strc_itemgroups_first
-\newconditional\c_strc_itemgroups_before
-\newconditional\c_strc_itemgroups_after
-\newconditional\c_strc_itemgroups_nowhite
-\newconditional\c_strc_itemgroups_joined
-\newconditional\c_strc_itemgroups_reverse
-\newconditional\c_strc_itemgroups_continue
-\newconditional\c_strc_itemgroups_fitting
-\newconditional\c_strc_itemgroups_indented_first
-\newconditional\c_strc_itemgroups_inline
-\newconditional\c_strc_itemgroups_columns
-\newconditional\c_strc_itemgroups_concat
-\newconditional\c_strc_itemgroups_txt
-\newconditional\c_strc_itemgroups_extra
-\newconditional\c_strc_itemgroups_repeat
-\newconditional\c_strc_itemgroups_inline_head
-
-% 0 = before/after
-% 1 = between unless before
-% 2 = between
-
-\newconstant \c_strc_itemgroups_spacing_mode \c_strc_itemgroups_spacing_mode\plustwo
-\newconditional\c_strc_itemgroups_optimize \settrue\c_strc_itemgroups_optimize
-\newconditional\c_strc_itemgroups_auto_concat \settrue\c_strc_itemgroups_auto_concat
-
-\newsignal \d_strc_itemgroups_signal
-
-\newbox \b_strc_itemgroups
-
-\newdimen \d_strc_itemgroups_list_width
-\newdimen \d_strc_itemgroups_asked_width
-
-\newdimen \d_strc_itemgroups_max_width % multipass
-\newcount \c_strc_itemgroups_max_items % multipass
-
-\newcount \c_strc_itemgroups_n_of_items
-\newcount \c_strc_itemgroups_nesting
-\newcount \c_strc_itemgroups_column_depth
-
-\def \v_strc_itemgroups_counter {itemgroup:\currentparentitemgroup}
-\let \m_strc_itemgroups_repeat_start \empty
-\def \v_strc_itemgroups_unknown_symbol {?}
-\let \m_strc_itemgroups_indenting \empty
-\let \m_strc_itemgroups_destination \empty
-
-\let \currentitemlevel \!!zerocount % public
-\def \currentnofitems {\the\c_strc_itemgroups_max_items}
-\def \currentitemnumber {\strc_counters_raw_sub\v_strc_itemgroups_counter\currentitemlevel} % public
-
-\newtoks \itemgroupcommands % maybe public
-
-\def \currentitemgroupsymbol {n} % here we cannot use a _ in the name
-\let \currentitemgroupconversionset \empty % here we cannot use a _ in the name
-\let \currentitemgroupsegments \empty
-
-\def\strc_itemgroups_register_status
- {\clf_registeritemgroup{\currentparentitemgroup}\c_strc_itemgroups_nesting\c_strc_itemgroups_n_of_items\dimexpr\itemgroupparameter\c!maxwidth\relax}
-
-\def\strc_itemgroups_check_n_of_items % we could do this at the lua end and save a call (i.e. will be dimen and counter)
- {\clf_analyzeitemgroup{\currentparentitemgroup}\c_strc_itemgroups_nesting\relax
- \edef\currentnofitems{\the\c_strc_itemgroups_max_items}}
-
-% todo: \dodosetreference -> \strc_counters_register_component (to be checked)
-
-\def\strc_itemgroups_insert_reference % we will make a decent number helper
- {\iftrialtypesetting \orelse \ifx\currentitemreference \empty \else
- \strc_itemgroups_insert_reference_indeed
- \fi}
-
-\def\strc_itemgroups_insert_extra_reference
- {\iftrialtypesetting \orelse \ifx\currentitemreference \empty \else
- \normalexpanded{\textreference[\currentitemreference]{\strc_itemgroups_extra_symbol}}%
- \fi}
-
-\def\strc_itemgroups_insert_reference_indeed % maybe we need a 'frozen counter' numberdata blob / quick hack .. .mive this to strc-ref
- {% needs testing, gave problems:
- \setnextinternalreference
- % no need to collect nodes in \b_strc_destination_nodes here ... maybe at some point
- \strc_references_start_destination_nodes
- % this is somewhat over the top ... we should use the counter's reference
- \clf_setdestinationattribute
- {%
- metadata {%
- kind {item}% was item, why?
- \ifx\currentreferencecoding\s!xml
- xmlroot {\xmldocument}% only useful when text
- \fi
- catcodes \catcodetable
- }%
- references {%
- internal \locationcount % no: this spoils references
- % block {\currentsectionblock}%
- view {\interactionparameter\c!focus}%
- prefix {\referenceprefix}%
- reference {\currentitemreference}%
- }%
- prefixdata {%
- prefix {\namedcounterparameter\v_strc_itemgroups_counter\c!prefix}%
- separatorset {\namedcounterparameter\v_strc_itemgroups_counter\c!prefixseparatorset}%
- conversion {\namedcounterparameter\v_strc_itemgroups_counter\c!prefixconversion}%
- conversionset {\namedcounterparameter\v_strc_itemgroups_counter\c!prefixconversionset}%
- set {\namedcounterparameter\v_strc_itemgroups_counter\c!prefixset}%
- segments {\namedcounterparameter\v_strc_itemgroups_counter\c!prefixsegments}%
- % segments {\askedprefixsegments}%
- connector {\namedcounterparameter\v_strc_itemgroups_counter\c!prefixconnector}%
- }%
- numberdata {%
- numbers {\v_strc_itemgroups_counter}%
- separatorset {\namedcounterparameter\v_strc_itemgroups_counter\c!numberseparatorset}%
- % conversion {\namedcounterparameter\v_strc_itemgroups_counter\c!numberconversion}%
- % conversionset {\namedcounterparameter\v_strc_itemgroups_counter\c!numberconversionset}%
- % fixedconversion {\currentitemgroupconversionset}%
- conversionset {fixed::\currentitemgroupconversionset}% temp hack
- %
- % for the moment no stopper, we need to make references configurable first
- % stopper {\namedcounterparameter\v_strc_itemgroups_counter\c!numberstopper}%
- segments {\namedcounterparameter\v_strc_itemgroups_counter\c!numbersegments}%
- }%
- }%
- \relax
- \strc_references_stop_destination_nodes
- \xdef\currentdestinationattribute{\number\lastdestinationattribute}%
- % will become an option:
- \ifnum\lastdestinationattribute>\zerocount
- \dontleavehmode\hbox attr \destinationattribute\lastdestinationattribute\bgroup
- \strc_references_flush_destination_nodes
- \egroup
- \fi}
-
-%D Defining and setup:
-
-\installcorenamespace{itemgroup}
-\installcorenamespace{itemgroupoption}
-\installcorenamespace{itemgroupsetting}
-\installcorenamespace{itemgroupkeyword}
-\installcorenamespace{itemgroupalign}
-\installcorenamespace{itemgrouplocal}
-\installcorenamespace{itemgroupglobal}
-\installcorenamespace{itemgroupdistance}
-\installcorenamespace{itemgroupstack}
-\installcorenamespace{itemgroupfirst}
-\installcorenamespace{itemgroupstart}
-
-\installcommandhandler \??itemgroup {itemgroup} \??itemgroup
-
-\let\setupitemgroups\setupitemgroup
-
-\appendtoks
- \setuevalue{\e!start\currentitemgroup}{\startitemgroup[\currentitemgroup]}%
- \setuevalue{\e!stop \currentitemgroup}{\stopitemgroup}%
- \setuevalue{\e!setup\currentitemgroup\e!endsetup}{\setupitemgroup[\currentitemgroup]}% obsolete
- \let\currentparentitemgroup\currentitemgroup
- \definecounter[\v_strc_itemgroups_counter]%
- % beware ... we cannot use _ as the conversion set is not expanded
- % \defineconversionset[\v_strc_itemgroups_counter][\currentitemgroupconversionset][\currentitemgroupsymbol]%
-\to \everydefineitemgroup
-
-%D Global states
-
-\def\strc_itemgroups_store_continue_state#options#settings%
- {\setxvalue{\??itemgroupoption \currentitemgroup}{\strc_itemgroups_process_options{#options}}%
- \setgvalue{\??itemgroupsetting\currentitemgroup}{\setupcurrentitemgroup[#settings]}}
-
-\def\strc_itemgroups_fetch_continue_state
- {\csname\??itemgroupoption \currentitemgroup\endcsname
- \csname\??itemgroupsetting\currentitemgroup\endcsname}
-
-\def\strc_itemgroups_reset_continue_state
- {\expandafter\glet\csname\??itemgroupoption \currentitemgroup\endcsname\relax
- \expandafter\glet\csname\??itemgroupsetting\currentitemgroup\endcsname\relax}
-
-% These will become keywords. We will also add a feature to keep the while set
-% together.
-
-\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] % discourage .. too low, 5000 is better
-
-\def\strc_itemgroups_insert_break_when_needed#break%
- {\ifconditional\c_strc_itemgroups_optimize
- \ifconditional\c_strc_itemgroups_text \else
- #break\relax
- \fi
- \fi}
-
-\def\strc_itemgroups_insert_breakallow {\strc_itemgroups_insert_break_when_needed\strc_itemgroups_insert_breakallow_indeed}
-\def\strc_itemgroups_insert_breakno {\strc_itemgroups_insert_break_when_needed\strc_itemgroups_insert_breakno_indeed }
-\def\strc_itemgroups_insert_break {\strc_itemgroups_insert_break_when_needed\strc_itemgroups_insert_break_indeed }
-\def\strc_itemgroups_insert_nobreak {\strc_itemgroups_insert_break_when_needed\strc_itemgroups_insert_nobreak_indeed }
-
-\def\strc_itemgroups_insert_breakallow_indeed{\vspacing[\v!item @0]}
-\def\strc_itemgroups_insert_breakno_indeed {\vspacing[\v!item @10000]}
-\def\strc_itemgroups_insert_break_indeed {\flushnotes
- \vspacing[\v!item @-5]}
-\def\strc_itemgroups_insert_nobreak_indeed {\flushnotes
- \ifinsidecolumns % todo
- \vspacing[\v!item @5]%
- \else
- \vspacing[\v!item @500]%
- \fi}
-
-\unexpanded\def\strc_itemgroups_process_options#options%
- {\processcommacommand[#options]\strc_itemgroups_process_option} % expansion of options is handy for xml
-
-% \installcommalistprocessorcommand \strc_itemgroups_process_option_list \strc_itemgroups_process_option
-%
-% \unexpanded\def\strc_itemgroups_process_options#options%
-% {\normalexpanded{\strc_itemgroups_process_option_list[#options]}} % expansion of options is handy for xml
-
-\def\strc_itemgroups_process_option#option%
- {\edef\itemgroupconstantvalue{#option}%
- \ifx\itemgroupconstantvalue\empty\else
- \splitatasterisk\itemgroupconstantvalue\itemgroupfirst\itemgroupsecond
- \ifx\itemgroupsecond\empty
- \let\itemgroupsecond\itemgroupfirst
- \let\itemgroupfirst\!!plusone
- \fi
- \ifcsname\??itemgroupkeyword\itemgroupsecond\endcsname
- \lastnamedcs
- \else
- \strc_itemgroups_set_symbol\itemgroupconstantvalue
- \fi
- \fi}
-
-\def\strc_itemgroups_process_set_option_pack
- {\ifcase\c_strc_itemgroups_nesting \else
- \settrue\c_strc_itemgroups_pack
- \fi}
-
-\def\strc_itemgroups_process_set_option_unpack
- {\ifcase\c_strc_itemgroups_nesting\else
- \setfalse\c_strc_itemgroups_pack
- \fi}
-
-\setvalue{\??itemgroupkeyword\!!zerocount }{} % ignore 0
-\setvalue{\??itemgroupkeyword\v!packed }{\strc_itemgroups_process_set_option_pack}
-\setvalue{\??itemgroupkeyword\v!unpacked }{\strc_itemgroups_process_set_option_unpack}
-\setvalue{\??itemgroupkeyword\v!intro }{\settrue\c_strc_itemgroups_intro} % here? not set to false
-\setvalue{\??itemgroupkeyword\v!autointro }{\settrue\c_strc_itemgroups_auto_intro}
-\setvalue{\??itemgroupkeyword\v!broad }{\ifx\itemgroupfirst\empty
- \let\itemgroupfirst\!!plusone
- \fi
- \letitemgroupparameter\c!factor\itemgroupfirst}
-\setvalue{\??itemgroupkeyword\v!text }{\settrue\c_strc_itemgroups_text
- \settrue\c_strc_itemgroups_inline
- \settrue\c_strc_itemgroups_joined
- \strc_itemgroups_process_set_option_pack}
-\setvalue{\??itemgroupkeyword\v!before }{\settrue\c_strc_itemgroups_before}
-\setvalue{\??itemgroupkeyword\v!after }{\settrue\c_strc_itemgroups_after}
-\setvalue{\??itemgroupkeyword\v!nowhite }{\settrue\c_strc_itemgroups_nowhite}
-\setvalue{\??itemgroupkeyword\v!margin }{\setitemgroupparameter\c!width{-2em}} % signal
-\setvalue{\??itemgroupkeyword\v!inmargin }{\setitemgroupparameter\c!width{-2em}} % signal
-\setvalue{\??itemgroupkeyword\v!atmargin }{\ifnum\c_strc_itemgroups_nesting>\plusone
- \setitemgroupparameter\c!width{0em}%
- \fi} % signal
-\setvalue{\??itemgroupkeyword\v!intext }{\settrue\c_strc_itemgroups_inline}
-\setvalue{\??itemgroupkeyword\v!headintext }{\settrue\c_strc_itemgroups_inline_head}
-\setvalue{\??itemgroupkeyword\v!loose }{\setfalse\c_strc_itemgroups_optimize}
-\setvalue{\??itemgroupkeyword\v!fit }{\settrue\c_strc_itemgroups_fitting}
-\setvalue{\??itemgroupkeyword\v!nofit }{\setfalse\c_strc_itemgroups_fitting}
-\setvalue{\??itemgroupkeyword\v!paragraph }{\settrue\c_strc_itemgroups_paragraph
- \strc_itemgroups_process_set_option_pack}
-\setvalue{\??itemgroupkeyword\v!joinedup }{\settrue\c_strc_itemgroups_joined
- \strc_itemgroups_process_set_option_pack}
-\setvalue{\??itemgroupkeyword\v!notjoinedup}{\setfalse\c_strc_itemgroups_joined}
-\setvalue{\??itemgroupkeyword\v!serried }{\edef\itemgroupfirst{-\ifx\itemgroupfirst\empty1\else\itemgroupfirst\fi}%
- \letitemgroupparameter\c!factor\itemgroupfirst}
-\setvalue{\??itemgroupkeyword\v!stopper }{\letitemgroupparameter\c!placestopper\v!yes} % keep {}
-\setvalue{\??itemgroupkeyword\v!nostopper }{\letitemgroupparameter\c!placestopper\v!no} % keep {}
-\setvalue{\??itemgroupkeyword\v!repeat }{\settrue\c_strc_itemgroups_repeat}
-\setvalue{\??itemgroupkeyword\v!norepeat }{\setfalse\c_strc_itemgroups_repeat}
-\setvalue{\??itemgroupkeyword\v!reverse }{\settrue\c_strc_itemgroups_reverse}
-\setvalue{\??itemgroupkeyword\v!columns }{\settrue\c_strc_itemgroups_columns}
-\setvalue{\??itemgroupkeyword\v!one }{\letitemgroupparameter\c!n\plusone}
-\setvalue{\??itemgroupkeyword\v!two }{\letitemgroupparameter\c!n\plustwo}
-\setvalue{\??itemgroupkeyword\v!three }{\letitemgroupparameter\c!n\plusthree}
-\setvalue{\??itemgroupkeyword\v!four }{\letitemgroupparameter\c!n\plusfour}
-\setvalue{\??itemgroupkeyword\v!five }{\letitemgroupparameter\c!n\plusfive}
-\setvalue{\??itemgroupkeyword\v!six }{\letitemgroupparameter\c!n\plussix}
-\setvalue{\??itemgroupkeyword\v!seven }{\letitemgroupparameter\c!n\plusseven}
-\setvalue{\??itemgroupkeyword\v!eight }{\letitemgroupparameter\c!n\pluseight}
-\setvalue{\??itemgroupkeyword\v!nine }{\letitemgroupparameter\c!n\plusnine}
-\setvalue{\??itemgroupkeyword\v!standard }{\setitemgroupparameter\c!width {1.5\emwidth}%
- \setitemgroupparameter\c!distance {.5\emwidth}%
- %\letitemgroupparameter\c!factor \!!zerocount
- \letitemgroupparameter\c!factor {\zerocount}%
- \setitemgroupparameter\c!packcriterium{\zerocount}%
- \letitemgroupparameter\c!inner \empty
- \letitemgroupparameter\c!beforehead \empty
- \letitemgroupparameter\c!afterhead \blank
- \letitemgroupparameter\c!before \blank
- \letitemgroupparameter\c!inbetween \blank
- \letitemgroupparameter\c!after \blank}
-
-\def\strc_itemgroups_initialize_local
- {\setfalse\c_strc_itemgroups_inline
- \setfalse\c_strc_itemgroups_concat
- \setfalse\c_strc_itemgroups_txt
- %
- \setfalse\c_strc_itemgroups_reverse
- \setfalse\c_strc_itemgroups_intro
- \setfalse\c_strc_itemgroups_auto_intro
- \setfalse\c_strc_itemgroups_before
- \setfalse\c_strc_itemgroups_after
- \setfalse\c_strc_itemgroups_nowhite
- \setfalse\c_strc_itemgroups_randomize
- \setfalse\c_strc_itemgroups_horizontal
- \setfalse\c_strc_itemgroups_collecting
- \setfalse\c_strc_itemgroups_intro
- \setfalse\c_strc_itemgroups_continue
- % this will be a constant
- \setfalse\c_strc_itemgroups_head
- \setfalse\c_strc_itemgroups_sub
- \setfalse\c_strc_itemgroups_symbol
- \setfalse\c_strc_itemgroups_columns
- % to be checked
- \let\m_strc_itemgroups_destination\empty
- \let\strc_itemgroups_used_symbol \empty % ** start value
- \let\strc_itemgroups_margin_symbol\empty
- \let\strc_itemgroups_extra_symbol \empty
- %
- \global\letitemgroupparameter\c!maxwidth\!!zeropoint
- }
-
-\setvalue{\??itemgroupfirst\v!intro }{\settrue\c_strc_itemgroups_intro}
-\setvalue{\??itemgroupfirst\v!continue }{\settrue\c_strc_itemgroups_continue}
-\setvalue{\??itemgroupfirst\v!random }{\settrue\c_strc_itemgroups_randomize
- \settrue\c_strc_itemgroups_collecting}
-\setvalue{\??itemgroupkeyword\v!horizontal}{\settrue\c_strc_itemgroups_horizontal
- \settrue\c_strc_itemgroups_collecting
- \settrue\c_strc_itemgroups_inline
- \settrue\c_strc_itemgroups_joined
- \strc_itemgroups_process_set_option_pack}
-
-\def\strc_itemgroups_preset_stage_one#options%
- {\processcommacommand[#options]\strc_itemgroups_preset_stage_one_indeed}
-
-% \installcommalistprocessorcommand \strc_itemgroups_preset_stage_one_list \strc_itemgroups_preset_stage_one_indeed
-%
-% \def\strc_itemgroups_preset_stage_one#options%
-% {\normalexpanded{\strc_itemgroups_preset_stage_one_list[#options]}}
-
-\def\strc_itemgroups_preset_stage_one_indeed#option%
- {\ifcsname\??itemgroupfirst#option\endcsname
- \lastnamedcs
- \fi}
-
-\ifdefined\dotagsetitemgroup \else \let\dotagsetitemgroup\relax \fi
-\ifdefined\dotagsetitem \else \let\dotagsetitem \gobbleoneargument \fi
-
-\def\strc_itemgroups_tag_start_group
- {\dostarttaggedchained\t!itemgroup\currentparentitemgroup\??itemgroup
- \dotagsetitemgroup}
-
-\def\strc_itemgroups_tag_stop_group
- {\dostoptagged}
-
-\def\strc_itemgroups_before_command
- {\ifconditional\c_strc_itemgroups_nowhite
- \ifconditional\c_strc_itemgroups_before
- \ifcase\c_strc_itemgroups_nesting\or\itemgroupparameter\c!before\fi
- \else
- \nowhitespace
- \fi
- \orelse\ifconditional\c_strc_itemgroups_joined
- % \empty
- \else
- \itemgroupparameter\c!before
- \fi}
-
-\def\strc_itemgroups_after_command
- {\ifconditional\c_strc_itemgroups_nowhite
- \ifconditional\c_strc_itemgroups_after
- \ifcase\c_strc_itemgroups_nesting\or\itemgroupparameter\c!after\fi
- \else
- \nowhitespace
- \fi
- \orelse\ifconditional\c_strc_itemgroups_joined
- % \empty
- \else
- \itemgroupparameter\c!after
- \fi}
-
-\def\strc_itemgroups_between_command
- {\ifconditional\c_strc_itemgroups_nowhite
- \nowhitespace
- \orelse\ifconditional\c_strc_itemgroups_joined
- % \empty
- \else
- \itemgroupparameter\c!inbetween
- \fi}
-
-\def\strc_itemgroups_before_head_command
- {\ifconditional\c_strc_itemgroups_nowhite
- \nowhitespace
- \orelse\ifconditional\c_strc_itemgroups_joined
- % \empty
- \else
- \itemgroupparameter\c!beforehead
- \fi}
-
-\def\strc_itemgroups_after_head_command
- {\ifconditional\c_strc_itemgroups_nowhite
- \nowhitespace
- \orelse\ifconditional\c_strc_itemgroups_joined
- % \empty
- \else
- \itemgroupparameter\c!afterhead
- \fi}
-
-% compatible setup command:
-
-\let\strc_itemgroups_normal_setup\setupitemgroup
-
-\unexpanded\def\setupitemgroup
- {\doquadrupleempty\strc_itemgroups_setup}
-
-\def\strc_itemgroups_setup[#category][#levels][#options][#settings]% category level|each options|settings settings|options
- {\edef\strc_itemgroups_setup_what{#levels}%
- \iffourthargument
- \ifx\strc_itemgroups_setup_what\v!each
- \strc_itemgroups_setup_each{#category}{#options}%
- \strc_itemgroups_setup_each{#category}{#settings}%
- \else
- \strc_itemgroups_setup_list{#levels}{#category}{#options}%
- \strc_itemgroups_setup_list{#levels}{#category}{#settings}%
- \fi
- \orelse\ifthirdargument
- \ifx\strc_itemgroups_setup_what\v!each
- \strc_itemgroups_setup_each{#category}{#options}%
- \else
- \strc_itemgroups_setup_list{#levels}{#category}{#options}%
- \fi
- \orelse\ifsecondargument
- \strc_itemgroups_setup_each{#category}{#levels}%
- \else
- \strc_itemgroups_normal_setup[#category]% == settings
- \fi}
-
-% can be made a bit faster
-
-% \def\strc_itemgroups_setup_each#category#whatever%
-% {\doifelseassignment{#whatever}
-% {\strc_itemgroups_normal_setup[#category][#whatever]}
-% {\strc_itemgroups_normal_setup[#category][\c!option={#whatever}]}}
-
-\def\strc_itemgroups_setup_each#category#whatever%
- {\ifcondition\validassignment{#whatever}%
- \strc_itemgroups_normal_setup[#category][#whatever]%
- \else
- \strc_itemgroups_normal_setup[#category][\c!option={#whatever}]%
- \fi}
-
-\def\strc_itemgroups_setup_list_level_a#category#whatever#level%
- {\strc_itemgroups_normal_setup[#category:#level][#whatever]}
-
-\def\strc_itemgroups_setup_list_level_b#category#whatever#level%
- {\strc_itemgroups_normal_setup[#category:#level][\c!option={#whatever}]}
-
-% \def\strc_itemgroups_setup_list#subcategories#category#whatever%
-% {\doifelseassignment{#whatever}
-% {\processcommalist[#subcategories]{\strc_itemgroups_setup_list_level_a{#category}{#whatever}}}
-% {\processcommalist[#subcategories]{\strc_itemgroups_setup_list_level_b{#category}{#whatever}}}}
-
-\def\strc_itemgroups_setup_list#subcategories#category#whatever%
- {\ifcondition\validassignment{#whatever}%
- \processcommalist[#subcategories]{\strc_itemgroups_setup_list_level_a{#category}{#whatever}}%
- \else
- \processcommalist[#subcategories]{\strc_itemgroups_setup_list_level_b{#category}{#whatever}}%
- \fi}
-
-\def\strc_itemgroups_increment_item_counter
- {\ifconditional\c_strc_itemgroups_sub \else
- \ifconditional\c_strc_itemgroups_symbol \else % \ifx\strc_itemgroups_extra_symbol\empty
- \strc_counters_increment_sub\v_strc_itemgroups_counter\currentitemlevel
- \fi
- \fi}
-
-\unexpanded\def\strc_itemgroups_insert_item_counter
- {\ifconditional\c_strc_itemgroups_repeat
- \ifcase\c_strc_itemgroups_nesting
- % skip
- \or
- \strc_itemgroups_insert_item_counter_indeed % this could become an option
- \else
- \strc_itemgroups_insert_item_counter_indeed
- \fi
- \else
- \strc_itemgroups_insert_item_counter_indeed
- \fi}
-
-\def\strc_itemgroups_insert_item_counter_indeed % quite slow ... every time this setup .. but it
- {\begingroup % can be optimized ... best move some to strc-num
- \setupcounter
- [\v_strc_itemgroups_counter]%
- [\c!prefix=\itemgroupparameter\c!prefix,
- \c!prefixstopper=\itemgroupparameter\c!prefixstopper,
- \c!prefixseparatorset=\itemgroupparameter\c!prefixseparatorset,
- \c!prefixconversion=\itemgroupparameter\c!prefixconversion,
- \c!prefixconversionset=\itemgroupparameter\c!prefixseparatorset,
- \c!prefixset=\itemgroupparameter\c!prefixset,
- \c!prefixsegments=\itemgroupparameter\c!prefixsegments,
- \c!prefixconnector=\itemgroupparameter\c!prefixconnector,
- \c!criterium=\itemgroupparameter\c!criterium,
- \c!numberorder=\ifconditional\c_strc_itemgroups_reverse\v!reverse\else\v!normal\fi,
- \c!numberstopper=\expdoif{\itemgroupparameter\c!placestopper}\v!yes{\itemgroupparameter\c!stopper},
- \c!numberconversionset=\v_strc_itemgroups_counter,
- \c!numbersegments=\currentitemgroupsegments]%
- % there will be a fixedconversion key
- %\normalexpanded{\defineconversionset[\v_strc_itemgroups_counter][\currentitemgroupconversionset][\currentitemgroupsymbol]}%
- \normalexpanded{\strc_sets_define_conversion_set[\v_strc_itemgroups_counter][\currentitemgroupconversionset][\currentitemgroupsymbol]}%
- %
- \convertedcounter[\v_strc_itemgroups_counter]% [\number\currentitemlevel]%
- \strc_itemgroups_insert_reference
- \endgroup}
-
-% needs testing (maybe it need to happen later)
-%
-% \appendtoks
-% \setupcounter
-% [\v_strc_itemgroups_counter]%
-% [\c!prefix=\itemgroupparameter\c!prefix,
-% \c!prefixstopper=\itemgroupparameter\c!prefixstopper,
-% \c!prefixseparatorset=\itemgroupparameter\c!prefixseparatorset,
-% \c!prefixconversion=\itemgroupparameter\c!prefixconversion,
-% \c!prefixconversionset=\itemgroupparameter\c!prefixseparatorset,
-% \c!prefixset=\itemgroupparameter\c!prefixset,
-% \c!prefixsegments=\itemgroupparameter\c!prefixsegments,
-% \c!prefixconnector=\itemgroupparameter\c!prefixconnector,
-% \c!criterium=\itemgroupparameter\c!criterium,
-% \c!numberorder=\ifconditional\c_strc_itemgroups_reverse\v!reverse\else\v!normal\fi,
-% \c!numberstopper=\expdoif{\itemgroupparameter\c!placestopper}\v!yes{\itemgroupparameter\c!stopper},
-% \c!numberconversionset=\v_strc_itemgroups_counter,
-% \c!numbersegments=\currentitemgroupsegments]%
-% \to\itemgroupcommands
-%
-% \def\strc_itemgroups_insert_item_counter_indeed % quite slow ... every time this setup .. but it
-% {\begingroup % can be optimized ... best move some to strc-num
-% % there will be a fixedconversion key
-% %\normalexpanded{\defineconversionset[\v_strc_itemgroups_counter][\currentitemgroupconversionset][\currentitemgroupsymbol]}%
-% \normalexpanded{\strc_sets_define_conversion_set[\v_strc_itemgroups_counter][\currentitemgroupconversionset][\currentitemgroupsymbol]}%
-% %
-% \convertedcounter[\v_strc_itemgroups_counter]% [\number\currentitemlevel]%
-% \strc_itemgroups_insert_reference
-% \endgroup}
-
-\def\strc_itemgroups_set_symbol#symbol%
- {\edef\strc_itemgroups_tmp_symbol{#symbol}%
- \ifx\strc_itemgroups_tmp_symbol\empty \else
- \doifelsesymboldefined\strc_itemgroups_tmp_symbol
- \strc_itemgroups_set_symbol_symbol
- {\doifelseconversiondefined\strc_itemgroups_tmp_symbol
- \strc_itemgroups_set_symbol_conversion
- \donothing}%
- \fi}
-
-\def\strc_itemgroups_set_symbol_symbol
- {\let\currentitemgroupsymbol\strc_itemgroups_tmp_symbol
- \strc_itemgroups_store_global_symbol\currentitemgroupsymbol
- \strc_itemgroups_store_local_symbol\v_strc_itemgroups_unknown_symbol
- \let\strc_itemgroups_used_symbol\strc_itemgroups_set_symbol_symbol_item
- \let\strc_itemgroups_asked_symbol\empty}
-
-\def\strc_itemgroups_set_symbol_conversion
- {\let\currentitemgroupsymbol\strc_itemgroups_tmp_symbol
- \strc_itemgroups_store_global_symbol\currentitemgroupsymbol
- \strc_itemgroups_store_local_symbol\strc_itemgroups_insert_item_counter
- \let\strc_itemgroups_used_symbol\strc_itemgroups_set_symbol_conversion_item
- \let\strc_itemgroups_asked_symbol\empty}
-
-\def\strc_itemgroups_set_symbol_symbol_item
- {\symbol[\currentitemgroupsymbol]}
-
-\def\strc_itemgroups_set_symbol_conversion_item
- {\ifconditional\c_strc_itemgroups_text
- % maybe block stopper here, but one can as well clone an itemgroup then
- \itemgroupparameter\c!lefttext
- \strc_itemgroups_fetch_local_symbol
- \itemgroupparameter\c!righttext
- \else
- \itemgroupparameter\c!left
- \strc_itemgroups_fetch_local_symbol
- \itemgroupparameter\c!right
- \fi}
-
-\def\strc_itemgroups_calculate_list_width#level%
- {\let\savedcurrentitemgroup\currentitemgroup
- \edef\currentitemgroup{\currentparentitemgroup:\number#level}%
- \ifdim\d_strc_itemgroups_max_width>\zeropoint
- \d_strc_itemgroups_list_width\d_strc_itemgroups_max_width
- \orelse\ifnum\itemgroupparameter\c!factor>\zerocount
- \d_strc_itemgroups_list_width\itemgroupparameter\c!step\relax
- \ifzeropt\d_strc_itemgroups_list_width \d_strc_itemgroups_list_width=.5em\fi
- \multiply\d_strc_itemgroups_list_width \itemgroupparameter\c!factor
- \advance\d_strc_itemgroups_list_width\itemgroupparameter\c!width\relax
- \else
- \d_strc_itemgroups_list_width\itemgroupparameter\c!width\relax
- \fi
- \advance\d_strc_itemgroups_list_width\itemgroupparameter\c!distance\relax
- \let\currentitemgroup\savedcurrentitemgroup}
-
-\unexpanded\def\startitemgroup
- {\dotripleempty\strc_itemgroups_start}
-
-\def\strc_itemgroups_start[#category][#options][#settings]%
- {\begingroup % (1)
- \def\currentitemgroup{#category}% no nested mixing of itemgroups
- \let\currentparentitemgroup\currentitemgroup
- \global\advance\c_strc_itemgroups_nesting\plusone
- \def\currentitemlevel{\number\c_strc_itemgroups_nesting}%
- \normalexpanded{\chaintocurrentitemgroup{\currentparentitemgroup:\currentitemlevel}}%
- \edef\currentitemgroup{\currentparentitemgroup:\currentitemlevel}%
- %
- \ifthirdargument
- \strc_itemgroups_start_indeed[#options][#settings]%
- \orelse\ifsecondargument
- \ifcondition\validassignment{#options}%
- \strc_itemgroups_start_indeed[][#options]%
- \else
- \strc_itemgroups_start_indeed[#options][]%
- \fi
- \else
- \strc_itemgroups_start_indeed[][]%
- \fi}
-
-\def\strc_itemgroups_start_indeed[#options][#settings]%
- {\edef\itemgroupoptions{\itemgroupparameter\c!option}%
- \edef\itemgroupextraoptions{#options}%
- \ifx\itemgroupoptions\empty
- \let\itemgroupoptions\itemgroupextraoptions
- \orelse\ifx\itemgroupextraoptions\empty
- % ok
- \else
- \edef\itemgroupoptions{\itemgroupoptions,\itemgroupextraoptions}%
- \fi
- \begingroup % (2)
- \the\itemgroupcommands
- \let\c_strc_itemgroups_text_saved\c_strc_itemgroups_text
- \strc_itemgroups_initialize_local
- \strc_itemgroups_preset_stage_one\itemgroupoptions
-%
-% \ifhmode
-% \ifconditional\c_strc_itemgroups_auto_concat
-% \ifdim\lastskip=\d_strc_itemgroups_signal
-% \settrue\c_strc_itemgroups_concat
-% \fi
-% \fi
-% \ifconditional\c_strc_itemgroups_text_saved \else
-% \ifconditional\c_strc_itemgroups_text \else
-% \par
-% \fi
-% \fi
-% \fi
-%
- \iftrialtypesetting
- \strc_counters_save\v_strc_itemgroups_counter
- \fi
- \c_strc_itemgroups_n_of_items\zerocount
- \strc_itemgroups_check_n_of_items
- \ifx\itemgroupoptions\empty
- \strc_itemgroups_setup_symbol_default
- \strc_itemgroups_reset_continue_state
- \setupcurrentitemgroup[#settings]%
- \else
- \strc_itemgroups_process_options\itemgroupoptions
- \setupcurrentitemgroup[#settings]%
- \ifconditional\c_strc_itemgroups_continue
- \strc_itemgroups_setup_symbol_continue
- \strc_itemgroups_fetch_continue_state
- \else
- \strc_itemgroups_setup_symbol_asked
- \strc_itemgroups_store_continue_state\itemgroupoptions{#settings}%
- \fi
- \fi
- %
- \ifhmode
- \ifconditional\c_strc_itemgroups_auto_concat
- \ifdim\lastskip=\d_strc_itemgroups_signal
- \settrue\c_strc_itemgroups_concat
- \fi
- \fi
- \ifconditional\c_strc_itemgroups_text_saved \else
- \ifconditional\c_strc_itemgroups_text \else
- \par
- \fi
- \fi
- \fi
- %
- \ifconditional\c_strc_itemgroups_pack
- \ifnum\currentnofitems>\itemgroupparameter\c!packcriterium\relax\else
- \setfalse\c_strc_itemgroups_pack
- \fi
- \fi
- %
- \ifnum\c_strc_itemgroups_nesting=\plusone % NIEUW
- \doadaptleftskip {\itemgroupparameter\c!margin}%
- \doadaptleftskip {\itemgroupparameter\c!leftmargin}%
- \doadaptrightskip{\itemgroupparameter\c!rightmargin}%
- \fi
- %
- \doadaptleftskip {\itemgroupparameter\c!leftmargindistance}%
- \doadaptrightskip{\itemgroupparameter\c!rightmargindistance}%
- %
- \usealignparameter\itemgroupparameter
- \edef\m_strc_itemgroups_indenting{\itemgroupparameter\c!indenting}%
- \ifnum\c_strc_itemgroups_nesting>\zerocount
- \settrue\c_strc_itemgroups_first
- \ifconditional\c_strc_itemgroups_continue \else
- \strc_counters_restart_sub\v_strc_itemgroups_counter\currentitemlevel{\numexpr\itemgroupparameter\c!start-\plusone\relax}%
- \fi
- \fi
- \ifx\strc_itemgroups_used_symbol\empty
- \strc_itemgroups_set_symbol\strc_itemgroups_asked_symbol % ** default value
- \ifx\strc_itemgroups_used_symbol\empty
- \let\currentitemgroupsymbol\currentitemlevel % ** fall back
- \fi
- \fi
- \ifconditional\c_strc_itemgroups_auto_intro\ifnum\prevgraf<\plusthree
- \settrue\c_strc_itemgroups_intro
- \fi\fi
- \ifconditional\c_strc_itemgroups_paragraph
- \ifnum\c_strc_itemgroups_nesting>\plusone
- \letitemgroupparameter\c!inbetween\empty
- \fi
- \fi
- \ifconditional\c_strc_itemgroups_pack
- \letitemgroupparameter\c!inbetween\empty
- \fi
- \ifconditional\c_strc_itemgroups_columns
- \ifinsidecolumns\else\ifcase\c_strc_itemgroups_column_depth
- \global\c_strc_itemgroups_column_depth\c_strc_itemgroups_nesting % global ?
- \strc_itemgroups_before_command
- \strc_itemgroups_tag_start_group
- \strc_itemgroups_start_columns
- \fi\fi
- \fi
- \ifconditional\c_strc_itemgroups_fitting
- \ifdim\d_strc_itemgroups_max_width>\zeropoint
- \letitemgroupparameter\c!width\d_strc_itemgroups_max_width
- \fi
- \fi
- \strc_itemgroups_calculate_list_width\c_strc_itemgroups_nesting
- \ifdim\d_strc_itemgroups_list_width>\zeropoint\relax
- \ifconditional\c_strc_itemgroups_inline\else
- \advance\leftskip\d_strc_itemgroups_list_width\relax
- \fi
- \fi
- \ifx\m_strc_itemgroups_repeat_start\empty
- \let\currentitemgroupconversionset \currentitemgroupsymbol
- \edef\currentitemgroupsegments {\currentitemlevel}%
- \else
- \edef\currentitemgroupconversionset{\currentitemgroupconversionset,\currentitemgroupsymbol}%
- \edef\currentitemgroupsegments {\m_strc_itemgroups_repeat_start:\currentitemlevel}%
- \fi
- \d_strc_itemgroups_asked_width\itemgroupparameter\c!width\relax
- \startcollectitems}
-
-\let\startcollectitems\relax
-\let\stopcollectitems \relax
-
-\letvalue{\??itemgroupalign\v!flushleft }\relax
-\letvalue{\??itemgroupalign\v!right }\relax
-\letvalue{\??itemgroupalign\v!flushright}\hfill
-\letvalue{\??itemgroupalign\v!left }\hfill
-\letvalue{\??itemgroupalign\v!middle }\hfil
-\letvalue{\??itemgroupalign\v!center }\hfil
-
-\def\strc_itemgroups_left_sym_filler
- {\csname\??itemgroupalign\itemgroupparameter\c!symalign\endcsname}
-
-% symbols + states
-
-\def\strc_itemgroups_store_global_symbol#symbol%
- {\letgvalue{\??itemgroupglobal\currentitemgroup:\currentitemlevel}#symbol}
-
-\def\strc_itemgroups_store_local_symbol#symbol%
- {\letgvalue{\??itemgrouplocal\currentitemgroup:\currentitemlevel}#symbol}
-
-\def\strc_itemgroups_fetch_global_symbol
- {\csname\??itemgroupglobal\currentitemgroup:\currentitemlevel\endcsname}
-
-\def\strc_itemgroups_fetch_local_symbol
- {\csname\??itemgrouplocal\currentitemgroup:\currentitemlevel\endcsname}
-
-\def\strc_itemgroups_setup_symbol_default
- {\edef\strc_itemgroups_asked_symbol{\itemgroupparameter\c!symbol}%
- \strc_itemgroups_store_global_symbol\empty}
-
-\def\strc_itemgroups_setup_symbol_continue
- {\ifcsname\??itemgroupglobal\currentitemgroup:\currentitemlevel\endcsname
- \let\strc_itemgroups_asked_symbol\strc_itemgroups_fetch_global_symbol
- \else
- \let\strc_itemgroups_asked_symbol\currentitemlevel
- \fi}
-
-\def\strc_itemgroups_setup_symbol_asked
- {\edef\strc_itemgroups_asked_symbol{\itemgroupparameter\c!symbol}}
-
-\ifdefined\strc_itemgroups_start_columns
-
- % already defined in page-mix
-
-\else
-
- % will be redefined in page-mix
-
- \ifdefined\startcolumns \else
- \unexpanded\def\startcolumns[#settings]{}
- \unexpanded\def\stopcolumns {}
- \fi
-
- \def\strc_itemgroups_start_columns
- {\startcolumns
- [\c!n=\itemgroupparameter\c!n,
- \c!height=,
- \c!rule=\v!off,
- \c!balance=\v!yes,
- \c!align=\v!no]}
-
- \def\strc_itemgroups_stop_columns
- {\stopcolumns}
-
-\fi
-
-\unexpanded\def\stopitemgroup
- {\stopcollectitems
- \ifconditional\c_strc_itemgroups_text
- \removeunwantedspaces
- \space
- \ignorespaces
- \else
- \par
- \fi
- \strc_itemgroups_register_status
- \ifconditional\c_strc_itemgroups_first \else
- \dostoptagged
- \dostoptagged
- % \endgroup % (3)
- \fi
- \ifnum\c_strc_itemgroups_column_depth=\c_strc_itemgroups_nesting\relax
- \strc_itemgroups_stop_columns
- \global\c_strc_itemgroups_column_depth\zerocount % global ?
- \strc_itemgroups_tag_stop_group
- \strc_itemgroups_after_command
- \dontrechecknextindentation
- \orelse\ifnum\c_strc_itemgroups_nesting=\plusone
- \strc_itemgroups_insert_breakallow
- \strc_itemgroups_tag_stop_group
- \strc_itemgroups_after_command
- \useindentnextparameter\itemgroupparameter
- \else
- % nieuw, not yet nobreak handling
- \strc_itemgroups_tag_stop_group
- \ifcase\c_strc_itemgroups_spacing_mode
- \strc_itemgroups_after_command
- \or
- \strc_itemgroups_after_command
- \fi
- \dontrechecknextindentation
- \fi
- % new test, needed in sidefloats (surfaced in volker's proceedings)
- \iftrialtypesetting
- \strc_counters_restore\v_strc_itemgroups_counter % could happen in LUA
- \fi
- \global\advance\c_strc_itemgroups_nesting\minusone
- \xdef\currentitemlevel{\number\c_strc_itemgroups_nesting}%
- %\ifconditional\c_strc_itemgroups_text
- \endgroup % (2)
- \endgroup % (1)
- %\else
- % \endgroup % (2)
- % \endgroup % (1)
- % \par % hm, already done, and dangerous as \c_strc_itemgroups_text is already forgotten
- %\fi
- \dorechecknextindentation}
-
-% The items.
-
-\unexpanded\def\startitemgroupitem
- {\dosingleempty\strc_itemgroups_start_item}
-
-\def\strc_itemgroups_start_item_first
- {\setfalse\c_strc_itemgroups_first
- % \begingroup % (3)
- \ifcase\c_strc_itemgroups_nesting
- % 0
- \or
- \strc_itemgroups_start_item_first_one % 1
- \else
- \strc_itemgroups_start_item_first_two % 2+
- \fi}
-
-\def\strc_itemgroups_start_item_first_one
- {\ifcase\c_strc_itemgroups_column_depth
- \ifconditional\c_strc_itemgroups_intro\strc_itemgroups_insert_breakno\fi
- \strc_itemgroups_before_command
- \strc_itemgroups_tag_start_group
- \ifconditional\c_strc_itemgroups_intro\strc_itemgroups_insert_breakno\fi
- \fi}
-
-\def\strc_itemgroups_start_item_first_two
- {\ifconditional\c_strc_itemgroups_paragraph\else
- \edef\previtemlevel{\the\numexpr\c_strc_itemgroups_nesting-\plusone}%
- \ifcase\c_strc_itemgroups_spacing_mode
- \strc_itemgroups_before_command
- \or
- \doifelsenothing\strc_itemgroups_before_command % should possibly expand to empty
- {\nameditemgroupparameter{\currentparentitemgroup:\previtemlevel}\c!inbetween}%
- \strc_itemgroups_before_command
- \else
- \nameditemgroupparameter{\currentparentitemgroup:\previtemlevel}\c!inbetween
- \fi
- \strc_itemgroups_tag_start_group
- \fi}
-
-\def\strc_itemgroups_start_item_next
- {\dostoptagged % ok? what do we stop here?
- \dostoptagged % ok? what do we stop here?
- \ifconditional\c_strc_itemgroups_text
- \ifhmode
- % WS: make the distance between items customizable, think about better default values -> see itemize-1.tex
- \strc_itemgroups_set_text_item_distance% HH: moved out and made configurable (sort of)
- \removeunwantedspaces
- \hskip\m_strc_itemgroups_text_distance\relax
- \fi
- \else
- \strc_itemgroups_between_command
- \fi}
-
-% c_strc_itemgroups_concat:
-%
-% the problem is that we use leftskip so concat cannot reliable take the height into
-% account; it's .. rather tricky when white space in there anyway (due to \par) .. so
-% we rely on a special blank method
-%
-% \startitemize[n]
-% \item bla
-% \item \startitemize[a]
-% \item bla $\displaystyle\int^{x^{y^4}}$ \item bla
-% \stopitemize
-% \stopitemize
-
-\unexpanded\def\strc_itemgroups_start_item[#reference]% we can reuse more
- {\def\currentitemreference{#reference}%
- \ifconditional\c_strc_itemgroups_text
- % begin of item
- \else
- \par
- \fi
- \ifconditional\c_strc_itemgroups_concat
- \strc_itemgroups_insert_breakno
- \fi
- \strc_itemgroups_increment_item_counter
- \ifconditional\c_strc_itemgroups_first
- \strc_itemgroups_start_item_first
- \else
- \strc_itemgroups_start_item_next
- \fi
- \ifconditional\c_strc_itemgroups_concat
- \spac_overlay_lines % see spac-ver.mkvi ... a typical potential problem
- \setfalse\c_strc_itemgroups_concat
- \fi
- \dostarttagged\t!item\empty
- % \dotagsetitem\empty
- \dostarttagged\t!itemtag\empty
- \strc_itemgroups_insert_item
- \dostoptagged
- \ifconditional\c_strc_itemgroups_pack
- \setupwhitespace[\v!none]%
- \fi
- \itemgroupparameter\c!inner % will become obsolete (better use setups)
- \strc_itemgroups_margin_symbol
- \let\strc_itemgroups_margin_symbol\relax
- \dostarttagged\t!itemcontent\empty
- \begstrut % \strut
- \nobreak % else problems with intext items
- \seteffectivehsize % NEW !
- \hskip\d_strc_itemgroups_signal % concat
- \itemgroupparameter\c!command}
-
-\unexpanded\def\stopitemgroupitem
- {\ifhmode
- \endstrut % new per 2017-12-15
- \fi
- \ifconditional\c_strc_itemgroups_text
- % nothing
- \else
- \endgraf
- \fi}
-\unexpanded\def\startitemgrouphead
- {\dosingleempty\strc_itemgroups_start_head}
-
-\unexpanded\def\strc_itemgroups_start_head[#reference]%
- {\ifconditional\c_strc_itemgroups_first \else
- \strc_itemgroups_insert_breakallow
- \fi
- \ifconditional\c_strc_itemgroups_pack \else
- \strc_itemgroups_before_head_command
- \fi
- \ifconditional\c_strc_itemgroups_first
- \ifconditional\c_strc_itemgroups_intro \else
- \ifcase\c_strc_itemgroups_nesting
- \strc_itemgroups_insert_breakallow
- \fi
- \fi
- \fi
- \strc_itemgroups_start_item[#reference]%
- \pickupgroupedcommand
- \strc_itemgroups_start_head_indeed
- \strc_itemgroups_stop_head_indeed
- \strc_itemgroups_head_body_indeed}
-
-\unexpanded\def\stopitemgrouphead
- {\dostoptagged
- \stopitemgroupitem}
-
-\unexpanded\def\strc_itemgroups_start_head_indeed
- {\settrue\c_strc_itemgroups_head
- \dotagsetitem\s!head% % weird place
- \dostarttagged\t!itemhead\empty
- \useitemgroupstyleandcolor\c!headstyle\c!headcolor\ignorespaces}
-
-\unexpanded\def\strc_itemgroups_stop_head_indeed
- {\removeunwantedspaces
- \dostoptagged
- \ifconditional\c_strc_itemgroups_inline_head
- \space
- \ignorespaces
- \else
- \ifconditional\c_strc_itemgroups_text
- \space
- \ignorespaces
- \else
- \par
- \fi
- \strc_itemgroups_insert_breakno
- \ifconditional\c_strc_itemgroups_pack\else\strc_itemgroups_after_head_command\fi
- \strc_itemgroups_insert_breakno
- \fi}
-
-\unexpanded\def\strc_itemgroups_head_body_indeed
- {\dostarttagged\t!itembody\empty
- \noindentation
- \ignorespaces}
-
-% Simple commands.
-
-\unexpanded\def\strc_itemgroups_start_do_item
- {\startitemgroupitem}
-
-\unexpanded\def\strc_itemgroups_start_no_item
- {\let\currentitemreference\empty
- \strc_itemgroups_increment_item_counter
- %\advance\c_strc_itemgroups_n_of_items\plusone
- \setbox\b_strc_itemgroups\emptyhbox
- \strc_itemgroups_check_for_repeated
- \ignorespaces}
-
-\unexpanded\def\strc_itemgroups_start_button[#destination]%
- {\edef\m_strc_itemgroups_destination{#destination}%
- \startitemgroupitem}
-
-\unexpanded\def\strc_itemgroups_start_symbol#text%
- {\def\strc_itemgroups_extra_symbol{#text}%
- \settrue\c_strc_itemgroups_symbol
- \startitemgroupitem
- \dotagsetitem\s!symbol}
-
-\unexpanded\def\strc_itemgroups_start_dummy
- {\strc_itemgroups_start_symbol
- %\strut\strut} % two ?
- \begstrut}
-
-\unexpanded\def\strc_itemgroups_start_subitem
- {\settrue\c_strc_itemgroups_sub
- \startitemgroupitem
- \dotagsetitem\s!sub}
-
-\unexpanded\def\strc_itemgroups_start_edge#text%
- {\strc_itemgroups_start_symbol
- {\strc_itemgroups_calculate_list_width\c_strc_itemgroups_nesting
- \dostarttagged\t!ignore\empty % for the moment, maybe an attribute
- \hbox to \d_strc_itemgroups_list_width
- {#text\hskip\itemgroupparameter\c!distance}%
- \dostoptagged}}
-
-\unexpanded\def\strc_itemgroups_start_margin#text%
- {\def\strc_itemgroups_margin_symbol % brrr
- {\dostarttagged\t!ignore\empty % for the moment, maybe an attribute
- \llap
- {\begingroup
- \useitemgroupstyleandcolor\c!marstyle\c!marcolor
- #text% keep em/ex local
- \endgroup
- \hskip\dimexpr\leftskip+\leftmargindistance\relax}%
- \dostoptagged}%
- \startitemgroupitem
- \dotagsetitem\s!margin}
-
-\unexpanded\def\strc_itemgroups_start_text#text%
- {\def\strc_itemgroups_extra_symbol{#text}%
- \settrue\c_strc_itemgroups_symbol
- \settrue\c_strc_itemgroups_txt
- \startitemgroupitem}
-
-% \unexpanded\def\strc_itemgroups_start_head
-% {\settrue\c_strc_itemgroups_head
-% \startitemgrouphead}
-
-\unexpanded\def\strc_itemgroups_start_items
- {\dosingleempty\strc_itemgroups_start_items_indeed}
-
-\unexpanded\def\strc_itemgroups_start_items_indeed[#whatever]% something got lost
- {\strc_itemgroups_start_edge
- {\dorecurse{0\itemgroupparameter\c!items}{\strc_itemgroups_used_symbol\hss}%
- \unskip}}
-
-% \unexpanded\def\startspecialitemgroupitem[#name]%
-% {\csname\??itemgroupstart\ifcsname\??itemgroupstart#name\endcsname#name\else\v!item\fi\endcsname}
-
-\unexpanded\def\startspecialitemgroupitem[#name]%
- {\ifcsname\??itemgroupstart#name\endcsname
- \expandafter\lastnamedcs
- \else
- \expandafter\strc_itemgroups_start_do_item
- \fi}
-
-\unexpanded\def\stopspecialitemgroupitem
- {\stopitemgroupitem}
-
-\letvalue{\??itemgroupstart\v!item}\strc_itemgroups_start_do_item
-\letvalue{\??itemgroupstart\v!sub }\strc_itemgroups_start_subitem
-\letvalue{\??itemgroupstart\v!sym }\strc_itemgroups_start_symbol
-\letvalue{\??itemgroupstart\v!ran }\strc_itemgroups_start_edge
-\letvalue{\??itemgroupstart\v!its }\strc_itemgroups_start_items
-\letvalue{\??itemgroupstart\v!mar }\strc_itemgroups_start_margin
-
-\def\optimizelistitemsbreak
- {\ifcase\c_strc_itemgroups_column_depth
- \ifconditional\c_strc_itemgroups_optimize
- \ifcase\c_strc_itemgroups_max_items
- \orelse\ifnum\c_strc_itemgroups_max_items=\plusthree
- \ifnum\c_strc_itemgroups_n_of_items>\plusone
- \strc_itemgroups_insert_nobreak
- \fi
- \orelse\ifnum\c_strc_itemgroups_max_items>\plusthree
- \ifnum\c_strc_itemgroups_n_of_items=\plustwo
- \ifconditional\c_strc_itemgroups_intro
- \strc_itemgroups_insert_breakno
- \else
- \strc_itemgroups_insert_nobreak
- \fi
- \orelse\ifnum\c_strc_itemgroups_max_items=\c_strc_itemgroups_n_of_items\relax
- \strc_itemgroups_insert_nobreak
- \orelse\ifnum\c_strc_itemgroups_n_of_items>\plustwo
- \strc_itemgroups_insert_break
- \else
- \ifconditional\c_strc_itemgroups_intro\else\strc_itemgroups_insert_break\fi
- \fi
- \fi
- \fi
- \fi}
-
-\def\strc_itemgroups_handle_text_item
- {\scratchdimen\wd\b_strc_itemgroups
- \advance \scratchdimen \itemgroupparameter\c!distance\relax
- \ifdim\scratchdimen>\d_strc_itemgroups_list_width
- \advance\scratchdimen -\d_strc_itemgroups_list_width
- \else
- \scratchdimen\zeropoint
- \fi
- \llap{\hbox to \d_strc_itemgroups_list_width{\ifconditional\c_strc_itemgroups_sub\llap{+\enspace}\fi\box\b_strc_itemgroups\hss}}% was: \hfill
- \hskip\scratchdimen}
-
-\def\strc_itemgroups_handle_lapped_item_positive
- {\llap
- {\dontcomplain
- \hbox to \d_strc_itemgroups_list_width
- {\ifconditional\c_strc_itemgroups_sub
- \dostarttagged\t!ignore\empty
- \llap{+\enspace}%
- \dostoptagged
- \fi
- \strc_itemgroups_left_sym_filler
- \box\b_strc_itemgroups % can already have a forced widt, only factor handled here
- \hfil
- \hskip\itemgroupparameter\c!distance}}}
-
-\def\strc_itemgroups_handle_lapped_item_negative
- {\llap
- {\ifconditional\c_strc_itemgroups_sub
- \dostarttagged\t!ignore\empty
- \llap{+\enspace}%
- \dostoptagged
- \fi
- \box\b_strc_itemgroups
- \hskip\leftmargindistance}}
-
-\def\strc_itemgroups_handle_groups_text_item
- {\hbox
- {\ifconditional\c_strc_itemgroups_sub
- \dostarttagged\t!ignore\empty
- +\enspace
- \dostoptagged
- \fi
- \box\b_strc_itemgroups
- \hskip\interwordspace}%
- \nobreak}
-
-\def\strc_itemgroups_handle_groups_inline_item
- {\hbox to \d_strc_itemgroups_list_width
- {\ifconditional\c_strc_itemgroups_sub
- \dostarttagged\t!ignore\empty
- \llap{+\enspace}%
- \dostoptagged
- \fi
- \box\b_strc_itemgroups
- \hss}} % was: \hfill
-
-\unexpanded\def\strc_itemgroups_start_head_sym#text%
- {\def\strc_itemgroups_extra_symbol{#text}%
- \settrue\c_strc_itemgroups_symbol
- \settrue\c_strc_itemgroups_head
- \strc_itemgroups_start_head}
-
-\def\strc_itemgroups_make_symbol_box
- {\setbox\b_strc_itemgroups\autodirhbox
- {\ifconditional\c_strc_itemgroups_head
- \ifconditional\c_strc_itemgroups_symbol
- \strc_itemgroups_insert_extra_reference
- \useitemgroupstyleandcolor\c!symstyle\c!symcolor
- \strc_itemgroups_extra_symbol
- \else
- \useitemgroupstyleandcolor\c!headstyle\c!headcolor
- \strc_itemgroups_used_symbol
- \fi
- \else
- \ifconditional\c_strc_itemgroups_symbol
- \strc_itemgroups_insert_extra_reference
- \useitemgroupstyleandcolor\c!symstyle\c!symcolor
- \strc_itemgroups_extra_symbol
- \else
- \useitemgroupstyleandcolor\c!style\c!color
- \strc_itemgroups_used_symbol
- \fi
- \fi}%
- \let\strc_itemgroups_extra_symbol\empty
- \setfalse\c_strc_itemgroups_symbol}
-
-\def\strc_itemgroups_make_fitting_box
- {\ifdim\wd\b_strc_itemgroups>\itemgroupparameter\c!maxwidth\relax
- \normalexpanded{\global\setitemgroupparameter{\c!maxwidth}{\the\wd\b_strc_itemgroups}}%
- \fi
- \ifdim\d_strc_itemgroups_max_width>\zeropoint
- \setbox\b_strc_itemgroups\simplealignedbox
- {\dimexpr\d_strc_itemgroups_max_width+\itemgroupparameter\c!distance\relax}
- {\itemgroupparameter\c!itemalign}
- {\box\b_strc_itemgroups\hskip\itemgroupparameter\c!distance}%
- \fi}
-
-\def\strc_itemgroups_make_aligned_box
- {\doifsomething{\itemgroupparameter\c!itemalign}
- {\setbox\b_strc_itemgroups\simplealignedbox
- {\dimexpr\d_strc_itemgroups_asked_width+\itemgroupparameter\c!distance\relax}
- {\itemgroupparameter\c!itemalign}
- {\box\b_strc_itemgroups\hskip\itemgroupparameter\c!distance}}}
-
-\def\strc_itemgroups_make_destination_box
- {\iftrialtypesetting \orelse \ifx\m_strc_itemgroups_destination\empty \else
- \setbox\b_strc_itemgroups\hbox{\directgotobox{\box\b_strc_itemgroups}[\m_strc_itemgroups_destination]}%
- \fi}
-
-\def\strc_itemgroups_check_indenting
- {\setfalse\c_strc_itemgroups_indented_first
- \ifx\m_strc_itemgroups_indenting\empty \else
- \normalexpanded{\setupindenting[\v!reset,\v!yes,\m_strc_itemgroups_indenting]}%
- \ifconditional\c_spac_indentation_indent_first % better is to have a mode
- \doifnot{\itemgroupparameter\c!alignsymbol}\v!yes
- {\settrue\c_strc_itemgroups_indented_first}%
- \fi
- \fi}
-
-\def\strc_itemgroups_check_for_repeated
- {\ifconditional\c_strc_itemgroups_repeat
- \ifx\m_strc_itemgroups_repeat_start\empty
- \edef\m_strc_itemgroups_repeat_start{\currentitemlevel}%
- \fi
- \else
- \let\m_strc_itemgroups_repeat_start\empty
- \fi}
-
-\def\strc_itemgroups_insert_item
- {\ifconditional\c_strc_itemgroups_text % again?
- % begin of item
- \else
- \par % done twice?
- \fi
- \advance\c_strc_itemgroups_n_of_items\plusone
- \optimizelistitemsbreak
- \strc_itemgroups_check_indenting
- \dontleavehmode
- \ifconditional\c_strc_itemgroups_indented_first
- \hskip-\parindent
- \fi
- \strc_itemgroups_make_symbol_box
- \strc_itemgroups_make_destination_box
- \ifconditional\c_strc_itemgroups_fitting
- \strc_itemgroups_make_fitting_box
- \else\ifdim\d_strc_itemgroups_asked_width>\zeropoint
- \strc_itemgroups_make_aligned_box
- \fi\fi
- \let\m_strc_itemgroups_destination\empty
- \ht\b_strc_itemgroups\strutheight % just in case a symbols is not yet available in
- \dp\b_strc_itemgroups\strutdepth % the current run (more a mkii mp side artifact)
- \strc_itemgroups_check_for_repeated
- \ifdim\d_strc_itemgroups_asked_width<\zeropoint\relax
- \strc_itemgroups_handle_lapped_item_negative
- \else
- \ifzeropt\d_strc_itemgroups_asked_width
- \strc_itemgroups_calculate_list_width\plusone
- \else
- \strc_itemgroups_calculate_list_width\c_strc_itemgroups_nesting
- \fi
- \ifconditional\c_strc_itemgroups_text
- \strc_itemgroups_handle_groups_text_item
- \orelse\ifconditional\c_strc_itemgroups_inline
- \strc_itemgroups_handle_groups_inline_item
- \orelse\ifconditional\c_strc_itemgroups_txt
- \strc_itemgroups_handle_text_item
- \else
- \strc_itemgroups_handle_lapped_item_positive
- \fi
- \fi
- \setfalse\c_strc_itemgroups_head
- \setfalse\c_strc_itemgroups_sub
- \ifconditional\c_strc_itemgroups_indented_first
- \hskip\parindent
- \fi
- \ignorespaces}
-
-\def\strc_itemgroups_start_item_nop
- {\let\currentitemreference\empty
- \strc_itemgroups_increment_item_counter
- \advance\c_strc_itemgroups_n_of_items\plusone
- \setbox\b_strc_itemgroups\hbox
- {\useitemgroupstyleandcolor\c!style\c!color
- \strc_itemgroups_used_symbol}%
- \strc_itemgroups_check_for_repeated
- \ignorespaces}
-
-\setvalue{\??itemgroupdistance\v!none}%
- {\let\m_strc_itemgroups_text_distance\zeropoint}
-
-\setvalue{\??itemgroupdistance\v!space}%
- {\def\m_strc_itemgroups_text_distance{\interwordspace\!!plus\interwordstretch\!!minus\interwordshrink}}
-
-\setvalue\??itemgroupdistance % catches empty value
- {\let\m_strc_itemgroups_text_distance\zeropoint}
-
-\unexpanded\def\strc_itemgroups_set_text_item_distance
- {\edef\m_strc_itemgroups_text_distance{\itemgroupparameter\c!textdistance}%
- \ifx\m_strc_itemgroups_text_distance\empty
- %
- \orelse\ifcsname\??itemgroupdistance\m_strc_itemgroups_text_distance\endcsname
- \lastnamedcs
- \else
- \strc_itemgroups_set_text_item_distance_indeed
- \fi}
-
-\def\strc_itemgroups_set_text_item_distance_indeed
- {\assignvalue
- \m_strc_itemgroups_text_distance
- \m_strc_itemgroups_text_distance
- {.5\interwordspace\!!plus.5\emwidth}%
- {\interwordspace \!!plus \emwidth}%
- {\emwidth \!!plus \interwordstretch\!!minus\interwordshrink}}
-
-% \unexpanded\def\strc_itemgroups_default_command
-% {\EveryPar{\ignorespaces}% needed ?
-% \ignorespaces}
-
-\unexpanded\def\strc_itemgroups_default_command
- {\ignorespaces}
-
-%D Special case:
-
-\unexpanded\def\strc_itemgroups_head#text\par
- {\startitemgrouphead{#text}}
-
-%D The local commands:
-
-\appendtoks
- \let\item \strc_itemgroups_start_do_item
- \let\noitem \strc_itemgroups_start_no_item
- \let\itm \strc_itemgroups_start_do_item
- \let\but \strc_itemgroups_start_button
- \let\nop \strc_itemgroups_start_dummy
- \let\txt \strc_itemgroups_start_text
- \let\head \strc_itemgroups_head
- \let\headsym \strc_itemgroups_start_head_sym
- \let\startitem \startitemgroupitem
- \let\stopitem \stopitemgroupitem
- \let\starthead \startitemgrouphead
- \let\stophead \stopitemgroupitemhead
- \let\startspecialitem\startspecialitemgroupitem
- \let\stopspecialitem \stopspecialitemgroupitem
-\to \itemgroupcommands
-
-\ifx\currentinterface \v!english \else
-
- \appendtoks
- \expandafter\let\csname\v!item \endcsname\strc_itemgroups_start_do_item
- \expandafter\let\csname\v!sub \endcsname\strc_itemgroups_start_subitem
- \expandafter\let\csname\v!sym \endcsname\strc_itemgroups_start_symbol
- \expandafter\let\csname\v!ran \endcsname\strc_itemgroups_start_edge
- \expandafter\let\csname\v!head \endcsname\strc_itemgroups_head
- \expandafter\let\csname\v!its \endcsname\strc_itemgroups_start_items
- \expandafter\let\csname\v!mar \endcsname\strc_itemgroups_start_margin
- \expandafter\let\csname\v!txt \endcsname\strc_itemgroups_start_text
- \expandafter\let\csname\e!start\v!item\endcsname\startitemgroupitem
- \expandafter\let\csname\e!stop \v!item\endcsname\stopitemgroupitem
- \expandafter\let\csname\e!start\v!head\endcsname\startitemgrouphead
- \expandafter\let\csname\e!stop \v!head\endcsname\stopitemgrouphead
- \to \itemgroupcommands
-
-\fi
-
-\relaxvalueifundefined \v!item
-\relaxvalueifundefined \v!sub
-\relaxvalueifundefined \v!sym
-\relaxvalueifundefined \v!ran
-\relaxvalueifundefined \v!head
-\relaxvalueifundefined \v!its
-\relaxvalueifundefined \v!mar
-\relaxvalueifundefined \v!txt
-\relaxvalueifundefined {\e!start\v!item}
-\relaxvalueifundefined {\e!stop \v!item}
-\relaxvalueifundefined {\e!start\v!head}
-\relaxvalueifundefined {\e!stop \v!head}
-
-%D A nice example of a plugin:
-%D
-%D \startbuffer
-%D \startitemize[a,random,packed]
-%D \startitem first \stopitem \startitem second \stopitem
-%D \startitem third \stopitem \startitem fourth \stopitem
-%D \stopitemize
-%D
-%D \startitemize[a,random,packed]
-%D \startitem first \stopitem \startitem second \stopitem
-%D \startitem third \stopitem \startitem fourth \stopitem
-%D \stopitemize
-%D
-%D \startitemize[a,packed]
-%D \startitem first \stopitem \startitem second \stopitem
-%D \startitem third \stopitem \startitem fourth \stopitem
-%D \stopitemize
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-
-% better collectitems als conditional and a real plugin mechanism (some day)
-
-\newcount\c_strc_itemgroups_collected_stored
-\newcount\c_strc_itemgroups_collected_done
-\newcount\c_strc_itemgroups_collected_current
-
-% \expandafter\def\expandafter\strc_itemgroups_collected_store\expandafter#\expandafter1\csname\e!stop\v!item\endcsname % use grabuntil
-% {\advance\c_strc_itemgroups_collected_stored\plusone
-% \setvalue{\??itemgroupstack\number\c_strc_itemgroups_collected_stored}{\startitemgroupitem#1\stopitemgroupitem}}
-
-\let\strc_itemgroups_collected_store\relax
-
-\normalexpanded{\def\strc_itemgroups_collected_store#1\csname\e!stop\v!item\endcsname}%
- {\advance\c_strc_itemgroups_collected_stored\plusone
- \setvalue{\??itemgroupstack\number\c_strc_itemgroups_collected_stored}{\startitemgroupitem#1\stopitemgroupitem}}
-
-\def\strc_itemgroups_collected_flush_randomize
- {\collecteditemgroupitem}
-
-\def\strc_itemgroups_collected_flush_horizontal
- {\begingroup
- \scratchcounter\itemgroupparameter\c!n\relax
- \ifnum\c_strc_itemgroups_collected_done>\plusone
- \ifcase\modulonumber\scratchcounter\c_strc_itemgroups_collected_done\relax
- % compensate for rounding errors
- \hfill % \hskip\zeropoint plus \scaledpoint minus \scaledpoint
- \allowbreak
- \fi
- \fi
- \noindent % no \dontleavehmode
- \hbox to \dimexpr\availablehsize/\scratchcounter\relax{\collecteditemgroupitem\hss}%
- \endgroup}
-
-% \def\strc_itemgroups_collected_flush_indeed
-% {\collecteditemgroupitem
-% \iftrialtypesetting
-% \undefinevalue{\??itemgroupstack\number\c_strc_itemgroups_collected_current}%
-% \fi}
-
-\def\strc_itemgroups_collected_flush_indeed
- {\collecteditemgroupitem
- \undefinevalue{\??itemgroupstack\number\c_strc_itemgroups_collected_current}}
-
-\def\strc_itemgroups_collected_flush
- {\ifconditional\c_strc_itemgroups_randomize
- \getrandomcount\c_strc_itemgroups_collected_current\plusone\c_strc_itemgroups_collected_stored
- \else
- \advance\c_strc_itemgroups_collected_current\plusone
- \fi
- \ifcsname\??itemgroupstack\number\c_strc_itemgroups_collected_current\endcsname
- \edef\collecteditemgroupitem{\lastnamedcs}%
- \ifconditional\c_strc_itemgroups_horizontal
- \strc_itemgroups_collected_flush_horizontal
- \else
- \strc_itemgroups_collected_flush_indeed
- \fi
- \advance\c_strc_itemgroups_collected_done\plusone
- \fi
- \ifnum\c_strc_itemgroups_collected_done<\c_strc_itemgroups_collected_stored
- \expandafter\strc_itemgroups_collected_flush
- \fi}
-
-\unexpanded\def\stopcollectitems
- {\ifconditional\c_strc_itemgroups_collecting
- \c_strc_itemgroups_collected_done \zerocount
- \c_strc_itemgroups_collected_current\zerocount
- \ifnum\c_strc_itemgroups_collected_stored>\zerocount
- \ifconditional\c_strc_itemgroups_horizontal
- \strc_itemgroups_before_command
- \setfalse\c_strc_itemgroups_first
- \strc_itemgroups_collected_flush
- %\strc_itemgroups_after_command % triggered elsewhere
- \else
- \strc_itemgroups_collected_flush
- \fi
- \fi
- \fi}
-
-\unexpanded\def\startcollectitems
- {\ifconditional\c_strc_itemgroups_collecting
- \c_strc_itemgroups_collected_stored\zerocount
- \letvalue{\e!start\v!item}\strc_itemgroups_collected_store
- \fi}
-
-%D Left-overs:
-
-\unexpanded\def\item
- {\strc_itemgroups_item_alone}
-
-\def\strc_itemgroups_item_alone[#category]#text\par
- {\doifelsesomething{#category}{\startitemgroup[#category]}{\startitemgroup[\v!itemize]}%
- \startitem#text\stopitem
- \stopitemgroup}
-
-\unexpanded\def\head
- {\strc_itemgroups_head_alone}
-
-\def\strc_itemgroups_head_alone[#category]#head\par#body\par
- {\doifelsesomething{#category}{\startitemgroup[#category]}{\startitemgroup[\v!itemize]}%
- \starthead{#head}#body\stophead
- \stopitemgroup}
-
-\setuvalue{\e!start\v!item}%
- {\startitemgroup[\v!itemize]%
- \startitemgroupitem
- \setuvalue{\e!stop\v!item}{\stopitemgroupitem\stopitemgroup}}
-
-% \def\sym#text%
-% {\noindent
-% \begingroup
-% \setbox\scratchbox\hbox{\settrialtypesetting#text}%
-% \setbox\scratchbox\hbox\ifdim\wd\scratchbox<1em to 1.5\else spread 1\fi em{#text\hfil}%
-% \normalexpanded{\box\scratchbox\endgroup\hangindent\the\wd\scratchbox}%
-% \ignorespaces}
-
-%D End of plugin.
-
-%D Something for tables:
-
-\unexpanded\def\itemtag
- {\dosingleempty\strc_itemgroups_item_tag}
-
-\unexpanded\def\strc_itemgroups_item_tag[#reference]% we can reuse more
- {\def\currentitemreference{#reference}%
- \iftrialtypesetting
- \strc_counters_save\v_strc_itemgroups_counter
- \strc_itemgroups_increment_item_counter
- \strc_itemgroups_insert_item_tag_indeed
- \strc_counters_restore\v_strc_itemgroups_counter
- \else
- \strc_itemgroups_increment_item_counter
- \strc_itemgroups_insert_item_tag_indeed
- \fi}
-
-\def\strc_itemgroups_insert_item_tag_indeed
- {\letitemgroupparameter\c!distance\zeropoint
- %letitemgroupparameter\c!width\zeropoint
- \strc_itemgroups_make_symbol_box
- \strc_itemgroups_make_destination_box
- \let\m_strc_itemgroups_destination\empty
- \ht\b_strc_itemgroups\strutheight
- \dp\b_strc_itemgroups\strutdepth
- \box\b_strc_itemgroups
- \ignorespaces}
-
-%D Done again.
-
-\setupitemgroup
- [\c!margin=\zeropoint,
- \c!leftmargin=\zeropoint,
- \c!rightmargin=\zeropoint,
- \c!leftmargindistance=\zeropoint,
- \c!rightmargindistance=\zeropoint,
- \c!indentnext=\v!yes,
- \c!width=1.5\emwidth,
- \c!factor=0,
- %\c!distance=.5em, % is now:
- \c!step=.5\emwidth, % deals with broad
- \c!distance=\zeropoint,
- %\c!align=\v!normal, % definitely not \v!normal !
- %\c!symalign=,
- %\c!color=,
- %\c!indenting=, % untouched if empty
- %\c!style=,
- \c!marstyle=\v!type,
- %\c!symstyle=,
- %\c!headstyle=,
- %\c!marcolor=,
- %\c!symcolor=,
- %\c!headcolor=,
- %\c!beforehead=,
- \c!symcolor=\itemgroupparameter\c!color, % new per 2012.01.17
- \c!symstyle=\itemgroupparameter\c!style, % new per 2012.01.17
- \c!afterhead=\blank,
- \c!before=\blank,
- \c!inbetween=\blank,
- \c!after=\blank,
- %\c!stopper=.,
- \c!placestopper=\v!yes,
- \c!stopper=.,
- %\c!inner=,
- \c!n=2,
- \c!items=4,
- \c!levels=10,
- \c!lefttext=(,
- \c!righttext=),
- \c!start=1,
- \c!packcriterium=\zerocount,
- \c!criterium=\v!all, % permits 0 and negative numbers
- %\c!option=,
- \c!textdistance=\v!space, % none big medium small <dimension>
- \c!command=\strc_itemgroups_default_command,
- \c!indenting=\v!next,
- %\c!alignsymbol=v!no,
- \c!symbol=\currentitemlevel,
- \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]
-
-\defineitemgroup
- [\v!itemize]
-
-%D This is really ugly I should get rid of the global mess, whuch is a side
-%D effect of the simple \type {\item} interface that we're stuck with for
-%D compatibility reasons. See footnotes for usage. It's probablynot robust
-%D for mixed itemgroups so in the end I need to get rid of the globals. One
-%D problem is that counters are set.
-
-\defineitemgroup
- [\v!itemize:\v!note]
-
-\def\strc_itemgroups_push
- {\edef\strc_itemgroups_pop
- {\xdef\noexpand\currentitemlevel{\currentitemlevel}%
- \global\c_strc_itemgroups_nesting \the\c_strc_itemgroups_nesting \relax
- \global\c_strc_itemgroups_column_depth\the\c_strc_itemgroups_column_depth\relax}%
- \global\c_strc_itemgroups_column_depth\zerocount
- \global\c_strc_itemgroups_nesting \zerocount
- \glet\currentitemlevel\!!zerocount
- \unexpanded\def\startitemize{\startitemgroup[\v!itemize:\v!note]}%
- \unexpanded\def\stopitemize {\stopitemgroup}}
-
-\let\strc_itemgroups_pop\relax
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-itm.mkvi b/Master/texmf-dist/tex/context/base/mkiv/strc-itm.mkvi
index cbbefd5dbcc..a46923d3eb5 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-itm.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-itm.mkvi
@@ -676,6 +676,12 @@
\strc_itemgroups_insert_item_counter_indeed
\fi}
+\installcorenamespace{itemstopper}
+
+\setvalue{\??itemstopper\v!yes }{\itemgroupparameter\c!stopper}
+\setvalue{\??itemstopper\v!display}{\ifconditional\c_strc_itemgroups_inline\else\itemgroupparameter\c!stopper\fi}
+\setvalue{\??itemstopper\v!inline }{\ifconditional\c_strc_itemgroups_inline\itemgroupparameter\c!stopper\fi}
+
\def\strc_itemgroups_insert_item_counter_indeed % quite slow ... every time this setup .. but it
{\begingroup % can be optimized ... best move some to strc-num
\setupcounter
@@ -690,7 +696,7 @@
\c!prefixconnector=\itemgroupparameter\c!prefixconnector,
\c!criterium=\itemgroupparameter\c!criterium,
\c!numberorder=\ifconditional\c_strc_itemgroups_reverse\v!reverse\else\v!normal\fi,
- \c!numberstopper=\expdoif{\itemgroupparameter\c!placestopper}\v!yes{\itemgroupparameter\c!stopper},
+ \c!numberstopper=\begincsname\??itemstopper\itemgroupparameter\c!placestopper\endcsname,
\c!numberconversionset=\v_strc_itemgroups_counter,
\c!numbersegments=\currentitemgroupsegments]%
% there will be a fixedconversion key
@@ -1321,6 +1327,7 @@
\letvalue{\??itemgroupstart\v!ran }\strc_itemgroups_start_edge
\letvalue{\??itemgroupstart\v!its }\strc_itemgroups_start_items
\letvalue{\??itemgroupstart\v!mar }\strc_itemgroups_start_margin
+\letvalue{\??itemgroupstart\v!txt }\strc_itemgroups_start_text
\def\optimizelistitemsbreak
{\ifcase\c_strc_itemgroups_column_depth \ifconditional\c_strc_itemgroups_optimize
@@ -1538,7 +1545,7 @@
{\let\m_strc_itemgroups_text_distance\zeropoint}
\setvalue{\??itemgroupdistance\v!space}%
- {\def\m_strc_itemgroups_text_distance{\interwordspace\!!plus\interwordstretch\!!minus\interwordshrink}}
+ {\def\m_strc_itemgroups_text_distance{\interwordspace\s!plus\interwordstretch\s!minus\interwordshrink}}
\setvalue\??itemgroupdistance % catches empty value
{\let\m_strc_itemgroups_text_distance\zeropoint}
@@ -1557,9 +1564,9 @@
{\assignvalue
\m_strc_itemgroups_text_distance
\m_strc_itemgroups_text_distance
- {.5\interwordspace\!!plus.5\emwidth}%
- {\interwordspace \!!plus \emwidth}%
- {\emwidth \!!plus \interwordstretch\!!minus\interwordshrink}}
+ {.5\interwordspace\s!plus.5\emwidth}%
+ {\interwordspace \s!plus \emwidth}%
+ {\emwidth \s!plus \interwordstretch\s!minus\interwordshrink}}
% \unexpanded\def\strc_itemgroups_default_command
% {\EveryPar{\ignorespaces}% needed ?
@@ -1577,6 +1584,11 @@
\appendtoks
\let\item \strc_itemgroups_start_do_item
+ \let\sub \strc_itemgroups_start_subitem
+ \let\sym \strc_itemgroups_start_symbol
+ \let\ran \strc_itemgroups_start_edge
+ \let\its \strc_itemgroups_start_items
+ \let\mar \strc_itemgroups_start_margin
\let\noitem \strc_itemgroups_start_no_item
\let\itm \strc_itemgroups_start_do_item
\let\but \strc_itemgroups_start_button
@@ -1587,27 +1599,29 @@
\let\startitem \startitemgroupitem
\let\stopitem \stopitemgroupitem
\let\starthead \startitemgrouphead
- \let\stophead \stopitemgroupitemhead
+ \let\stophead \stopitemgrouphead
\let\startspecialitem\startspecialitemgroupitem
\let\stopspecialitem \stopspecialitemgroupitem
\to \itemgroupcommands
-\ifx\currentinterface \v!english \else
-
- \appendtoks
- \expandafter\let\csname\v!item \endcsname\strc_itemgroups_start_do_item
- \expandafter\let\csname\v!sub \endcsname\strc_itemgroups_start_subitem
- \expandafter\let\csname\v!sym \endcsname\strc_itemgroups_start_symbol
- \expandafter\let\csname\v!ran \endcsname\strc_itemgroups_start_edge
- \expandafter\let\csname\v!head \endcsname\strc_itemgroups_head
- \expandafter\let\csname\v!its \endcsname\strc_itemgroups_start_items
- \expandafter\let\csname\v!mar \endcsname\strc_itemgroups_start_margin
- \expandafter\let\csname\v!txt \endcsname\strc_itemgroups_start_text
- \expandafter\let\csname\e!start\v!item\endcsname\startitemgroupitem
- \expandafter\let\csname\e!stop \v!item\endcsname\stopitemgroupitem
- \expandafter\let\csname\e!start\v!head\endcsname\startitemgrouphead
- \expandafter\let\csname\e!stop \v!head\endcsname\stopitemgrouphead
- \to \itemgroupcommands
+\ifx\currentinterface \s!english \else
+
+ \def\next#1#2{\ifcsname#1\endcsname\else\let\csname#1\endcsname#2\fi}
+
+ \etoksapp\itemgroupcommands{%
+ \next{\v!item }\strc_itemgroups_start_do_item
+ \next{\v!sub }\strc_itemgroups_start_subitem
+ \next{\v!sym }\strc_itemgroups_start_symbol
+ \next{\v!ran }\strc_itemgroups_start_edge
+ \next{\v!head }\strc_itemgroups_head
+ \next{\v!its }\strc_itemgroups_start_items
+ \next{\v!mar }\strc_itemgroups_start_margin
+ \next{\v!txt }\strc_itemgroups_start_text
+ \next{\e!start\v!item}\startitemgroupitem
+ \next{\e!stop \v!item}\stopitemgroupitem
+ \next{\e!start\v!head}\startitemgrouphead
+ \next{\e!stop \v!head}\stopitemgrouphead
+ }
\fi
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-lnt.mkvi b/Master/texmf-dist/tex/context/base/mkiv/strc-lnt.mkvi
index ad8c80d93e6..0d35be90cdc 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-lnt.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-lnt.mkvi
@@ -234,17 +234,15 @@
\let\strc_linenotes_traced\gobbleoneargument
\def\strc_linenotes_traced_indeed#1%
- {\iftracelinenotes
- \hpack to \zeropoint
- {\forgetall
- \hsize\zeropoint
- \hss
- \vpack to \strutheight{\llap{\red\infofont\setstrut\the\c_strc_linenotes}\vss}%
- {\color[blue]{\vl}}%
- \vpack to \strutheight{\rlap{\red\infofont\setstrut#1}\vss}%
- \hss}%
- \prewordbreak
- \fi}
+ {\hpack to \zeropoint
+ {\forgetall
+ \hsize\zeropoint
+ \hss
+ \vpack to \strutheight{\llap{\red\infofont\setstrut\the\c_strc_linenotes}\vss}%
+ {\color[blue]{\vl}}%
+ \vpack to \strutheight{\rlap{\red\infofont\setstrut#1}\vss}%
+ \hss}%
+ \prewordbreak}
\unexpanded\def\tracelinenotes
{\let\strc_linenotes_traced\strc_linenotes_traced_indeed}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-lst.lua b/Master/texmf-dist/tex/context/base/mkiv/strc-lst.lua
index bc6135e7242..a6799d80f1a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-lst.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-lst.lua
@@ -835,14 +835,18 @@ function lists.getresult(r)
end
function lists.process(specification)
- lists.result = filtercollected(specification)
- local specials = settings_to_set(specification.extras or "")
- specials = next(specials) and specials or nil
- for i=1,#lists.result do
- local r = lists.result[i]
- local m = r.metadata
- local s = specials and r.numberdata and specials[zerostrippedconcat(r.numberdata.numbers,".")] or ""
- context.strclistsentryprocess(m.name,m.kind,i,s)
+ local result = filtercollected(specification)
+ local total = #result
+ lists.result = result
+ if total > 0 then
+ local specials = settings_to_set(specification.extras or "")
+ specials = next(specials) and specials or nil
+ for i=1,total do
+ local r = result[i]
+ local m = r.metadata
+ local s = specials and r.numberdata and specials[zerostrippedconcat(r.numberdata.numbers,".")] or ""
+ context.strclistsentryprocess(m.name,m.kind,i,s)
+ end
end
end
@@ -1050,6 +1054,7 @@ implement {
{ "bookmark" },
{ "marking" },
{ "list" },
+ { "reference" },
}
},
{ "prefixdata", {
@@ -1212,7 +1217,7 @@ implement {
implement { name = "doifelselisthastitle", actions = { lists.hastitledata, commands.doifelse }, arguments = { "string", "integer" } }
implement { name = "doifelselisthaspage", actions = { lists.haspagedata, commands.doifelse }, arguments = { "string", "integer" } }
implement { name = "doifelselisthasnumber", actions = { lists.hasnumberdata, commands.doifelse }, arguments = { "string", "integer" } }
-implement { name = "doifelselisthasentry", actions = { lists.iscached, commands.doifelse }, arguments = { "integer" } }
+implement { name = "doifelselisthasentry", actions = { lists.iscached, commands.doifelse }, arguments = "integer" }
local function savedlisttitle(name,n,tag)
local data = cached[tonumber(n)]
@@ -1270,7 +1275,7 @@ implement {
implement {
name = "discardfromlist",
actions = lists.discard,
- arguments = { "integer" }
+ arguments = "integer"
}
-- new and experimental and therefore off by default
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-lst.mkvi b/Master/texmf-dist/tex/context/base/mkiv/strc-lst.mkvi
index d29b1f6fdae..e3a466656c3 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-lst.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-lst.mkvi
@@ -76,7 +76,7 @@
%\c!inbetween=,
%\c!symbol=,
%\c!expansion=,
- \c!limittext=\languageparameter\c!limittext] % not used currently
+ \c!limittext=\languageparameter\c!limittext] % not used currently
%D Helpers:
@@ -242,7 +242,7 @@
%D When placing a list either one or a set can be giving. This makes
%D it possible to flush for instance an nested (or merged) table of
%D contents. Keep in mind that placing a list is what we do most (think
-%D of tables of contents, figures, etc.\ but other usag eis also possible
+%D of tables of contents, figures, etc.\ but other usage is also possible
%D in which case low level commands have to be used.
\newtoks\everystructurelist
@@ -367,6 +367,17 @@
\unexpanded\def\savedlisttitle #1#2{\clf_savedlisttitle {#1}\numexpr#2\relax}
\unexpanded\def\savedlistprefixednumber#1#2{\clf_savedlistprefixednumber{#1}\numexpr#2\relax}
+\newconditional\c_lists_show_realpage
+
+\installcorenamespace {listpagenumber}
+
+\setvalue{\??listpagenumber\v!always }{\settrue\c_lists_show_page\settrue\c_lists_has_page}
+\setvalue{\??listpagenumber\v!yes }{\settrue\c_lists_show_page}
+\setvalue{\??listpagenumber\s!realpage}{\settrue\c_lists_show_page\settrue\c_lists_show_realpage}
+
+\def\strc_lists_process_pagenumber#1%
+ {\begincsname\??listpagenumber#1\endcsname}
+
\def\structurelistlocation
{\clf_listlocation\numexpr\currentlistindex\relax}
@@ -375,23 +386,27 @@
\unexpanded\def\structurelistpagenumber
{\dostarttagged\t!listpage\empty
- \clf_listprefixedpage
- {\currentlist}%
- \currentlistindex
- {
- separatorset {\listparameter\c!pageprefixseparatorset}
- conversionset {\listparameter\c!pageprefixconversionset}
- set {\listparameter\c!pageprefixset}
- segments {\listparameter\c!pageprefixsegments}
- connector {\listparameter\c!pageprefixconnector}
- }%
- {
- prefix {\listparameter\c!pageprefix}
- conversionset {\listparameter\c!pageconversionset}
- starter {\listparameter\c!pagestarter}
- stopper {\listparameter\c!pagestopper}
- }%
- \relax
+ \ifconditional\c_lists_show_realpage
+ \clf_listrealpage{\currentlist}\numexpr\currentlistindex\relax
+ \else
+ \clf_listprefixedpage
+ {\currentlist}%
+ \currentlistindex
+ {
+ separatorset {\listparameter\c!pageprefixseparatorset}
+ conversionset {\listparameter\c!pageprefixconversionset}
+ set {\listparameter\c!pageprefixset}
+ segments {\listparameter\c!pageprefixsegments}
+ connector {\listparameter\c!pageprefixconnector}
+ }%
+ {
+ prefix {\listparameter\c!pageprefix}
+ conversionset {\listparameter\c!pageconversionset}
+ starter {\listparameter\c!pagestarter}
+ stopper {\listparameter\c!pagestopper}
+ }%
+ \relax
+ \fi
\dostoptagged}
\unexpanded\def\structurelistuservariable#name%
@@ -402,8 +417,8 @@
\def\rawstructurelistuservariable#name%
{\clf_listuserdata{\currentlist}\currentlistindex{#name}}
-\unexpanded\def\structurelistfirst {\structurelistuservariable\s!first } % s!
-\unexpanded\def\structurelistsecond {\structurelistuservariable\s!second} % s!
+\unexpanded\def\structurelistfirst {\structurelistuservariable\s!first } % s!
+\unexpanded\def\structurelistsecond{\structurelistuservariable\s!second} % s!
\def\rawstructurelistfirst {\rawstructurelistuservariable\s!first } % s! % was \unexpanded
\def\rawstructurelistsecond{\rawstructurelistuservariable\s!second} % s! % was \unexpanded
@@ -612,14 +627,14 @@
{\strut\symbol[bullet]}
\unexpanded\def\strc_lists_symbol_two
- {\vrule\!!width\emwidth\!!height\exheight\!!depth\zeropoint}
+ {\vrule\s!width\emwidth\s!height\exheight\s!depth\zeropoint\relax}
\unexpanded\def\strc_lists_symbol_three
{\begingroup
\strc_lists_assign_dimen\scratchwidth \c!width {1.5\emwidth}%
\strc_lists_assign_dimen\scratchheight\c!height\exheight
\strc_lists_assign_dimen\scratchdepth \c!depth \zeropoint
- \vrule\!!width\scratchwidth\!!height\scratchheight\!!depth\scratchdepth
+ \vrule\s!width\scratchwidth\s!height\scratchheight\s!depth\scratchdepth
\endgroup}
\unexpanded\def\strc_lists_symbol_unknown
@@ -877,7 +892,7 @@
\appendtoks
% better is to use a special list entry but we keep this for compatibility
- \let\\=\space
+ \enforced\let\\\space
% so expanding this token register has to come *after* the font switch
\dontconvertfont % (**) this has to become an option (see publ)
\to \t_lists_every_renderingtext
@@ -891,17 +906,22 @@
% because these tests happen often and because we're dealing with
% rather complex composed data we have special conditionals; keep
% in mind that testing for empty fails do to tagging being applied
- \edef\p_pagenumber{\listparameter\c!pagenumber}%
- \ifx\p_pagenumber\v!always
- \settrue\c_lists_has_page
- \settrue\c_lists_show_page
- \else
+% \edef\p_pagenumber{\listparameter\c!pagenumber}%
+% \ifx\p_pagenumber\v!always
+% \settrue\c_lists_has_page
+% \settrue\c_lists_show_page
+% \else
+% \doifelsestructurelisthaspage\settrue\setfalse\c_lists_has_page
+% \ifx\p_pagenumber\v!yes
+% \settrue\c_lists_show_page
+% \else
+% \setfalse\c_lists_show_page
+% \fi
+% \fi
+ \setfalse\c_lists_show_page % necessary?
+ \processcommacommand[\listparameter\c!pagenumber]\strc_lists_process_pagenumber
+ \ifconditional\c_lists_has_page \else
\doifelsestructurelisthaspage\settrue\setfalse\c_lists_has_page
- \ifx\p_pagenumber\v!yes
- \settrue\c_lists_show_page
- \else
- \setfalse\c_lists_show_page
- \fi
\fi
% always forces number placement (in bib we use a forced number)
\edef\p_headnumber{\listparameter\c!headnumber}%
@@ -933,6 +953,7 @@
\setfalse\c_lists_has_page
\setfalse\c_lists_has_number
\setfalse\c_lists_show_page
+ \setfalse\c_lists_show_realpage
\setfalse\c_lists_show_number
\to \t_lists_every_renderingcleanup
@@ -1118,7 +1139,7 @@
\hangafter\ifx\p_hang\v!no\zerocount\else\plusone\fi
\scratchdimen\listalternativeparameter\c!distance\relax
\ifzeropt\wd\b_strc_lists_page \else \ifdim\scratchdimen>\zeropoint\relax
- \rightskip\scratchdimen\!!plus\listalternativeparameter\c!stretch\relax
+ \rightskip\scratchdimen\s!plus\listalternativeparameter\c!stretch\relax
\parfillskip-\rightskip
\fi \fi
\else
@@ -1241,9 +1262,9 @@
\endgroup
\scratchdistance\listparameter\c!distance\relax
\ifdim\scratchdistance<\emwidth
- \hskip\emwidth\!!plus\emwidth\!!minus.25\emwidth\relax
+ \hskip\emwidth\s!plus\emwidth\s!minus.25\emwidth\relax
\else
- \hskip\scratchdistance\!!plus.5\scratchdistance\!!minus.25\scratchdistance\relax
+ \hskip\scratchdistance\s!plus.5\scratchdistance\s!minus.25\scratchdistance\relax
\fi
\endgroup
\endgroup
@@ -1346,7 +1367,8 @@
%D such (for now). No interaction either as that is dealt with elsewhere.
%D
%D \currentlistsymbol
-%D \currentlistentry
+%D \currentlistentrynumber
+%D \currentlistentrytitle
%D \currentlistentrypagenumber % not really used
\definelistalternative
@@ -1522,14 +1544,14 @@
\def\strc_lists_set_reference_attribute_indeed#element%
{\ifx#element\p_interaction_forward
- \attribute\referenceattribute\a_strc_lists_reference
+ \c_attr_reference\a_strc_lists_reference
\fi}
\def\strc_lists_get_destination_attribute_indeed
{attr \destinationattribute\number\a_strc_lists_destination}
\def\strc_lists_set_destination_attribute_indeed
- {\attribute\destinationattribute\a_strc_lists_destination}
+ {\c_attr_destination\a_strc_lists_destination}
\unexpanded\def\strc_lists_set_style_color_normal#style#color#element%
{\useliststyleandcolor#style#color}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-mar.lua b/Master/texmf-dist/tex/context/base/mkiv/strc-mar.lua
index b5fd2667b1a..f7953c416e0 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-mar.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-mar.lua
@@ -122,7 +122,7 @@ end
local function sweep(head,first,last)
for n, id, subtype in nextnode, head do
-- we need to handle empty heads so we test for latelua
- if id == glyph_code or (id == whatsit_code and subtype == lateluawhatsit_code) then
+ if id == glyph_code or (id == whatsit_code and subtype == lateluawhatsit_code) then -- brrr
local a = getattr(n,a_marks)
if not a then
-- next
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-mat.mkiv b/Master/texmf-dist/tex/context/base/mkiv/strc-mat.mkiv
index 0b80a26cd63..7f5a1915445 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-mat.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-mat.mkiv
@@ -1,5 +1,4 @@
%D \module
-%D \module
%D [ file=strc-mat,
%D version=2008.10.20,
%D title=\CONTEXT\ Structure Macros,
@@ -315,7 +314,7 @@
\def\theformuladestinationattribute#1%
{\iflocation\ifx#1\relax\else\ifx#1\empty\else
- \attribute\destinationattribute#1%
+ \c_attr_destination#1%
\glet#1\relax
\fi\fi\fi}
@@ -500,6 +499,8 @@
%D
%D Otherwise we get a missing \type {$$} error reported.
+\pushoverloadmode
+
\let\reqno\eqno % no longer valid as we just nil it
\let\math_native_leqno\leqno
@@ -514,6 +515,8 @@
\let\reqno\normaleqno
\let\eqno \normaleqno
+\popoverloadmode
+
%D \macros
%D {startsubformulas}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-not.lua b/Master/texmf-dist/tex/context/base/mkiv/strc-not.lua
index b2c8106e153..a18b3bd5e4a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-not.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-not.lua
@@ -32,7 +32,8 @@ notes.states = notes.states or { }
lists.enhancers = lists.enhancers or { }
notes.numbers = notes.numbers or { }
-storage.register("structures/notes/states", notes.states, "structures.notes.states")
+storage.register("structures/notes/states", notes.states, "structures.notes.states")
+storage.register("structures/notes/numbers", notes.numbers, "structures.notes.numbers")
local notestates = notes.states
local notedata = table.setmetatableindex("table")
@@ -492,6 +493,7 @@ local texgetglue = tex.getglue
local texsetglue = tex.setglue
local function check_spacing(n,i)
+ -- we can also check for tex.insertheights > 0 (instead of i > 1)
local gn, pn, mn = texgetglue(n)
local gi, pi, mi = texgetglue(i > 1 and "s_strc_notes_inbetween" or "s_strc_notes_before")
local gt, pt, mt = gn + gi, pn + pi, mn + mi
@@ -508,7 +510,7 @@ notes.check_spacing = check_spacing
callback.register("build_page_insert", function(n,i)
local state = notes.numbers[n]
if state then
- -- only notes, kind of hardcoded .. bah
+ -- only notes, kind of hardcoded .. bah
local gt, pt, mt = check_spacing(n,i)
texsetglue(0,gt,pt,mt) -- for the moment we use skip register 0
return 0
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-not.mkvi b/Master/texmf-dist/tex/context/base/mkiv/strc-not.mkvi
index 05aa1eb6bbe..f29cb38ba16 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-not.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-not.mkvi
@@ -27,39 +27,50 @@
\unexpanded\def\unvboxed {\ifvmode\unvbox \else\box \fi} % will change or used more often
\unexpanded\def\unvcopied{\ifvmode\unvcopy\else\copy\fi} % will change or used more often
-%D Notes have two handlers: notations and notes. Although notations can
-%D be defined independently it makes not much sense. In principle we can
-%D treat notes as lists but they are currently done as a variant on
-%D enumerations. I will provide a list variant as well. One complication is
-%D that for page related notes inserts are used and therefore notes are
-%D typeset immediately and descriptions are better suited for that. For
-%D instance endnotes can as well be typeset using lists.
+%D \LMTX\ testcase:
+%D
+%D \starttyping
+%D \hbox {\hbox{\footnote{HH1}\footnote{HH2}}} \par
+%D \hbox {\hbox{x\footnote{XHH1}x\footnote{XHH2}}} \par
+%D \vbox {\setbox0\hbox{\footnote{VH1}\footnote{VH2}}\box0} \par
+%D \vbox {\hbox{\footnote{VH1}xxx\footnote{VH2}}} \par
+%D \vbox {\hbox{\footnote{VH1}\footnote{VH2}}
+%D \hbox{\footnote{VH1}\footnote{VH2}}} \par
+%D \vbox {\hbox{x\footnote{XVH1}x\footnote{XVH2}}} \par
+%D \vbox {\vbox{\footnote{VV1}\footnote{VV2}}} \par % two lines
+%D \vbox {\vbox{x\footnote{XVV1}x\footnote{XVV2}}} \par
+%D \stoptyping
+
+%D Notes have two handlers: notations and notes. Although notations can be defined
+%D independently it makes not much sense. In principle we can treat notes as lists
+%D but they are currently done as a variant on enumerations. I will provide a list
+%D variant as well. One complication is that for page related notes inserts are used
+%D and therefore notes are typeset immediately and descriptions are better suited
+%D for that. For instance endnotes can as well be typeset using lists.
% textcommand/textstyle/textcolor : set by note commandhandler and used for inline number
%D \macros
%D {setupnote,setupnotation}
%D
-%D We can influence footnote typesetting with the setup
-%D command:
+%D We can influence footnote typesetting with the setup command:
%D
%D \showsetup{setupnotation}
%D \showsetup{setupnote}
%D
-%D The definition command indicate that we can frame the footnote
-%D area. The footnotes themselves are treated as descriptions.
+%D The definition command indicate that we can frame the footnote area. The
+%D footnotes themselves are treated as descriptions.
%D
%D \showsetup{definenote}
%D
-%D It's sort of a custom to precede footnotes by a horizontal
-%D rule and although fancy rules like
+%D It's sort of a custom to precede footnotes by a horizontal rule and although
+%D fancy rules like
%D
%D \starttyping
%D \hbox to 10em{\hskip-3em\dotfill}
%D \stoptyping
%D
-%D Are quite ligitimate, we default to a simple one 20\% of the
-%D text width.
+%D Are quite ligitimate, we default to a simple one 20\% of the text width.
% \c!headstyle=\noteparameter\c!style,
% \c!headcolor=\noteparameter\c!color,
@@ -211,11 +222,10 @@
\fi
\fi}
-%D Notations (we simply needed a word that relates to notes and is
-%D and sounds like description and enumeration) are a special case
-%D in the sense that they are stored, rendered elsewhere and referered
-%D to from where they are specified. For that reason they have a different
-%D set op main commands.
+%D Notations (we simply needed a word that relates to notes and is and sounds like
+%D description and enumeration) are a special case in the sense that they are
+%D stored, rendered elsewhere and referered to from where they are specified. For
+%D that reason they have a different set op main commands.
% \notation[ref]{title}
% \notation[reference=,title=]
@@ -305,10 +315,10 @@
\unexpanded\def\strc_notations_stop
{}
-%D A complication is that we need to set up rather specific properties
-%D of e.g. footnotes. It is for this reason that we introduce an extra
-%D level of indirectness. This way notations don't bark on undefined
-%D macros when used in combination.
+%D A complication is that we need to set up rather specific properties of e.g.
+%D footnotes. It is for this reason that we introduce an extra level of
+%D indirectness. This way notations don't bark on undefined macros when used in
+%D combination.
\unexpanded\setvalue{\??constructionnotehandler\v!notation}%
{\csname\??constructionnotehandler\currentconstructionhandler:\constructionparameter\c!type\endcsname}
@@ -338,8 +348,7 @@
\let\setupnotes\setupnote
-% These only concern the inline symbol/number and wrapping of the
-% whole list.
+% These only concern the inline symbol/number and wrapping of the whole list.
\setupnotes % not all make sense here
[\c!location=\v!page,
@@ -437,7 +446,7 @@
{\iftrialtypesetting \else
\begingroup
\currentconstructionsynchronize
- \attribute\destinationattribute\currentconstructionattribute\relax % todo, whole text
+ \c_attr_destination\currentconstructionattribute\relax % todo, whole text
\signalcharacter
\endgroup
\fi#following}
@@ -486,20 +495,19 @@
\kern\notesignal\relax % \relax is needed to honor spaces
\fi}
-%D Interaction in notes is somewhat complex due to the way notes get
-%D flushed. In principle it is more or less the same as lists but where
-%D in lists we pack whole entries, in notes this doesn't happen. Okay,
-%D in retrospect we could have made descriptions lists but that will be
-%D a backward compatibility mess. At some point a completely new mechanism
-%D might show up, but not now. Also, as notes are inserts there is some
-%D extra mess to be kept in mind and it's easier to maintain two mechanisms
-%D than to combine too much.
+%D Interaction in notes is somewhat complex due to the way notes get flushed. In
+%D principle it is more or less the same as lists but where in lists we pack whole
+%D entries, in notes this doesn't happen. Okay, in retrospect we could have made
+%D descriptions lists but that will be a backward compatibility mess. At some point
+%D a completely new mechanism might show up, but not now. Also, as notes are inserts
+%D there is some extra mess to be kept in mind and it's easier to maintain two
+%D mechanisms than to combine too much.
%D
-%D Interaction is also complicated because we want to provide several variants.
-%D For simple reference there is no need for anything special, as page references
-%D will do and we store them in the list anyway. But if we want a destination with
-%D dimensions we will use an additional destination because we can have only
-%D one with the same name and we always have the number as one.
+%D Interaction is also complicated because we want to provide several variants. For
+%D simple reference there is no need for anything special, as page references will
+%D do and we store them in the list anyway. But if we want a destination with
+%D dimensions we will use an additional destination because we can have only one
+%D with the same name and we always have the number as one.
% interaction:
%
@@ -579,25 +587,6 @@
\let\strc_notes_set_destination_attribute_text\donothing
\let\strc_notes_set_style_color_display\strc_notes_set_style_color_display_nop}
-% \def\strc_references_prepare_display_references_yes_number
-% {\let\strc_notes_set_reference_attribute_text\donothing
-% \strc_references_get_simple_reference{symb:\currentnote:\currentnotenumber}% reference
-% \edef\strc_notes_set_reference_attribute_number{\attribute\referenceattribute\currentreferenceattribute}%
-% \let\strc_notes_set_style_color_display\strc_notes_set_style_color_display_yes}
-
-% \def\strc_references_prepare_display_references_yes_text
-% {\strc_references_get_simple_reference{symb:\currentnote:\currentnotenumber}% reference
-% \edef\strc_notes_set_reference_attribute_text{\attribute\referenceattribute\currentreferenceattribute}%
-% \let\strc_notes_set_reference_attribute_number\donothing
-% \let\strc_notes_set_style_color_display\strc_notes_set_style_color_display_yes}
-
-% \def\strc_references_prepare_display_references_yes_all
-% {\strc_references_get_simple_reference{symb:\currentnote:\currentnotenumber}% reference
-% \edef\strc_notes_set_reference_attribute_text{\attribute\referenceattribute\currentreferenceattribute}%
-% \strc_references_get_simple_reference{symb:\currentnote:\currentnotenumber}% reference
-% \edef\strc_notes_set_reference_attribute_number{\attribute\referenceattribute\currentreferenceattribute}%
-% \let\strc_notes_set_style_color_display\strc_notes_set_style_color_display_yes}
-
\def\strc_references_prepare_display_references_yes_number
{\edef\currentnoteinternal{\clf_noteinternal{\currentnote}\currentnotenumber}%
\ifcase\currentnoteinternal\relax
@@ -605,7 +594,7 @@
\else
\let\strc_notes_set_reference_attribute_text\donothing
\strc_references_get_simple_reference{*\currentnoteinternal}% reference
- \edef\strc_notes_set_reference_attribute_number{\attribute\referenceattribute\currentreferenceattribute}%
+ \edef\strc_notes_set_reference_attribute_number{\c_attr_reference\currentreferenceattribute}%
\let\strc_notes_set_style_color_display\strc_notes_set_style_color_display_yes
\fi}
@@ -615,7 +604,7 @@
\strc_references_prepare_display_references_nop
\else
\strc_references_get_simple_reference{*\currentnoteinternal}% reference
- \edef\strc_notes_set_reference_attribute_text{\attribute\referenceattribute\currentreferenceattribute}%
+ \edef\strc_notes_set_reference_attribute_text{\c_attr_reference\currentreferenceattribute}%
\let\strc_notes_set_reference_attribute_number\donothing
\let\strc_notes_set_style_color_display\strc_notes_set_style_color_display_yes
\fi}
@@ -626,9 +615,9 @@
\strc_references_prepare_display_references_nop
\else
\strc_references_get_simple_reference{*\currentnoteinternal}% reference
- \edef\strc_notes_set_reference_attribute_text{\attribute\referenceattribute\currentreferenceattribute}%
+ \edef\strc_notes_set_reference_attribute_text{\c_attr_reference\currentreferenceattribute}%
\strc_references_get_simple_reference{*\currentnoteinternal}% reference
- \edef\strc_notes_set_reference_attribute_number{\attribute\referenceattribute\currentreferenceattribute}%
+ \edef\strc_notes_set_reference_attribute_number{\c_attr_reference\currentreferenceattribute}%
\let\strc_notes_set_style_color_display\strc_notes_set_style_color_display_yes
\fi}
@@ -802,26 +791,23 @@
%D Footnotes are can be characterized by three components:
%D
%D \startitemize[packed]
-%D \item a small number \footnote {a footnote number} or
-%D symbol {\setupfootnotes [conversion=set 2]\footnote
-%D {a footnote}}
+%D \item a small number \footnote {a footnote number} or symbol {\setupfootnotes
+%D [conversion=set 2]\footnote {a footnote}}
%D \item and a similar mark at the bottom of the page
%D \item followed by some additional text
%D \stopitemize
%D
-%D Because footnotes are declared at the location of their
-%D reference they can be seen as a special kind of
-%D floating bodies. Their placement is postponed but has to be
-%D taken into account in the pagebreak calculations. This kind
-%D of calculations are forced by using \type{\insert}s and dealing
-%D with all cases is not trivial.
+%D Because footnotes are declared at the location of their reference they can be
+%D seen as a special kind of floating bodies. Their placement is postponed but has
+%D to be taken into account in the pagebreak calculations. This kind of calculations
+%D are forced by using \type{\insert}s and dealing with all cases is not trivial.
%D \macros
%D {notesenabled}
%D
-%D We need a couple of states because at some moments we don't want
-%D to mess around with inserts at all. Take for instance a table
-%D of contents. And so we can temporary disable footnotes by saying
+%D We need a couple of states because at some moments we don't want to mess around
+%D with inserts at all. Take for instance a table of contents. And so we can
+%D temporary disable footnotes by saying
%D
%D \starttyping
%D \notesenabledfalse
@@ -837,8 +823,8 @@
\appendtoks \notesenabledfalse \to \everysimplifycommands % quick hack
\appendtoks \notesenabledfalse \to \everypreroll % quick hack
-%D Often we need to process the whole set of notes and to make that
-%D fast, we use a token register:
+%D Often we need to process the whole set of notes and to make that fast, we use a
+%D token register:
% we have several synchronizers:
%
@@ -943,27 +929,6 @@
\letvalue{\??notepenalty\v!verystrict}\notepenaltyverystrict
\letvalue{\??notepenalty }\notepenaltytolerant
-% \def\strc_notes_set_width
-% {\edef\p_width{\noteparameter\c!width}%
-% \ifx\p_width\empty
-% \setnoteparameter\c!width{\hsize}%
-% \fi}
-
-\setupnotes
- [\c!width=\v!auto]
-
-\def\strc_notes_set_width
- {\edef\p_width{\noteparameter\c!width}%
- \ifx\p_width\v!auto
- \setnoteparameter\c!width{\ifdim\hsize<\makeupwidth\hsize\else\makeupwidth\fi}%
- \else\ifx\p_width\empty
- \setnoteparameter\c!width{\hsize}%
- \fi\fi}
-
-\appendtoks
- \strc_notes_set_width
-\to \everysynchronizenote
-
%D The following switch can be used to disable limiting the height of the footnote
%D area, something that is needed in multi column balancing. Use this switch with
%D care.
@@ -1112,12 +1077,21 @@
\c_strc_notes_columns\plusone
\fi}
+% \def\strc_notes_set_location_page
+% {\setfalse\c_strc_notes_delayed
+% \strc_notes_set_distance
+% \strc_notes_set_columns
+% \page_inserts_set_location\currentnoteinsertion\v!page % \setupinsertion[\currentnote][\c!location=\v!page]%
+% \global\count\currentnoteinsertionnumber\numexpr\plusthousand/\c_strc_notes_columns\relax
+% \global\dimen\currentnoteinsertionnumber\ifnotelimit\dimexpr\noteparameter\c!height*\c_strc_notes_columns\relax\else\maxdimen\fi
+% \global\skip \currentnoteinsertionnumber\s_strc_notes_distance\relax}
+
\def\strc_notes_set_location_page
{\setfalse\c_strc_notes_delayed
\strc_notes_set_distance
\strc_notes_set_columns
\page_inserts_set_location\currentnoteinsertion\v!page % \setupinsertion[\currentnote][\c!location=\v!page]%
- \global\count\currentnoteinsertionnumber\numexpr\plusthousand/\c_strc_notes_columns\relax
+ \global\count\currentnoteinsertionnumber\numexpr(\plusthousand/\c_strc_notes_columns)*\nofmulticolumns\relax
\global\dimen\currentnoteinsertionnumber\ifnotelimit\dimexpr\noteparameter\c!height*\c_strc_notes_columns\relax\else\maxdimen\fi
\global\skip \currentnoteinsertionnumber\s_strc_notes_distance}
@@ -1195,12 +1169,9 @@
% \dorecurse{10}{test \mynote{one one one one one one} \input zapf \mynote{one one one one one one} }
% \stoptext
-%D The noterule can be a graphic and therefore calling this
-%D setup macro at every skipswitch is tricky (many many MP
-%D runs). Let's just reserve a few points, that probably match
-%D those of the stretch component.
-
-%D A bit messy:
+%D The noterule can be a graphic and therefore calling this setup macro at every
+%D skipswitch is tricky (many many MP runs). Let's just reserve a few points, that
+%D probably match those of the stretch component. A bit messy:
\unexpanded\def\placenoterule
{\begingroup
@@ -1220,14 +1191,8 @@
\kern\strutdepth
\fi}
-\ifdefined\setnotehsize \else
-
- \unexpanded\def\setnotehsize{\hsize\noteparameter\c!width\relax} % can be overloaded
-
-\fi
-
-%D The formatting depends on the width of the table, so we
-%D have to set \type {n} to zero.
+%D The formatting depends on the width of the table, so we have to set \type {n} to
+%D zero.
%D
%D \starttyping
%D \startbuffer
@@ -1245,21 +1210,19 @@
%D \macros
%D {footnote}
%D
-%D A footnote can have a reference as optional argument and
-%D therefore its formal specification looks like:
+%D A footnote can have a reference as optional argument and therefore its formal
+%D specification looks like:
%D
%D \showsetup{footnote}
%D
-%D This command has one optional command: the reference. By
-%D saying \type{[-]} the number is omitted. The footnote
-%D command is not that sensitive to spacing, so it's quite
-%D legal to say:
+%D This command has one optional command: the reference. By saying \type{[-]} the
+%D number is omitted. The footnote command is not that sensitive to spacing, so it's
+%D quite legal to say:
%D
%D \startbuffer
-%D Users of \CONTEXT\ must keep both feet \footnote{Given they
-%D have two.} on the ground and not get confused \footnote{Or
-%D even crazy.} by all those obscure \footnote{But fortunately
-%D readable.} parameters.
+%D Users of \CONTEXT\ must keep both feet \footnote {Given they have two.} on the
+%D ground and not get confused \footnote {Or even crazy.} by all those obscure
+%D \footnote {But fortunately readable.} parameters.
%D \stopbuffer
%D
%D \typebuffer
@@ -1274,15 +1237,11 @@
%D \stopnarrower
%D \egroup
%D
-%D Typesetting footnotes is, at least for the moment, disabled
-%D when reshaping boxes.
-%D
-%D The additional macro \type {\footnotetext} and the
-%D associated \type {\note} macro were implemented at
-%D request of users on the mailing list and a suggestion by
-%D taco to split of the symbol placement. I decided to
-%D merge this functionality with the existing \type {\note}
-%D functionality.
+%D Typesetting footnotes is, at least for the moment, disabled when reshaping boxes.
+%D The additional macro \type {\footnotetext} and the associated \type {\note} macro
+%D were implemented at request of users on the mailing list and a suggestion by taco
+%D to split of the symbol placement. I decided to merge this functionality with the
+%D existing \type {\note} functionality.
\newconditional\c_strc_notes_symbol \settrue\c_strc_notes_symbol % not used
\newconditional\c_strc_notes_skip
@@ -1357,6 +1316,13 @@
\newtoks\everyinsidenoteinsert
\newtoks\everyafternoteinsert
+\unexpanded\def\doifelseinnote
+ {\ifconditional\processingnote
+ \expandafter\firstoftwoarguments
+ \else
+ \expandafter\secondoftwoarguments
+ \fi}
+
\appendtoks
\let\flushnotes\relax
\let\postponenotes\relax
@@ -1410,17 +1376,35 @@
% \setfalse\inhibitmargindata
% \to \everyinsidenoteinsert
+\setupnotes
+ [\c!width=\v!auto]
+
+\unexpanded\def\setnotehsize
+ {\ifinsidemulticolumns
+ \setnoteparameter\c!width{\makeupwidth}%
+ \else
+ \edef\p_width{\noteparameter\c!width}%
+ \ifx\p_width\v!auto
+ % \ifinsidecolumns
+ \setnoteparameter\c!width{\ifdim\hsize<\makeupwidth\hsize\else\makeupwidth\fi}%
+ % \else
+ % \setnoteparameter\c!width{\makeupwidth}%
+ % \fi
+ \else\ifx\p_width\empty
+ \setnoteparameter\c!width{\hsize}%
+ \fi\fi
+ \fi
+ \hsize\noteparameter\c!width\relax}
+
\appendtoks
% only needed when columns (could be three \set...)
+ \setnotehsize
\setsimplecolumnshsize[\c!distance=\noteparameter\c!columndistance,\c!n=\noteparameter\c!n,\c!width=\noteparameter\c!width]%
\to \everyinsidenoteinsert
-% not: \appendtoks \setnotehsize \to \everyinsidenoteinsert (spoils columns)
-
-%D Normally footnotes are saved as inserts that are called upon
-%D as soon as the pagebody is constructed. The footnote
-%D insertion routine looks just like the \PLAIN\ \TEX\ one,
-%D except that we check for the end note state.
+%D Normally footnotes are saved as inserts that are called upon as soon as the
+%D pagebody is constructed. The footnote insertion routine looks just like the
+%D \PLAIN\ \TEX\ one, except that we check for the end note state.
% testcase for split bottom alignment see (a) below
%
@@ -1506,9 +1490,12 @@
\obeydepth} % (a) added , since split footnotes will not align properly
\def\strc_notes_flush_inserts_columns
- {\startsimplecolumns[\c!distance=\noteparameter\c!columndistance,\c!n=\noteparameter\c!n,\c!width=\noteparameter\c!width]%
+ {\begingroup
+ \setnotehsize % probably still not ok for columns
+ \startsimplecolumns[\c!distance=\noteparameter\c!columndistance,\c!n=\noteparameter\c!n,\c!width=\noteparameter\c!width]%
\strc_notes_flush_global
- \stopsimplecolumns}
+ \stopsimplecolumns
+ \endgroup}
% idea: tag with attr and then just flush them again
@@ -1523,10 +1510,9 @@
{\iftrialtypesetting\unvcopied\else\unvboxed\fi\currentnoteinsertionnumber}%
\endgroup}
-%D Supporting end notes is surprisingly easy. Even better, we
-%D can combine this feature with solving the common \TEX\
-%D problem of disappearing inserts when they're called for in
-%D deeply nested boxes. The general case looks like:
+%D Supporting end notes is surprisingly easy. Even better, we can combine this
+%D feature with solving the common \TEX\ problem of disappearing inserts when
+%D they're called for in deeply nested boxes. The general case looks like:
%D
%D \starttyping
%D \postponenotes
@@ -1534,9 +1520,8 @@
%D \flushnotes
%D \stoptyping
%D
-%D This alternative can be used in headings, captions, tables
-%D etc. The latter one sometimes calls for notes local to
-%D the table, which can be realized by saying
+%D This alternative can be used in headings, captions, tables etc. The latter one
+%D sometimes calls for notes local to the table, which can be realized by saying
%D
%D \starttyping
%D \setlocalfootnotes
@@ -1544,26 +1529,28 @@
%D \placelocalfootnotes
%D \stoptyping
%D
-%D Postponing is accomplished by simply redefining the (local)
-%D insert operation. A not too robust method uses the
-%D \type{\insert} primitive when possible. This method fails in
-%D situations where it's not entirely clear in what mode \TEX\
-%D is. Therefore the auto method can is to be overruled when
-%D needed.
+%D Postponing is accomplished by simply redefining the (local) insert operation. A
+%D not too robust method uses the \type{\insert} primitive when possible. This
+%D method fails in situations where it's not entirely clear in what mode \TEX\ is.
+%D Therefore the auto method can is to be overruled when needed.
\newconditional\postponingnotes
% we need a proper state: normal, postponing, flushing
\unexpanded\def\postponenotes
- {\ifconditional\postponingnotes\else
- \global\settrue\postponingnotes
- \glet\flushnotes\doflushnotes
- \clf_postponenotes
+ {\ifcase\insertionmigrationmode
+ \ifconditional\postponingnotes\else
+ \global\settrue\postponingnotes
+ \glet\flushnotes\doflushnotes
+ \clf_postponenotes
+ \fi
\fi}
\let\flushnotes\relax
+% also \ifcase\insertionmigrationmode here, needs testing:
+
\unexpanded\def\startpostponingnotes % experimental, page-mix
{\ifconditional\postponingnotes\else
\global\settrue\postponingnotes
@@ -1595,8 +1582,8 @@
%D \macros
%D {startlocalfootnotes,placelocalfootnotes}
%D
-%D The next two macros can be used in for instance tables, as
-%D we'll demonstrate later on.
+%D The next two macros can be used in for instance tables, as we'll demonstrate
+%D later on.
%D
%D \showsetup{startlocalfootnotes}
%D \showsetup{placelocalfootnotes}
@@ -1678,19 +1665,17 @@
%D
%D \typebuffer
%D
-%D Because this table placement macro expect box content, and
-%D thanks to the grouping of the local footnotes, we don't need
-%D additional braces.
+%D Because this table placement macro expect box content, and thanks to the grouping
+%D of the local footnotes, we don't need additional braces.
%D
%D \getbuffer
%D \macros
%D {placefootnotes}
%D
-%D We still have no decent command for placing footnotes
-%D somewhere else than at the bottom of the page (for which no
-%D user action is needed). Footnotes (endnotes) can be
-%D placed by using
+%D We still have no decent command for placing footnotes somewhere else than at the
+%D bottom of the page (for which no user action is needed). Footnotes (endnotes) can
+%D be placed by using
%D
%D \showsetup{placefootnotes}
@@ -1866,22 +1851,20 @@
\def\calculatetotalclevernoteheight{\totalnoteheight\zeropoint\strc_notes_process\docalculatetotalclevernoteheight}
\def\calculatetotalpagenoteheight {\totalnoteheight\zeropoint\strc_notes_process\docalculatetotalpagenoteheight}
-%D Now how can this mechanism be hooked into \CONTEXT\ without
-%D explictly postponing footnotes? The solution turned out to
-%D be rather simple:
+%D Now how can this mechanism be hooked into \CONTEXT\ without explictly postponing
+%D footnotes? The solution turned out to be rather simple:
%D
%D \starttyping
%D \everypar {...\flushnotes...}
%D \neverypar {...\postponenotes}
%D \stoptyping
%D
-%D We can use \type{\neverypar} because in most commands
-%D sensitive to footnote gobbling we disable \type{\everypar}
-%D in favor for \type{\neverypar}. In fact, this footnote
-%D implementation is the first to use this scheme.
+%D We can use \type {\neverypar} because in most commands sensitive to footnote
+%D gobbling we disable \type {\everypar} in favor for \type {\neverypar}. In fact,
+%D this footnote implementation is the first to use this scheme.
-%D This is a nasty and new secondary footnote flusher. It
-%D can be hooked into \type {\everypar} like:
+%D This is a nasty and new secondary footnote flusher. It can be hooked into \type
+%D {\everypar} like:
%D
%D \starttyping
%D \appendtoks \synchronizenotes \to \everypar
@@ -1895,10 +1878,9 @@
\let\synchronizenotes\relax
-%D When typesetting footnotes, we have to return to the
-%D footnote specific bodyfont size, which is in most cases derived
-%D from the global document bodyfont size. In the previous macros
-%D we already used a footnote specific font setting macro.
+%D When typesetting footnotes, we have to return to the footnote specific bodyfont
+%D size, which is in most cases derived from the global document bodyfont size. In
+%D the previous macros we already used a footnote specific font setting macro.
\def\strc_notes_set_bodyfont
{\let\strc_notes_set_bodyfont\relax
@@ -1906,9 +1888,23 @@
\usebodyfontparameter\noteparameter
\usealignparameter\noteparameter}
-%D The footnote mechanism defaults to a traditional one
-%D column way of showing them. By default we precede them by
-%D a small line.
+%D The footnote mechanism defaults to a traditional one column way of showing them.
+%D By default we precede them by a small line.
+
+% end notes in the margin:
+%
+% \setuptexttexts
+% [margin]
+% [] [{\directsetup{notabene}}]
+%
+% \startsetups notabene
+% \vbox to \textheight \bgroup
+% \setupalign[tolerant]
+% \topskipcorrection
+% \placenotes[endnote][before=,after=]
+% \vfilll
+% \egroup
+% \stopsetups
\definenote [\v!footnote]
\definenote [\v!endnote ] [\c!location=\v!none] % else no break
@@ -1954,8 +1950,7 @@
%D \macros
%D {note}
%D
-%D Refering to a note is accomplished by the rather short
-%D command:
+%D Refering to a note is accomplished by the rather short command:
%D
%D \showsetup{note}
%D
@@ -2031,5 +2026,10 @@
% a\footnote{\input tufte\par\input ward\relax}
% \stoptext
-\protect \endinput
+%D Bonus:
+\appendtoks
+ \setsystemmode\currentnote
+\to \everysynchronizenote
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-pag.lua b/Master/texmf-dist/tex/context/base/mkiv/strc-pag.lua
index 9b3a77e741f..9c040104db4 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-pag.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-pag.lua
@@ -35,6 +35,8 @@ local stopapplyprocessor = processors.stopapply
local texsetcount = tex.setcount
local texgetcount = tex.getcount
+local texconditionals = tex.conditionals
+
local ctx_convertnumber = context.convertnumber
-- storage
@@ -82,6 +84,7 @@ function pages.save(prefixdata,numberdata,extradata)
block = sections.currentblock(),
prefixdata = prefixdata and helpers.simplify(prefixdata),
numberdata = numberdata and helpers.simplify(numberdata),
+ marked = pages.markedlist(realpage), -- not yet defined
}
tobesaved[realpage] = data
if not collected[realpage] then
@@ -319,6 +322,10 @@ function pages.on_right(n)
end
end
+function pages.has_changed()
+ return texconditionals.layouthaschanged
+end
+
function pages.in_body(n)
return texgetcount("pagebodymode") > 0
end
@@ -440,6 +447,6 @@ implement { -- weird place
interfaces.implement {
name = "pageofinternal",
- arguments = { "integer" },
+ arguments = "integer",
actions = helpers.pageofinternal,
}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-pag.mkiv b/Master/texmf-dist/tex/context/base/mkiv/strc-pag.mkiv
index 01361e2c53b..909c418f956 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-pag.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-pag.mkiv
@@ -21,14 +21,14 @@
% Allocation:
-\countdef\realpageno \zerocount \realpageno \plusone
-\countdef\userpageno \plusone \userpageno \plusone
-\countdef\subpageno \plustwo \subpageno \plusone % was \zerocount but that doesn't work well with bytext
-\countdef\arrangeno \plusthree \arrangeno \zerocount % !
-\countdef\pagenoshift\plusfour \pagenoshift\zerocount % !
-\countdef\lastpageno \plusfive \lastpageno \zerocount % !
+\ifdefined\realpageno \else \countdef\realpageno \zerocount \fi \realpageno \plusone
+\ifdefined\userpageno \else \countdef\userpageno \plusone \fi \userpageno \plusone
+\ifdefined\subpageno \else \countdef\subpageno \plustwo \fi \subpageno \plusone % was \zerocount but that doesn't work well with bytext
+\ifdefined\arrangeno \else \countdef\arrangeno \plusthree \fi \arrangeno \zerocount % !
+\ifdefined\pagenoshift \else \countdef\pagenoshift\plusfour \fi \pagenoshift\zerocount % !
+\ifdefined\lastpageno \else \countdef\lastpageno \plusfive \fi \lastpageno \zerocount % !
-\let\pageno\userpageno
+\ifdefined\pageno \else \let\pageno\userpageno \fi
\def\realfolio{\the\realpageno}
\def\userfolio{\the\userpageno}
@@ -268,8 +268,8 @@
% States:
-\newif\ifdoublesided \newconditional\layoutisdoublesided
-\newif\ifsinglesided \newconditional\layoutissinglesided
+\newconditional\layoutisdoublesided % already defined: \newif\ifdoublesided
+\newconditional\layoutissinglesided % already defined: \newif\ifsinglesided
% Realpage and subpage numbers:
@@ -316,7 +316,8 @@
\doublesidedfalse \setfalse\layoutissinglesided
\resetsystemmode\v!singlesided
\resetsystemmode\v!doublesided
- \processallactionsinset[\directpagenumberingparameter\c!alternative]
+ \processallactionsinset
+ [\directpagenumberingparameter\c!alternative]%
[ \v!singlesided=>\setsystemmode\v!singlesided\singlesidedtrue\settrue\layoutissinglesided,
\v!doublesided=>\setsystemmode\v!doublesided\doublesidedtrue\settrue\layoutisdoublesided]%
\the\everysidedswitch
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-ref.lua b/Master/texmf-dist/tex/context/base/mkiv/strc-ref.lua
index c85b3338a32..bca36ccef43 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-ref.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-ref.lua
@@ -2289,7 +2289,7 @@ function genericfilters.title(data)
if data then
local titledata = data.titledata or data.useddata
if titledata then
- helpers.title(titledata.title or "?",data.metadata)
+ helpers.title(titledata.reference or titledata.title or "?",data.metadata)
end
end
end
@@ -2615,6 +2615,18 @@ implement {
-- }
implement {
+ name = "askedreference",
+ public = true,
+ protected = true,
+ actions = function()
+ local actions = references.currentset
+ if actions then
+ context("[p=%s,r=%s]",actions.prefix or "",actions.reference)
+ end
+ end
+}
+
+implement {
name = "referencerealpage",
actions = function()
local actions = references.currentset
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-ref.mkvi b/Master/texmf-dist/tex/context/base/mkiv/strc-ref.mkvi
index e774117fa50..3bf33963851 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-ref.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-ref.mkvi
@@ -167,7 +167,7 @@
\def\strc_references_placeholder
{\ifx\dotaggedplaceholder\empty\else
- \attribute\destinationattribute\lastdestinationattribute
+ \c_attr_destination\lastdestinationattribute
\dotaggedplaceholder
\fi}
@@ -373,7 +373,7 @@
\unexpanded\def\vboxreference[#1]{\boxreference[#1]\vbox}
% \ifx\currentdestinationattribute\empty
-% \begingroup\attribute\destinationattribute\currentdestinationattribute\emptyhbox\endgroup % todo
+% \begingroup\c_attr_destination\currentdestinationattribute\emptyhbox\endgroup % todo
% \fi
\def\defaultreferencepage#text{[[[#text]]]}
@@ -737,6 +737,29 @@
\def\dummyreference{{\tttf ??}}
\def\emptyreference{{\tttf !!}}
+\installtextracker
+ {structures.referencing.show}
+ {\let\strc_references_dummy\strc_references_dummy_yes}
+ {\let\strc_references_dummy\strc_references_dummy_nop}
+
+\def\strc_references_dummy_nop
+ {\dummyreference}
+
+\def\strc_references_dummy_yes
+ {\dummyreference
+ \margindata
+ [\referencingparameter\c!labelalternative]% alternative?
+ [\c!style=\referencingparameter\c!labelstyle,
+ \c!color=\referencingparameter\c!labelcolor]
+ {\askedreference}}
+
+\let\strc_references_dummy\strc_references_dummy_nop
+
+\setupreferencing
+ [\c!labelalternative=\v!inleft,
+ \c!labelcolor=darkred,
+ \c!labelstyle=\smallinfofont]
+
%D To prevent repetitive messages concerning a reference being defined, we set such
%D an unknown reference to an empty one after the first encounter.
%D
@@ -971,9 +994,9 @@
\def\strc_references_get_reference[#key][#label]% #key = number page title text default realpage ...
{\ifsecondargument
- \doifelsereferencefound{#label}{\clf_filterreference{#key}}\dummyreference
+ \doifelsereferencefound{#label}{\clf_filterreference{#key}}\strc_references_dummy
\else
- \dummyreference
+ \strc_references_dummy
\fi}
\let\ref\getreference
@@ -983,8 +1006,8 @@
\unexpanded\def\strc_references_about[#label]%
{\dontleavehmode
\begingroup
- \let\crlf\space
- \let\\\space
+ \enforced\let\crlf\space
+ \enforced\let\\\space
\postponenotes % might go
\referencingparameter\c!left
\doifelsereferencefound{#label}
@@ -1143,12 +1166,12 @@
\unexpanded\def\atpage[#label]% todo
{\doifcheckedpagestate{#label}%
- {\goto{\labeltext \v!precedingpage }[#label]}%
- {\goto{\labeltext \v!hencefore }[#label]}%
+ {\goto{\labeltext\v!precedingpage}[#label]}%
+ {\goto{\labeltext\v!hencefore}[#label]}%
{\ignorespaces}%
- {\goto{\labeltext \v!hereafter }[#label]}%
- {\goto{\labeltext \v!followingpage }[#label]}%
- {\goto{\labeltexts\v!page\dummyreference}[#label]}}
+ {\goto{\labeltext\v!hereafter}[#label]}%
+ {\goto{\labeltext\v!followingpage}[#label]}%
+ {\goto{\labeltexts\v!page\strc_references_dummy}[#label]}}
% Someone requested this but in retrospect didn't need it so we keep it as example.
% Beware: a node is injected which is why we add ignorespaces!
@@ -1262,7 +1285,7 @@
% inefficient: double resolve
\doifelsereferencefound{#label} % we need to resolve the text
{\goto{\referencesequence}[#label]}
- {\let\currentreferencecontent\dummyreference
+ {\let\currentreferencecontent\strc_references_dummy
\goto{\referencesequence}[#label]}%
\strc_references_stop_goto}
@@ -1452,12 +1475,12 @@
\newbox\referencebox
\def\revivesavedreferenceattribute % sometimes handy as no test etc needed
- {\attribute\referenceattribute\lastsavedreferenceattribute}
+ {\c_attr_reference\lastsavedreferenceattribute}
\def\strc_references_direct_goto#content[#label]% no test for valid references
{\dontleavehmode
\begingroup
- \attribute\referenceattribute\attributeunsetvalue
+ \c_attr_reference\attributeunsetvalue
\global\lastsavedreferenceattribute\attributeunsetvalue
\iflocation
\clf_injectreference
@@ -1472,7 +1495,7 @@
\setlocationattributes
\setstrut % can be option
\global\lastsavedreferenceattribute\lastreferenceattribute
- \attribute\referenceattribute\lastreferenceattribute
+ \c_attr_reference\lastreferenceattribute
\dostarttagged\t!link\empty % not here
#content%
\dostoptagged
@@ -1485,7 +1508,7 @@
{\dontleavehmode
\begingroup
\global\lastsavedreferenceattribute\attributeunsetvalue
- \attribute\referenceattribute\attributeunsetvalue
+ \c_attr_reference\attributeunsetvalue
\iflocation
\clf_injectreference
{\referenceprefix}%
@@ -1497,7 +1520,7 @@
}%
\relax
\setlocationattributes
- \attribute\referenceattribute\lastreferenceattribute
+ \c_attr_reference\lastreferenceattribute
\global\lastsavedreferenceattribute\lastreferenceattribute
\dostarttagged\t!link\empty
#content%
@@ -1512,7 +1535,7 @@
\begingroup
%\setbox\referencebox\hbox\bgroup % experiment, might change again to non \par support
\global\lastsavedreferenceattribute\attributeunsetvalue
- \attribute\referenceattribute\attributeunsetvalue
+ \c_attr_reference\attributeunsetvalue
\iflocation
\clf_doifelsereference{\referenceprefix}{#label}{\extrareferencearguments}%
{\expandtexincurrentreference
@@ -1523,7 +1546,7 @@
\setlocationattributes
\setstrut % can be option
\global\lastsavedreferenceattribute\lastreferenceattribute
- \attribute\referenceattribute\lastreferenceattribute
+ \c_attr_reference\lastreferenceattribute
\dostarttagged\t!link\empty
#content%
\dostoptagged}%
@@ -1538,12 +1561,12 @@
{\dontleavehmode
\begingroup
\global\lastsavedreferenceattribute\attributeunsetvalue
- \attribute\referenceattribute\attributeunsetvalue
+ \c_attr_reference\attributeunsetvalue
\iflocation
\setstrut % can be option
\strc_references_get_simple_reference{#internal}%
\global\lastsavedreferenceattribute\currentreferenceattribute
- \attribute\referenceattribute\currentreferenceattribute
+ \c_attr_reference\currentreferenceattribute
\setlocationattributes
\dostarttagged\t!link\empty
#content%
@@ -1579,7 +1602,7 @@
\setlocationattributes
\setstrut % can be option
\global\lastsavedreferenceattribute\lastreferenceattribute
- \attribute\referenceattribute\lastreferenceattribute
+ \c_attr_reference\lastreferenceattribute
\dostarttagged\t!link\empty
\let\stopgoto\strc_references_stop_goto_yes}
@@ -1591,7 +1614,7 @@
{\dontleavehmode
\begingroup
\global\lastsavedreferenceattribute\attributeunsetvalue
- \attribute\referenceattribute\attributeunsetvalue
+ \c_attr_reference\attributeunsetvalue
\iflocation
\clf_doifelsereference{\referenceprefix}{#label}{\extrareferencearguments}%
{\expandtexincurrentreference
@@ -1601,7 +1624,7 @@
\relax
\setlocationattributes
\global\lastsavedreferenceattribute\lastreferenceattribute
- \attribute\referenceattribute\lastreferenceattribute
+ \c_attr_reference\lastreferenceattribute
\dostarttagged\t!link\empty
#content%
\dostoptagged}%
@@ -1615,7 +1638,7 @@
{\dontleavehmode
\begingroup
\global\lastsavedreferenceattribute\attributeunsetvalue
- \attribute\referenceattribute\attributeunsetvalue
+ \c_attr_reference\attributeunsetvalue
\iflocation
\clf_injectreference
{\referenceprefix}%
@@ -1636,7 +1659,7 @@
{\dontleavehmode
\begingroup
\global\lastsavedreferenceattribute\attributeunsetvalue
- \attribute\referenceattribute\attributeunsetvalue
+ \c_attr_reference\attributeunsetvalue
\iflocation
\clf_injectreference
{\referenceprefix}%
@@ -1657,7 +1680,7 @@
{\dontleavehmode
\begingroup
\global\lastsavedreferenceattribute\attributeunsetvalue
- \attribute\referenceattribute\attributeunsetvalue
+ \c_attr_reference\attributeunsetvalue
\iflocation
\clf_injectreference
{\referenceprefix}%
@@ -1677,7 +1700,7 @@
{\dontleavehmode
\begingroup
\global\lastsavedreferenceattribute\attributeunsetvalue
- \attribute\referenceattribute\attributeunsetvalue
+ \c_attr_reference\attributeunsetvalue
\iflocation
\clf_doifelsereference{\referenceprefix}{#label}{\extrareferencearguments}%
{\expandtexincurrentreference
@@ -1700,7 +1723,7 @@
\wd\scratchbox#width%
\ht\scratchbox#height%
\global\lastsavedreferenceattribute\attributeunsetvalue
- \attribute\referenceattribute\attributeunsetvalue
+ \c_attr_reference\attributeunsetvalue
\clf_doifelsereference{\referenceprefix}{#label}{\extrareferencearguments}%
{\clf_injectcurrentreference
\global\lastsavedreferenceattribute\lastreferenceattribute
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-reg.lua b/Master/texmf-dist/tex/context/base/mkiv/strc-reg.lua
index 6873f89eb72..6e26f6f3701 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-reg.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-reg.lua
@@ -460,6 +460,7 @@ local function preprocessentries(rawdata)
local processors = rawdata.processors
local et = entries.entries
local kt = entries.keys
+ local pt = entries.processors
local entryproc = processors and processors.entry
local pageproc = processors and processors.page
local coding = rawdata.metadata.coding
@@ -483,16 +484,20 @@ local function preprocessentries(rawdata)
end
kt = lpegmatch(coding == "xml" and entrysplitter_xml or entrysplitter_tex,k)
end
+ if not pt then
+ pt = { }
+ end
--
entries = { }
local ok = false
for k=#et,1,-1 do
local etk = et[k]
local ktk = kt[k]
+ local ptk = pt[k]
if not ok and etk == "" then
entries[k] = nil
else
- entries[k] = { etk or "", ktk ~= "" and ktk or nil }
+ entries[k] = { etk or "", ktk ~= "" and ktk or false, ptk ~= "" and ptk or false }
ok = true
end
end
@@ -677,31 +682,33 @@ implement {
{ "catcodes", "integer" },
{ "own" },
{ "xmlroot" },
- { "xmlsetup" }
+ { "xmlsetup" },
}
},
{ "entries", {
{ "entries", "list" },
{ "keys", "list" },
+ { "processors", "list" },
{ "entry" },
- { "key" }
+ { "key" },
+ { "processor" },
}
},
{ "references", {
{ "internal", "integer" },
{ "section", "integer" },
{ "view" },
- { "label" }
+ { "label" },
}
},
{ "seeword", {
- { "text" }
+ { "text" },
}
},
{ "processors", {
{ "entry" },
{ "key" },
- { "page" }
+ { "page" },
}
},
{ "userdata" },
@@ -1258,6 +1265,7 @@ function registers.flush(data,options,prefixspec,pagespec)
while d < #data do
d = d + 1
local entry = data[d]
+-- inspect(entry)
local metadata = entry.metadata
local kind = metadata.kind
local list = entry.list
@@ -1266,8 +1274,9 @@ function registers.flush(data,options,prefixspec,pagespec)
e[i] = false
end
for i=1,maxlevel do
+ local li = list[i]
if list[i] then
- e[i] = list[i][1]
+ e[i] = li[1]
end
if e[i] == done[i] then
-- skip
@@ -1309,7 +1318,7 @@ function registers.flush(data,options,prefixspec,pagespec)
local processors = entry.processors
local internal = references.internal or 0
local seeparent = references.seeparent or ""
- local processor = processors and processors[1] or ""
+ local processor = (li and li[3]) or (processors and processors[1]) or ""
-- so, we need to keep e as is (local), or we need local title = e[i] ... which might be
-- more of a problem
ctx_startregisterentry(0) -- will become a counter
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-reg.mkiv b/Master/texmf-dist/tex/context/base/mkiv/strc-reg.mkiv
index e955c700ba7..1e632eebc39 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-reg.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-reg.mkiv
@@ -48,7 +48,7 @@
\let\strc_registers_setup_saved\setupregister
-\unexpanded\def\setupregister % maybe we should drop the plural form
+\unexpanded\overloaded\def\setupregister % maybe we should drop the plural form
{\dotripleempty\strc_registers_setup}
\def\strc_registers_setup[#1][#2][#3]%
@@ -311,7 +311,7 @@
% needs thinking ... bla\index{bla}. will break before the . but adding a
% penalty is also no solution
\dostarttagged\t!registerlocation\currentregister
- \attribute\destinationattribute\lastdestinationattribute \signalcharacter % no \strut as it will be removed during cleanup
+ \c_attr_destination\lastdestinationattribute \signalcharacter % no \strut as it will be removed during cleanup
\dotagregisterlocation
\dostoptagged
\endgroup}
@@ -344,7 +344,7 @@
\xdef\currentregistersynchronize{\clf_deferredenhanceregister{\currentregister}\number\currentregisternumber}%
\currentregistersynchronize % here?
\dostarttagged\t!registerlocation\currentregister
- \attribute\destinationattribute\lastdestinationattribute \signalcharacter % no \strut as it will be removed during cleanup
+ \c_attr_destination\lastdestinationattribute \signalcharacter % no \strut as it will be removed during cleanup
\dotagregisterlocation
\dostoptagged
\endgroup}
@@ -564,7 +564,7 @@
view {\interactionparameter\c!focus}%
\relax % this will change
\dostarttagged\t!registerlocation\currentregister
- \attribute\destinationattribute\lastdestinationattribute \signalcharacter % no \strut as it will be removed during cleanup
+ \c_attr_destination\lastdestinationattribute \signalcharacter % no \strut as it will be removed during cleanup
\dotagregisterlocation
\dostoptagged
\endgroup}
@@ -618,7 +618,7 @@
\edef\currentregister{\firstinset{#1}}%
\the\everyplaceregister
\ifnum\namedmixedcolumnsparameter\currentregister\c!n>\plusone
- \startmixedcolumns[\currentregister]
+ \startmixedcolumns[\currentregister]%
\strc_registers_place_indeed{#1}%
\stopmixedcolumns
\else
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-ren.mkiv b/Master/texmf-dist/tex/context/base/mkiv/strc-ren.mkiv
index 59f3a9256ee..359bd6aecc0 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-ren.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-ren.mkiv
@@ -90,9 +90,9 @@
\def\setinlineheadreferenceattributes
{\ifconditional\headisdisplay \else \iflocation
- \attribute\destinationattribute\currentstructureattribute
- \attribute\referenceattribute \currentstructurereferenceattribute
- % \attribute\internalattribute \locationcount
+ \c_attr_destination\currentstructureattribute
+ \c_attr_reference \currentstructurereferenceattribute
+ % \c_attr_internal \locationcount
\fi \fi}
\def\docheckheadreference
@@ -187,7 +187,7 @@
\ifx\p_strut\v!no
\setnostrut
\fi
- \let\\\strc_rendering_shortcut_backslash}
+ \enforced\let\\\strc_rendering_shortcut_backslash}
\unexpanded\def\strc_rendering_shortcut_backslash
{\crlf
@@ -745,8 +745,8 @@
\vbox {
\headsetupspacing
\veryraggedcenter
- \let\\\endgraf
- \let\crlf\endgraf
+ \enforced\let\\\endgraf
+ \enforced\let\crlf\endgraf
\ifconditional\headshownumber
\strut
\headnumbercontent
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-sec.mkiv b/Master/texmf-dist/tex/context/base/mkiv/strc-sec.mkiv
index 0e30d92fa03..8d326e30022 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-sec.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-sec.mkiv
@@ -145,6 +145,7 @@
\xdef\currentstructureshownumber {\structureparameter\c!number}%
\xdef\currentstructuresaveinlist {\structureparameter\c!saveinlist}%
\xdef\currentstructureincrementnumber{\structureparameter\c!incrementnumber}%
+ \xdef\currentstructureplaceholder {\structureparameter\c!placeholder}%
\ifx\currentstructureexpansion\s!xml
\xmlstartraw
\xdef\currentstructuretitle {\structureparameter\c!title}%
@@ -797,7 +798,7 @@
\glet\currentstructuresynchronize\donothing
\to \everyheadsynchronization
-\unexpanded\def\theheadsynchonization
+\unexpanded\def\theheadsynchronization
{% no, interferes: \signalcharacter
\the\everyheadsynchronization}
@@ -926,7 +927,7 @@
\strc_sectioning_register{#1}{#2}{#3}% after optional \page
\strc_sectioning_report
\dostarttagged\t!sectioncaption\empty
- \let\getheadsyncs\theheadsynchonization
+ \let\getheadsyncs\theheadsynchronization
\let\getheadtitle\fullheadtitle
\ifconditional\headshownumber
\let\getheadnumber\fullheadnumber
@@ -940,7 +941,7 @@
\strc_sectioning_register{#1}{#2}{#3}% after optional \page
\strc_sectioning_report
\dostarttagged\t!sectioncaption\empty
- \let\getheadsyncs\theheadsynchonization
+ \let\getheadsyncs\theheadsynchronization
\ifconditional\c_strc_sectioning_section
\strc_rendering_place_head_section
\else
@@ -952,7 +953,7 @@
\strc_sectioning_register{#1}{#2}{#3}% after optional \page
\strc_sectioning_report
\dostarttagged\t!sectioncaption\empty
- \let\getheadsyncs\theheadsynchonization
+ \let\getheadsyncs\theheadsynchronization
\strc_rendering_place_head_empty % just flush 'm
\dostoptagged
\strc_sectioning_after_nop
@@ -963,7 +964,7 @@
\strc_sectioning_register{#1}{#2}{#3}% after optional \page
\strc_sectioning_report
\dostarttagged\t!sectioncaption\empty
- \let\getheadsyncs\theheadsynchonization
+ \let\getheadsyncs\theheadsynchronization
\let\getheadtitle\fullheadtitle
\strc_rendering_place_head_text
\dostoptagged
@@ -971,7 +972,7 @@
\else\ifconditional\c_strc_sectioning_hidden
\strc_sectioning_register{#1}{#2}{#3}% after optional \page
\strc_sectioning_report
- \let\getheadsyncs\theheadsynchonization
+ \let\getheadsyncs\theheadsynchronization
\dostarttagged\t!sectioncaption\empty
\ifconditional\c_strc_sectioning_section
\strc_rendering_place_head_section
@@ -985,7 +986,7 @@
\strc_sectioning_register{#1}{#2}{#3}% after optional \page
\strc_sectioning_report
\dostarttagged\t!sectioncaption\empty
- \let\getheadsyncs\theheadsynchonization
+ \let\getheadsyncs\theheadsynchronization
\strc_rendering_place_head_empty % just flush 'm
\dostoptagged
\strc_sectioning_after_nop
@@ -997,12 +998,26 @@
\setfalse\c_strc_sectioning_ignore_page
% ignorespaces prevents spaces creeping in when after=\dontleavehmode
\dostarttagged\t!sectioncontent\empty
- \ifconditional\headisdisplay
- \ignorespaces
+ \ifx\currentstructureplaceholder\empty
+ \ifconditional\headisdisplay
+ \doubleexpandafter\ignorespaces
+ \else
+ \doubleexpandafter\ignorepars
+ \fi
\else
- \expandafter\GotoPar
+ \expandafter\strc_sectioning_placeholder
\fi}
+%D \starttyping
+%D \startsubject[placeholder=todo,title=one]
+%D whatever one
+%D \stopsubject
+%D \stoptyping
+
+\def\strc_sectioning_placeholder
+ {\placeholder[\currentstructureplaceholder]%
+ \gobblenested{\e!start\currenthead}{\e!stop\currenthead}{\e!stop\currenthead}}
+
% typesetting (the getters are public)
\unexpanded\def\strc_rendering_place_head_number_and_text
@@ -1029,14 +1044,14 @@
\def\strc_sectioning_delayed_flush
{\ifvoid\b_sectioning_delayed\else
- \smashboxed\b_sectioning_delayed
+ \smashedbox\b_sectioning_delayed
\fi}
\unexpanded\def\strc_rendering_place_head_section % see hidden below
{\global\setbox\b_sectioning_delayed\hpack\bgroup
\setmarking[\currentheadcoupling]{li::\currentstructurelistnumber}%
\hpack\headreferenceattributes{}% also does the mark
- \theheadsynchonization
+ \theheadsynchronization
\egroup}
\unexpanded\def\strc_rendering_place_head_hidden % maybe trialtypesetting check
@@ -1046,7 +1061,7 @@
{\noexpand\letgvalue{\??hiddenheadsync\currenthead}\relax
\noexpand\setmarking[\currentheadcoupling]{li::\currentstructurelistnumber}%
\hpack\headreferenceattributes{}% otherwise no destination ... maybe tag ref as hidden and fall back on page reference
- \theheadsynchonization}} % and it's a node anyway
+ \theheadsynchronization}} % and it's a node anyway
\def\synchronizehead #1{\csname\??hiddenheadsync#1\endcsname}
\def\theheadreferenceattributes#1{\csname\??hiddenheadattr#1\endcsname}
@@ -1283,6 +1298,14 @@
\fi
\glet\previoushead\currenthead}
+\def\strc_sectioning_depth_correction
+ {\ifvmode
+ \edef\p_depthcorrection{\headparameter\c!depthcorrection}%
+ \ifx\p_depthcorrection\v!strut
+ \prevdepth\strutdepth
+ \fi
+ \fi}
+
\def\strc_sectioning_after_yes
{\ifconditional\headisdisplay
\ifconditional\c_strc_sectioning_auto_break
@@ -1290,6 +1313,7 @@
\fi
\strc_sectioning_empty_correction
\headparameter\c!after
+ \strc_sectioning_depth_correction
\fi}
\unexpanded\def\strc_sectioning_prevent_page_break % see strc-con
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-syn.lua b/Master/texmf-dist/tex/context/base/mkiv/strc-syn.lua
index eec025593d7..c0ebb556cc7 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-syn.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-syn.lua
@@ -37,6 +37,20 @@ end
local function finalizer()
for entry, data in next, tobesaved do
data.hash = nil
+ -- being sparse can be an option but often we actually do want the
+ -- whole list so we don't do this ... only as possible option
+ --
+ -- local entries = data.entries
+ -- local t = { }
+ -- local n = 0
+ -- for i=1,#entries do
+ -- local e = entries[i]
+ -- if e.definition.shown then
+ -- n = n + 1
+ -- t[n] = e
+ -- end
+ -- end
+ -- data.entries = t
end
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-syn.mkiv b/Master/texmf-dist/tex/context/base/mkiv/strc-syn.mkiv
index 7f71e88f52f..cdede1d0da0 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-syn.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-syn.mkiv
@@ -383,6 +383,7 @@
\startsetups[\??simplelistrenderings::\v!text]
\begingroup
+ \usehyphensparameter\simplelistparameter
\usesimpleliststyleandcolor\c!textstyle\c!textcolor
\simplelistparameter\c!textcommand{\currentsynonymmeaning}%
\endgroup
@@ -663,7 +664,8 @@
\setupsynonyms
[\v!abbreviation]
- [\c!textstyle=\v!capital]
+ [\c!hyphens=\v!no, % new, not yet in setup definitions
+ \c!textstyle=\v!capital]
\definesorting
[\v!logo]
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-tag.lua b/Master/texmf-dist/tex/context/base/mkiv/strc-tag.lua
index 88e0f108dc9..83ff515e30c 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-tag.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-tag.lua
@@ -104,6 +104,7 @@ local properties = allocate { -- todo: more "record = true" to improve forma
lines = { pdf = "Code", nature = "display" },
line = { pdf = "Code", nature = "mixed" },
+ linenumber = { pdf = "Span", nature = "inline" },
synonym = { pdf = "Span", nature = "inline" },
sorting = { pdf = "Span", nature = "inline" },
@@ -265,8 +266,8 @@ end
function structures.atlocation(str)
local specification = taglist[texgetattribute(a_tagged)]
if specification then
+ local list = specification.taglist
if list then
- local taglist = specification.taglist
local pattern = patterns[str]
for i=#list,1,-1 do
if find(list[i],pattern) then
@@ -362,7 +363,9 @@ function tags.start(tag,specification)
metadata = nil
end
local userdata = specification.userdata
- if userdata ~= "" and type(userdata) == "string" then
+ if userdata == "" then
+ specification.userdata = nil
+ elseif type(userdata) == "string" then
specification.userdata = settings_to_hash(userdata)
end
local detail = specification.detail
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-tag.mkiv b/Master/texmf-dist/tex/context/base/mkiv/strc-tag.mkiv
index 83ee030902a..bae04461243 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-tag.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-tag.mkiv
@@ -20,168 +20,173 @@
\unprotect
-%D Eventually these labels will either move to the modules
-%D where they're used, or they will en dup in mult-tag.
-
-\def\t!document {document} % Div
-
-\def\t!division {division} % Div
-\def\t!paragraph {paragraph} % P
-\def\t!p {p} % P
-\def\t!construct {construct} % Span
-\def\t!highlight {highlight} % Span
-
-\def\t!section {section} % Sect
-\def\t!sectioncaption {sectioncaption} % Div
-\def\t!sectiontitle {sectiontitle} % H
-\def\t!sectionnumber {sectionnumber} % H
-\def\t!sectioncontent {sectioncontent} % Div
-
-\def\t!itemgroup {itemgroup} % L
-\def\t!item {item} % Li
-\def\t!itemtag {itemtag} % Lbl
-\def\t!itemcontent {itemcontent} % LBody
-\def\t!itemhead {itemhead} % Div
-\def\t!itembody {itembody} % Div
-
-\def\t!description {description} % Li
-\def\t!descriptiontag {descriptiontag} % Lbl
-\def\t!descriptioncontent {descriptioncontent} % LBody
-\def\t!descriptionsymbol {descriptionsymbol} % Span
-
-\let\t!construction \t!description
-\let\t!constructiontag \t!descriptiontag
-\let\t!constructioncontent \t!descriptioncontent
-\let\t!constructionsymbol \t!descriptionsymbol
-
-\def\t!verbatimblock {verbatimblock} % Code
-\def\t!verbatimlines {verbatimlines} % Code
-\def\t!verbatimline {verbatimline} % Code
-\def\t!verbatim {verbatim} % Code
-
-\def\t!lines {lines} % Code
-\def\t!line {line} % Code
-
-\def\t!sorting {sorting} % Span
-\def\t!synonym {synonym} % Span
-
-\def\t!register {register} % Div
-\def\t!registerlocation {registerlocation} % Span
-\def\t!registersection {registersection} % Div
-\def\t!registertag {registertag} % Span
-\def\t!registerentries {registerentries} % Div
-\def\t!registerentry {registerentry} % Span
-\def\t!registercontent {registercontent} % Span
-\def\t!registersee {registersee} % Span
-\def\t!registersection {registersection} % Span
-\def\t!registerpages {registerpages} % Span
-\def\t!registerpage {registerpage} % Span
-\def\t!registerpagerange {registerpagerange} % Span
-\def\t!registerfrompage {registerfrompage} % Span
-\def\t!registertopage {registertopage} % Span
-\def\t!registerseparator {registerseparator} % Span
-
-\def\t!table {table} % Table
-\def\t!tablerow {tablerow} % TR
-\def\t!tablecell {tablecell} % TD
-\def\t!tableheadcell {tableheadcell} % TH
-\def\t!tablehead {tablehead} % THEAD
-\def\t!tablebody {tablebody} % TBODY
-\def\t!tablefoot {tablefoot} % TFOOT
-
-
-\def\t!tabulate {tabulate} % Table
-\def\t!tabulaterow {tabulaterow} % TR
-\def\t!tabulatecell {tabulatecell} % TD
-\def\t!tabulateheadcell {tabulateheadcell} % TH
-\def\t!tabulatehead {tabulatehead} % THEAD
-\def\t!tabulatebody {tabulatebody} % TBODY
-\def\t!tabulatefoot {tabulatefoot} % TFOOT
-
-\def\t!math {math} % math
-\def\t!mathtable {mtable} % Table
-\def\t!mathtablerow {mtr} % TR
-\def\t!mathtablecell {mtd} % TD
-\def\t!mathaction {maction} %
-\def\t!mathstacker {mstacker}
-\def\t!mathstackertop {mstackertop}
-\def\t!mathstackermid {mstackermid}
-\def\t!mathstackerbot {mstackerbot}
-
-\def\t!munderover {munderover} % special cases
-\def\t!munder {munder} % special cases
-\def\t!mover {mover} % special cases
-
-\def\t!list {list} % TOC
-\def\t!listitem {listitem} % TOCI
-\def\t!listtag {listtag} % Lbl
-\def\t!listcontent {listcontent} % P
-\def\t!listdata {listdata} % P
-\def\t!listpage {listpage} % Reference
-\def\t!listtext {listtext} % Span
-
-\def\t!delimitedblock {delimited} % BlockQuote
-\def\t!delimited {delimited} % Quote
-\def\t!delimitedsymbol {delimitedsymbol} % Span
-\def\t!delimitedcontent {delimitedcontent} % Span
-\def\t!subsentence {subsentence} % Span
-\def\t!subsentencecontent {subsentencecontent} % Span
-\def\t!subsentencesymbol {subsentencesymbol} % Span
-
-\def\t!float {float} % Div
-\def\t!floatcaption {floatcaption} % Caption
-\def\t!floatlabel {floatlabel} % Span
-\def\t!floattext {floattext} % Span
-\def\t!floatnumber {floatnumber} % Span
-\def\t!floatcontent {floatcontent} % P
-
-\def\t!image {image} % P
-
-\def\t!mpgraphic {mpgraphic} % P
-
-\def\t!formulaset {formulaset} % Div
-\def\t!formula {formula} % Div
-\def\t!formulacaption {formulacaption} % Span
-\def\t!formulalabel {formulalabel} % Span
-\def\t!formulanumber {formulanumber} % P
-\def\t!formulacontent {formulacontent} % P
-\def\t!subformula {subformula} % Div
-
-\def\t!link {link} % Link
-\def\t!reference {reference} % Span
-
-\def\t!margintext {margintext} % Span
-\def\t!margintextblock {margintextblock} % Div
-\def\t!marginanchor {marginanchor} % Span
+%D Eventually these labels will either move to the modules where they're used, or
+%D they will en dup in mult-tag.
+
+\definetagconstant{document} % Div
+
+\definetagconstant{division} % Div
+\definetagconstant{paragraph} % P
+\definetagconstant{p} % P
+\definetagconstant{construct} % Span
+\definetagconstant{highlight} % Span
+
+\definetagconstant{section} % Sect
+\definetagconstant{sectioncaption} % Div
+\definetagconstant{sectiontitle} % H
+\definetagconstant{sectionnumber} % H
+\definetagconstant{sectioncontent} % Div
+
+\definetagconstant{itemgroup} % L
+\definetagconstant{item} % Li
+\definetagconstant{itemtag} % Lbl
+\definetagconstant{itemcontent} % LBody
+\definetagconstant{itemhead} % Div
+\definetagconstant{itembody} % Div
+
+\definetagconstant{description} % Li
+\definetagconstant{descriptiontag} % Lbl
+\definetagconstant{descriptioncontent} % LBody
+\definetagconstant{descriptionsymbol} % Span
+
+\aliastagconstant{construction} {description}
+\aliastagconstant{constructiontag} {descriptiontag}
+\aliastagconstant{constructioncontent}{descriptioncontent}
+\aliastagconstant{constructionsymbol} {descriptionsymbol}
+
+\definetagconstant{verbatimblock} % Code
+\definetagconstant{verbatimlines} % Code
+\definetagconstant{verbatimline} % Code
+\definetagconstant{verbatim} % Code
+
+\definetagconstant{lines} % Code
+\definetagconstant{line} % Code
+\definetagconstant{linenumber} % Span
+
+\definetagconstant{sorting} % Span
+\definetagconstant{synonym} % Span
+
+\definetagconstant{register} % Div
+\definetagconstant{registerlocation} % Span
+\definetagconstant{registersection} % Div
+\definetagconstant{registertag} % Span
+\definetagconstant{registerentries} % Div
+\definetagconstant{registerentry} % Span
+\definetagconstant{registercontent} % Span
+\definetagconstant{registersee} % Span
+\definetagconstant{registerpages} % Span
+\definetagconstant{registerpage} % Span
+\definetagconstant{registerpagerange} % Span
+\definetagconstant{registerfrompage} % Span
+\definetagconstant{registertopage} % Span
+\definetagconstant{registerseparator} % Span
+
+\definetagconstant{table} % Table
+\definetagconstant{tablerow} % TR
+\definetagconstant{tablecell} % TD
+\definetagconstant{tableheadcell} % TH
+\definetagconstant{tablehead} % THEAD
+\definetagconstant{tablebody} % TBODY
+\definetagconstant{tablefoot} % TFOOT
+
+\definetagconstant{tabulate} % Table
+\definetagconstant{tabulaterow} % TR
+\definetagconstant{tabulatecell} % TD
+\definetagconstant{tabulateheadcell} % TH
+\definetagconstant{tabulatehead} % THEAD
+\definetagconstant{tabulatebody} % TBODY
+\definetagconstant{tabulatefoot} % TFOOT
+
+\definetagconstant{math} % math
+\definetagconstant{mtable} % Table
+\definetagconstant{mtr} % TR
+\definetagconstant{mtd} % TD
+\definetagconstant{maction} %
+\definetagconstant{mstacker}
+\definetagconstant{mstackertop}
+\definetagconstant{mstackermid}
+\definetagconstant{mstackerbot}
+
+\aliastagconstant{mtablerow} {mtr}
+\aliastagconstant{mtablecell}{mtd}
+
+\definetagconstant{munderover} % special cases
+\definetagconstant{munder} % special cases
+\definetagconstant{mover} % special cases
+
+\definetagconstant{list} % TOC
+\definetagconstant{listitem} % TOCI
+\definetagconstant{listtag} % Lbl
+\definetagconstant{listcontent} % P
+\definetagconstant{listdata} % P
+\definetagconstant{listpage} % Reference
+\definetagconstant{listtext} % Span
+
+\definetagconstant{delimited} % BlockQuote
+%definetagconstant{delimited} % Quote
+\definetagconstant{delimitedsymbol} % Span
+\definetagconstant{delimitedcontent} % Span
+
+\aliastagconstant{delimitedblock}{delimited}
+
+\definetagconstant{subsentence} % Span
+\definetagconstant{subsentencecontent} % Span
+\definetagconstant{subsentencesymbol} % Span
+
+\definetagconstant{float} % Div
+\definetagconstant{floatcaption} % Caption
+\definetagconstant{floatlabel} % Span
+\definetagconstant{floattext} % Span
+\definetagconstant{floatnumber} % Span
+\definetagconstant{floatcontent} % P
+
+\definetagconstant{image} % P
+
+\definetagconstant{mpgraphic} % P
+
+\definetagconstant{formulaset} % Div
+\definetagconstant{formula} % Div
+\definetagconstant{formulacaption} % Span
+\definetagconstant{formulalabel} % Span
+\definetagconstant{formulanumber} % P
+\definetagconstant{formulacontent} % P
+\definetagconstant{subformula} % Div
+
+\definetagconstant{link} % Link
+\definetagconstant{reference} % Span
+
+\definetagconstant{margintext} % Span
+\definetagconstant{margintextblock} % Div
+\definetagconstant{marginanchor} % Span
% we might opt for verbose variants so this is experimental:
-\def\t!label {label} % Span
-\def\t!number {number} % Span
+\definetagconstant{label} % Span
+\definetagconstant{number} % Span
-\def\t!ignore {ignore} % Span
-\def\t!private {private} % Span
+\definetagconstant{ignore} % Span
+\definetagconstant{private} % Span
-\def\t!mid {mid} % Span
-\def\t!sub {sub} % Span
-\def\t!sup {sup} % Span
-\def\t!subsup {subsup} % Span
+\definetagconstant{mid} % Span
+\definetagconstant{sub} % Span
+\definetagconstant{sup} % Span
+\definetagconstant{subsup} % Span
-\def\t!unit {unit} % Span
-\def\t!quantity {quantity} % Span
-\def\t!number {number} % Span
+\definetagconstant{unit} % Span
+\definetagconstant{quantity} % Span
+%definetagconstant{number} % Span
-\def\t!combination {combination} % Span
-\def\t!combinationpair {combinationpair} % Span
-\def\t!combinationcontent {combinationcontent} % Span
-\def\t!combinationcaption {combinationcaption} % Span
+\definetagconstant{combination} % Span
+\definetagconstant{combinationpair} % Span
+\definetagconstant{combinationcontent} % Span
+\definetagconstant{combinationcaption} % Span
-\def\t!publications {publications} % Span
-\def\t!publication {publication} % Span
-\def\t!pubfld {pubfld} % Span
+\definetagconstant{publications} % Span
+\definetagconstant{publication} % Span
+\definetagconstant{pubfld} % Span
-\def\t!block {block} % Div
-\def\t!userdata {userdata} % Div
+\definetagconstant{block} % Div
+\definetagconstant{userdata} % Div
% \setuptaglabeltext
% [en]
@@ -329,11 +334,8 @@
\chardef\strc_tags_placeholder_char\zerocount % "FFFC
-\unexpanded\def\strc_tags_enable
- {% once enable one is toast
- \global\settrue\c_strc_tags_enabled
- % and gets:
- \let\dotaggedplaceholder \strc_tags_placeholder_char
+\unexpanded\def\strc_tags_enable_indeed
+ {\let\dotaggedplaceholder \strc_tags_placeholder_char
\let\dostarttagged \strc_tags_enabled_start_detail
\let\dostarttaggednodetail\strc_tags_enabled_start_no_detail
\let\dostarttaggedchained \strc_tags_enabled_start_chained
@@ -341,6 +343,12 @@
\let\dostartignoretagging \strc_tags_start_yes_ignore
\let\dostopignoretagging \strc_tags_stop_yes_ignore}
+\unexpanded\def\strc_tags_enable
+ {% once enable one is toast
+ \global\settrue\c_strc_tags_enabled
+ % and gets:
+ \strc_tags_enable_indeed}
+
\unexpanded\def\strc_tags_disable
{\ifconditional\c_strc_tags_enabled
% so now all are artifacts
@@ -411,7 +419,7 @@
\to \everysetuptagging
\unexpanded\def\forgettagging
- {\attribute\taggedattribute\attributeunsetvalue}
+ {\c_attr_tagged\attributeunsetvalue}
\setuptagging
[\c!state=\v!stop,
diff --git a/Master/texmf-dist/tex/context/base/mkiv/supp-box.lua b/Master/texmf-dist/tex/context/base/mkiv/supp-box.lua
index e547c8710d6..4914b6818f1 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/supp-box.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/supp-box.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['supp-box'] = {
version = 1.001,
+ optimize = true,
comment = "companion to supp-box.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
@@ -28,6 +29,11 @@ local vlist_code = nodecodes.vlist
local glue_code = nodecodes.glue
local penalty_code = nodecodes.penalty
local glyph_code = nodecodes.glyph
+local par_code = nodecodes.par
+
+local indent_code = nodes.listcodes.indent
+
+local hmode_code = tex.modelevels.horizontal
local nuts = nodes.nuts
local tonut = nuts.tonut
@@ -39,11 +45,13 @@ local getprev = nuts.getprev
local getboth = nuts.getboth
local getdisc = nuts.getdisc
local getid = nuts.getid
+local getsubtype = nuts.getsubtype
local getlist = nuts.getlist
local getattribute = nuts.getattribute
local getbox = nuts.getbox
local getdirection = nuts.getdirection
local getwidth = nuts.getwidth
+local getwhd = nuts.getwhd
local takebox = nuts.takebox
----- setfield = nuts.setfield
@@ -70,6 +78,7 @@ local getdimensions = nuts.dimensions
local hpack = nuts.hpack
local vpack = nuts.vpack
local traverse_id = nuts.traverse_id
+local traverse = nuts.traverse
local free = nuts.free
local findtail = nuts.tail
@@ -89,6 +98,7 @@ local setlistcolor = nodes.tracers.colors.setlist
local texget = tex.get
local texgetbox = tex.getbox
local texsetdimen = tex.setdimen
+local texgetnest = tex.getnest
local function hyphenatedlist(head,usecolor)
local current = head and tonut(head)
@@ -825,3 +835,68 @@ implement {
context(limitate(t))
end,
}
+
+implement {
+ name = "doifelseindented",
+ public = true,
+ protected = true,
+ actions = function()
+ local n = texgetnest()
+ local b = false
+ if n.mode == hmode_code then
+ n = tonut(n.head)
+ while n do
+ n = getnext(n)
+ if n then
+ local id = getid(n)
+ if id == hlist_code then
+ if getsubtype(n) == indent_code then
+ b = getwidth(n) > 0
+ break
+ end
+ elseif id ~= par_code then
+ break
+ end
+ end
+ end
+ end
+ commands.doifelse(b)
+ end,
+}
+
+implement {
+ name = "noflinesinbox",
+ public = true,
+ protected = false,
+ arguments = "integer",
+ actions = function(n)
+ local c = 0
+ local b = getbox(n)
+ if b then
+ b = getlist(b)
+ if b then
+ for n, id in traverse(b) do
+ if id == hlist_code or id == vlist_code then
+ c = c + 1
+ end
+ end
+ end
+ end
+ context(c)
+ end,
+}
+
+do
+
+ local takebox = tex.takebox
+
+ interfaces.implement {
+ name = "thebox",
+ public = true,
+ arguments = "integer",
+ actions = function(n)
+ context(takebox(n))
+ end
+ }
+
+end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/supp-box.mkiv b/Master/texmf-dist/tex/context/base/mkiv/supp-box.mkiv
index d43459c631b..16f09302301 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/supp-box.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/supp-box.mkiv
@@ -66,7 +66,7 @@
%D The next macro suppresses over- and underfull messages which often makes sense
%D when we deal with boxes.
-\unexpanded\def\dontcomplain
+\protected\def\dontcomplain
{\hbadness\plustenthousand
\vbadness\plustenthousand
\hfuzz \maxdimen
@@ -112,16 +112,16 @@
%D Smashing is introduced in \PLAIN\ \TEX, and stands for reducing the dimensions of
%D a box to zero. The most resolute one is presented first.
-\unexpanded\def\smashbox#1%
- {\wd#1\zeropoint
- \ht#1\zeropoint
- \dp#1\zeropoint}
+% \protected\def\smashbox#1%
+% {\wd#1\zeropoint
+% \ht#1\zeropoint
+% \dp#1\zeropoint}
-\unexpanded\def\smashboxed#1%
- {\wd#1\zeropoint
- \ht#1\zeropoint
- \dp#1\zeropoint
- \box#1\relax}
+% \protected\def\smashboxed#1%
+% {\wd#1\zeropoint
+% \ht#1\zeropoint
+% \dp#1\zeropoint
+% \box#1\relax}
%D \macros
%D {hsmashbox,vsmashbox}
@@ -129,10 +129,10 @@
%D Smashing can be used for overlaying boxes. Depending on the mode, horizontal or
%D vertical, one can use:
-\unexpanded\def\hsmashbox#1%
+\protected\def\hsmashbox#1%
{\wd#1\zeropoint}
-\unexpanded\def\vsmashbox#1%
+\protected\def\vsmashbox#1%
{\ht#1\zeropoint
\dp#1\zeropoint}
@@ -140,7 +140,7 @@
\newcount\c_boxes_register
-\unexpanded\def\smashbox
+\protected\def\smashbox
{\afterassignment\syst_boxes_smash_boxes_register\c_boxes_register}
\def\syst_boxes_smash_boxes_register
@@ -148,28 +148,30 @@
\ht\c_boxes_register\zeropoint
\dp\c_boxes_register\zeropoint}
-\unexpanded\def\hsmashbox
+\protected\def\hsmashbox
{\afterassignment\syst_boxes_hsmashed_boxes_register\c_boxes_register}
\def\syst_boxes_hsmashed_boxes_register
{\wd\c_boxes_register\zeropoint}
-\unexpanded\def\vsmashbox
+\protected\def\vsmashbox
{\afterassignment\syst_boxes_vsmashed_boxes_register\c_boxes_register}
\def\syst_boxes_vsmashed_boxes_register
{\ht\c_boxes_register\zeropoint
\dp\c_boxes_register\zeropoint}
-\unexpanded\def\smashedbox
+\protected\def\smashedbox
{\afterassignment\syst_boxes_smashed_boxes_register\c_boxes_register}
-\unexpanded\def\syst_boxes_smashed_boxes_register
+\protected\def\syst_boxes_smashed_boxes_register
{\wd\c_boxes_register\zeropoint
\ht\c_boxes_register\zeropoint
\dp\c_boxes_register\zeropoint
\box\c_boxes_register}
+\let\smashboxed\smashedbox
+
%D \macros
%D {hsmash,vsmash,
%D hsmashed,vsmashed}
@@ -178,23 +180,23 @@
%D some subtle differences betreen the smash and smashed alternatives. The later
%D ones reduce all dimensions to zero.
-\unexpanded\def\hsmash {\bgroup\dowithnextboxcs\syst_boxes_hsmashed_nextbox\hbox}
-\unexpanded\def\vsmash {\bgroup\dowithnextboxcs\syst_boxes_vsmashed_nextbox\vbox}
-\unexpanded\def\hsmashed{\bgroup\dowithnextboxcs\syst_boxes_smashed_nextbox \hbox}
-\unexpanded\def\vsmashed{\bgroup\dowithnextboxcs\syst_boxes_smashed_nextbox \vbox}
+\protected\def\hsmash {\bgroup\dowithnextboxcs\syst_boxes_hsmashed_nextbox\hbox}
+\protected\def\vsmash {\bgroup\dowithnextboxcs\syst_boxes_vsmashed_nextbox\vbox}
+\protected\def\hsmashed{\bgroup\dowithnextboxcs\syst_boxes_smashed_nextbox \hbox}
+\protected\def\vsmashed{\bgroup\dowithnextboxcs\syst_boxes_smashed_nextbox \vbox}
-\unexpanded\def\syst_boxes_hsmashed_nextbox
+\protected\def\syst_boxes_hsmashed_nextbox
{\wd\nextbox\zeropoint
\box\nextbox
\egroup}
-\unexpanded\def\syst_boxes_vsmashed_nextbox
+\protected\def\syst_boxes_vsmashed_nextbox
{\ht\nextbox\zeropoint
\dp\nextbox\zeropoint
\box\nextbox
\egroup}
-\unexpanded\def\syst_boxes_smashed_nextbox
+\protected\def\syst_boxes_smashed_nextbox
{\ht\nextbox\zeropoint
\dp\nextbox\zeropoint
\wd\nextbox\zeropoint
@@ -211,16 +213,16 @@
%D \smashedvbox to ... {...}
%D \stoptyping
-\unexpanded\def\smashedhbox{\hpack\bgroup\dowithnextboxcs\syst_boxes_smashed_nextbox\hbox}
-\unexpanded\def\smashedvbox{\vpack\bgroup\dowithnextboxcs\syst_boxes_smashed_nextbox\vbox}
+\protected\def\smashedhbox{\hpack\bgroup\dowithnextboxcs\syst_boxes_smashed_nextbox\hbox}
+\protected\def\smashedvbox{\vpack\bgroup\dowithnextboxcs\syst_boxes_smashed_nextbox\vbox}
%D First we define a helper. We use a \LUATEX\ feature in order to avoid
%D mathpalettes.
\newcount\c_boxes_math_style
-\unexpanded\def\syst_boxes_math_set_nextbox#1%
- {\c_boxes_math_style\mathstyle
+\protected\def\syst_boxes_math_set_nextbox#1%
+ {\c_boxes_math_style\normalmathstyle
\setbox\nextbox\hbox{\normalstartimath\mathsurround\zeropoint\triggermathstyle\c_boxes_math_style{#1}\normalstopimath}}
%D \macros
@@ -230,7 +232,7 @@
%D catcode safer. It is needed by the math module (although the \type {\leavevmode}
%D is not added here).
-\unexpanded\def\smash
+\protected\def\smash
{\begingroup
\futurelet\nexttoken\syst_boxes_smash}
@@ -309,9 +311,9 @@
%D {\mathchoice}, the next macro looks ugly. We also take care of non||braced
%D arguments.
-\unexpanded\def\phantom {\begingroup\futurelet\nexttoken\syst_boxes_phantom_indeed }
-\unexpanded\def\vphantom{\begingroup\futurelet\nexttoken\syst_boxes_phantom_indeed_v}
-\unexpanded\def\hphantom{\begingroup\futurelet\nexttoken\syst_boxes_phantom_indeed_h}
+\protected\def\phantom {\begingroup\futurelet\nexttoken\syst_boxes_phantom_indeed }
+\protected\def\vphantom{\begingroup\futurelet\nexttoken\syst_boxes_phantom_indeed_v}
+\protected\def\hphantom{\begingroup\futurelet\nexttoken\syst_boxes_phantom_indeed_h}
\def\syst_boxes_phantom_math #1{\syst_boxes_math_set_nextbox{#1}\syst_boxes_phantom_make }
\def\syst_boxes_phantom_math_v#1{\syst_boxes_math_set_nextbox{#1}\syst_boxes_phantom_make_v}
@@ -375,7 +377,7 @@
%D We also define plain's \type {\mathstrut}.
-\unexpanded\def\mathstrut{\vphantom(} % can be made faster by inlining
+\protected\def\mathstrut{\vphantom(} % can be made faster by inlining
%D \macros
%D {getboxheight}
@@ -409,7 +411,7 @@
%D The next alternative is slightly more clever, since it accepts \type {{12}} as
%D well as \type {12} as box number.
-\unexpanded\def\getboxheight#1\of#2\box#3%
+\protected\def\getboxheight#1\of#2\box#3%
{\def\next{#1\dimexpr\ht\c_boxes_register+\dp\c_boxes_register\relax}%
\afterassignment\next\c_boxes_register=#3}
@@ -458,7 +460,7 @@
\newcount\noflines
\newdimen\noflinesheight
-\unexpanded\def\getnoflines#1%
+\protected\def\getnoflines#1%
{\noflinesheight#1\relax
\ifzeropt\noflinesheight
\noflines\zerocount
@@ -474,7 +476,7 @@
\advance\noflines\minusone
\fi\fi}
-\unexpanded\def\getroundednoflines#1%
+\protected\def\getroundednoflines#1%
{\noflinesheight#1\relax
\ifzeropt\noflinesheight
\noflines\zerocount
@@ -488,7 +490,7 @@
\noflines\noflinesheight
\fi\fi}
-\unexpanded\def\getrawnoflines#1%
+\protected\def\getrawnoflines#1%
{\noflinesheight#1\relax
\ifzeropt\noflinesheight
\noflines\zerocount
@@ -541,15 +543,18 @@
%D \determinenoflines{\definedfont[Sans at 40pt]test\\test}
%D \stoptyping
-\def\syst_boxes_determine_noflines % can be mkiv'd
- {\beginofshapebox
- \unvbox\nextbox
- \endofshapebox
- \globalscratchcounter\zerocount
- \reshapebox{\global\advance\globalscratchcounter\plusone}%
- \expandafter\egroup\expandafter\noflines\the\globalscratchcounter\relax}
+% \def\syst_boxes_determine_noflines % can be mkiv'd
+% {\beginofshapebox
+% \unvbox\nextbox
+% \endofshapebox
+% \globalscratchcounter\zerocount
+% \reshapebox{\global\advance\globalscratchcounter\plusone}%
+% \expandafter\egroup\expandafter\noflines\the\globalscratchcounter\relax}
-\unexpanded\def\determinenoflines
+\def\syst_boxes_determine_noflines
+ {\expandafter\egroup\expandafter\noflines\noflinesinbox\nextbox\relax}
+
+\protected\def\determinenoflines
{\bgroup
\forgetall
\let\crlf\endgraf
@@ -567,7 +572,7 @@
%D \doiftext {data} {then branch}
%D \stoptyping
-\unexpanded\def\doifelsetext#1%
+\protected\def\doifelsetext#1%
{\begingroup
\setbox\scratchbox\hbox % no \hpack because we can have fallbacks
{\settrialtypesetting
@@ -580,7 +585,7 @@
\let\doiftextelse\doifelsetext
-\unexpanded\def\doiftext#1%
+\protected\def\doiftext#1%
{\begingroup
\setbox\scratchbox\hbox % no \hpack because we can have fallbacks
{\settrialtypesetting
@@ -624,7 +629,7 @@
%D In this implementation the \type {\aftergroup} construction is needed because
%D \type {\afterassignment} is executed inside the box.
-\unexpanded\def\dowithnextbox#1%
+\protected\def\dowithnextbox#1%
{\def\syst_boxes_with_next_box{#1}%
\afterassignment\syst_boxes_with_next_box_indeed
\setbox\nextbox}
@@ -632,7 +637,7 @@
\def\syst_boxes_with_next_box_indeed
{\aftergroup\syst_boxes_with_next_box}
-\unexpanded\def\dowithnextboxcs#1%
+\protected\def\dowithnextboxcs#1%
{\let\syst_boxes_with_next_box#1%
\afterassignment\syst_boxes_with_next_box_indeed
\setbox\nextbox}
@@ -652,7 +657,7 @@
%D A slower but more versatile implementation is:
%D
%D \starttyping
-%D \unexpanded\def\dowithnextbox#1#2%
+%D \protected\def\dowithnextbox#1#2%
%D {\def\syst_boxes_with_next_box{#1}%
%D \ifx#2\hbox
%D \afterassignment\syst_boxes_with_next_box_indeed
@@ -682,7 +687,7 @@
\def\nextboxdp {\dp\nextbox}
\def\nextboxhtdp{\dimexpr\ht\nextbox+\dp\nextbox\relax}
-\unexpanded\def\flushnextbox{\box\nextbox}
+\protected\def\flushnextbox{\box\nextbox}
%D \macros
%D {dowithnextboxcontent}
@@ -696,13 +701,13 @@
%D
%D {\em todo: Search source for potential usage!}
-\unexpanded\def\dowithnextboxcontent#1#2% inside, after
+\protected\def\dowithnextboxcontent#1#2% inside, after
{\def\syst_boxes_with_next_box_one{#2}%
\def\syst_boxes_with_next_box_two{#1}%
\afterassignment\syst_boxes_with_next_box_content_indeed
\setbox\nextbox}
-\unexpanded\def\dowithnextboxcontentcs#1#2% inside, after
+\protected\def\dowithnextboxcontentcs#1#2% inside, after
{\let\syst_boxes_with_next_box_one#2%
\let\syst_boxes_with_next_box_two#1%
\afterassignment\syst_boxes_with_next_box_content_indeed
@@ -729,15 +734,15 @@
\def\domathllap{\mathpalette\dodomathllap} \def\dodomathllap#1#2{\dollap{\normalstartimath\mathsurround\zeropoint#1#2\normalstopimath}}
\def\domathrlap{\mathpalette\dodomathrlap} \def\dodomathrlap#1#2{\dorlap{\normalstartimath\mathsurround\zeropoint#1#2\normalstopimath}}
-\unexpanded\def\rlap{\mathortext\domathrlap\dorlap}
-\unexpanded\def\llap{\mathortext\domathllap\dollap}
-\unexpanded\def\clap{\mathortext\domathclap\doclap}
+\protected\def\rlap{\mathortext\domathrlap\dorlap}
+\protected\def\llap{\mathortext\domathllap\dollap}
+\protected\def\clap{\mathortext\domathclap\doclap}
\def\dodotlap{\vpack to \zeropoint{\vss\box\nextbox}\endgroup}
\def\dodoblap{\vpack to \zeropoint{\box\nextbox\vss}\endgroup}
-\unexpanded\def\tlap{\begingroup\dowithnextboxcs\dodotlap\vbox}
-\unexpanded\def\blap{\begingroup\dowithnextboxcs\dodoblap\vbox}
+\protected\def\tlap{\begingroup\dowithnextboxcs\dodotlap\vbox}
+\protected\def\blap{\begingroup\dowithnextboxcs\dodoblap\vbox}
%D \macros
%D {beginofshapebox,
@@ -871,7 +876,7 @@
\def\shapesignal{.12345678pt} % or 12345sp
-\unexpanded\def\reshapebox#1%
+\protected\def\reshapebox#1%
{\doreshapebox
{#1}%
{\penalty\shapepenalty}%
@@ -895,11 +900,11 @@
% We will turn this into a \MKIV\ variant (we can use \type {\vpack} too).
-\unexpanded\def\insertshapesignal
+\protected\def\insertshapesignal
{\hpack to \shapesignal{\strut\hss}% plus \strut
\prevdepth\strutdp} % never \nointerlineskip
-\unexpanded\def\restoreshapebox % compensates for the signal
+\protected\def\restoreshapebox % compensates for the signal
{\global\setbox\tmpshapebox\vbox{\vskip-\lineheight\unvcopy\oldshapebox}}
\def\dodoreshapebox#1#2#3#4% \shapebox, \shapepenalty, \shapekern, \shapeskip
@@ -936,21 +941,21 @@
\advance\shapecounter \plusone
\fi}
-\unexpanded\def\beginofshapebox
+\protected\def\beginofshapebox
{\setbox\oldshapebox\vbox
\bgroup
\reshapingboxtrue
\the\everyshapebox
\insertshapesignal}
-\unexpanded\def\endofshapebox
+\protected\def\endofshapebox
{\endgraf
\egroup}
\let\beginshapebox\beginofshapebox
\let\endshapebox \endofshapebox
-\unexpanded\def\flushshapebox
+\protected\def\flushshapebox
{\bgroup
\ifzeropt\ht\newshapebox
\else
@@ -1001,7 +1006,7 @@
%
% \omlijnd[offset=0pt,hoogte=8mm,uitlijnen={rechts,laho}]{\bfa test}
-\unexpanded\def\innerflushshapebox
+\protected\def\innerflushshapebox
{\ifzeropt\ht\newshapebox \else
\unvcopy\newshapebox\relax % unvcopy ! else spacing problem
% \kern-\dp\newshapebox\relax
@@ -1024,7 +1029,7 @@
%D use \type {\shapedhbox} instead of \type {\hbox}, since it manages the height and
%D depth of the line.
-\unexpanded\def\shapedhbox % lines with non strutted dimensions have
+\protected\def\shapedhbox % lines with non strutted dimensions have
{\expanded{\dowithnextbox % interlineskip so if we want the original
{\ht\nextbox\the\ht\shapebox % spacing, we need to preserve the original
\dp\nextbox\the\dp\shapebox % height and depth which is definitely
@@ -1044,10 +1049,10 @@
%D \showhyphens{dohyphenatedword}
%D \stoptyping
-\unexpanded\def\doshowhyphenatednextbox
+\protected\def\doshowhyphenatednextbox
{\clf_showhyphenatedinlist\nextbox}
-\unexpanded\def\showhyphens % hpack: so no processing (we hyphenate in lua)
+\protected\def\showhyphens % hpack: so no processing (we hyphenate in lua)
{\dowithnextboxcs\doshowhyphenatednextbox\hpack}
%D The following macros are seldom used but handy for tracing.
@@ -1058,19 +1063,19 @@
%D \hyphenatedfile{tufte}
%D \stoptyping
-\unexpanded\def\dohyphenatednextbox
+\protected\def\dohyphenatednextbox
{\clf_hyphenatedlist\nextbox false\relax
\unhbox\nextbox}
-\unexpanded\def\hyphenatedword {\dowithnextboxcs\dohyphenatednextbox\hbox}
-\unexpanded\def\hyphenatedpar {\dowithnextboxcs\dohyphenatednextbox\hbox}
-\unexpanded\def\hyphenatedfile#1{\dowithnextboxcs\dohyphenatednextbox\hbox{\readfile{#1}\donothing\donothing}}
+\protected\def\hyphenatedword {\dowithnextboxcs\dohyphenatednextbox\hbox}
+\protected\def\hyphenatedpar {\dowithnextboxcs\dohyphenatednextbox\hbox}
+\protected\def\hyphenatedfile#1{\dowithnextboxcs\dohyphenatednextbox\hbox{\readfile{#1}\donothing\donothing}}
-\unexpanded\def\dohyphenatednextboxcolor
+\protected\def\dohyphenatednextboxcolor
{\clf_hyphenatedlist\nextbox true\relax
\unhbox\nextbox}
-\unexpanded\def\hyphenatedcoloredword{\dowithnextboxcs\dohyphenatednextboxcolor\hbox}
+\protected\def\hyphenatedcoloredword{\dowithnextboxcs\dohyphenatednextboxcolor\hbox}
%D \macros
%D {processtokens}
@@ -1099,11 +1104,11 @@
%D The list of tokens may contain spaces, while \type {\\}, \type {{}} and \type {\
%D } are handled as space too.
-\unexpanded\def\processtokens#1#2#3#4#5%
+\protected\def\processtokens#1#2#3#4#5%
{\begingroup
\def\lastcharacter{\lastcharacter}% hm, recursive ?
+ \let\\\space
\def\space{ }%
- \let\\=\space
\def\before {#1}%
\def\between{#2}%
\def\after {#3}%
@@ -1188,7 +1193,7 @@
\ifdefined\fakecompoundhyphen\else \let\fakecompoundhyphen\relax \fi
\ifdefined\veryraggedright \else \def\veryraggedright{\raggedright} \fi
-\unexpanded\def\limitatetext
+\protected\def\limitatetext
{\bgroup % evt \setstrut
\forgetall % otherwise indentation and so
\let\limitatetext\firstofthreearguments
@@ -1285,7 +1290,7 @@
\ifdim\wd\scratchboxtwo<\wd\scratchboxone #1\else\unhbox\scratchboxone\fi
\egroup}
-\unexpanded\def\limitatetext#1#2#3% \expanded added 2003/01/16
+\protected\def\limitatetext#1#2#3% \expanded added 2003/01/16
{\splitatcomma{#2}\leftlimit\rightlimit
\ifx\rightlimit\empty
\normallimitatetext {#1}\leftlimit {#3}%
@@ -1299,7 +1304,7 @@
%D \limitatefirstline{\input tufte\relax}{10cm}{\unknown}
%D \stoptyping
-\unexpanded\def\limitatefirstline#1#2#3%
+\protected\def\limitatefirstline#1#2#3%
{\hbox\bgroup\strut % \hpack
\setbox\scratchbox\hbox{\begstrut#1\endstrut}%
\ifdim\wd\scratchbox>#2\relax
@@ -1342,7 +1347,7 @@
% todo: provide variant with #1 picked up as box
-\unexpanded\def\processisolatedchars#1#2%
+\protected\def\processisolatedchars#1#2%
{\dontleavehmode
\begingroup
\setbox\scratchbox\hbox{\settrialtypesetting#2{\savecurrentattributes{pic}}}%
@@ -1355,7 +1360,7 @@
\relax
\endgroup}
-\unexpanded\def\processisolatedwords#1#2%
+\protected\def\processisolatedwords#1#2%
{\dontleavehmode
\begingroup
\setbox\scratchbox\hbox{\settrialtypesetting#2{\savecurrentattributes{pic}}}%
@@ -1370,7 +1375,7 @@
%D A variant:
-\unexpanded\def\applytocharacters#1%
+\protected\def\applytocharacters#1%
{\dontleavehmode
\dowithnextbox{\clf_applytobox
method {char}%
@@ -1380,7 +1385,7 @@
\relax}%
\hbox}
-\unexpanded\def\applytowords#1%
+\protected\def\applytowords#1%
{\dontleavehmode
\dowithnextbox{\clf_applytobox
method {word}%
@@ -1392,33 +1397,33 @@
%D The old call:
-\unexpanded\def\processwords#1%
+\protected\def\processwords#1%
{\processisolatedwords{#1}\processword}
\let\processword\relax
-\unexpanded\def\applytosplitstringchar#1#2%
+\protected\def\applytosplitstringchar#1#2%
{\dontleavehmode\clf_processsplit
data {#2}%
command {\csstring#1}%
method {char}%
\relax}
-\unexpanded\def\applytosplitstringword#1#2%
+\protected\def\applytosplitstringword#1#2%
{\dontleavehmode\clf_processsplit
data {#2}%
command {\csstring#1}%
method {word}%
\relax}
-\unexpanded\def\applytosplitstringline#1#2%
+\protected\def\applytosplitstringline#1#2%
{\dontleavehmode\clf_processsplit
data {#2}%
command {\csstring#1}%
method {line}%
\relax}
-\unexpanded\def\applytosplitstringcharspaced#1#2%
+\protected\def\applytosplitstringcharspaced#1#2%
{\dontleavehmode\clf_processsplit
data {#2}%
command {\csstring#1}%
@@ -1426,7 +1431,7 @@
spaced true%
\relax}
-\unexpanded\def\applytosplitstringwordspaced#1#2%
+\protected\def\applytosplitstringwordspaced#1#2%
{\dontleavehmode\clf_processsplit
data {#2}%
command {\csstring#1}%
@@ -1434,7 +1439,7 @@
spaced true%
\relax}
-\unexpanded\def\applytosplitstringlinespaced#1#2%
+\protected\def\applytosplitstringlinespaced#1#2%
{\dontleavehmode\clf_processsplit
data {#2}%
command {\csstring#1}%
@@ -1467,11 +1472,11 @@
%D would have ended up in the text. This macro can be useful when building
%D complicated menus, headers and footers and|/|or margin material.
-\unexpanded\def\sbox
+\protected\def\sbox
{\vpack\bgroup
\dowithnextboxcs\syst_boxes_sbox_finish\vbox}
-\unexpanded\def\syst_boxes_sbox_finish
+\protected\def\syst_boxes_sbox_finish
{\setbox\nextbox\hpack
{\strut % not needed
\dp\nextbox\zeropoint % not needed
@@ -1487,7 +1492,7 @@
%D xx \ruledhbox{\inlinedbox{\tfd test}} xx
%D \stoptyping
-\unexpanded\def\inlinedbox
+\protected\def\inlinedbox
{\bgroup
\dowithnextbox
{\setbox\nextbox\hpack
@@ -1505,7 +1510,7 @@
%D
%D This boxing macro limits the height and depth to those of a strut.
-\unexpanded\def\struttedbox
+\protected\def\struttedbox
{\hpack\bgroup
\dowithnextboxcs\syst_boxes_struttedbox_finish\hbox}
@@ -1521,7 +1526,7 @@
%D This macro compensates the difference between the topskip and strutheight. Watch
%D how we preserve the depth when it equals strutdepth.
-\unexpanded\def\topskippedbox
+\protected\def\topskippedbox
{\hpack\bgroup\dowithnextboxcs\syst_boxes_topskippedbox_finish\hbox}
\def\syst_boxes_topskippedbox_finish
@@ -1573,7 +1578,7 @@
%D The dimensions of the surrounding box are kept intact. This commands handles
%D positive and negative dimensions (which is why we need two boxes with rules).
-\unexpanded\def\centeredbox#1#% height +/-dimen width +/-dimen
+\protected\def\centeredbox#1#% height +/-dimen width +/-dimen
{\bgroup
\setbox\scratchboxone\vpack to \vsize
\bgroup
@@ -1613,7 +1618,7 @@
%D
%D Do you see what we call this one \type {next}?
-\unexpanded\def\centerednextbox#1#%
+\protected\def\centerednextbox#1#%
{\bgroup
\dowithnextbox
{\hsize\wd\nextbox
@@ -1634,7 +1639,7 @@
%D When omitted, the current \type {\hsize} and \type {\vsize} are used. Local
%D dimensions are supported.
-\unexpanded\def\centerbox#1#% optional height +/-dimen width +/-dimen
+\protected\def\centerbox#1#% optional height +/-dimen width +/-dimen
{\bgroup
\dowithnextbox
{\setlocalhsize
@@ -1664,7 +1669,7 @@
\newif\ifstretchrigidcolumns
\newif\iftightrigidcolumns % if true: just a vbox, no depth/noflines/gridsnap corrrections
-\unexpanded\def\setrigidcolumnhsize#1#2#3% todo: \dimexpr
+\protected\def\setrigidcolumnhsize#1#2#3% todo: \dimexpr
{\xdef\savedrigidhsize{\the\hsize}%
\hsize#1\relax
\global\chardef\rigidcolumns#3\relax
@@ -1685,7 +1690,7 @@
\let\rigidcolumnlines\!!zerocount
-\unexpanded\def\rigidcolumnbalance#1%
+\protected\def\rigidcolumnbalance#1%
{\ifnum\rigidcolumns=1 % tzt ook h/d correctie
\ifinner\ifhmode\box\else\unvbox\fi\else\unvbox\fi#1\relax
\else
@@ -1776,7 +1781,7 @@
%D Create line and fake height of paragraph by messign with heights: a nice hack by
%D DEK himself.
-%\unexpanded\def\setvboxtohbox
+%\protected\def\setvboxtohbox
% {\bgroup
% \ifdim\baselineskip<16pt \relax
% \scratchdimen\baselineskip
@@ -1790,13 +1795,13 @@
% \xdef\vboxtohboxfactor{\withoutpt\the\scratchdimen}%
% \egroup}
%
-% \unexpanded\def\startvboxtohbox
+% \protected\def\startvboxtohbox
% {\bgroup
% \setvboxtohbox
% \setbox\scratchbox\hbox\bgroup}
%
-% \unexpanded\def\stopvboxtohbox
-% {\ifcase\vboxtohboxslack\else\hskip\zeropoint\!!minus\vboxtohboxslack\fi
+% \protected\def\stopvboxtohbox
+% {\ifcase\vboxtohboxslack\else\hskip\zeropoint\s!minus\vboxtohboxslack\fi
% \egroup
% \dp\scratchbox\zeropoint
% \ht\scratchbox\vboxtohboxfactor\wd\scratchbox
@@ -1810,17 +1815,17 @@
%newbox\d_syst_boxes_vboxtohbox
\newbox\d_syst_boxes_separator
-\unexpanded\def\startvboxtohboxseparator
+\protected\def\startvboxtohboxseparator
{\setbox\d_syst_boxes_separator\hbox attr \vboxtohboxseparatorattribute\plusone\bgroup}
-\unexpanded\def\stopvboxtohboxseparator
+\protected\def\stopvboxtohboxseparator
{\egroup}
-\unexpanded\def\startvboxtohbox
+\protected\def\startvboxtohbox
{\begingroup
\setbox\scratchbox\hbox\bgroup}
-\unexpanded\def\stopvboxtohbox
+\protected\def\stopvboxtohbox
{\ifvoid\d_syst_boxes_separator
\hskip\zeropoint\ifcase\vboxtohboxslack\else\s!minus\vboxtohboxslack\fi % we really need a skip
\else
@@ -1833,12 +1838,12 @@
% A possible reconstruction:
-\unexpanded\def\convertvboxtohbox
+\protected\def\convertvboxtohbox
{\makehboxofhboxes
\setbox\scratchboxone\hpack{\unhbox\scratchboxone\removehboxes}% \hpack
\noindent\unhbox\scratchboxone\par}
-\unexpanded\def\makehboxofhboxes
+\protected\def\makehboxofhboxes
{\setbox\scratchboxone\emptyhbox
\loop % \doloop { .. \exitloop .. }
\setbox\scratchboxtwo\lastbox
@@ -1846,7 +1851,7 @@
\setbox\scratchboxone\hpack{\box\scratchboxtwo\unhbox\scratchboxone}%
\repeat}
-\unexpanded\def\removehboxes
+\protected\def\removehboxes
{\setbox\scratchboxone\lastbox
\ifhbox\scratchboxone
{\removehboxes}\unhbox\scratchboxone
@@ -1854,16 +1859,16 @@
% And one special for notes:
-% \unexpanded\def\starthboxestohbox
+% \protected\def\starthboxestohbox
% {\bgroup
% \beginofshapebox}
%
-% \unexpanded\def\stophboxestohbox
+% \protected\def\stophboxestohbox
% {\endofshapebox
% \doreshapebox
% {\hbox\bgroup
% \unhbox\shapebox
-% \ifcase\hboxestohboxslack\else\hskip\zeropoint\!!minus\hboxestohboxslack\fi
+% \ifcase\hboxestohboxslack\else\hskip\zeropoint\s!minus\hboxestohboxslack\fi
% \egroup}%
% \donothing
% \donothing
@@ -1875,11 +1880,11 @@
% More modern:
-\unexpanded\def\starthboxestohbox
+\protected\def\starthboxestohbox
{\bgroup
\setbox\scratchbox\vbox\bgroup}
-\unexpanded\def\stophboxestohbox
+\protected\def\stophboxestohbox
{\egroup
\clf_vboxlisttohbox\scratchbox\nextbox\dimexpr\hboxestohboxslack\relax
\dontleavehmode
@@ -1899,7 +1904,7 @@
\newdimen \lasthhboxwidth
\newskip \hhboxindent
-\unexpanded\def\unhhbox#1\with#2%
+\protected\def\unhhbox#1\with#2%
{\bgroup
\nopenalties
\dontcomplain
@@ -1930,7 +1935,7 @@
\unhbox1
\egroup}
-\unexpanded\def\hboxofvbox
+\protected\def\hboxofvbox
{\bgroup
\afterassignment\dohboxofvbox
\scratchcounter=}
@@ -1973,7 +1978,7 @@
%D dimension of this box suggest some content, the resulting box is unboxed and
%D surrounded by the first two arguments, else the third arguments is executed.
-\unexpanded\def\doifcontent#1#2#3%
+\protected\def\doifcontent#1#2#3%
{\dowithnextbox
{\ifhbox\nextbox
\ifdim\wd\nextbox>\zeropoint
@@ -2019,7 +2024,7 @@
% \newbox\processbox % public : this is the one where \nextbox's end up in
%
-% \unexpanded\def\processboxes#1%
+% \protected\def\processboxes#1%
% {\bgroup
% \def\syst_boxes_process_indeed{#1}% #1 can be redefined halfway
% \setbox\processbox\emptybox
@@ -2042,7 +2047,7 @@
% \afterassignment\syst_boxes_process
% \let\nexttoken}
%
-% \unexpanded\def\syst_boxes_process_nop
+% \protected\def\syst_boxes_process_nop
% {\removeunwantedspaces
% \box\processbox
% \nexttoken % messy as we are still in the group
@@ -2050,7 +2055,7 @@
\newbox\processbox % public : this is the one where \nextbox's end up in
-\unexpanded\def\processboxes#1%
+\protected\def\processboxes#1%
{\bgroup
\def\syst_boxes_process_indeed{#1}% #1 can be redefined halfway
\setbox\processbox\emptybox
@@ -2064,7 +2069,7 @@
\syst_boxes_process_indeed % takes \nextbox makes \processbox
\doifelsenextbgroup\syst_boxes_process_yes\syst_boxes_process_nop}
-\unexpanded\def\syst_boxes_process_nop
+\protected\def\syst_boxes_process_nop
{\removeunwantedspaces
\box\processbox
\egroup}
@@ -2124,7 +2129,7 @@
\kern-\scratchwidth
\hpack to \scratchwidth{\hss\box\nextbox \hss}}}
-\unexpanded\def\startoverlay
+\protected\def\startoverlay
{\bgroup
\let\stopoverlay\egroup
\processboxes\syst_boxes_overlay_process}
@@ -2142,7 +2147,7 @@
%D
%D returns an empty box with the dimensions of the box specified, here being zero.
-\unexpanded\def\fakebox
+\protected\def\fakebox
{\bgroup
\afterassignment\syst_boxes_fakebox_finish\scratchcounter}
@@ -2171,13 +2176,13 @@
\def\syst_boxes_lrc_process#1{\bgroup\forgetall\let\\\endgraf#1\let\next}
-\unexpanded\def\lbox#1#{\vbox#1\syst_boxes_lrc_process\raggedleft }
-\unexpanded\def\cbox#1#{\vbox#1\syst_boxes_lrc_process\raggedcenter}
-\unexpanded\def\rbox#1#{\vbox#1\syst_boxes_lrc_process\raggedright }
+\protected\def\lbox#1#{\vbox#1\syst_boxes_lrc_process\raggedleft }
+\protected\def\cbox#1#{\vbox#1\syst_boxes_lrc_process\raggedcenter}
+\protected\def\rbox#1#{\vbox#1\syst_boxes_lrc_process\raggedright }
-\unexpanded\def\ltop#1#{\vtop#1\syst_boxes_lrc_process\raggedleft }
-\unexpanded\def\ctop#1#{\vtop#1\syst_boxes_lrc_process\raggedcenter}
-\unexpanded\def\rtop#1#{\vtop#1\syst_boxes_lrc_process\raggedright }
+\protected\def\ltop#1#{\vtop#1\syst_boxes_lrc_process\raggedleft }
+\protected\def\ctop#1#{\vtop#1\syst_boxes_lrc_process\raggedcenter}
+\protected\def\rtop#1#{\vtop#1\syst_boxes_lrc_process\raggedright }
%D The alternatives \type {\tbox} and \type {\bbox} can be used to properly align
%D boxes, like in:
@@ -2199,8 +2204,8 @@
%D
%D \getbuffer
-\unexpanded\def\tbox{\hpack\bgroup\dowithnextboxcs\syst_boxes_tbox_finish\hbox}
-\unexpanded\def\bbox{\hpack\bgroup\dowithnextboxcs\syst_boxes_bbox_finish\hbox}
+\protected\def\tbox{\hpack\bgroup\dowithnextboxcs\syst_boxes_tbox_finish\hbox}
+\protected\def\bbox{\hpack\bgroup\dowithnextboxcs\syst_boxes_bbox_finish\hbox}
\def\syst_boxes_tbox_finish
{\scratchdepth\dimexpr\ht\nextbox+\dp\nextbox-\ht\strutbox\relax
@@ -2231,9 +2236,9 @@
\def\dodomhbox{\hpack to \hsize{\hss\box\nextbox\hss}}
\def\dodorhbox{\hpack to \hsize{\hss\box\nextbox }}
-\unexpanded\def\lhbox{\dowithnextboxcs\dodolhbox\hbox}
-\unexpanded\def\mhbox{\dowithnextboxcs\dodomhbox\hbox}
-\unexpanded\def\rhbox{\dowithnextboxcs\dodorhbox\hbox}
+\protected\def\lhbox{\dowithnextboxcs\dodolhbox\hbox}
+\protected\def\mhbox{\dowithnextboxcs\dodomhbox\hbox}
+\protected\def\rhbox{\dowithnextboxcs\dodorhbox\hbox}
\let\lefthbox \lhbox
\let\midhbox \mhbox
@@ -2254,15 +2259,15 @@
\newdimen\sizeofbox
-\unexpanded\def\boxofsize#1%
+\protected\def\boxofsize#1%
{\bgroup
\sizeofbox\zeropoint
\scratchdimen\zeropoint
\def\docommand
{\advance\sizeofbox\scratchdimen
- \futurelet\next\dodocommand}%
+ \futurelet\nexttoken\dodocommand}%
\def\dodocommand
- {\ifx\next\bgroup
+ {\ifx\nexttoken\bgroup
\expanded{\egroup#1 to \the\sizeofbox}%
\else
\expandafter\afterassignment\expandafter\docommand\expandafter\scratchdimen
@@ -2276,7 +2281,7 @@
% \limitvbox
% \limithbox
-\unexpanded\def\limitatelines#1#2% size sentinel
+\protected\def\limitatelines#1#2% size sentinel
{\dowithnextbox
{\scratchdimen#1\hsize
\ifdim\wd\nextbox>\scratchdimen
@@ -2287,7 +2292,7 @@
\unhbox\nextbox}
\hbox}
-\unexpanded\def\fittoptobaselinegrid % weg hier
+\protected\def\fittoptobaselinegrid % weg hier
{\dowithnextbox
{\bgroup
\par
@@ -2316,7 +2321,7 @@
\setbox\fakedboxcursor\hpack
{\vrule\s!width\zeropoint\s!height\zeropoint\s!depth\zeropoint}
-\unexpanded\def\boxcursor % overloaded in core-vis
+\protected\def\boxcursor % overloaded in core-vis
{\iftraceboxplacement
\bgroup
\scratchdimen2\onepoint
@@ -2333,21 +2338,21 @@
\copy\fakedboxcursor
\fi}
-\unexpanded\def\placedbox
+\protected\def\placedbox
{\iftraceboxplacement\ruledhbox\else\hbox\fi}
\newdimen\boxoffset
\newdimen\boxhdisplacement
\newdimen\boxvdisplacement
-\unexpanded\def\rightbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_rightbox_finish \placedbox}
-\unexpanded\def\leftbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_leftbox_finish \placedbox}
-\unexpanded\def\topbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_topbox_finish \placedbox}
-\unexpanded\def\bottombox {\hpack\bgroup\dowithnextboxcs\syst_boxes_bottombox_finish \placedbox}
-\unexpanded\def\lefttopbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_lefttopbox_finish \placedbox}
-\unexpanded\def\righttopbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_righttopbox_finish \placedbox}
-\unexpanded\def\leftbottombox {\hpack\bgroup\dowithnextboxcs\syst_boxes_leftbottombox_finish \placedbox}
-\unexpanded\def\rightbottombox{\hpack\bgroup\dowithnextboxcs\syst_boxes_rightbottombox_finish\placedbox}
+\protected\def\rightbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_rightbox_finish \placedbox}
+\protected\def\leftbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_leftbox_finish \placedbox}
+\protected\def\topbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_topbox_finish \placedbox}
+\protected\def\bottombox {\hpack\bgroup\dowithnextboxcs\syst_boxes_bottombox_finish \placedbox}
+\protected\def\lefttopbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_lefttopbox_finish \placedbox}
+\protected\def\righttopbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_righttopbox_finish \placedbox}
+\protected\def\leftbottombox {\hpack\bgroup\dowithnextboxcs\syst_boxes_leftbottombox_finish \placedbox}
+\protected\def\rightbottombox{\hpack\bgroup\dowithnextboxcs\syst_boxes_rightbottombox_finish\placedbox}
\let\topleftbox \lefttopbox
\let\toprightbox \righttopbox
@@ -2413,10 +2418,10 @@
\boxcursor\kern\boxhdisplacement\lower\boxvdisplacement\box\nextbox
\egroup}
-\unexpanded\def\middlebox {\hpack\bgroup\dowithnextboxcs\syst_boxes_middlebox_finish \placedbox}
-\unexpanded\def\baselinemiddlebox{\hpack\bgroup\dowithnextboxcs\syst_boxes_baselinemiddlebox_finish\placedbox}
-\unexpanded\def\baselineleftbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_baselineleftbox_finish \placedbox}
-\unexpanded\def\baselinerightbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_baselinerightbox_finish \placedbox}
+\protected\def\middlebox {\hpack\bgroup\dowithnextboxcs\syst_boxes_middlebox_finish \placedbox}
+\protected\def\baselinemiddlebox{\hpack\bgroup\dowithnextboxcs\syst_boxes_baselinemiddlebox_finish\placedbox}
+\protected\def\baselineleftbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_baselineleftbox_finish \placedbox}
+\protected\def\baselinerightbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_baselinerightbox_finish \placedbox}
\def\syst_boxes_middlebox_finish
{\global\boxhdisplacement-.5\wd\nextbox
@@ -2450,7 +2455,7 @@
%D
%D Experimental, not yet frozen:
-\unexpanded\def\lrtbbox#1#2#3#4% l r t b
+\protected\def\lrtbbox#1#2#3#4% l r t b
{\bgroup
\dowithnextboxcontent
{\advance\hsize-#1\advance\hsize-#2\relax
@@ -2463,7 +2468,7 @@
%D
%D See core-tbl.tex for an example of its usage:
-\unexpanded\def\toplinebox
+\protected\def\toplinebox
{\dowithnextboxcs\syst_boxes_toplinebox_finish\tbox}
\def\syst_boxes_toplinebox_finish
@@ -2502,20 +2507,20 @@
\installcorenamespace {stackbox}
\installcorenamespace {stacklst}
-\unexpanded\def\setstackbox#1#2%
+\protected\def\setstackbox#1#2%
{\ifcsname\??stackbox#1:#2\endcsname\else
\expandafter\newbox\csname\??stackbox#1:#2\endcsname
\fi
\global\setbox\csname\??stackbox#1:#2\endcsname\vbox}
-\unexpanded\def\initializeboxstack#1%
+\protected\def\initializeboxstack#1%
{\def\docommand##1{\setstackbox{#1}{##1}{}}%
\ifcsname\??stacklst#1\endcsname
\expandafter\processcommacommand\expandafter[\lastnamedcs]\docommand
\fi
\letgvalueempty{\??stacklst#1}}
-\unexpanded\def\savebox#1#2% stack name
+\protected\def\savebox#1#2% stack name
{% beware, \setxvalue defines the cs beforehand so we cannot use the
% test inside the { }
\ifcsname\??stacklst#1\endcsname
@@ -2526,27 +2531,27 @@
\fi
\setstackbox{#1}{#2}}
-\unexpanded\def\flushbox#1#2% unwrapped
+\protected\def\flushbox#1#2% unwrapped
{\ifcsname\??stackbox#1:#2\endcsname
\box\lastnamedcs
\else
\emptybox
\fi}
-\unexpanded\def\restorebox#1#2% unwrapped
+\protected\def\restorebox#1#2% unwrapped
{\ifcsname\??stackbox#1:#2\endcsname
\copy\lastnamedcs
\else
\emptybox
\fi}
-\unexpanded\def\foundbox#1#2% wrapped
+\protected\def\foundbox#1#2% wrapped
{\vpack
{\ifcsname\??stackbox#1:#2\endcsname
\copy\lastnamedcs
\fi}}
-\unexpanded\def\doifelsebox#1#2%
+\protected\def\doifelsebox#1#2%
{\ifcsname\??stackbox#1:#2\endcsname
\ifvoid\lastnamedcs
\doubleexpandafter\secondoftwoarguments
@@ -2566,11 +2571,11 @@
\newcount\c_syst_boxes_stack
\let \b_syst_boxes_stack\relax
-\unexpanded\def\syst_boxes_stack_allocate
+\protected\def\syst_boxes_stack_allocate
{\newbox\b_syst_boxes_stack
\expandafter\let\csname\??boxstack\number\c_syst_boxes_stack\endcsname\b_syst_boxes_stack}
-\unexpanded\def\syst_boxes_push#1#2%
+\protected\def\syst_boxes_push#1#2%
{\global\advance\c_syst_boxes_stack\plusone
\expandafter\let\expandafter\b_syst_boxes_stack\csname\??boxstack\number\c_syst_boxes_stack\endcsname
\ifx\b_syst_boxes_stack\relax % cheaper then csname check as in most cases it's defined
@@ -2578,15 +2583,15 @@
\fi
#1\setbox\b_syst_boxes_stack\box#2\relax}
-\unexpanded\def\syst_boxes_pop#1#2%
+\protected\def\syst_boxes_pop#1#2%
{#1\setbox#2\box\csname\??boxstack\number\c_syst_boxes_stack\endcsname
\global\advance\c_syst_boxes_stack\minusone}
-\unexpanded\def\localpushbox {\syst_boxes_push\relax}
-\unexpanded\def\localpopbox {\syst_boxes_pop \relax}
+\protected\def\localpushbox {\syst_boxes_push\relax}
+\protected\def\localpopbox {\syst_boxes_pop \relax}
-\unexpanded\def\globalpushbox{\syst_boxes_push\global}
-\unexpanded\def\globalpopbox {\syst_boxes_pop \global}
+\protected\def\globalpushbox{\syst_boxes_push\global}
+\protected\def\globalpopbox {\syst_boxes_pop \global}
%D And here is a more modern one (not yet in i-*):
%D
@@ -2604,15 +2609,15 @@
%D \resetboxesincache{foo}
%D \stoptyping
-\unexpanded\def\putboxincache #1#2#3{\clf_putboxincache {#1}{#2}#3\relax}
-\unexpanded\def\getboxfromcache #1#2#3{\clf_getboxfromcache {#1}{#2}#3\relax}
-\unexpanded\def\doifelseboxincache #1#2{\clf_doifelseboxincache {#1}{#2}}
-\unexpanded\def\copyboxfromcache #1#2#3{\clf_copyboxfromcache {#1}{#2}#3\relax}
-\unexpanded\def\directboxfromcache #1#2{\clf_directboxfromcache {#1}{#2}}
-\unexpanded\def\directcopyboxfromcache#1#2{\clf_directcopyboxfromcache{#1}{#2}}
-\unexpanded\def\resetboxesincache #1{\clf_resetboxesincache {#1}}
+\protected\def\putboxincache #1#2#3{\clf_putboxincache {#1}{#2}#3\relax}
+\protected\def\getboxfromcache #1#2#3{\clf_getboxfromcache {#1}{#2}#3\relax}
+\protected\def\doifelseboxincache #1#2{\clf_doifelseboxincache {#1}{#2}}
+\protected\def\copyboxfromcache #1#2#3{\clf_copyboxfromcache {#1}{#2}#3\relax}
+\protected\def\directboxfromcache #1#2{\clf_directboxfromcache {#1}{#2}}
+\protected\def\directcopyboxfromcache#1#2{\clf_directcopyboxfromcache{#1}{#2}}
+\protected\def\resetboxesincache #1{\clf_resetboxesincache {#1}}
-\unexpanded\def\putnextboxincache#1#2%
+\protected\def\putnextboxincache#1#2%
{\dowithnextbox{\putboxincache{#1}{#2}\nextbox}}
%D \macros
@@ -2621,21 +2626,21 @@
%D While \type {\removedepth} removes the preceding depth, \type {\obeydepth} makes
%D sure we have depth. Both macros leave the \type {\prevdepth} untouched.
-\unexpanded\def\removedepth
+\protected\def\removedepth
{\ifvmode
\ifdim\prevdepth>\zeropoint
\kern-\prevdepth
\fi
\fi}
-\unexpanded\def\obeydepth
+\protected\def\obeydepth
{\par % watch out for changes in math formulas
\ifvmode\ifdim\prevdepth<\zeropoint\else\ifdim\prevdepth<\strutdp
\kern\dimexpr\strutdp-\prevdepth\relax
\prevdepth\strutdp
\fi\fi\fi}
-\unexpanded\def\undepthed
+\protected\def\undepthed
{\dowithnextbox{\dp\nextbox\zeropoint\box\nextbox}\hbox}
%D \macros
@@ -2643,10 +2648,10 @@
%D
%D A funny (but rather stupid) one, plus a redefinition.
-\unexpanded\def\removebottomthings
+\protected\def\removebottomthings
{\dorecurse\plusfive{\unskip\unkern\unpenalty}}
-\unexpanded\def\removelastskip % \ifvmode the plain tex one \fi
+\protected\def\removelastskip % \ifvmode the plain tex one \fi
{\ifvmode\ifzeropt\lastskip\else\vskip-\lastskip\fi\fi}
%D \macros
@@ -2655,7 +2660,7 @@
%D This macro sets the dimensions of a box to those of a strut. Sort of obsolete so
%D it will go away.
-\unexpanded\def\makestrutofbox % not used
+\protected\def\makestrutofbox % not used
{\afterassignment\syst_boxes_makestrutofbox\c_boxes_register}
\def\syst_boxes_makestrutofbox
@@ -2674,8 +2679,8 @@
%D \hsmash{\raisebox{100pt}\hbox{test}}
%D \stoptyping
-\unexpanded\def\raisebox#1{\bgroup\afterassignment\syst_boxes_raise_indeed\scratchdimen#1} % so both 10pt and {10pt} is accepted
-\unexpanded\def\lowerbox#1{\bgroup\afterassignment\syst_boxes_lower_indeed\scratchdimen#1} % so both 10pt and {10pt} is accepted
+\protected\def\raisebox#1{\bgroup\afterassignment\syst_boxes_raise_indeed\scratchdimen#1} % so both 10pt and {10pt} is accepted
+\protected\def\lowerbox#1{\bgroup\afterassignment\syst_boxes_lower_indeed\scratchdimen#1} % so both 10pt and {10pt} is accepted
\def\syst_boxes_raise_indeed{\dowithnextboxcs\syst_boxes_raise_finish}
\def\syst_boxes_lower_indeed{\dowithnextboxcs\syst_boxes_lower_finish}
@@ -2696,7 +2701,7 @@
% vcenter in text, we kunnen vcenter overloaden
-\unexpanded\def\halfwaybox
+\protected\def\halfwaybox
{\hpack\bgroup
\dowithnextboxcs\syst_boxes_halfwaybox_finish\hbox}
@@ -2705,7 +2710,7 @@
\lower.5\ht\nextbox\box\nextbox
\egroup}
-\unexpanded\def\depthonlybox
+\protected\def\depthonlybox
{\tpack\bgroup
\dowithnextboxcs\syst_boxes_depthonlybox_finish\vbox}
@@ -2728,7 +2733,9 @@
%D
%D Also new: tex mode \type {\vcenter}.
-\unexpanded\def\vcenter
+% not in lmtxmode:
+
+\protected\def\vcenter
{\vbox\bgroup
\dowithnextboxcs\syst_boxes_vcenter_finish\vbox}
@@ -2748,7 +2755,7 @@
%D
%D A not so well unhboxable box can be made with:
-\unexpanded\def\frozenhbox
+\protected\def\frozenhbox
{\hpack\bgroup
\dowithnextboxcs\syst_boxes_frozenhbox_finish\hbox}
@@ -2764,11 +2771,11 @@
\installcorenamespace {box_x}
\installcorenamespace {box_y}
-\unexpanded\def\setboxllx #1#2{\expandafter\edef\csname\??box_x\number#1\endcsname{\the\dimexpr#2\relax}}
-\unexpanded\def\setboxlly #1#2{\expandafter\edef\csname\??box_y\number#1\endcsname{\the\dimexpr#2\relax}}
+\protected\def\setboxllx #1#2{\expandafter\edef\csname\??box_x\number#1\endcsname{\the\dimexpr#2\relax}}
+\protected\def\setboxlly #1#2{\expandafter\edef\csname\??box_y\number#1\endcsname{\the\dimexpr#2\relax}}
-\unexpanded\def\gsetboxllx#1#2{\expandafter\xdef\csname\??box_x\number#1\endcsname{\the\dimexpr#2\relax}}
-\unexpanded\def\gsetboxlly#1#2{\expandafter\xdef\csname\??box_y\number#1\endcsname{\the\dimexpr#2\relax}}
+\protected\def\gsetboxllx#1#2{\expandafter\xdef\csname\??box_x\number#1\endcsname{\the\dimexpr#2\relax}}
+\protected\def\gsetboxlly#1#2{\expandafter\xdef\csname\??box_y\number#1\endcsname{\the\dimexpr#2\relax}}
%def\getboxllx#1{\ifcsname\??box_x\number#1\endcsname\csname\??box_x\number#1\endcsname\else\zeropoint\fi}
%def\getboxlly#1{\ifcsname\??box_y\number#1\endcsname\csname\??box_y\number#1\endcsname\else\zeropoint\fi}
@@ -2791,7 +2798,7 @@
%D \shownextbox\vbox{\setupwhitespace[big]test\endgraf\thinrule}
%D \stoptyping
-\unexpanded\def\shownextbox % seldom used
+\protected\def\shownextbox % seldom used
{\dowithnextbox
{\bgroup
\showboxbreadth\maxdimen
@@ -2803,7 +2810,7 @@
\interactionmode\scratchcounter
\egroup}}
-\unexpanded\def\spreadhbox#1% rebuilds \hbox{<box><hss><box><hss><box>}
+\protected\def\spreadhbox#1% rebuilds \hbox{<box><hss><box><hss><box>}
{\bgroup
\ifhbox#1\relax
\setbox\scratchboxtwo\emptybox
@@ -2835,7 +2842,7 @@
%D \minimalhbox 100pt {test}
%D \stoptyping
-\unexpanded\def\minimalhbox#1#%
+\protected\def\minimalhbox#1#%
{\dowithnextbox
{\bgroup
\setbox\scratchbox\hpack#1{\hss}%
@@ -2846,7 +2853,7 @@
%D A bit dirty:
-\unexpanded\def\nodestostring#1#2% more tolerant for #2=\cs
+\protected\def\nodestostring#1#2% more tolerant for #2=\cs
{\begingroup
\setbox\nextbox\hbox{#2}%
\normalexpanded{\endgroup\edef\noexpand#1{\clf_boxtostring\nextbox}}}
@@ -2877,7 +2884,7 @@
\let\getnaturalwd\clf_getnaturalwd % no intermediate
\let\setnaturalwd\clf_setnaturalwd % no intermediate
-\unexpanded\def\doifelserighttoleftinbox{\clf_doifelserighttoleftinbox}
+\protected\def\doifelserighttoleftinbox{\clf_doifelserighttoleftinbox}
\let\doifrighttoleftinboxelse\doifelserighttoleftinbox
@@ -2886,23 +2893,23 @@
\definesystemattribute [runningtext] [public]
%unexpanded\def\runninghbox{\hbox attr \runningtextattribute \plusone} % not yet in i-*
-\unexpanded\def\runninghbox{\hbox attr \runningtextattribute \fontid\font} % not yet in i-*
+\protected\def\runninghbox{\hbox attr \runningtextattribute \fontid\font} % not yet in i-*
%D To complement lua (yet undocumented):
-\unexpanded\def\beginhbox{\hbox\bgroup} \let\endhbox\egroup
-\unexpanded\def\beginvbox{\vbox\bgroup} \let\endvbox\egroup
-\unexpanded\def\beginvtop{\vtop\bgroup} \let\endvtop\egroup
+\protected\def\beginhbox{\hbox\bgroup} \let\endhbox\egroup
+\protected\def\beginvbox{\vbox\bgroup} \let\endvbox\egroup
+\protected\def\beginvtop{\vtop\bgroup} \let\endvtop\egroup
-\unexpanded\def\sethboxregister#1{\setbox#1\hbox}
-\unexpanded\def\setvboxregister#1{\setbox#1\vbox}
-\unexpanded\def\setvtopregister#1{\setbox#1\vtop}
+\protected\def\sethboxregister#1{\setbox#1\hbox}
+\protected\def\setvboxregister#1{\setbox#1\vbox}
+\protected\def\setvtopregister#1{\setbox#1\vtop}
-\unexpanded\def\flushboxregister#1{\box\numexpr#1\relax}
+\protected\def\flushboxregister#1{\box\numexpr#1\relax}
-\unexpanded\def\starthboxregister#1{\setbox#1\hbox\bgroup} \let\stophboxregister\egroup
-\unexpanded\def\startvboxregister#1{\setbox#1\vbox\bgroup} \let\stopvboxregister\egroup
-\unexpanded\def\startvtopregister#1{\setbox#1\vtop\bgroup} \let\stopvtopregister\egroup
+\protected\def\starthboxregister#1{\setbox#1\hbox\bgroup} \let\stophboxregister\egroup
+\protected\def\startvboxregister#1{\setbox#1\vbox\bgroup} \let\stopvboxregister\egroup
+\protected\def\startvtopregister#1{\setbox#1\vtop\bgroup} \let\stopvtopregister\egroup
%D For whatever third party package needs it:
%D
@@ -2918,7 +2925,7 @@
\installcorenamespace{localbox}
-\unexpanded\def\newlocalbox#1%
+\protected\def\newlocalbox#1%
{\expandafter\let\expandafter#1\csname\??localbox\string#1\endcsname
\ifx#1\relax
\syst_aux_new_localbox#1%
@@ -2930,26 +2937,26 @@
%D Who knows when this comes in handy:
-\unexpanded\def\lastlinewidth{\dimexpr\clf_lastlinewidth\scaledpoint\relax}
+\protected\def\lastlinewidth{\dimexpr\clf_lastlinewidth\scaledpoint\relax}
%D Keep as reference:
-% \unexpanded\def\tightvbox{\dowithnextbox{\dp\nextbox\zeropoint\box\nextbox}\vbox}
-% \unexpanded\def\tightvtop{\dowithnextbox{\ht\nextbox\zeropoint\box\nextbox}\vtop}
+% \protected\def\tightvbox{\dowithnextbox{\dp\nextbox\zeropoint\box\nextbox}\vbox}
+% \protected\def\tightvtop{\dowithnextbox{\ht\nextbox\zeropoint\box\nextbox}\vtop}
%D This one keeps dimensions and sets the shift field (and so it's more for testing
%D than for real usage):
-\unexpanded\def\shiftbox {\clf_shiftbox}
-\unexpanded\def\vpackbox {\clf_vpackbox}
-\unexpanded\def\hpackbox {\clf_hpackbox}
-\unexpanded\def\vpackedbox{\clf_vpackedbox}
-\unexpanded\def\hpackedbox{\clf_hpackedbox}
+\protected\def\shiftbox {\clf_shiftbox}
+\protected\def\vpackbox {\clf_vpackbox}
+\protected\def\hpackbox {\clf_hpackbox}
+\protected\def\vpackedbox{\clf_vpackedbox}
+\protected\def\hpackedbox{\clf_hpackedbox}
%D This one has been moved from a 2 decade old file. It makes something boxed
%D sit on the baseline.
-\unexpanded\def\linebox
+\protected\def\linebox
{\hpack\bgroup\dowithnextbox
{\scratchdimen\dimexpr\dimexpr\htdp\nextbox-\lineheight\relax/2+\dp\strutbox\relax
\setbox\nextbox\hpack{\lower\scratchdimen\box\nextbox}%
@@ -3000,10 +3007,10 @@
%
% \unprotect
%
-% \unexpanded\def\withwordsinstring#1#2% command str
+% \protected\def\withwordsinstring#1#2% command str
% {\ctxcommand{withwords(\!!bs#1\!!es,\!!bs#2\!!es)}}
%
-% \unexpanded\def\withwordsinfile#1#2% command name
+% \protected\def\withwordsinfile#1#2% command name
% {\ctxcommand{withwords(\!!bs#1\!!es,io.loaddata(resolvers.findfile("#2")))}}
%
% \protect
diff --git a/Master/texmf-dist/tex/context/base/mkiv/supp-box.mkxl b/Master/texmf-dist/tex/context/base/mkiv/supp-box.mkxl
deleted file mode 100644
index e6ab96e8929..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/supp-box.mkxl
+++ /dev/null
@@ -1,2952 +0,0 @@
-%D \module
-%D [ file=supp-box,
-%D version=1995.10.10,
-%D title=\CONTEXT\ Support Macros,
-%D subtitle=Boxes,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Support Macros / Boxes}
-
-\unprotect
-
-\registerctxluafile{supp-box}{optimize}
-
-% This file is partially cleaned up.
-
-%D First some defaults:
-
-\fixupboxesmode\plusone
-
-%D And some dimensions:
-
-\newdimen\givenwidth
-\newdimen\givenheight
-\newdimen\givendepth
-
-%D \macros
-%D {dontcomplain}
-%D
-%D The next macro suppresses over- and underfull messages which often makes sense
-%D when we deal with boxes.
-
-\unexpanded\def\dontcomplain
- {\hbadness\plustenthousand
- \vbadness\plustenthousand
- \hfuzz \maxdimen
- \vfuzz \maxdimen}
-
-%D This module implements some box manipulation macros. Some are quite simple, some
-%D are more advanced and when understood well, all can be of use.
-%D
-%D \macros
-%D {strutdp,strutht,strutwd}
-%D
-%D The next shortcuts save memory and keying. The width is normally zero points (if
-%D not, you're in trouble). These shortcuts can be used like a dimension, opposite
-%D to the core macros \type {\strutdepth} and alike, which are values.
-
-\def\strutdp {\dp\strutbox}
-\def\strutht {\ht\strutbox}
-\def\strutwd {\wd\strutbox}
-\def\struthtdp{\htdp\strutbox}
-\def\strutgap {\dimexpr\ht\strutbox-\dp\strutbox\relax}
-
-%D \macros
-%D {voidbox,nextbox}
-%D
-%D Let's start with an easy one. The next macro hides the ugly \type {@} in \type
-%D {\voidb@x}.
-
-\ifdefined\voidbox \else \newbox\voidbox \fi
-\ifdefined\nextbox \else \newbox\nextbox \fi
-
-%D \macros
-%D {nextdepth}
-%D
-%D Let's start with a rather simple declaration. Sometimes we need to save the \TEX\
-%D \DIMENSION\ \type{\prevdepth} and append it later on. The name \type {\nextdepth}
-%D suits this purpose well.
-
-\newdimen\nextdepth
-
-%D \macros
-%D {smashbox, smashedbox}
-%D
-%D Smashing is introduced in \PLAIN\ \TEX, and stands for reducing the dimensions of
-%D a box to zero. The most resolute one is presented first.
-
-\unexpanded\def\smashbox#1%
- {\wd#1\zeropoint
- \ht#1\zeropoint
- \dp#1\zeropoint}
-
-\unexpanded\def\smashboxed#1%
- {\wd#1\zeropoint
- \ht#1\zeropoint
- \dp#1\zeropoint
- \box#1\relax}
-
-%D \macros
-%D {hsmashbox,vsmashbox}
-%D
-%D Smashing can be used for overlaying boxes. Depending on the mode, horizontal or
-%D vertical, one can use:
-
-\unexpanded\def\hsmashbox#1%
- {\wd#1\zeropoint}
-
-\unexpanded\def\vsmashbox#1%
- {\ht#1\zeropoint
- \dp#1\zeropoint}
-
-%D The next implementation is less sensitive for spurious spaces.
-
-\newcount\c_boxes_register
-
-\unexpanded\def\smashbox
- {\afterassignment\syst_boxes_smash_boxes_register\c_boxes_register}
-
-\def\syst_boxes_smash_boxes_register
- {\wd\c_boxes_register\zeropoint
- \ht\c_boxes_register\zeropoint
- \dp\c_boxes_register\zeropoint}
-
-\unexpanded\def\hsmashbox
- {\afterassignment\syst_boxes_hsmashed_boxes_register\c_boxes_register}
-
-\def\syst_boxes_hsmashed_boxes_register
- {\wd\c_boxes_register\zeropoint}
-
-\unexpanded\def\vsmashbox
- {\afterassignment\syst_boxes_vsmashed_boxes_register\c_boxes_register}
-
-\def\syst_boxes_vsmashed_boxes_register
- {\ht\c_boxes_register\zeropoint
- \dp\c_boxes_register\zeropoint}
-
-\unexpanded\def\smashedbox
- {\afterassignment\syst_boxes_smashed_boxes_register\c_boxes_register}
-
-\unexpanded\def\syst_boxes_smashed_boxes_register
- {\wd\c_boxes_register\zeropoint
- \ht\c_boxes_register\zeropoint
- \dp\c_boxes_register\zeropoint
- \box\c_boxes_register}
-
-%D \macros
-%D {hsmash,vsmash,
-%D hsmashed,vsmashed}
-%D
-%D While the previous macros expected a \BOX, the next act on a content. They are
-%D some subtle differences betreen the smash and smashed alternatives. The later
-%D ones reduce all dimensions to zero.
-
-\unexpanded\def\hsmash {\bgroup\dowithnextboxcs\syst_boxes_hsmashed_nextbox\hbox}
-\unexpanded\def\vsmash {\bgroup\dowithnextboxcs\syst_boxes_vsmashed_nextbox\vbox}
-\unexpanded\def\hsmashed{\bgroup\dowithnextboxcs\syst_boxes_smashed_nextbox \hbox}
-\unexpanded\def\vsmashed{\bgroup\dowithnextboxcs\syst_boxes_smashed_nextbox \vbox}
-
-\unexpanded\def\syst_boxes_hsmashed_nextbox
- {\wd\nextbox\zeropoint
- \box\nextbox
- \egroup}
-
-\unexpanded\def\syst_boxes_vsmashed_nextbox
- {\ht\nextbox\zeropoint
- \dp\nextbox\zeropoint
- \box\nextbox
- \egroup}
-
-\unexpanded\def\syst_boxes_smashed_nextbox
- {\ht\nextbox\zeropoint
- \dp\nextbox\zeropoint
- \wd\nextbox\zeropoint
- \box\nextbox
- \egroup}
-
-%D \macros
-%D {smashedhbox,smashedvbox}
-%D
-%D Also handy (all dimensions zeroed):
-%D
-%D \starttyping
-%D \smashedhbox to ... {...}
-%D \smashedvbox to ... {...}
-%D \stoptyping
-
-\unexpanded\def\smashedhbox{\hpack\bgroup\dowithnextboxcs\syst_boxes_smashed_nextbox\hbox}
-\unexpanded\def\smashedvbox{\vpack\bgroup\dowithnextboxcs\syst_boxes_smashed_nextbox\vbox}
-
-%D First we define a helper. We use a \LUATEX\ feature in order to avoid
-%D mathpalettes.
-
-\newcount\c_boxes_math_style
-
-\unexpanded\def\syst_boxes_math_set_nextbox#1%
- {\c_boxes_math_style\mathstyle
- \setbox\nextbox\hbox{\normalstartimath\mathsurround\zeropoint\triggermathstyle\c_boxes_math_style{#1}\normalstopimath}}
-
-%D \macros
-%D {smash}
-%D
-%D This smash alternative takes an optional arg [whdtb] as well as is potentially
-%D catcode safer. It is needed by the math module (although the \type {\leavevmode}
-%D is not added here).
-
-\unexpanded\def\smash
- {\begingroup
- \futureexpandis[\syst_boxes_smash_yes\syst_boxes_smash_nop}
-
-\def\syst_boxes_smash_nop
- {\edef\m_boxes_smash_options{hd}%
- \futurelet\nexttoken\syst_boxes_smash_indeed}
-
-\def\syst_boxes_smash_yes[#1]%
- {\edef\m_boxes_smash_options{#1}%
- \futurelet\nexttoken\syst_boxes_smash_indeed}
-
-\def\syst_boxes_smash_indeed
- {\ifmmode
- \expandafter\syst_boxes_smash_math
- \orelse\ifx\nexttoken\bgroup
- \expandafter\syst_boxes_smash_hbox
- \else
- \expandafter\syst_boxes_smash_text
- \fi}
-
-\def\syst_boxes_smash_math#1%
- {\syst_boxes_math_set_nextbox{#1}%
- \syst_boxes_smash_process}
-
-\def\syst_boxes_smash_hbox
- {\dowithnextboxcs\syst_boxes_smash_process\hbox}
-
-\def\syst_boxes_smash_text#1%
- {\setbox\nextbox\hbox{#1}%
- \syst_boxes_smash_process}
-
-\def\syst_boxes_smash_process
- {\expandafter\syst_boxes_smash_process_option\m_boxes_smash_options\relax
- \box\nextbox
- \endgroup}
-
-\installcorenamespace {smashoptions}
-
-\setvalue{\??smashoptions w}{\wd\nextbox\zeropoint}
-\setvalue{\??smashoptions h}{\ht\nextbox\zeropoint}
-\setvalue{\??smashoptions d}{\dp\nextbox\zeropoint}
-\setvalue{\??smashoptions t}{\ht\nextbox\zeropoint}
-\setvalue{\??smashoptions b}{\dp\nextbox\zeropoint}
-
-\def\syst_boxes_smash_process_option#1%
- {\ifx#1\relax\else
- \begincsname\??smashoptions#1\endcsname
- \expandafter\syst_boxes_smash_process_option
- \fi}
-
-\def\syst_boxes_lower_nextbox_dp
- {\setbox\nextbox\hpack{\lower\dp\nextbox\box\nextbox}}
-
-%D \starttabulate[|l|l|]
-%D \NC w \NC \ruledhbox{\smash [w]{This is some great smashing, isn't it?}} \NC \NR
-%D \NC h \NC \ruledhbox{\smash [h]{This is some great smashing, isn't it?}} \NC \NR
-%D \NC d \NC \ruledhbox{\smash [d]{This is some great smashing, isn't it?}} \NC \NR
-%D \NC tb \NC \ruledhbox{\smash [tb]{This is some great smashing, isn't it?}} \NC \NR
-%D \NC whd \NC \ruledhbox{\smash[whd]{This is some great smashing, isn't it?}} \NC \NR
-%D \stoptabulate
-
-%D \macros
-%D {phantom, hphantom, vphantom, mathstrut}
-%D
-%D The next implementation of \type {\phantom} cum suis does not grab an argument in
-%D the non||math case, which is better.
-%D
-%D Due to a complicated call to \type {\mathpallete} and thereby \type
-%D {\mathchoice}, the next macro looks ugly. We also take care of non||braced
-%D arguments.
-
-\unexpanded\def\phantom {\begingroup\futurelet\nexttoken\syst_boxes_phantom_indeed }
-\unexpanded\def\vphantom{\begingroup\futurelet\nexttoken\syst_boxes_phantom_indeed_v}
-\unexpanded\def\hphantom{\begingroup\futurelet\nexttoken\syst_boxes_phantom_indeed_h}
-
-\def\syst_boxes_phantom_math #1{\syst_boxes_math_set_nextbox{#1}\syst_boxes_phantom_make }
-\def\syst_boxes_phantom_math_v#1{\syst_boxes_math_set_nextbox{#1}\syst_boxes_phantom_make_v}
-\def\syst_boxes_phantom_math_h#1{\syst_boxes_math_set_nextbox{#1}\syst_boxes_phantom_make_h}
-
-\def\syst_boxes_phantom_hbox {\dowithnextboxcs\syst_boxes_phantom_make \hbox} % always hbox
-\def\syst_boxes_phantom_hbox_v{\dowithnextboxcs\syst_boxes_phantom_make_v\hbox} % always hbox
-\def\syst_boxes_phantom_hbox_h{\dowithnextboxcs\syst_boxes_phantom_make_h\hbox} % always hbox
-
-\def\syst_boxes_phantom_text #1{\setbox\nextbox\hbox{#1}\syst_boxes_phantom_make } % always hbox
-\def\syst_boxes_phantom_text_v#1{\setbox\nextbox\hbox{#1}\syst_boxes_phantom_make_v} % always hbox
-\def\syst_boxes_phantom_text_h#1{\setbox\nextbox\hbox{#1}\syst_boxes_phantom_make_h} % always hbox
-
-\def\syst_boxes_phantom_indeed
- {\ifmmode
- \expandafter\syst_boxes_phantom_math
- \orelse\ifx\nexttoken\bgroup
- \expandafter\syst_boxes_phantom_hbox
- \else
- \expandafter\syst_boxes_phantom_text
- \fi}
-
-\def\syst_boxes_phantom_indeed_v
- {\ifmmode
- \expandafter\syst_boxes_phantom_math_v
- \orelse\ifx\nexttoken\bgroup
- \expandafter\syst_boxes_phantom_hbox_v
- \else
- \expandafter\syst_boxes_phantom_text_v
- \fi}
-
-\def\syst_boxes_phantom_indeed_h
- {\ifmmode
- \expandafter\syst_boxes_phantom_math_h
- \orelse\ifx\nexttoken\bgroup
- \expandafter\syst_boxes_phantom_hbox_h
- \else
- \expandafter\syst_boxes_phantom_text_h
- \fi}
-
-\def\syst_boxes_phantom_make
- {\setbox\scratchbox\emptyhbox
- \ht\scratchbox\ht\nextbox
- \dp\scratchbox\dp\nextbox
- \wd\scratchbox\wd\nextbox
- \box\scratchbox
- \endgroup}
-
-\def\syst_boxes_phantom_make_v
- {\setbox\scratchbox\emptyhbox
- \ht\scratchbox\ht\nextbox
- \dp\scratchbox\dp\nextbox
- \box\scratchbox
- \endgroup}
-
-\def\syst_boxes_phantom_make_h
- {\setbox\scratchbox\emptyhbox
- \wd\scratchbox\wd\nextbox
- \box\scratchbox
- \endgroup}
-
-%D We also define plain's \type {\mathstrut}.
-
-\unexpanded\def\mathstrut{\vphantom(} % can be made faster by inlining
-
-%D \macros
-%D {getboxheight}
-%D
-%D Although often needed, \TEX\ does not support arithmics like:
-%D
-%D \starttyping
-%D \dimen0 = \ht0 + \dp0
-%D \stoptyping
-%D
-%D so we implemented:
-%D
-%D \starttyping
-%D \getboxheight ... \of \box...
-%D \stoptyping
-%D
-%D For instance,
-%D
-%D \starttyping
-%D \getboxheight \dimen0 \of \box0
-%D \getboxheight \someheight \of \box \tempbox
-%D \stoptyping
-%D
-%D The implementation is rather stupid:
-%D
-%D \starttyping
-%D \def\getboxheight#1\of#2\box#3%
-%D {#1\ht#3\advance#1\dp#3\relax}
-%D \stoptyping
-%D
-%D The next alternative is slightly more clever, since it accepts \type {{12}} as
-%D well as \type {12} as box number.
-
-\unexpanded\def\getboxheight#1\of#2\box#3%
- {\def\next{#1\htdp\c_boxes_register}%
- \afterassignment\next\c_boxes_register=#3}
-
-%D For a long time the following three macros were part of the grid snapping core
-%D module, but it makes more sense to have them here so that users can see them.
-%D
-%D \macros
-%D {getnoflines, getroundednoflines, getrawnoflines}
-%D
-%D Het commando \type {\getnoflines} converteert een hoogte (dimensie) in een aantal
-%D regels en kent dit toe aan \type {\noflines}.
-%D
-%D \starttyping
-%D \getnoflines{dimensie}
-%D \stoptyping
-%D
-%D Er wordt gedeeld door \type {\openlineheight} en een hoogte van~0pt komt overeen
-%D met 0~regels. The raw alternative does not round.
-%D
-%D For a long time we had:
-%D
-%D \starttyping
-%D \newcount\noflines
-%D \newdimen\noflinesheight
-%D
-%D \def\dogetnoflines#1#2%
-%D {\noflinesheight#2\relax
-%D \ifzeropt\noflinesheight
-%D \noflines\zerocount
-%D \else
-%D \divide\noflinesheight \openlineheight
-%D \noflines\noflinesheight
-%D #1\ifdim\noflines\openlineheight=#2\relax \else
-%D \advance\noflines\ifdim#2>\zeropoint\plusone\else\minusone\fi
-%D \fi\fi
-%D \fi}
-%D
-%D \def\getnoflines {\dogetnoflines\iftrue } % compensated
-%D \def\getrawnoflines{\dogetnoflines\iffalse} % no compensation
-%D \stoptyping
-%D
-%D A more recent variant is:
-
-\ifx\roundingeps\undefined \newdimen\roundingeps \roundingeps=10sp \fi
-
-\newcount\noflines
-\newdimen\noflinesheight
-
-\unexpanded\def\getnoflines#1%
- {\noflinesheight#1\relax
- \ifzeropt\noflinesheight
- \noflines\zerocount
- \orelse\ifdim\noflinesheight>\zeropoint
- \advance\noflinesheight-\roundingeps
- \divide\noflinesheight\openlineheight
- \noflines\noflinesheight
- \advance\noflines\plusone
- \else
- \advance\noflinesheight\roundingeps
- \divide\noflinesheight\openlineheight
- \noflines\noflinesheight
- \advance\noflines\minusone
- \fi}
-
-\unexpanded\def\getroundednoflines#1%
- {\noflinesheight#1\relax
- \ifzeropt\noflinesheight
- \noflines\zerocount
- \orelse\ifdim\noflinesheight>\zeropoint
- \advance\noflinesheight\roundingeps
- \divide\noflinesheight\openlineheight
- \noflines\noflinesheight
- \else
- \advance\noflinesheight-\roundingeps
- \divide\noflinesheight\openlineheight
- \noflines\noflinesheight
- \fi}
-
-\unexpanded\def\getrawnoflines#1%
- {\noflinesheight#1\relax
- \ifzeropt\noflinesheight
- \noflines\zerocount
- \orelse\ifdim\noflinesheight>\zeropoint
- \advance\noflinesheight\roundingeps
- \advance\noflinesheight.5\openlineheight
- \divide\noflinesheight\openlineheight
- \noflines\noflinesheight
- \else
- \advance\noflinesheight-\roundingeps
- \advance\noflinesheight-.5\openlineheight
- \divide\noflinesheight\openlineheight
- \noflines\noflinesheight
- \fi}
-
-%D Let's proof that it works:
-%D
-%D \startbuffer
-%D \scratchdimen\dimexpr(3pt) \getnoflines\scratchdimen 1=\the\noflines \endgraf
-%D \scratchdimen\dimexpr(10\lineheight) \getnoflines\scratchdimen 10=\the\noflines \endgraf
-%D \scratchdimen\dimexpr(10.1\lineheight) \getnoflines\scratchdimen 11=\the\noflines \endgraf
-%D \scratchdimen\dimexpr(10.5\lineheight) \getnoflines\scratchdimen 11=\the\noflines \endgraf
-%D \scratchdimen\dimexpr(10.9\lineheight) \getnoflines\scratchdimen 11=\the\noflines \endgraf
-%D \scratchdimen\dimexpr(10\lineheight+3pt) \getnoflines\scratchdimen 11=\the\noflines \endgraf
-%D \scratchdimen\dimexpr(10\lineheight+3sp) \getnoflines\scratchdimen 10=\the\noflines \endgraf
-%D \scratchdimen\dimexpr(10\lineheight-3sp) \getnoflines\scratchdimen 10=\the\noflines \endgraf
-%D
-%D \scratchdimen\dimexpr(3pt) \getrawnoflines\scratchdimen 0=\the\noflines \endgraf
-%D \scratchdimen\dimexpr(10\lineheight) \getrawnoflines\scratchdimen 10=\the\noflines \endgraf
-%D \scratchdimen\dimexpr(10.1\lineheight) \getrawnoflines\scratchdimen 10=\the\noflines \endgraf
-%D \scratchdimen\dimexpr(10.5\lineheight) \getrawnoflines\scratchdimen 11=\the\noflines \endgraf
-%D \scratchdimen\dimexpr(10.9\lineheight) \getrawnoflines\scratchdimen 11=\the\noflines \endgraf
-%D \scratchdimen\dimexpr(10\lineheight+3pt) \getrawnoflines\scratchdimen 10=\the\noflines \endgraf
-%D \scratchdimen\dimexpr(10\lineheight+3sp) \getrawnoflines\scratchdimen 10=\the\noflines \endgraf
-%D \scratchdimen\dimexpr(10\lineheight-3sp) \getrawnoflines\scratchdimen 10=\the\noflines \endgraf
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-
-%D \macros
-%D {determinenoflines}
-%D
-%D The next macro determines the number of lines and returns it it \type
-%D {\noflines}. The macro works reasonable well as long as the content can be
-%D unboxed.
-%D
-%D \starttyping
-%D \determinenoflines{test\\test}
-%D \determinenoflines{\bfd test\\test}
-%D \determinenoflines{\definedfont[Sans at 40pt]test\\test}
-%D \stoptyping
-
-\def\syst_boxes_determine_noflines % can be mkiv'd
- {\beginofshapebox
- \unvbox\nextbox
- \endofshapebox
- \globalscratchcounter\zerocount
- \reshapebox{\global\advance\globalscratchcounter\plusone}%
- \expandafter\egroup\expandafter\noflines\the\globalscratchcounter\relax}
-
-\unexpanded\def\determinenoflines
- {\bgroup
- \forgetall
- \let\crlf\endgraf
- \let\\\endgraf
- \dowithnextboxcs\syst_boxes_determine_noflines\vbox}
-
-%D \macros
-%D {doiftextelse, doiftext}
-%D
-%D When \type {\doifelse} cum suis hopelessly fail, for instance because we pass
-%D data, we can fall back on the next macro:
-%D
-%D \starttyping
-%D \doiftextelse {data} {then branch} {else branch}
-%D \doiftext {data} {then branch}
-%D \stoptyping
-
-\unexpanded\def\doifelsetext#1%
- {\begingroup
- \setbox\scratchbox\hbox % no \hpack because we can have fallbacks
- {\settrialtypesetting
- \ignorespaces#1\removeunwantedspaces}%
- \ifzeropt\wd\scratchbox
- \endgroup\expandafter\secondoftwoarguments
- \else
- \endgroup\expandafter\firstoftwoarguments
- \fi}
-
-\unexpanded\def\doiftext#1%
- {\begingroup
- \setbox\scratchbox\hbox % no \hpack because we can have fallbacks
- {\settrialtypesetting
- \ignorespaces#1\removeunwantedspaces}%
- \ifzeropt\wd\scratchbox
- \endgroup\expandafter\gobbleoneargument
- \else
- \endgroup\expandafter\firstofoneargument
- \fi}
-
-% more efficient but maybe fragile:
-%
-% \nospacing#1}%
-
-\let\doiftextelse\doifelsetext
-
-%D \macros
-%D {dowithnextbox,nextbox}
-%D
-%D Sometimes we want a macro to grab a box and do something on the content. One
-%D could pass an argument to a box, but this can violate the specific \CATCODES\ of
-%D its content and leads to unexpected results. The next macro treats the following
-%D braced text as the content of a box and manipulates it afterwards in a predefined
-%D way.
-%D
-%D The first argument specifies what to do with the content. This content is
-%D available in \type {\nextbox}. The second argument is one of \type {\hbox}, \type
-%D {\vbox} or \type {\vtop}. The third argument must be grouped with \type {\bgroup}
-%D and \type {\egroup}, \type {{...}} or can be a \type {\box} specification.
-%D
-%D In \CONTEXT\ this macro is used for picking up a box and treating it according to
-%D earlier specifications. We use for instance something like:
-%D
-%D \starttyping
-%D \def\getfloat%
-%D {\def\handlefloat{...\box\nextbox...}
-%D \dowithnextboxcs\handlefloat\vbox}
-%D \stoptyping
-%D
-%D instead of:
-%D
-%D \starttyping
-%D \def\getfloat#1%
-%D {...#1...}
-%D \stoptyping
-%D
-%D In this implementation the \type {\aftergroup} construction is needed because
-%D \type {\afterassignment} is executed inside the box.
-
-\unexpanded\def\dowithnextbox#1%
- {\def\syst_boxes_with_next_box{#1}%
- \afterassignment\syst_boxes_with_next_box_indeed
- \setbox\nextbox}
-
-\def\syst_boxes_with_next_box_indeed
- {\aftergroup\syst_boxes_with_next_box}
-
-\unexpanded\def\dowithnextboxcs#1%
- {\let\syst_boxes_with_next_box#1%
- \afterassignment\syst_boxes_with_next_box_indeed
- \setbox\nextbox}
-
-%D So in fact we get:
-%D
-%D \starttyping
-%D \setbox\nextbox { \aftergroup\syst_boxes_with_next_box ... }
-%D \stoptyping
-%D
-%D or
-%D
-%D \starttyping
-%D \setbox\nextbox { ... } \syst_boxes_with_next_box
-%D \stoptyping
-%D
-%D A slower but more versatile implementation is:
-%D
-%D \starttyping
-%D \unexpanded\def\dowithnextbox#1#2%
-%D {\def\syst_boxes_with_next_box{#1}%
-%D \ifx#2\hbox
-%D \afterassignment\syst_boxes_with_next_box_indeed
-%D \else\ifx#2\vbox
-%D \afterassignment\syst_boxes_with_next_box_indeed
-%D \else\ifx#2\vtop
-%D \afterassignment\syst_boxes_with_next_box_indeed
-%D \else\ifx#2\normalvcenter
-%D \afterassignment\syst_boxes_with_next_box_indeed
-%D \else
-%D \afterassignment\syst_boxes_with_next_box
-%D \fi\fi\fi\fi
-%D \setbox\nextbox#2}
-%D \stoptyping
-%D
-%D This alternative also accepts \type {\box0} and alike, but we don't really need
-%D this functionality now.
-
-%D \macros
-%D {nextboxht,nextboxwd,nextboxdp,flushnextbox}
-%D
-%D The next couple of shortcuts saves us memory as well as \type {{}}'s in passing
-%D parameters.
-
-\def\nextboxht {\ht\nextbox}
-\def\nextboxwd {\wd\nextbox}
-\def\nextboxdp {\dp\nextbox}
-\def\nextboxhtdp{\htdp\nextbox}
-
-\unexpanded\def\flushnextbox{\box\nextbox}
-
-%D \macros
-%D {dowithnextboxcontent}
-%D
-%D But, occasionally we do need to pass some local settings without wanting to use
-%D additional grouping. Therefore we provide:
-%D
-%D \starttyping
-%D \dowithnextboxcontent{inside}{after}{box content}
-%D \stoptyping
-%D
-%D {\em todo: Search source for potential usage!}
-
-\unexpanded\def\dowithnextboxcontent#1#2% inside, after
- {\def\syst_boxes_with_next_box_one{#2}%
- \def\syst_boxes_with_next_box_two{#1}%
- \afterassignment\syst_boxes_with_next_box_content_indeed
- \setbox\nextbox}
-
-\unexpanded\def\dowithnextboxcontentcs#1#2% inside, after
- {\let\syst_boxes_with_next_box_one#2%
- \let\syst_boxes_with_next_box_two#1%
- \afterassignment\syst_boxes_with_next_box_content_indeed
- \setbox\nextbox}
-
-\def\syst_boxes_with_next_box_content_indeed
- {\syst_boxes_with_next_box_two\aftergroup\syst_boxes_with_next_box_one}
-
-%D \macros
-%D {llap, rlap, tlap, blap, clap}
-%D
-%D Some well known friends, but we implement them our own way. We want the macros to
-%D work in both math and text mode.
-
-\def\dodorlap{\hpack to \zeropoint{\box\nextbox\hss}\endgroup}
-\def\dodollap{\hpack to \zeropoint{\hss\box\nextbox}\endgroup}
-\def\dodoclap{\hpack to \zeropoint{\hss\box\nextbox\hss}\endgroup}
-
-\def\dorlap{\begingroup\dowithnextboxcs\dodorlap\hbox}
-\def\dollap{\begingroup\dowithnextboxcs\dodollap\hbox}
-\def\doclap{\begingroup\dowithnextboxcs\dodoclap\hbox}
-
-\def\domathclap{\mathpalette\dodomathclap} \def\dodomathclap#1#2{\doclap{\normalstartimath\mathsurround\zeropoint#1#2\normalstopimath}}
-\def\domathllap{\mathpalette\dodomathllap} \def\dodomathllap#1#2{\dollap{\normalstartimath\mathsurround\zeropoint#1#2\normalstopimath}}
-\def\domathrlap{\mathpalette\dodomathrlap} \def\dodomathrlap#1#2{\dorlap{\normalstartimath\mathsurround\zeropoint#1#2\normalstopimath}}
-
-\unexpanded\def\rlap{\mathortext\domathrlap\dorlap}
-\unexpanded\def\llap{\mathortext\domathllap\dollap}
-\unexpanded\def\clap{\mathortext\domathclap\doclap}
-
-\def\dodotlap{\vpack to \zeropoint{\vss\box\nextbox}\endgroup}
-\def\dodoblap{\vpack to \zeropoint{\box\nextbox\vss}\endgroup}
-
-\unexpanded\def\tlap{\begingroup\dowithnextboxcs\dodotlap\vbox}
-\unexpanded\def\blap{\begingroup\dowithnextboxcs\dodoblap\vbox}
-
-%D \macros
-%D {beginofshapebox,
-%D reshapebox, doreshapebox,
-%D flushshapebox,
-%D innerflushshapebox,
-%D shapebox,
-%D ifreshapingbox}
-%D
-%D The next utility macro originates from some linenumbering mechanism. Due to
-%D \TEX's advanced way of typesetting paragraphs, it's not easy to do things on a
-%D line||by||line basis. This macro is able to reprocess a given box and can act
-%D upon its vertical boxed components, such as lines. The unwinding sequence in this
-%D macro is inspired by a \NTG\ workshop of David Salomon in June 1992.
-%D
-%D First we have to grab the piece of text we want to act upon. This is done by
-%D means of the duo macros:
-%D
-%D \starttyping
-%D \beginofshapebox
-%D a piece of text
-%D \endofshapebox
-%D \stoptyping
-%D
-%D When all texts is collected, we can call \type {\reshapebox} and do something
-%D with it's vertical components. We can make as much passes as needed. When we're
-%D done, the box can be unloaded with \type {\flushshapebox}. The only condition in
-%D this scheme is that \type {\reshapebox} must somehow unload the \BOX\ \type
-%D {\shapebox}.
-%D
-%D An important aspect is that the content is unrolled bottom||up. The next example
-%D illustrates this maybe unexpected characteristic.
-%D
-%D \startbuffer
-%D \beginofshapebox
-%D \em \input tufte
-%D \endofshapebox
-%D
-%D \newcounter\LineNumber
-%D
-%D \reshapebox
-%D {\doglobal\increment\LineNumber
-%D \hbox{\llap{\LineNumber\hskip2em}\box\shapebox}}
-%D
-%D \flushshapebox
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \getbuffer
-%D
-%D As we can see, when some kind of numbering is done, we have to add a second pass.
-%D
-%D \startbuffer
-%D \newcounter\LineNumber
-%D \newcounter\NumberOfLines
-%D
-%D \reshapebox
-%D {\doglobal\increment\NumberOfLines
-%D \box\shapebox}
-%D
-%D \reshapebox
-%D {\doglobal\increment\LineNumber
-%D \hbox
-%D {\llap{\LineNumber\ (\NumberOfLines)\hskip2em}%
-%D \box\shapebox}%
-%D \doglobal\decrement\NumberOfLines}
-%D
-%D \flushshapebox
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \getbuffer
-%D
-%D This example shows that the content of the box is still available after flushing.
-%D Another feature is that only the last reshaping counts. Multiple reshaping can be
-%D done by:
-%D
-%D \startbuffer
-%D \beginofshapebox
-%D \flushshapebox
-%D \endofshapebox
-%D
-%D \reshapebox
-%D {\doglobal\increment\LineNumber
-%D \hbox{\llap{$\star$\hskip1em}\box\shapebox}%
-%D \doglobal\decrement\NumberOfLines}
-%D
-%D \flushshapebox
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \getbuffer
-%D
-%D The macros are surprisingly easy to follow and in fact introduce no new concepts.
-%D Nearly all books on \TEX\ show similar solutions for unwinding \BOXES.
-%D
-%D Some macros, like footnote ones, can be sensitive for reshaping, which can result
-%D in an endless loop. We therefore offer:
-%D
-%D \starttyping
-%D \ifreshapingbox
-%D \stoptyping
-%D
-%D Some \CONTEXT\ commands are protected this way. Anyhow, reshaping is aborted
-%D after 100 dead cycles.
-%D
-%D By the way, changing the height and depth of \BOX\ \type {\shapebox} results in
-%D bad spacing. This means that for instance linenumbers etc. should be given zero
-%D height and depth before being lapped into the margin. The previous examples
-%D ignore this side effect, but beware!
-
-\newif \ifsomeshapeleft
-\newif \ifreshapingbox
-\newif \ifreshapingfailed % may save redundant runs
-
-\newbox \shapebox
-\newcount \shapepenalty
-\newdimen \shapekern
-\newskip \shapeskip
-
-\newbox \newshapebox
-\newbox \oldshapebox
-\newbox \tmpshapebox
-
-\newcount \shapecounter
-
-\newevery \everyshapebox \relax
-
-\def\shapesignal{.12345678pt} % or 12345sp
-
-\unexpanded\def\reshapebox#1%
- {\doreshapebox
- {#1}%
- {\penalty\shapepenalty}%
- {\kern \shapekern }%
- {\vskip \shapeskip }}
-
-\def\doreshapebox#1#2#3#4% \shapebox, \shapepenalty, \shapekern, \shapeskip
- {\global\reshapingfailedfalse
- \ifzeropt\ht\oldshapebox
- \setbox\newshapebox\emptyvbox
- \else
- \setbox\newshapebox\vbox % can be \vpack
- {\unvcopy\oldshapebox
- \setbox\newshapebox\emptybox
- \shapecounter\zerocount
- \doloop{\dodoreshapebox{#1}{#2}{#3}{#4}}}%
- \setbox\newshapebox\box\tmpshapebox
- \fi}
-
-\ifx\originalshapebox\undefined \let\originalshapebox\oldshapebox \fi
-
-% We will turn this into a \MKIV\ variant (we can use \type {\vpack} too).
-
-\unexpanded\def\insertshapesignal
- {\hpack to \shapesignal{\strut\hss}% plus \strut
- \prevdepth\strutdp} % never \nointerlineskip
-
-\unexpanded\def\restoreshapebox % compensates for the signal
- {\global\setbox\tmpshapebox\vbox{\vskip-\lineheight\unvcopy\oldshapebox}}
-
-\def\dodoreshapebox#1#2#3#4% \shapebox, \shapepenalty, \shapekern, \shapeskip
- {\ifnum\lastnodetype=\gluenodecode
- \shapeskip\lastskip
- \global\setbox\tmpshapebox\vbox{#4\unvbox\tmpshapebox}%
- \unskip
- \orelse\ifnum\lastnodetype=\kernnodecode
- \shapekern\lastkern
- \global\setbox\tmpshapebox\vbox{#3\unvbox\tmpshapebox}%
- \unkern
- \orelse\ifnum\lastnodetype=\penaltynodecode
- \shapepenalty\lastpenalty
- \global\setbox\tmpshapebox\vbox{#2\unvbox\tmpshapebox}%
- \unpenalty
- \orelse\ifnum\lastnodetype<\zeropoint
- \exitloop
- \else
- \setbox\shapebox\lastbox
- \ifvoid\shapebox
- \orelse\ifdim\wd\shapebox=\shapesignal\relax
- \exitloop
- \else
- \shapecounter\zerocount
- \global\setbox\tmpshapebox\vbox{#1\unvbox\tmpshapebox}%
- \fi
- \fi
- \ifnum\shapecounter>100 % can be less
- \global\reshapingfailedtrue
- \message{!!forced exit from shapebox \the\lastnodetype !!}%
- \restoreshapebox
- \exitloop
- \else
- \advance\shapecounter \plusone
- \fi}
-
-\unexpanded\def\beginofshapebox
- {\setbox\oldshapebox\vbox
- \bgroup
- \reshapingboxtrue
- \the\everyshapebox
- \insertshapesignal}
-
-\unexpanded\def\endofshapebox
- {\endgraf
- \egroup}
-
-\let\beginshapebox\beginofshapebox
-\let\endshapebox \endofshapebox
-
-\unexpanded\def\flushshapebox
- {\bgroup
- \ifzeropt\ht\newshapebox
- \else
- % make \prevdepth legal
- % \par before the next \vskip gives far worse results
- \ifdim\parskip>\zeropoint\vskip\parskip\else\par\fi
- % and take a look
- \ifdim\prevdepth=-\thousandpoint
- \prevdepth\zeropoint
- \fi
- \ifdim\prevdepth<\zeropoint\relax
- % something like a line or a signal or ...
- \donetrue
- \orelse\ifinner
- % not watertight and not ok
- \donefalse
- \orelse\ifdim\pagegoal=\maxdimen
- \donetrue
- \else
- % give the previous line a normal depth
- \donetrue
- {\forgeteverypar\verticalstrut}\nobreak
- \kern-\struttotal % geen \vskip
- \kern-\parskip
- % \vskip-\strutdp
- \fi
- \scratchdimen\dp\newshapebox
- \unvbox\newshapebox
- % \prevdepth=0pt and \dp\newshapebox depend on last line
- \kern-\scratchdimen % ??
- % now \prevdepth=0pt
- \ifdone
- \kern\strutdp
- \prevdepth\strutdp
- \fi
- \fi
- \egroup}
-
-%D In real inner situations we can use:
-%D
-%D \starttyping
-%D \flushinnershapebox
-%D \stoptyping
-%D
-%D This one is used in \type{\framed}.
-
-% The kern fails on for instance:
-%
-% \omlijnd[offset=0pt,hoogte=8mm,uitlijnen={rechts,laho}]{\bfa test}
-
-\unexpanded\def\innerflushshapebox
- {\ifzeropt\ht\newshapebox \else
- \unvcopy\newshapebox\relax % unvcopy ! else spacing problem
- % \kern-\dp\newshapebox\relax
- \fi}
-
-%D For absolute control, one can use \type {\doreshapebox} directly. This macro
-%D takes four arguments, that take care of:
-%D
-%D \startitemize[n,packed]
-%D \item \type{\shapebox}
-%D \item \type{\shapepenalty}
-%D \item \type{\shapekern}
-%D \item \type{\shapeskip}
-%D \stopitemize
-
-%D \macros
-%D {shapedhbox}
-%D
-%D When constructing a new box, using the content of \type {\shapebox}, one can best
-%D use \type {\shapedhbox} instead of \type {\hbox}, since it manages the height and
-%D depth of the line.
-
-\unexpanded\def\shapedhbox % lines with non strutted dimensions have
- {\expanded{\dowithnextbox % interlineskip so if we want the original
- {\ht\nextbox\the\ht\shapebox % spacing, we need to preserve the original
- \dp\nextbox\the\dp\shapebox % height and depth which is definitely
- \box\nextbox}} % needed if we apply struts to the 'new'
- \hbox} % box or do something that changed ist size
-
-%D \macros
-%D {hyphenatedword,
-%D hyphenatedpar,
-%D hyphenatedfile,
-%D dohyphenateword}
-%D
-%D We no longer use the pure \TEX\ variant. In due time we will report some more
-%D advanced statistics.
-%D
-%D \starttyping
-%D \showhyphens{dohyphenatedword}
-%D \stoptyping
-
-\unexpanded\def\doshowhyphenatednextbox
- {\clf_showhyphenatedinlist\nextbox}
-
-\unexpanded\def\showhyphens % hpack: so no processing (we hyphenate in lua)
- {\dowithnextboxcs\doshowhyphenatednextbox\hpack}
-
-%D The following macros are seldom used but handy for tracing.
-%D
-%D \starttyping
-%D \hyphenatedword{dohyphenatedword}
-%D \hyphenatedpar {\dorecurse{10}{dohyphenatedword }}
-%D \hyphenatedfile{tufte}
-%D \stoptyping
-
-\unexpanded\def\dohyphenatednextbox
- {\clf_hyphenatedlist\nextbox false\relax
- \unhbox\nextbox}
-
-\unexpanded\def\hyphenatedword {\dowithnextboxcs\dohyphenatednextbox\hbox}
-\unexpanded\def\hyphenatedpar {\dowithnextboxcs\dohyphenatednextbox\hbox}
-\unexpanded\def\hyphenatedfile#1{\dowithnextboxcs\dohyphenatednextbox\hbox{\readfile{#1}\donothing\donothing}}
-
-\unexpanded\def\dohyphenatednextboxcolor
- {\clf_hyphenatedlist\nextbox true\relax
- \unhbox\nextbox}
-
-\unexpanded\def\hyphenatedcoloredword{\dowithnextboxcs\dohyphenatednextboxcolor\hbox}
-
-%D \macros
-%D {processtokens}
-%D
-%D We fully agree with (most) typographers that inter||letter spacing is only
-%D permitted in fancy titles, we provide a macro that can be used to do so. Because
-%D this is (definitely and fortunately) no feature of \TEX, we have to step through
-%D the token list ourselves.
-%D
-%D \starttyping
-%D \processtokens {before} {between} {after} {space} {tokens}
-%D \stoptyping
-%D
-%D An example of a call is:
-%D
-%D \startbuffer
-%D \processtokens {[} {+} {]} {\space} {hello world}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D This results in:
-%D
-%D \getbuffer
-%D
-%D The list of tokens may contain spaces, while \type {\\}, \type {{}} and \type {\
-%D } are handled as space too.
-
-\unexpanded\def\processtokens#1#2#3#4#5%
- {\begingroup
- \def\lastcharacter{\lastcharacter}% hm, recursive ?
- \def\space{ }%
- \let\\=\space
- \def\before {#1}%
- \def\between{#2}%
- \def\after {#3}%
- \def\white {#4}%
- \let\savedbefore\before
- \doprocesstokens#5\lastcharacter
- \endgroup}
-
-\def\doprocesstokens% the space after = is essential
- {\afterassignment\dodoprocesstokens\let\nextprocessedtoken= }
-
-\def\redoprocessedtoken
- {\dowithnextbox
- {\before{\copy\nextbox}% \before can use nextbox several times
- \let\before\between
- \doprocesstokens}
- \hbox\bgroup}
-
-\def\dodoprocesstokens
- {\ifx\nextprocessedtoken\lastcharacter
- \after
- \orelse\ifx\nextprocessedtoken\bgroup
- \expandafter\redoprocessedtoken
- \else
- \expandafter\if\space\nextprocessedtoken
- \after\white
- \let\before\savedbefore
- \else
- \before\nextprocessedtoken
- \let\before\between
- \fi
- \expandafter\doprocesstokens
- \fi}
-
-%D \macros
-%D {doboundtext}
-%D
-%D Sometimes there is not enough room to show the complete (line of) text. In such a
-%D situation we can strip of some characters by using \type {\doboundtext}. When the
-%D text is wider than the given width, it's split and the third argument is
-%D appended. When the text to be checked is packed in a command, we'll have to use
-%D \type {\expandafter}.
-%D
-%D \starttyping
-%D \doboundtext{a very, probably to long, text}{3cm}{...}
-%D \stoptyping
-%D
-%D When calculating the room needed, we take the width of the third argument into
-%D account, which leads to a bit more complex macro than needed at first sight.
-
-\def\dodoboundtext#1%
- {\setbox\scratchboxone\hbox{#1}%
- \advance\scratchdimen -\wd\scratchboxone
- \ifdim\scratchdimen>\zeropoint\relax#1\fi}
-
-\def\doboundtext#1#2#3% still used?
- {\hbox
- {\setbox\scratchbox\hbox{#1}%
- \scratchdimen#2\relax
- \ifdim\wd\scratchbox>\scratchdimen
- \setbox\scratchbox\hbox{#3}%
- \advance\scratchdimen -\wd\scratchbox
- \handletokens#1\with\dodoboundtext
- \fi
- \box\scratchbox}}
-
-%D \macros
-%D {limitatetext}
-%D
-%D A bit more beautiful alternative for the previous command is the next one. This
-%D command is more robust because we let \TEX\ do most of the job. The previous
-%D command works better on text that cannot be hyphenated.
-%D
-%D \starttyping
-%D \limitatetext {text} {width} {sentinel}
-%D \limitatetext {text} {-width} {prelude}
-%D \stoptyping
-%D
-%D When no width is given, the whole text comes available. The sentinel is optional.
-%D This is about the third version.
-
-\ifdefined\fakecompoundhyphen\else \let\fakecompoundhyphen\relax \fi
-\ifdefined\veryraggedright \else \def\veryraggedright{\raggedright} \fi
-
-% \unexpanded\def\limitatetext
-% {\bgroup % evt \setstrut
-% \forgetall % otherwise indentation and so
-% \let\limitatetext\firstofthreearguments
-% \fakecompoundhyphen % dangerous ! ! ! ! ! ! ! ! !
-% \dowithnextboxcs\syst_boxes_limitate_text\hbox}
-%
-% \def\syst_boxes_limitate_text#1% #2
-% {\doifelsenothing{#1}\syst_boxes_limitate_text_nop\syst_boxes_limitate_text_yes{#1}} % {#2}
-%
-% \def\syst_boxes_limitate_text_nop#1#2%
-% {\unhbox\nextbox
-% \egroup}
-%
-% \def\syst_boxes_limitate_text_yes#1#2%
-% {\nopenalties
-% \scratchdimen#1\relax
-% \ifdim\scratchdimen<\zeropoint\relax % we'll take the last line
-% \donefalse
-% \scratchdimen-\scratchdimen
-% \else
-% \donetrue
-% \fi
-% \ifdim\wd\nextbox>\scratchdimen
-% \setbox\scratchbox\hbox{\ifdone\space#2\else#2\space\fi}%
-% \advance\scratchdimen -\wd\scratchbox
-% \setbox\scratchboxone\box\nextbox
-% \setbox\nextbox\vbox
-% {\hsize\scratchdimen
-% \hfuzz\maxdimen
-% \veryraggedright
-% \strut
-% \ifdone \else
-% \parfillskip\zeropoint
-% \rightskip\zeropoint
-% \hskip\zeropoint \s!plus 1\s!fill % \hsize
-% \fi
-% \unhcopy\scratchboxone}%
-% \ifdim\ht\nextbox>\strutht
-% \setbox\nextbox\vbox % if omitted: missing brace reported
-% {\splittopskip\openstrutheight
-% \ifdone
-% \setbox\nextbox\vsplit\nextbox to \strutht
-% \else
-% \doloop
-% {\setbox\scratchboxone\vsplit\nextbox to \strutht
-% \ifdim\ht\nextbox>\strutht \else \exitloop \fi}%
-% \fi
-% \unvbox\nextbox
-% \setbox\nextbox\lastbox
-% \global\setbox1\hpack
-% {\ifdone
-% \unhbox\nextbox\unskip\kern\zeropoint\box\scratchbox
-% \else
-% \box\scratchbox\unhbox\nextbox
-% \fi
-% \unskip}}%
-% \unhbox1
-% \else
-% \unhbox0%
-% \fi
-% \else
-% \unhbox\nextbox
-% \fi
-% \egroup}
-%
-% %D We can also limit a text with more control:
-% %D
-% %D \startbuffer
-% %D \limitatetext {\input tufte } {2cm,5mm} {\unknown}
-% %D \limitatetext {ton en hans} {2cm,5mm} {\unknown}
-% %D \limitatetext {ton en hans zijn eikels} {2cm,5mm} {\unknown}
-% %D \limitatetext {ton} {2cm,5mm} {\unknown}
-% %D \stopbuffer
-% %D
-% %D \typebuffer \getbuffer
-% %D
-% %D We build this feature on top of the previous macro.
-%
-% % we could move the text argument to the end
-%
-% \let\normallimitatetext\limitatetext
-%
-% \def\speciallimitatetext#1#2#3#4% text left right placeholder
-% {%\dontleavehmode
-% \bgroup
-% \let\speciallimitatetext\firstoffourarguments
-% \setbox\scratchboxone\hbox
-% {\nohyphens
-% \normallimitatetext{#1}{+#2}{}#4%
-% \normallimitatetext{#1}{-#3}{}}%
-% \setbox\scratchboxtwo\hbox
-% {#1}%
-% \ifdim\wd\scratchboxtwo<\wd\scratchboxone #1\else\unhbox\scratchboxone\fi
-% \egroup}
-%
-% \unexpanded\def\limitatetext#1#2#3% \expanded added 2003/01/16
-% {\splitatcomma{#2}\leftlimit\rightlimit
-% \ifx\rightlimit\empty
-% \normallimitatetext {#1}\leftlimit {#3}%
-% \else
-% \speciallimitatetext{#1}\leftlimit\rightlimit{#3}%
-% \fi}
-
-\unexpanded\def\limitatetext#1#2#3% \expanded added 2003/01/16
- {\splitatcomma{#2}\leftlimit\rightlimit
- \limitated
- left \leftlimit
- \ifx\rightlimit\empty\else
- right \rightlimit
- \fi
- strip true
- sentinel {#3}
- text {#1}
- \relax}
-
-%D Undocumented bonus (see wiki):
-%D
-%D \starttyping
-%D \limitatefirstline{\input tufte\relax}{10cm}{\unknown}
-%D \stoptyping
-
-\unexpanded\def\limitatefirstline#1#2#3%
- {\hbox\bgroup\strut % \hpack
- \setbox\scratchbox\hbox{\begstrut#1\endstrut}%
- \ifdim\wd\scratchbox>#2\relax
- \setbox\scratchbox\hbox{#3}%
- \hsize#2\relax
- \advance\hsize-\wd\scratchbox
- \setbox\scratchbox\vbox{\forgetall\veryraggedright#1}%
- \setbox\scratchbox\vsplit\scratchbox to \lineheight
- \vbox
- {\unvbox\scratchbox
- \global\setbox\plusone\lastbox
- \global\setbox\plusone\hbox{\strut\unhbox\plusone}%
- \hbox % to #2 % \hpack
- {\ifx\clip\undefined
- \box\plusone
- \orelse\ifdim\wd\plusone>\hsize
- \lower\strutdepth\hpack{\clip[\c!width=\hsize,\c!height=\lineheight]{\hpack{\raise\strutdepth\box\plusone}}}%
- \else
- \box\plusone
- \fi
- \removeunwantedspaces#3}}% \removeunwantedspaces\hss#3}}%
- \else
- #1%
- \fi
- \egroup}
-
-%D \macros
-%D {processisolatedwords,processisolatedchars}
-%D
-%D \startbuffer
-%D \processisolatedchars{some more words} \ruledhbox \par
-%D \processisolatedchars{and some $x + y = z$ math} \ruledhbox \par
-%D \processisolatedchars{and a \hbox{$x + y = z$}} \ruledhbox \par
-%D \processisolatedwords{some more words} \ruledhbox \par
-%D \processisolatedwords{and some $x + y = z$ math} \ruledhbox \par
-%D \processisolatedwords{and a \hbox{$x + y = z$}} \ruledhbox \par
-%D \stopbuffer
-%D
-%D \typebuffer \blank \getbuffer \blank
-
-% todo: provide variant with #1 picked up as box
-
-\unexpanded\def\processisolatedchars#1#2%
- {\dontleavehmode
- \begingroup
- \setbox\scratchbox\hbox{\settrialtypesetting#2{\savecurrentattributes{pic}}}%
- \setbox\scratchbox\hbox{\restorecurrentattributes{pic}#1}%
- \clf_applytobox
- method {char}%
- box \scratchbox
- command {\csstring#2}%
- nested true%
- \relax
- \endgroup}
-
-\unexpanded\def\processisolatedwords#1#2%
- {\dontleavehmode
- \begingroup
- \setbox\scratchbox\hbox{\settrialtypesetting#2{\savecurrentattributes{pic}}}%
- \setbox\scratchbox\hbox{\restorecurrentattributes{pic}#1}%
- \clf_applytobox
- method {word}%
- box \scratchbox
- command {\csstring#2}%
- nested true%
- \relax
- \endgroup}
-
-%D A variant:
-
-\unexpanded\def\applytocharacters#1%
- {\dontleavehmode
- \dowithnextbox{\clf_applytobox
- method {char}%
- box \nextbox
- command {\csstring#1}%
- nested true%
- \relax}%
- \hbox}
-
-\unexpanded\def\applytowords#1%
- {\dontleavehmode
- \dowithnextbox{\clf_applytobox
- method {word}%
- box \nextbox
- command {\csstring#1}%
- nested true%
- \relax}%
- \hbox}
-
-%D The old call:
-
-\unexpanded\def\processwords#1%
- {\processisolatedwords{#1}\processword}
-
-\let\processword\relax
-
-\unexpanded\def\applytosplitstringchar#1#2%
- {\dontleavehmode\clf_processsplit
- data {#2}%
- command {\csstring#1}%
- method {char}%
- \relax}
-
-\unexpanded\def\applytosplitstringword#1#2%
- {\dontleavehmode\clf_processsplit
- data {#2}%
- command {\csstring#1}%
- method {word}%
- \relax}
-
-\unexpanded\def\applytosplitstringline#1#2%
- {\dontleavehmode\clf_processsplit
- data {#2}%
- command {\csstring#1}%
- method {line}%
- \relax}
-
-\unexpanded\def\applytosplitstringcharspaced#1#2%
- {\dontleavehmode\clf_processsplit
- data {#2}%
- command {\csstring#1}%
- method {char}%
- spaced true%
- \relax}
-
-\unexpanded\def\applytosplitstringwordspaced#1#2%
- {\dontleavehmode\clf_processsplit
- data {#2}%
- command {\csstring#1}%
- method {word}%
- spaced true%
- \relax}
-
-\unexpanded\def\applytosplitstringlinespaced#1#2%
- {\dontleavehmode\clf_processsplit
- data {#2}%
- command {\csstring#1}%
- method {line}%
- spaced true%
- \relax}
-
-%D \macros
-%D {sbox}
-%D
-%D This is a rather strange command. It grabs some box content and and limits the
-%D size to the height and depth of a \type {\strut}. The resulting bottom||alligned
-%D box can be used aside other ones, without disturbing the normal baseline
-%D distance.
-%D
-%D \startbuffer
-%D \ruledhbox to .5\hsize{\sbox{eerste\par tweede \par derde}}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D Shows up as:
-%D
-%D \startexample
-%D \vskip3\baselineskip
-%D \getbuffer
-%D \stopexample
-%D
-%D Before displaying the result we added some skip, otherwise the first two lines
-%D would have ended up in the text. This macro can be useful when building
-%D complicated menus, headers and footers and|/|or margin material.
-
-\unexpanded\def\sbox
- {\vpack\bgroup
- \dowithnextboxcs\syst_boxes_sbox_finish\vbox}
-
-\unexpanded\def\syst_boxes_sbox_finish
- {\boxyoffset\nextbox-\strutdp
- \dp\nextbox\strutdp
- \ht\nextbox\strutht
- \box\nextbox
- \egroup}
-
-%D A variant on this:
-%D
-%D \starttyping
-%D xx \ruledhbox{\inlinedbox{\tfd test}} xx
-%D \stoptyping
-
-\unexpanded\def\inlinedbox
- {\bgroup
- \dowithnextboxcs\syst_boxes_inlined_finish\hbox}
-
-\unexpanded\def\syst_boxes_inlined_finish
- {\boxyoffset\nextbox-\dimexpr(\htdp\nextbox-\lineheight)/\plustwo+\strutdp\relax
- \ht\nextbox\strutht
- \dp\nextbox\strutdp
- \box\nextbox
- \egroup}
-
-%D \macros
-%D {struttedbox}
-%D
-%D This boxing macro limits the height and depth to those of a strut.
-
-\unexpanded\def\struttedbox
- {\hpack\bgroup
- \dowithnextboxcs\syst_boxes_struttedbox_finish\hbox}
-
-\def\syst_boxes_struttedbox_finish
- {\dp\nextbox\strutdepth
- \ht\nextbox\strutheight
- \box\nextbox
- \egroup}
-
-%D \macros
-%D {topskippedbox}
-%D
-%D This macro compensates the difference between the topskip and strutheight. Watch
-%D how we preserve the depth when it equals strutdepth.
-
-\unexpanded\def\topskippedbox
- {\hpack\bgroup\dowithnextboxcs\syst_boxes_topskippedbox_finish\hbox}
-
-\def\syst_boxes_topskippedbox_finish
- {\edef\m_boxes_tmp{\ifdim\strutdepth=\dp\nextbox\dp\nextbox\the\dp\nextbox\fi}%
- \lower\topskip\hpack{\raise\strutheight\box\nextbox}%
- \m_boxes_tmp
- \egroup}
-
-%D \macros
-%D {centeredbox, centerednextbox}
-%D
-%D Here is another strange one. This one offers a sort of overlay with positive or
-%D negative offsets. This command can be used in well defined areas where no offset
-%D options are available. We first used it when building a button inside the margin
-%D footer, where the button should have a horizontal offset and should be centered
-%D with respect to the surrounding box. The last of the three examples we show below
-%D says:
-%D
-%D \starttyping
-%D \vsize=3cm
-%D \hsize=3cm
-%D \ruledvbox to \vsize
-%D {\centeredbox height .5cm width -1cm
-%D {\vrule width \hsize height \vsize}}}
-%D \stoptyping
-%D
-%D Here the \type {\ruledvbox} just shows the surrounding box and \type {\vrule} is
-%D used to show the centered box.
-%D
-%D \def\AnExample#1#2%
-%D {\vsize=3cm
-%D \hsize=3cm
-%D \ruledvbox to \vsize
-%D {\centeredbox height #1 width #2
-%D {\color[green]{\vrule width \hsize height \vsize}}}}
-%D
-%D \startlinecorrection
-%D \startcombination[3*1]
-%D {\AnExample {-1cm} {.5cm}} {}
-%D {\AnExample {.5cm} {-1cm}} {}
-%D {\AnExample {-1cm} {-.5cm}} {}
-%D \stopcombination
-%D \stoplinecorrection
-%D
-%D This command takes two optional arguments: \type {width} and \type {height}.
-%D Observing readers can see that we use \TEX's own scanner for grabbing these
-%D arguments: \type {#1#} reads everyting till the next brace and passes it to both
-%D rules. The setting of the box dimensions at the end is needed for special cases.
-%D The dimensions of the surrounding box are kept intact. This commands handles
-%D positive and negative dimensions (which is why we need two boxes with rules).
-
-\unexpanded\def\centeredbox#1#% height +/-dimen width +/-dimen
- {\bgroup
- \dontcomplain
- \forgetall
- \scangivendimensions#1\relax
- \advance\vsize\givenheight
- \advance\hsize\givenwidth
- \dowithnextboxcs\syst_boxes_centered_finish
- \hbox}
-
-\def\syst_boxes_centered_finish
- {\boxxoffset\nextbox.5\dimexpr
- \hsize
- -\wd\nextbox
- -\givenwidth
- \relax
- \boxyoffset\nextbox.5\dimexpr
- \vsize
- -\ht\nextbox
- +\dp\nextbox
- -\givenheight
- \relax
- \wd\nextbox\dimexpr\hsize-\givenwidth \relax
- \ht\nextbox\dimexpr\vsize-\givenheight\relax
- \dp\nextbox\zeropoint
- \box\nextbox
- \egroup}
-
-%D For those who don't want to deal with \type {\hsize} and \type {\vsize}, we have:
-%D
-%D \starttyping
-%D \centerednextbox width 2bp height 2bp
-%D {\framed[width=100bp,height=100bp]{}}
-%D \stoptyping
-%D
-%D Do you see why we call this one \type {next}?
-
-\unexpanded\def\centerednextbox#1#%
- {\bgroup
- \dowithnextbox
- {\hsize\wd\nextbox
- \vsize\ht\nextbox
- \centeredbox#1{\box\nextbox}%
- \egroup}
- \hbox}
-
-%D \macros
-%D {centerbox}
-%D
-%D Centering on the available space is done by:
-%D
-%D \starttyping
-%D \centerbox <optional specs> {content}
-%D \stoptyping
-%D
-%D When omitted, the current \type {\hsize} and \type {\vsize} are used. Local
-%D dimensions are supported.
-
-\unexpanded\def\centerbox#1#% optional height +/-dimen width +/-dimen
- {\bgroup
- \dowithnextbox
- {\setlocalhsize
- \setbox\scratchbox\hpack{\vrule\s!width \zeropoint#1}%
- \ifzeropt\wd\scratchbox\else\hsize\wd\scratchbox\fi
- \setbox\scratchbox\vpack{\hrule\s!height\zeropoint#1}%
- \ifzeropt\ht\scratchbox\else\vsize\ht\scratchbox\fi
- \vpack to \vsize{\vss\hpack to \hsize{\hss\box\nextbox\hss}\vss}%
- \egroup}%
- \hbox}
-
-%D \macros
-%D {setrigidcolumnhsize,rigidcolumnbalance,rigidcolumnlines}
-%D
-%D These macros are copied from the \TEX book, page~397, and extended by a macro
-%D that sets the \type {\hsize}.
-%D
-%D \starttyping
-%D \setrigidcolumnhsize {total width} {distance} {n}
-%D \rigidcolumnbalance {box}
-%D \stoptyping
-%D
-%D Both these macros are for instance used in typesetting footnotes. The following
-%D flags influence the process.
-
-\newif\ifalignrigidcolumns
-\newif\ifstretchrigidcolumns
-\newif\iftightrigidcolumns % if true: just a vbox, no depth/noflines/gridsnap corrrections
-
-\unexpanded\def\setrigidcolumnhsize#1#2#3% todo: \dimexpr
- {\xdef\savedrigidhsize{\the\hsize}%
- \hsize#1\relax
- \global\chardef\rigidcolumns#3\relax
- \scratchdimen -#2\relax
- \multiply\scratchdimen #3\relax
- \advance\scratchdimen #2\relax
- \advance\hsize \scratchdimen
- \divide\hsize #3\relax}
-
-% ==
-%
-% \def\setrigidcolumnhsize#1#2#3%
-% {\xdef\savedrigidhsize{\the\hsize}%
-% \global\chardef\rigidcolumns#3\relax
-% \hsize=\dimexpr(#1-\numexpr#3-1\relax\dimexpr#2\relax)/#3\relax}
-
-\newbox\rigidcolumnbox
-
-\let\rigidcolumnlines\!!zerocount
-
-\unexpanded\def\rigidcolumnbalance#1%
- {\ifnum\rigidcolumns=1 % tzt ook h/d correctie
- \ifinner\ifhmode\box\else\unvbox\fi\else\unvbox\fi#1\relax
- \else
- \vbox % \vpack
- {\forgetall
- \nopenalties
- \dontcomplain
- \setbox\rigidcolumnbox\vbox
- {\line{}\goodbreak\unvbox#1\removebottomthings}%
- \splittopskip\openstrutheight
- \setbox\scratchbox\vsplit\rigidcolumnbox to \zeropoint
- \ifcase\rigidcolumnlines\relax
- % \iffalse
- % % maybe some day an option
- % \scratchskip\ht\rigidcolumnbox
- % \advance\scratchskip\dp\rigidcolumnbox
- % \getnoflines\scratchskip
- % \ifodd\noflines
- % \advance\noflines\plusone
- % \fi
- % \divide\noflines\rigidcolumns
- %\else
- \scratchdimen\ht\rigidcolumnbox
- \divide\scratchdimen \rigidcolumns
- \getnoflines\scratchdimen
- %\fi
- \else
- \noflines\rigidcolumnlines % to be sure
- \fi
- \scratchdimen\noflines\lineheight
- % new: we now loop so that we don't loose content
- % since in practice we also use this macro for
- % funny lineheights and border cases
- \setbox0=\box\rigidcolumnbox
- \doloop
- {\setbox\rigidcolumnbox=\copy0
- \setbox\scratchbox\hpack to \savedrigidhsize
- {\dorecurse\rigidcolumns
- {\setbox\scratchbox\vsplit\rigidcolumnbox to \scratchdimen
- \dp\scratchbox\openstrutdepth
- \setbox\scratchbox\vtop
- \ifalignrigidcolumns to
- \ifstretchrigidcolumns\vsize\else\scratchdimen\fi
- \fi
- {\unvbox\scratchbox}%
- \wd\scratchbox\hsize
- \box\scratchbox
- \hfill}%
- \hfillneg}%
- \ifvoid\rigidcolumnbox\exitloop\else\advance\scratchdimen\lineheight\fi}%
- \iftightrigidcolumns
- \setbox\scratchbox\hpack{\raise\dp\scratchbox\box\scratchbox}%
- \else
- \advance\scratchdimen -\openstrutdepth
- \setbox\scratchbox\hpack{\raise\scratchdimen\box\scratchbox}%
- \dp\scratchbox\openstrutdepth
- \ht\scratchbox\scratchdimen
- \fi
- \box\scratchbox}%
- \fi}
-
-%D \macros
-%D {startvboxtohbox,stopvboxtohbox,convertvboxtohbox}
-%D
-%D Here is another of Knuth's dirty tricks, as presented on pages 398 and 399 of the
-%D \TEX book. These macros can be used like:
-%D
-%D \starttyping
-%D \vbox
-%D \bgroup
-%D \startvboxtohbox ... \stopvboxtohbox
-%D \startvboxtohbox ... \stopvboxtohbox
-%D \startvboxtohbox ... \stopvboxtohbox
-%D \egroup
-%D
-%D \vbox
-%D \bgroup
-%D \convertvboxtohbox
-%D \egroup
-%D \stoptyping
-%D
-%D These macros are used in reformatting footnotes, so they do what they're meant
-%D for.
-
-\newdimen\vboxtohboxslack
-\newdimen\hboxestohboxslack
-
-%D Create line and fake height of paragraph by messign with heights: a nice hack by
-%D DEK himself.
-
-%\unexpanded\def\setvboxtohbox
-% {\bgroup
-% \ifdim\baselineskip<16pt \relax
-% \scratchdimen\baselineskip
-% \multiply\scratchdimen 1024
-% \else
-% \message{cropping \baselineskip to 16pt}%
-% \scratchdimen\maxdimen
-% \fi
-% \divide\scratchdimen \hsize
-% \multiply\scratchdimen 64
-% \xdef\vboxtohboxfactor{\withoutpt\the\scratchdimen}%
-% \egroup}
-%
-% \unexpanded\def\startvboxtohbox
-% {\bgroup
-% \setvboxtohbox
-% \setbox\scratchbox\hbox\bgroup}
-%
-% \unexpanded\def\stopvboxtohbox
-% {\ifcase\vboxtohboxslack\else\hskip\zeropoint\!!minus\vboxtohboxslack\fi
-% \egroup
-% \dp\scratchbox\zeropoint
-% \ht\scratchbox\vboxtohboxfactor\wd\scratchbox
-% \box\scratchbox
-% \egroup}
-
-% More modern:
-
-% \definesystemattribute[vboxtohboxseparator][public]
-
-%newbox\d_syst_boxes_vboxtohbox
-\newbox\d_syst_boxes_separator
-
-\unexpanded\def\startvboxtohboxseparator
- {\setbox\d_syst_boxes_separator\hbox attr \vboxtohboxseparatorattribute\plusone\bgroup}
-
-\unexpanded\def\stopvboxtohboxseparator
- {\egroup}
-
-\unexpanded\def\startvboxtohbox
- {\begingroup
- \setbox\scratchbox\hbox\bgroup}
-
-\unexpanded\def\stopvboxtohbox
- {\ifvoid\d_syst_boxes_separator
- \hskip\zeropoint\ifcase\vboxtohboxslack\else\s!minus\vboxtohboxslack\fi % we really need a skip
- \else
- \box\d_syst_boxes_separator
- \fi
- \egroup
- \clf_hboxtovbox\scratchbox
- \box\scratchbox
- \endgroup}
-
-% A possible reconstruction:
-
-\unexpanded\def\convertvboxtohbox
- {\makehboxofhboxes
- \setbox\scratchboxone\hpack{\unhbox\scratchboxone\removehboxes}% \hpack
- \noindent\unhbox\scratchboxone\par}
-
-\unexpanded\def\makehboxofhboxes
- {\setbox\scratchboxone\emptyhbox
- \loop % \doloop { .. \exitloop .. }
- \setbox\scratchboxtwo\lastbox
- \ifhbox\scratchboxtwo
- \setbox\scratchboxone\hpack{\box\scratchboxtwo\unhbox\scratchboxone}%
- \repeat}
-
-\unexpanded\def\removehboxes
- {\setbox\scratchboxone\lastbox
- \ifhbox\scratchboxone
- {\removehboxes}\unhbox\scratchboxone
- \fi}
-
-% And one special for notes:
-
-\unexpanded\def\starthboxestohbox
- {\bgroup
- \setbox\scratchbox\vbox\bgroup}
-
-\unexpanded\def\stophboxestohbox
- {\egroup
- \clf_vboxlisttohbox\scratchbox\nextbox\dimexpr\hboxestohboxslack\relax
- \dontleavehmode
- \unhbox\nextbox
- \removeunwantedspaces
- \par
- \egroup}
-
-%D \macros
-%D {unhhbox}
-%D
-%D The next macro is used in typesetting inline headings. Let's first look at the
-%D macro and then show an example.
-
-\newbox \unhhedbox
-\newbox \hhbox
-\newdimen \lasthhboxwidth
-\newskip \hhboxindent
-
-\unexpanded\def\unhhbox#1\with#2%
- {\bgroup
- \nopenalties
- \dontcomplain
- \forgetall
- \setbox\unhhedbox\vbox{\hskip\hhboxindent\strut\unhbox#1}% => \hsize
- \doloop
- {\setbox\hhbox\vsplit\unhhedbox to \lineheight
- \ifvoid\unhhedbox
- \setbox\hhbox\hbox{\strut\hboxofvbox\hhbox}% \hpack
- \fi
- \ht\hhbox\strutht
- \dp\hhbox\strutdp
- \ifzeropt\hhboxindent\else
- \setbox\hhbox\hpack{\kern-\hhboxindent\box\hhbox}%
- \hhboxindent\zeropoint
- \fi
- \global\lasthhboxwidth\wd\hhbox
- #2\relax
- \ifvoid\unhhedbox
- \exitloop
- \else
- \hskip\zeropoint \s!plus \zeropoint
- \fi}%
- \egroup}
-
-\def\dohboxofvbox
- {\setbox0\vpack{\unvbox\scratchcounter\global\setbox1\lastbox}%
- \unhbox1
- \egroup}
-
-\unexpanded\def\hboxofvbox
- {\bgroup
- \afterassignment\dohboxofvbox
- \scratchcounter=}
-
-%D This macro can be used to break a paragraph apart and treat each line seperately,
-%D for instance, making it clickable. The main complication is that we want to be
-%D able to continue the paragraph, something that's needed in the in line section
-%D headers.
-%D
-%D \startbuffer
-%D \setbox0=\hbox{\input tufte \relax}
-%D \setbox2=\hbox{\input knuth \relax}
-%D \unhhbox0\with{\ruledhbox{\box\hhbox}}
-%D \hskip1em plus 1em minus 1em
-%D \hhboxindent=\lasthhboxwidth
-%D \advance\hhboxindent by \lastskip
-%D \unhhbox2\with{\ruledhbox{\box\hhbox}}
-%D \stopbuffer
-%D
-%D \getbuffer
-%D
-%D This piece of text was typeset by saying:
-%D
-%D \typebuffer
-%D
-%D Not that nice a definition, but effective. Note the stretch we've build in the
-%D line that connects the two paragraphs.
-
-%D \macros
-%D {doifcontent}
-%D
-%D When processing depends on the availability of content, one can give the next
-%D macro a try.
-%D
-%D \starttyping
-%D \doifcontent{pre content}{post content}{no content}\somebox
-%D \stoptyping
-%D
-%D Where \type {\somebox} is either a \type {\hbox} or \type {\vbox}. If the
-%D dimension of this box suggest some content, the resulting box is unboxed and
-%D surrounded by the first two arguments, else the third arguments is executed.
-
-\unexpanded\def\doifcontent#1#2#3%
- {\dowithnextbox
- {\ifhbox\nextbox
- \ifdim\wd\nextbox>\zeropoint
- #1\unhbox\nextbox#2\relax
- \else
- #3\relax
- \fi
- \else
- \ifdim\ht\nextbox>\zeropoint
- #1\unvbox\nextbox#2\relax
- \else
- #3\relax
- \fi
- \fi}}
-
-%D So when we say:
-%D
-%D \startbuffer
-%D \doifcontent{[}{]}{}\hbox{content sensitive typesetting}
-%D
-%D \doifcontent{}{\page}{}\vbox{content sensitive typesetting}
-%D
-%D \doifcontent{}{}{\message{Didn't you forget something?}}\hbox{}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D We get:
-%D
-%D \getbuffer
-%D
-%D Where the last call of course does not show up in this document, but definitely
-%D generates a confusing message.
-
-%D \macros
-%D {processboxes}
-%D
-%D The next macro gobble boxes and is for instance used for overlays. First we show
-%D the general handler.
-
-\newbox\processbox % public : this is the one where \nextbox's end up in
-
-\unexpanded\def\processboxes#1%
- {\bgroup
- \def\syst_boxes_process_indeed{#1}% #1 can be redefined halfway
- \setbox\processbox\emptybox
- \doifelsenextbgroup\syst_boxes_process_yes\syst_boxes_process_nop}
-
-\def\syst_boxes_process_yes
- {\dowithnextboxcs\syst_boxes_process_content\hbox}
-
-\def\syst_boxes_process_content
- {\removeunwantedspaces
- \syst_boxes_process_indeed % takes \nextbox makes \processbox
- \doifelsenextbgroup\syst_boxes_process_yes\syst_boxes_process_nop}
-
-\unexpanded\def\syst_boxes_process_nop
- {\removeunwantedspaces
- \box\processbox
- \egroup}
-
-%D \macros
-%D {startoverlay}
-%D
-%D We can overlay boxes by saying:
-%D
-%D \startbuffer
-%D \startoverlay
-%D {\framed{hans}}
-%D {\framed[width=3cm]{ton}}
-%D {\framed[height=2cm]{oeps}}
-%D \stopoverlay
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D shows up as:
-%D
-%D \leavevmode\getbuffer
-
-\def\boxisempty#1%
- {\ifdim\wd#1=\zeropoint
- \ifdim\ht#1=\zeropoint
- \ifdim\dp#1=\zeropoint
- \zerocount
- \else
- \plusone
- \fi
- \else
- \plusone
- \fi
- \else
- \plusone
- \fi}
-
-\def\syst_boxes_overlay_process
- {\ifcase\boxisempty\nextbox\else
- \syst_boxes_overlay_process_indeed
- \fi}
-
-\def\syst_boxes_overlay_process_indeed
- {%\removeunwantedspaces % already done
- \scratchdepth\dp\ifdim\dp\nextbox>\dp\processbox\nextbox\else\processbox\fi
- \ifdim\ht\nextbox>\ht\processbox
- \setbox\processbox\vpack to \ht\nextbox {\dp\processbox\zeropoint\vss\box\processbox\vss}%
- \else
- \setbox\nextbox \vpack to \ht\processbox{\dp\nextbox \zeropoint\vss\box\nextbox \vss}%
- \fi
- \dp\nextbox \scratchdepth
- \dp\processbox\scratchdepth
- \scratchwidth\wd\ifdim\wd\nextbox>\wd\processbox\nextbox\else\processbox\fi
- \setbox\processbox\hpack to \scratchwidth
- {\hpack to \scratchwidth{\hss\box\processbox\hss}%
- \kern-\scratchwidth
- \hpack to \scratchwidth{\hss\box\nextbox \hss}}}
-
-\unexpanded\def\startoverlay
- {\bgroup
- \let\stopoverlay\egroup
- \processboxes\syst_boxes_overlay_process}
-
-\let\stopoverlay\relax
-
-%D \macros
-%D {fakebox}
-%D
-%D The next macro is a rather silly one, but saves space.
-%D
-%D \starttyping
-%D \hbox{\fakebox0}
-%D \stoptyping
-%D
-%D returns an empty box with the dimensions of the box specified, here being zero.
-
-\unexpanded\def\fakebox
- {\bgroup
- \afterassignment\syst_boxes_fakebox_finish\scratchcounter}
-
-\def\syst_boxes_fakebox_finish
- {\setbox\scratchbox\ifhbox\scratchcounter\emptyhbox\else\emptyvbox\fi
- \wd\scratchbox\wd\scratchcounter
- \ht\scratchbox\ht\scratchcounter
- \dp\scratchbox\dp\scratchcounter
- \box\scratchbox
- \egroup}
-
-%D \macros
-%D {lbox,rbox,cbox,tbox,bbox}
-%D
-%D Here are some convenient alternative box types:
-%D
-%D \starttyping
-%D \lbox{text ...}
-%D \cbox{text ...}
-%D \rbox{text ...}
-%D \stoptyping
-%D
-%D Are similar to \type {\vbox}, which means that they also accept something like
-%D \type {to 3cm}, but align to the left, middle and right. These box types can be
-%D used to typeset paragraphs.
-
-\def\syst_boxes_lrc_process#1{\bgroup\forgetall\let\\\endgraf#1\let\next}
-
-\unexpanded\def\lbox#1#{\vbox#1\syst_boxes_lrc_process\raggedleft }
-\unexpanded\def\cbox#1#{\vbox#1\syst_boxes_lrc_process\raggedcenter}
-\unexpanded\def\rbox#1#{\vbox#1\syst_boxes_lrc_process\raggedright }
-
-\unexpanded\def\ltop#1#{\vtop#1\syst_boxes_lrc_process\raggedleft }
-\unexpanded\def\ctop#1#{\vtop#1\syst_boxes_lrc_process\raggedcenter}
-\unexpanded\def\rtop#1#{\vtop#1\syst_boxes_lrc_process\raggedright }
-
-%D The alternatives \type {\tbox} and \type {\bbox} can be used to properly align
-%D boxes, like in:
-%D
-%D \setupexternalfigures[directory={../sample}]
-%D \startbuffer
-%D \starttable[|||]
-%D \HL
-%D \VL \tbox{\externalfigure[cow][height=3cm,frame=on]} \VL top aligned \VL\SR
-%D \HL
-%D \VL \bbox{\externalfigure[cow][height=3cm,frame=on]} \VL bottom aligned \VL\SR
-%D \HL
-%D \stoptable
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D The positioning depends on the strut settings:
-%D
-%D \getbuffer
-
-\unexpanded\def\tbox{\hpack\bgroup\dowithnextboxcs\syst_boxes_tbox_finish\hbox}
-\unexpanded\def\bbox{\hpack\bgroup\dowithnextboxcs\syst_boxes_bbox_finish\hbox}
-
-\def\syst_boxes_tbox_finish
- {\scratchheight\ht\strutbox
- \scratchdepth\dimexpr\htdp\nextbox-\scratchheight\relax
- \ht\nextbox\scratchheight
- \dp\nextbox\scratchdepth
- \boxyoffset\nextbox-\scratchdepth
- \box\nextbox
- \egroup}
-
-\def\syst_boxes_bbox_finish
- {\scratchdepth\dp\strutbox
- \scratchheight\dimexpr\htdp\nextbox-\scratchdepth\relax
- \dp\nextbox\scratchdepth
- \ht\nextbox\scratchheight
- \boxyoffset\nextbox-\scratchdepth
- \box\nextbox
- \egroup}
-
-%D \macros
-%D {lhbox,mhbox,rhbox}
-%D
-%D A few more boxes.
-
-\def\dodolhbox{\hpack to \hsize{\box\nextbox\hss }}
-\def\dodomhbox{\hpack to \hsize{\hss\box\nextbox\hss}}
-\def\dodorhbox{\hpack to \hsize{\hss\box\nextbox }}
-
-\unexpanded\def\lhbox{\dowithnextboxcs\dodolhbox\hbox}
-\unexpanded\def\mhbox{\dowithnextboxcs\dodomhbox\hbox}
-\unexpanded\def\rhbox{\dowithnextboxcs\dodorhbox\hbox}
-
-\let\lefthbox \lhbox
-\let\midhbox \mhbox
-\let\righthbox\rhbox
-
-%D \macros
-%D {boxofsize}
-%D
-%D Sometimes we need to construct a box with a height or width made up of several
-%D dimensions. Instead of cumbersome additions, we can use:
-%D
-%D \starttyping
-%D \boxofsize \vbox 10cm 3cm -5cm {the text to be typeset}
-%D \stoptyping
-%D
-%D This example demonstrates that one can use positive and negative values.
-%D Dimension registers are also accepted.
-
-\newdimen\sizeofbox
-
-\unexpanded\def\boxofsize#1%
- {\bgroup
- \sizeofbox\zeropoint
- \scratchdimen\zeropoint
- \def\docommand
- {\advance\sizeofbox\scratchdimen
- \futurelet\next\dodocommand}%
- \def\dodocommand
- {\ifx\next\bgroup
- \expanded{\egroup#1 to \the\sizeofbox}%
- \else
- \expandafter\afterassignment\expandafter\docommand\expandafter\scratchdimen
- \fi}%
- \docommand}
-
-%D Some new, still undocumented features:
-
-% limitatetext -> beter {text} als laatste !!
-%
-% \limitvbox
-% \limithbox
-
-\unexpanded\def\limitatelines#1#2% size sentinel
- {\dowithnextbox
- {\scratchdimen#1\hsize
- \ifdim\wd\nextbox>\scratchdimen
- \setbox\nextbox\hbox
- {\advance\scratchdimen -.1\hsize
- \limitatetext{\unhbox\nextbox}{\scratchdimen}{\nobreak#2}}%
- \fi
- \unhbox\nextbox}
- \hbox}
-
-\unexpanded\def\fittoptobaselinegrid % weg hier
- {\dowithnextbox
- {\bgroup
- \par
- \scratchdimen\ht\nextbox
- \ht\nextbox\strutht
- \dp\nextbox\strutdp
- \hpack{\box\nextbox}
- \prevdepth\strutdp
- \doloop
- {\advance\scratchdimen -\lineheight
- \ifdim\scratchdimen<\zeropoint
- \exitloop
- \else
- \nobreak
- \hpack{\strut}
- \fi}
- \egroup}
- \vbox}
-
-%D Some more undocumented macros (used in m-chart).
-
-\newif\iftraceboxplacement % \traceboxplacementtrue
-
-\newbox\fakedboxcursor
-
-\setbox\fakedboxcursor\hpack
- {\vrule\s!width\zeropoint\s!height\zeropoint\s!depth\zeropoint}
-
-\unexpanded\def\boxcursor % overloaded in core-vis
- {\iftraceboxplacement
- \bgroup
- \scratchdimen2\onepoint
- \setbox\scratchbox\hpack to \zeropoint
- {\hss
- \vrule
- \s!width \scratchdimen
- \s!height\scratchdimen
- \s!depth \scratchdimen
- \hss}%
- \smashedbox\scratchbox
- \egroup
- \else
- \copy\fakedboxcursor
- \fi}
-
-\unexpanded\def\placedbox
- {\iftraceboxplacement\ruledhbox\else\hbox\fi}
-
-\newdimen\boxoffset
-\newdimen\boxhdisplacement
-\newdimen\boxvdisplacement
-
-\unexpanded\def\rightbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_rightbox_finish \placedbox}
-\unexpanded\def\leftbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_leftbox_finish \placedbox}
-\unexpanded\def\topbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_topbox_finish \placedbox}
-\unexpanded\def\bottombox {\hpack\bgroup\dowithnextboxcs\syst_boxes_bottombox_finish \placedbox}
-\unexpanded\def\lefttopbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_lefttopbox_finish \placedbox}
-\unexpanded\def\righttopbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_righttopbox_finish \placedbox}
-\unexpanded\def\leftbottombox {\hpack\bgroup\dowithnextboxcs\syst_boxes_leftbottombox_finish \placedbox}
-\unexpanded\def\rightbottombox{\hpack\bgroup\dowithnextboxcs\syst_boxes_rightbottombox_finish\placedbox}
-
-\let\topleftbox \lefttopbox
-\let\toprightbox \righttopbox
-\let\bottomleftbox \leftbottombox
-\let\bottomrightbox\rightbottombox
-
-\def\syst_boxes_rightbox_finish
- {\global\boxhdisplacement\boxoffset
- \global\boxvdisplacement.5\dimexpr\ht\nextbox-\dp\nextbox\relax
- \boxcursor
- \boxxmove\nextbox \boxhdisplacement
- \boxymove\nextbox-\boxvdisplacement
- \box\nextbox
- \egroup}
-
-\def\syst_boxes_leftbox_finish
- {\global\boxhdisplacement\dimexpr-\wd\nextbox-\boxoffset\relax
- \global\boxvdisplacement.5\dimexpr\ht\nextbox-\dp\nextbox\relax
- \boxcursor
- \boxxmove\nextbox \boxhdisplacement
- \boxymove\nextbox-\boxvdisplacement
- \box\nextbox
- \egroup}
-
-\def\syst_boxes_topbox_finish
- {\global\boxhdisplacement-.5\wd\nextbox
- \global\boxvdisplacement\dimexpr-\dp\nextbox-\boxoffset\relax
- \boxcursor
- \boxxmove\nextbox \boxhdisplacement
- \boxymove\nextbox-\boxvdisplacement
- \box\nextbox
- \egroup}
-
-\def\syst_boxes_bottombox_finish
- {\global\boxhdisplacement-.5\wd\nextbox
- \global\boxvdisplacement\dimexpr\ht\nextbox+\boxoffset\relax
- \boxcursor
- \boxxmove\nextbox \boxhdisplacement
- \boxymove\nextbox-\boxvdisplacement
- \box\nextbox
- \egroup}
-
-\def\syst_boxes_lefttopbox_finish
- {\global\boxhdisplacement\dimexpr-\wd\nextbox-\boxoffset\relax
- \global\boxvdisplacement\dimexpr-\dp\nextbox-\boxoffset\relax
- \boxcursor
- \boxxmove\nextbox \boxhdisplacement
- \boxymove\nextbox-\boxvdisplacement
- \box\nextbox
- \egroup}
-
-\def\syst_boxes_righttopbox_finish
- {\global\boxhdisplacement\boxoffset
- \global\boxvdisplacement\dimexpr-\dp\nextbox-\boxoffset\relax
- \boxcursor
- \boxxmove\nextbox \boxhdisplacement
- \boxymove\nextbox-\boxvdisplacement
- \box\nextbox
- \egroup}
-
-\def\syst_boxes_leftbottombox_finish
- {\global\boxhdisplacement\dimexpr-\wd\nextbox-\boxoffset\relax
- \global\boxvdisplacement\dimexpr\ht\nextbox+\boxoffset\relax
- \boxcursor
- \boxxmove\nextbox \boxhdisplacement
- \boxymove\nextbox-\boxvdisplacement
- \box\nextbox
- \egroup}
-
-\def\syst_boxes_rightbottombox_finish
- {\global\boxhdisplacement\boxoffset
- \global\boxvdisplacement\dimexpr\ht\nextbox+\boxoffset\relax
- \boxcursor
- \boxxmove\nextbox \boxhdisplacement
- \boxymove\nextbox-\boxvdisplacement
- \box\nextbox
- \egroup}
-
-\unexpanded\def\middlebox {\hpack\bgroup\dowithnextboxcs\syst_boxes_middlebox_finish \placedbox}
-\unexpanded\def\baselinemiddlebox{\hpack\bgroup\dowithnextboxcs\syst_boxes_baselinemiddlebox_finish\placedbox}
-\unexpanded\def\baselineleftbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_baselineleftbox_finish \placedbox}
-\unexpanded\def\baselinerightbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_baselinerightbox_finish \placedbox}
-
-\def\syst_boxes_middlebox_finish
- {\global\boxhdisplacement-.5\wd\nextbox
- \global\boxvdisplacement.5\dimexpr\ht\nextbox-\dp\nextbox\relax
- \boxcursor
- \boxxmove\nextbox \boxhdisplacement
- \boxymove\nextbox-\boxvdisplacement
- \box\nextbox
- \egroup}
-
-\def\syst_boxes_baselinemiddlebox_finish
- {\global\boxhdisplacement\dimexpr-.5\wd\nextbox-\boxoffset\relax
- \global\boxvdisplacement-\boxoffset
- \boxcursor
- \boxxmove\nextbox \boxhdisplacement
- \boxymove\nextbox-\boxvdisplacement
- \box\nextbox
- \egroup}
-
-\def\syst_boxes_baselineleftbox_finish
- {\global\boxhdisplacement\dimexpr-\wd\nextbox-\boxoffset\relax
- \global\boxvdisplacement-\boxoffset
- \boxcursor
- \boxxmove\nextbox \boxhdisplacement
- \boxymove\nextbox-\boxvdisplacement
- \box\nextbox
- \egroup}
-
-\def\syst_boxes_baselinerightbox_finish
- {\global\boxhdisplacement\boxoffset
- \global\boxvdisplacement-\boxoffset
- \boxcursor
- \boxxmove\nextbox \boxhdisplacement
- \boxymove\nextbox-\boxvdisplacement
- \box\nextbox
- \egroup}
-
-%D \macros
-%D {obox}
-%D
-%D Experimental, not yet frozen:
-
-\unexpanded\def\lrtbbox#1#2#3#4% l r t b
- {\bgroup
- \dowithnextboxcontent
- {\advance\hsize-#1\advance\hsize-#2\relax
- \advance\vsize-#3\advance\vsize-#4\relax}
- {\forgetall\vpack to \vsize{\vskip#3\hpack to \hsize{\hskip#1\box\nextbox\hss}\vss}\egroup}
- \vbox}
-
-%D \macros
-%D {toplinebox}
-%D
-%D See core-tbl.tex for an example of its usage:
-
-\unexpanded\def\toplinebox
- {\dowithnextboxcs\syst_boxes_toplinebox_finish\tbox}
-
-\def\syst_boxes_toplinebox_finish
- {\ifdim\dp\nextbox>\strutdepth
- \scratchdimen\dp\nextbox
- \advance\scratchdimen-\strutdepth
- \getnoflines\scratchdimen
- \struttedbox{\box\nextbox}%
- \dorecurse\noflines\verticalstrut
- \else
- \box\nextbox
- \fi}
-
-%D \macros
-%D {initializeboxstack,savebox,foundbox}
-%D
-%D At the cost of some memory, but saving box registers, we have implemented a box
-%D repository.
-%D
-%D \starttyping
-%D \initializeboxstack{one}
-%D
-%D \savebox{one}{a}{test a}
-%D \savebox{one}{p}{test p}
-%D \savebox{one}{q}{test q}
-%D
-%D \hbox{a:\foundbox{one}{a}} \par
-%D \hbox{q:\foundbox{one}{q}} \par
-%D \hbox{p:\foundbox{one}{p}} \par
-%D \hbox{x:\foundbox{one}{x}} \par
-%D \hbox{y:\foundbox{two}{a}} \par
-%D \stoptyping
-
-%D Kind of obsolete:
-
-\installcorenamespace {stackbox}
-\installcorenamespace {stacklst}
-
-\unexpanded\def\setstackbox#1#2%
- {\ifcsname\??stackbox#1:#2\endcsname\else
- \expandafter\newbox\csname\??stackbox#1:#2\endcsname
- \fi
- \global\setbox\csname\??stackbox#1:#2\endcsname\vbox}
-
-\unexpanded\def\initializeboxstack#1%
- {\def\docommand##1{\setstackbox{#1}{##1}{}}%
- \ifcsname\??stacklst#1\endcsname
- \expandafter\processcommacommand\expandafter[\lastnamedcs]\docommand
- \fi
- \letgvalueempty{\??stacklst#1}}
-
-\unexpanded\def\savebox#1#2% stack name
- {% beware, \setxvalue defines the cs beforehand so we cannot use the
- % test inside the { }
- \ifcsname\??stacklst#1\endcsname
- %\setxvalue{\??stacklst#1}{\csname\??stacklst#1\endcsname,#2}%
- \expandafter\xdef\csname\??stacklst#1\expandafter\endcsname\expandafter{\lastnamedcs,#2}%
- \else
- \expandafter\xdef\csname\??stacklst#1\endcsname{#2}%
- \fi
- \setstackbox{#1}{#2}}
-
-\unexpanded\def\flushbox#1#2% unwrapped
- {\ifcsname\??stackbox#1:#2\endcsname
- \box\lastnamedcs
- \else
- \emptybox
- \fi}
-
-\unexpanded\def\restorebox#1#2% unwrapped
- {\ifcsname\??stackbox#1:#2\endcsname
- \copy\lastnamedcs
- \else
- \emptybox
- \fi}
-
-\unexpanded\def\foundbox#1#2% wrapped
- {\vpack
- {\ifcsname\??stackbox#1:#2\endcsname
- \copy\lastnamedcs
- \fi}}
-
-\unexpanded\def\doifelsebox#1#2%
- {\ifcsname\??stackbox#1:#2\endcsname
- \ifvoid\lastnamedcs
- \doubleexpandafter\secondoftwoarguments
- \else
- \doubleexpandafter\firstoftwoarguments
- \fi
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\let\doifboxelse\doifelsebox
-
-%D This one is cheaper (the above is no longer used that much):
-
-\installcorenamespace {boxstack}
-
-\newcount\c_syst_boxes_stack
-\let \b_syst_boxes_stack\relax
-
-\unexpanded\def\syst_boxes_stack_allocate
- {\newbox\b_syst_boxes_stack
- \expandafter\let\csname\??boxstack\number\c_syst_boxes_stack\endcsname\b_syst_boxes_stack}
-
-\unexpanded\def\syst_boxes_push#1#2%
- {\global\advance\c_syst_boxes_stack\plusone
- \expandafter\let\expandafter\b_syst_boxes_stack\csname\??boxstack\number\c_syst_boxes_stack\endcsname
- \ifx\b_syst_boxes_stack\relax % cheaper then csname check as in most cases it's defined
- \syst_boxes_stack_allocate
- \fi
- #1\setbox\b_syst_boxes_stack\box#2\relax}
-
-\unexpanded\def\syst_boxes_pop#1#2%
- {#1\setbox#2\box\csname\??boxstack\number\c_syst_boxes_stack\endcsname
- \global\advance\c_syst_boxes_stack\minusone}
-
-\unexpanded\def\localpushbox {\syst_boxes_push\relax}
-\unexpanded\def\localpopbox {\syst_boxes_pop \relax}
-
-\unexpanded\def\globalpushbox{\syst_boxes_push\global}
-\unexpanded\def\globalpopbox {\syst_boxes_pop \global}
-
-%D And here is a more modern one (not yet in i-*):
-%D
-%D \starttyping
-%D \dorecurse {100} {
-%D \setbox\zerocount\hbox{test \recurselevel}
-%D \putboxincache{foo}{\recurselevel}\zerocount
-%D \copyboxfromcache{foo}{\recurselevel}\zerocount
-%D \iftrue
-%D \setbox\zerocount\hbox{\directboxfromcache{foo}{\recurselevel}}%
-%D \else
-%D \getboxfromcache{foo}{\recurselevel}\zerocount
-%D \fi
-%D }
-%D \resetboxesincache{foo}
-%D \stoptyping
-
-\unexpanded\def\putboxincache #1#2#3{\clf_putboxincache {#1}{#2}#3\relax}
-\unexpanded\def\getboxfromcache #1#2#3{\clf_getboxfromcache {#1}{#2}#3\relax}
-\unexpanded\def\doifelseboxincache #1#2{\clf_doifelseboxincache {#1}{#2}}
-\unexpanded\def\copyboxfromcache #1#2#3{\clf_copyboxfromcache {#1}{#2}#3\relax}
-\unexpanded\def\directboxfromcache #1#2{\clf_directboxfromcache {#1}{#2}}
-\unexpanded\def\directcopyboxfromcache#1#2{\clf_directcopyboxfromcache{#1}{#2}}
-\unexpanded\def\resetboxesincache #1{\clf_resetboxesincache {#1}}
-
-\unexpanded\def\putnextboxincache#1#2%
- {\dowithnextbox{\putboxincache{#1}{#2}\nextbox}}
-
-%D \macros
-%D {removedepth, obeydepth}
-%D
-%D While \type {\removedepth} removes the preceding depth, \type {\obeydepth} makes
-%D sure we have depth. Both macros leave the \type {\prevdepth} untouched.
-
-\unexpanded\def\removedepth
- {\ifvmode
- \ifdim\prevdepth>\zeropoint
- \kern-\prevdepth
- \fi
- \fi}
-
-\unexpanded\def\obeydepth
- {\par % watch out for changes in math formulas
- \ifvmode\ifdim\prevdepth<\zeropoint\orelse\ifdim\prevdepth<\strutdp
- \kern\dimexpr\strutdp-\prevdepth\relax
- \prevdepth\strutdp
- \fi\fi}
-
-\unexpanded\def\undepthed
- {\dowithnextbox{\dp\nextbox\zeropoint\box\nextbox}\hbox}
-
-%D \macros
-%D {removebottomthings, removelastskip}
-%D
-%D A funny (but rather stupid) one, plus a redefinition.
-
-\unexpanded\def\removebottomthings
- {\dorecurse\plusfive{\unskip\unkern\unpenalty}}
-
-\unexpanded\def\removelastskip % \ifvmode the plain tex one \fi
- {\ifvmode\ifzeropt\lastskip\else\vskip-\lastskip\fi\fi}
-
-%D \macros
-%D {makestrutofbox}
-%D
-%D This macro sets the dimensions of a box to those of a strut. Sort of obsolete so
-%D it will go away.
-
-\unexpanded\def\makestrutofbox % not used
- {\afterassignment\syst_boxes_makestrutofbox\c_boxes_register}
-
-\def\syst_boxes_makestrutofbox
- {\ht\c_boxes_register\strutht
- \dp\c_boxes_register\strutdp
- \wd\c_boxes_register\zeropoint}
-
-%D \macros
-%D {raisebox,lowerbox}
-%D
-%D Some more box stuff, related to positioning (under construction). Nice stuff for
-%D a tips and tricks maps article.
-%D
-%D \starttyping
-%D \raisebox{100pt}\hbox{test}
-%D \hsmash{\raisebox{100pt}\hbox{test}}
-%D \stoptyping
-
-\unexpanded\def\raisebox#1{\bgroup\afterassignment\syst_boxes_raise_indeed\scratchdimen#1} % so both 10pt and {10pt} is accepted
-\unexpanded\def\lowerbox#1{\bgroup\afterassignment\syst_boxes_lower_indeed\scratchdimen#1} % so both 10pt and {10pt} is accepted
-
-\def\syst_boxes_raise_indeed{\dowithnextboxcs\syst_boxes_raise_finish}
-\def\syst_boxes_lower_indeed{\dowithnextboxcs\syst_boxes_lower_finish}
-
-\def\syst_boxes_raise_finish
- {\boxyoffset\nextbox\scratchdimen
- \ht\nextbox\strutht
- \dp\nextbox\strutdp
- \box\nextbox
- \egroup}
-
-\def\syst_boxes_lower_finish
- {\boxyoffset\nextbox-\scratchdimen
- \ht\nextbox\strutht
- \dp\nextbox\strutdp
- \box\nextbox
- \egroup}
-
-% vcenter in text, we kunnen vcenter overloaden
-
-\unexpanded\def\halfwaybox
- {\hpack\bgroup
- \dowithnextboxcs\syst_boxes_halfwaybox_finish\hbox}
-
-\def\syst_boxes_halfwaybox_finish
- {\dp\nextbox\zeropoint
- \lower.5\ht\nextbox\box\nextbox
- \egroup}
-
-\unexpanded\def\depthonlybox
- {\tpack\bgroup
- \dowithnextboxcs\syst_boxes_depthonlybox_finish\vbox}
-
-\def\syst_boxes_depthonlybox_finish
- {\hsize\wd\nextbox
- \kern\zeropoint\box\nextbox
- \egroup}
-
-%D New:
-
-\def\setdimentoatleast#1#2{\ifdim#1>\zeropoint\else#1=#2\fi}
-\def\setdimentoatmost #1#2{\ifdim#1>#2\relax \else#1=#2\fi}
-
-%D And even rawer:
-
-\let\naturalvcenter\normalvtop % will go away
-
-%D \macros
-%D {vcenter}
-%D
-%D Also new: tex mode \type {\vcenter}.
-
-\unexpanded\def\vcenter
- {\vbox\bgroup
- \dowithnextboxcs\syst_boxes_vcenter_finish\vbox}
-
-\def\syst_boxes_vcenter_finish
- {\hpack{\normalstartimath\vcenter{\box\nextbox}\normalstopimath}%
- \egroup}
-
-% could be \everymathematics
-
-\prependtoks \let\vcenter\normalvcenter \to \everymath
-\prependtoks \let\vcenter\normalvcenter \to \everydisplay
-
-% \appendtoks \let\vcenter\normalvcenter \to \everymathematics
-
-%D \macros
-%D {frozenhbox}
-%D
-%D A not so well unhboxable box can be made with:
-
-\unexpanded\def\frozenhbox
- {\hpack\bgroup
- \dowithnextboxcs\syst_boxes_frozenhbox_finish\hbox}
-
-\def\syst_boxes_frozenhbox_finish
- {\hpack{\hpack{\box\nextbox}}%
- \egroup}
-
-%D \macros
-%D {setboxllx,setboxlly,gsetboxllx,gsetboxlly,getboxllx,getboxlly}
-%D
-%D A prelude to an extended \TEX\ feature:
-
-\installcorenamespace {box_x}
-\installcorenamespace {box_y}
-
-\unexpanded\def\setboxllx #1#2{\expandafter\edef\csname\??box_x\number#1\endcsname{\the\dimexpr#2\relax}}
-\unexpanded\def\setboxlly #1#2{\expandafter\edef\csname\??box_y\number#1\endcsname{\the\dimexpr#2\relax}}
-
-\unexpanded\def\gsetboxllx#1#2{\expandafter\xdef\csname\??box_x\number#1\endcsname{\the\dimexpr#2\relax}}
-\unexpanded\def\gsetboxlly#1#2{\expandafter\xdef\csname\??box_y\number#1\endcsname{\the\dimexpr#2\relax}}
-
-%def\getboxllx#1{\ifcsname\??box_x\number#1\endcsname\csname\??box_x\number#1\endcsname\else\zeropoint\fi}
-%def\getboxlly#1{\ifcsname\??box_y\number#1\endcsname\csname\??box_y\number#1\endcsname\else\zeropoint\fi}
-\def\getboxllx#1{\ifcsname\??box_x\number#1\endcsname\lastnamedcs\else\zeropoint\fi}
-\def\getboxlly#1{\ifcsname\??box_y\number#1\endcsname\lastnamedcs\else\zeropoint\fi}
-
-\def\directgetboxllx#1{\csname\??box_x\number#1\endcsname} % use when sure existence
-\def\directgetboxlly#1{\csname\??box_y\number#1\endcsname} % use when sure existence
-
-%D \macros
-%D {shownextbox}
-%D
-%D Handy for tracing
-%D
-%D \starttyping
-%D \shownextbox\vbox{test}
-%D \shownextbox\vbox{test\endgraf}
-%D \shownextbox\vbox{test\endgraf\strut\endgraf}
-%D \shownextbox\vbox{test\endgraf\thinrule}
-%D \shownextbox\vbox{\setupwhitespace[big]test\endgraf\thinrule}
-%D \stoptyping
-
-\unexpanded\def\shownextbox % seldom used
- {\dowithnextbox
- {\bgroup
- \showboxbreadth\maxdimen
- \showboxdepth \maxdimen
- \scratchcounter\interactionmode
- \batchmode
- \showbox\nextbox
- \box\nextbox
- \interactionmode\scratchcounter
- \egroup}}
-
-\unexpanded\def\spreadhbox#1% rebuilds \hbox{<box><hss><box><hss><box>}
- {\bgroup
- \ifhbox#1\relax
- \setbox\scratchboxtwo\emptybox
- \unhbox#1%
- \doloop
- {\unpenalty\unskip\unpenalty\unskip\unpenalty\unskip
- \setbox\scratchboxone\lastbox
- \ifvoid\scratchboxone
- \exitloop
- \else
- \setbox\scratchboxtwo\hbox
- {\ifhbox\scratchboxone \spreadhbox\scratchboxone\else\box\scratchboxone\fi
- \ifvoid\scratchboxtwo \else\hss\unhbox\scratchboxtwo\fi}%
- \fi}%
- \ifvoid\scratchboxtwo\else\unhbox\scratchboxtwo\fi
- \else
- \box#1%
- \fi
- \egroup}
-
-% makes sense but too much log for overfull boxes:
-%
-% \showboxbreadth\maxdimen
-% \showboxdepth \maxdimen
-
-%D Moved from cont-new:
-%D
-%D \starttyping
-%D \minimalhbox 100pt {test}
-%D \stoptyping
-
-\unexpanded\def\minimalhbox#1#%
- {\dowithnextbox
- {\bgroup
- \setbox\scratchbox\hpack#1{\hss}%
- \ifdim\wd\nextbox<\wd\scratchbox\wd\nextbox\wd\scratchbox\fi
- \box\nextbox
- \egroup}
- \hbox}
-
-%D A bit dirty:
-
-\unexpanded\def\nodestostring#1#2% more tolerant for #2=\cs
- {\begingroup
- \setbox\nextbox\hbox{#2}%
- \normalexpanded{\endgroup\edef\noexpand#1{\clf_boxtostring\nextbox}}}
-
-%D Even more dirty:
-
-\let\hyphenatedhbox\hbox
-
-%D We can do this:
-%D
-%D \starttyping
-%D \setbox0\hbox to 10cm{foo} \setbox2\hbox{\unhbox0} \the\wd2
-%D \stoptyping
-%D
-%D But this saves a copy (and hpack pass):
-%D
-%D \starttyping
-%D \setbox0\hbox to 10cm{foo} \the\naturalwd0
-%D \stoptyping
-
-\newdimen\lastnaturalboxwd
-\newdimen\lastnaturalboxht
-\newdimen\lastnaturalboxdp
-
-\let\getnaturaldimensions\clf_getnaturaldimensions % sets three dimensions
-\let\naturalwd \clf_naturalwd % calculates and returns wd
-
-\let\getnaturalwd\clf_getnaturalwd % no intermediate
-\let\setnaturalwd\clf_setnaturalwd % no intermediate
-
-\unexpanded\def\doifelserighttoleftinbox{\clf_doifelserighttoleftinbox}
-
-\let\doifrighttoleftinboxelse\doifelserighttoleftinbox
-
-%D New, used in high/low:
-
-\definesystemattribute [runningtext] [public]
-
-%unexpanded\def\runninghbox{\hbox attr \runningtextattribute \plusone} % not yet in i-*
-\unexpanded\def\runninghbox{\hbox attr \runningtextattribute \fontid\font} % not yet in i-*
-
-%D To complement lua (yet undocumented):
-
-\unexpanded\def\beginhbox{\hbox\bgroup} \let\endhbox\egroup
-\unexpanded\def\beginvbox{\vbox\bgroup} \let\endvbox\egroup
-\unexpanded\def\beginvtop{\vtop\bgroup} \let\endvtop\egroup
-
-\unexpanded\def\sethboxregister#1{\setbox#1\hbox}
-\unexpanded\def\setvboxregister#1{\setbox#1\vbox}
-\unexpanded\def\setvtopregister#1{\setbox#1\vtop}
-
-\unexpanded\def\flushboxregister#1{\box\numexpr#1\relax}
-
-\unexpanded\def\starthboxregister#1{\setbox#1\hbox\bgroup} \let\stophboxregister\egroup
-\unexpanded\def\startvboxregister#1{\setbox#1\vbox\bgroup} \let\stopvboxregister\egroup
-\unexpanded\def\startvtopregister#1{\setbox#1\vtop\bgroup} \let\stopvtopregister\egroup
-
-%D For whatever third party package needs it:
-%D
-%D \starttyping
-%D \newlocalbox\BoxOne
-%D \newlocalbox\BoxTwo
-%D
-%D \setbox\BoxOne\hbox{Box One}
-%D \setbox\BoxTwo\hbox{Box Two}
-%D
-%D [\box\BoxTwo] [\box\BoxOne]
-%D \stoptyping
-
-\installcorenamespace{localbox}
-
-\unexpanded\def\newlocalbox#1%
- {\expandafter\let\expandafter#1\csname\??localbox\string#1\endcsname
- \ifx#1\relax
- \syst_aux_new_localbox#1%
- \fi}
-
-\def\syst_aux_new_localbox#1%
- {\expandafter\newbox\csname\??localbox\string#1\endcsname
- \newlocalbox#1}
-
-%D Who knows when this comes in handy:
-
-\unexpanded\def\lastlinewidth{\dimexpr\clf_lastlinewidth\scaledpoint\relax}
-
-%D Keep as reference:
-
-% \unexpanded\def\tightvbox{\dowithnextbox{\dp\nextbox\zeropoint\box\nextbox}\vbox}
-% \unexpanded\def\tightvtop{\dowithnextbox{\ht\nextbox\zeropoint\box\nextbox}\vtop}
-
-%D This one keeps dimensions and sets the shift field (and so it's more for testing
-%D than for real usage):
-
-\unexpanded\def\shiftbox {\clf_shiftbox}
-\unexpanded\def\vpackbox {\clf_vpackbox}
-\unexpanded\def\hpackbox {\clf_hpackbox}
-\unexpanded\def\vpackedbox{\clf_vpackedbox}
-\unexpanded\def\hpackedbox{\clf_hpackedbox}
-
-%D This one has been moved from a 2 decade old file. It makes something boxed
-%D sit on the baseline.
-
-\unexpanded\def\linebox
- {\hpack\bgroup\dowithnextbox
- {\scratchdimen\dimexpr\dimexpr\htdp\nextbox-\lineheight\relax/2+\dp\strutbox\relax
- \setbox\nextbox\hpack{\lower\scratchdimen\box\nextbox}%
- \ht\nextbox\ht\strutbox
- \dp\nextbox\dp\strutbox
- \box\nextbox
- \egroup}
- \hbox}
-
-\protect \endinput
-
-% a bit of test code:
-
-% \hbox \bgroup
-% \ruledvbox {\hbox{\strut gans}}
-% \ruledvbox to \lineheight {\hbox{\strut gans}}
-% \ruledvbox to \lineheight {\hbox {gans}}
-% \ruledvbox to \strutheight{\hbox {gans}}
-% \ruledvbox to \strutheight{\hbox{\strut gans}}
-% \ruledvbox to \strutheight{\vss\hbox{gans}}
-% \egroup
-
-% to be considered
-
-% \startluacode
-%
-% local spacer = lpeg.patterns.spacer
-%
-% function commands.withwords(command,str)
-% if str then
-% command = command or "ruledhbox"
-% local done = false
-% local function apply(s)
-% if done then
-% context.space()
-% done = true
-% else
-% context.dontleavehmode()
-% end
-% context[command](s)
-% end
-% lpeg.match(lpeg.splitter(spacer,apply),str)
-% end
-%
-% end
-%
-% \stopluacode
-%
-% \unprotect
-%
-% \unexpanded\def\withwordsinstring#1#2% command str
-% {\ctxcommand{withwords(\!!bs#1\!!es,\!!bs#2\!!es)}}
-%
-% \unexpanded\def\withwordsinfile#1#2% command name
-% {\ctxcommand{withwords(\!!bs#1\!!es,io.loaddata(resolvers.findfile("#2")))}}
-%
-% \protect
-%
-% \starttext
-%
-% \defineframed[colored][foregroundcolor=red,foregroundstyle=\bfc\underbar,location=low]
-%
-% \withwordsinstring{colored}{bla bla}
-% \withwordsinfile{colored}{ward.tex}
-%
-% \stoptext
diff --git a/Master/texmf-dist/tex/context/base/mkiv/supp-dir.mkiv b/Master/texmf-dist/tex/context/base/mkiv/supp-dir.mkiv
index 277f2b7cac2..0b643709916 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/supp-dir.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/supp-dir.mkiv
@@ -13,41 +13,34 @@
\unprotect
-\chardef\directionlefttoright\zerocount
-\chardef\directionrighttoleft\plusone
-
-\edef\??bdir{\ifdefined\bodydir bdir\else direction\fi}
-
-\unexpanded\edef\naturalhbox {\hbox \??bdir\directionlefttoright}
-\unexpanded\edef\naturalvbox {\vbox \??bdir\directionlefttoright}
-\unexpanded\edef\naturalvtop {\vtop \??bdir\directionlefttoright}
-\unexpanded\edef\naturalhpack {\hpack \??bdir\directionlefttoright}
-\unexpanded\edef\naturalvpack {\vpack \??bdir\directionlefttoright}
-\unexpanded\edef\naturaltpack {\tpack \??bdir\directionlefttoright}
-
-\unexpanded\edef\reversehbox {\hbox \??bdir\directionrighttoleft}
-\unexpanded\edef\reversevbox {\vbox \??bdir\directionrighttoleft}
-\unexpanded\edef\reversevtop {\vtop \??bdir\directionrighttoleft}
-\unexpanded\edef\reversehpack {\hpack \??bdir\directionrighttoleft}
-\unexpanded\edef\reversevpack {\vpack \??bdir\directionrighttoleft}
-\unexpanded\edef\reversetpack {\tpack \??bdir\directionrighttoleft}
-
-\ifdefined\bodydir
- \let\bodydir \undefined \let\normalbodydir \undefined
- \let\bodydirection\undefined \let\normalbodydirection\undefined
-\fi
-
-\ifdefined\pagedir
- \let\pagedir \undefined \let\normalpagedir \undefined
- \let\pagedirection\undefined \let\normalpagedirection\undefined
-\fi
+% \immutable\chardef\directionlefttoright\zerocount
+% \immutable\chardef\directionrighttoleft\plusone
+
+\setnewconstant\directionlefttoright\zerocount
+\setnewconstant\directionrighttoleft\plusone
+
+\immutable\edef\??bdir{\ifdefined\bodydir bdir\else direction\fi}
+
+\permanent\protected\edef\naturalhbox {\hbox \??bdir\directionlefttoright}
+\permanent\protected\edef\naturalvbox {\vbox \??bdir\directionlefttoright}
+\permanent\protected\edef\naturalvtop {\vtop \??bdir\directionlefttoright}
+\permanent\protected\edef\naturalhpack {\hpack \??bdir\directionlefttoright}
+\permanent\protected\edef\naturalvpack {\vpack \??bdir\directionlefttoright}
+\permanent\protected\edef\naturaltpack {\tpack \??bdir\directionlefttoright}
+
+\permanent\protected\edef\reversehbox {\hbox \??bdir\directionrighttoleft}
+\permanent\protected\edef\reversevbox {\vbox \??bdir\directionrighttoleft}
+\permanent\protected\edef\reversevtop {\vtop \??bdir\directionrighttoleft}
+\permanent\protected\edef\reversehpack {\hpack \??bdir\directionrighttoleft}
+\permanent\protected\edef\reversevpack {\vpack \??bdir\directionrighttoleft}
+\permanent\protected\edef\reversetpack {\tpack \??bdir\directionrighttoleft}
% \expanded{\defineactivecharacter \number"2000E} {\textdirection\directionrighttoleft\relax}
% \expanded{\defineactivecharacter \number"2000F} {\textdirection\directionlefttoright\relax}
\def\syst_direction_string#1{\ifcase#1=\plusone r2l\else l2r\fi}
-\unexpanded\def\showdirsinmargin
+\permanent\protected\def\showdirsinmargin
{\normalexpanded{\inleft{\naturalhbox
{\ttxx[\syst_direction_string\pardirection,\syst_direction_string\textdirection]}}}}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/supp-mat.mkiv b/Master/texmf-dist/tex/context/base/mkiv/supp-mat.mkiv
index f3b94f73522..8f49ac25453 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/supp-mat.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/supp-mat.mkiv
@@ -53,7 +53,7 @@
% \let\normalstartdmath \Ustartdisplaymath
% \let\normalstopdmath \Ustopdisplaymath
-% \unexpanded\def\Ustartdisplaymath
+% \protected\def\Ustartdisplaymath
% {\ifinner
% \ifhmode
% \normalUstartmath
@@ -67,7 +67,7 @@
% \let\Ustopdisplaymath\normalUstopdisplaymath
% \fi}
-\unexpanded\def\Ucheckedstartdisplaymath
+\protected\def\Ucheckedstartdisplaymath
{\ifinner
\ifhmode
\normalUstartmath
@@ -93,16 +93,16 @@
\let\startdmath \Ustartdisplaymath % \Ucheckedstartdisplaymath
\let\stopdmath \Ustopdisplaymath % \Ucheckedstopdisplaymath
-\unexpanded\def\mathematics#1{\relax \ifmmode#1\else\normalstartimath#1\normalstopimath\fi}
-\unexpanded\def\displaymath#1{\noindent \ifmmode#1\else\normalstartdmath#1\normalstopdmath\fi}
-\unexpanded\def\inlinemath #1{\dontleavehmode\ifmmode#1\else\normalstartimath#1\normalstopimath\fi}
-\unexpanded\def\textmath #1{\dontleavehmode\ifmmode#1\else\begingroup\everymath\emptytoks\normalstartimath#1\normalstopimath\endgroup\fi} % \mathsurround\zeropoint
+\protected\def\mathematics#1{\relax \ifmmode#1\else\normalstartimath#1\normalstopimath\fi}
+\protected\def\displaymath#1{\noindent \ifmmode#1\else\normalstartdmath#1\normalstopdmath\fi}
+\protected\def\inlinemath #1{\dontleavehmode\ifmmode#1\else\normalstartimath#1\normalstopimath\fi}
+\protected\def\textmath #1{\dontleavehmode\ifmmode#1\else\begingroup\everymath\emptytoks\normalstartimath#1\normalstopimath\endgroup\fi} % \mathsurround\zeropoint
\let\m\mathematics
\let\stopmathmode\relax
-\unexpanded\def\startmathmode % nested variant
+\protected\def\startmathmode % nested variant
{\relax\ifmmode
\begingroup
\let\stopmathmode\endgroup
@@ -111,7 +111,7 @@
\let\stopmathmode\normalstopimath
\fi}
-\unexpanded\def\nomathematics#1%
+\protected\def\nomathematics#1%
{\relax\ifmmode\hbox{#1}\else#1\fi}
\let\math\mathematics
@@ -126,13 +126,13 @@
\def\strc_formulas_stop_formula {\normalstopdmath }
\fi
-\unexpanded\def\displaymathematics#1{\relax\ifmmode#1\else\strc_formulas_start_formula{}#1\strc_formulas_stop_formula\fi}
-\unexpanded\def\inlinemathematics {\dontleavehmode\mathematics}
-\unexpanded\def\automathematics {\relax\ifhmode\expandafter\inlinemathematics\else\expandafter\displaymathematics\fi}
+\protected\def\displaymathematics#1{\relax\ifmmode#1\else\strc_formulas_start_formula{}#1\strc_formulas_stop_formula\fi}
+\protected\def\inlinemathematics {\dontleavehmode\mathematics}
+\protected\def\automathematics {\relax\ifhmode\expandafter\inlinemathematics\else\expandafter\displaymathematics\fi}
% better, esp when used in bTABLE ... eTABLE
-\unexpanded\def\automathematics
+\protected\def\automathematics
{\relax
\ifhmode
\expandafter\inlinemathematics
@@ -157,7 +157,7 @@
\def\dimensiontypeface {\tf}
\def\dimensionhalfspace {\,}
-\unexpanded\def\dimension#1%
+\protected\def\dimension#1%
{\pushmacro\dodimensionsignal
\gdef\dodimensionsignal{\kern\dimensionsignal}%
\ifzeropt\lastskip
@@ -178,7 +178,7 @@
\dodimensionsignal
\popmacro\dodimensionsignal}
-\unexpanded\def\nodimension#1%
+\protected\def\nodimension#1%
{\unskip#1\glet\dodimensionsignal\relax}
%D \macros
@@ -193,7 +193,7 @@
%D
%D \typebuffer \getbuffer
-\unexpanded\def\cramped
+\protected\def\cramped
{\mathpalette\math_cramped}
%D We force a cramped style by issuing a non||existing radical (box).
@@ -294,9 +294,9 @@
%D Notice that \type {\clap{\cramped ... }} would also work,
%D but it requires \TEX\ to typeset it arguments 16 times.
-\unexpanded\def\crampedllap{\mathpalette\math_cramped_llap}
-\unexpanded\def\crampedrlap{\mathpalette\math_cramped_rlap}
-\unexpanded\def\crampedclap{\mathpalette\math_cramped_clap}
+\protected\def\crampedllap{\mathpalette\math_cramped_llap}
+\protected\def\crampedrlap{\mathpalette\math_cramped_rlap}
+\protected\def\crampedclap{\mathpalette\math_cramped_clap}
\def\math_cramped_llap#1#2{{}\dollap{\math_cramped #1{#2}}}
\def\math_cramped_rlap#1#2{{}\dorlap{\math_cramped #1{#2}}}
@@ -304,7 +304,7 @@
% experiment, not yet to be used
-% \unexpanded\def\displaybreak
+% \protected\def\displaybreak
% {\ifhmode
% \removeunwantedspaces
% \ifcase\raggedstatus\hfill\fi
@@ -319,4 +319,11 @@
\let\nosuperscript\Unosuperscript
\let\nosubscript \Unosubscript
+% only in luametatex:
+
+\let\superprescript \Usuperprescript
+\let\subprescript \Usubprescript
+\let\nosuperprescript\Unosuperprescript
+\let\nosubsprecript \Unosubprescript
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/supp-ran.lua b/Master/texmf-dist/tex/context/base/mkiv/supp-ran.lua
index 1a2d10bea72..7946370d727 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/supp-ran.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/supp-ran.lua
@@ -53,6 +53,9 @@ end
math.setrandomseedi = setrandomseedi
local function getrandomnumber(min,max)
+ if min > max then
+ min, max = max, min
+ end
last = random(min,max)
if trace_details then
report_system("number %s",last)
@@ -80,7 +83,8 @@ end
-- maybe stack
local function pushrandomseed()
- insert(stack,last)
+ -- insert(stack,last) -- doesn't work okay
+ insert(stack,randomseed(last) or last)
if trace_random or trace_details then
report_system("pushing seed %s",last)
end
@@ -132,6 +136,8 @@ utilities.randomizer = {
reuseseed = reuserandomseed,
popseed = poprandomseed,
get = getrandom,
+ -- the original, only for testing
+ -- mathrandom = random,
}
-- todo: also open up in utilities.randomizer.*
@@ -139,10 +145,9 @@ utilities.randomizer = {
implement { name = "getrandomnumber", actions = { getrandomnumber, context }, arguments = { "integer", "integer" } }
implement { name = "getrandomdimen", actions = { getrandomnumber, context }, arguments = { "dimen", "dimen" } }
implement { name = "getrandomfloat", actions = { getrandomnumber, context }, arguments = { "number", "number" } }
---------- { name = "getmprandomnumber", actions = { getmprandomnumber, context } }
-implement { name = "setrandomseed", actions = { setrandomseed }, arguments = { "integer" } }
-implement { name = "getrandomseed", actions = { getrandomseed, context } }
-implement { name = "pushrandomseed", actions = { pushrandomseed } }
-implement { name = "poprandomseed", actions = { poprandomseed } }
-implement { name = "reuserandomseed", actions = { reuserandomseed } }
+implement { name = "getrandomseed", actions = { getrandomseed, context } }
+implement { name = "setrandomseed", actions = setrandomseed, arguments = "integer" }
+implement { name = "pushrandomseed", actions = pushrandomseed, public = true, }
+implement { name = "poprandomseed", actions = poprandomseed, public = true, }
+implement { name = "reuserandomseed", actions = reuserandomseed, public = true, }
diff --git a/Master/texmf-dist/tex/context/base/mkiv/supp-ran.mkiv b/Master/texmf-dist/tex/context/base/mkiv/supp-ran.mkiv
index 59707836aeb..52a45cf9cd0 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/supp-ran.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/supp-ran.mkiv
@@ -13,27 +13,40 @@
\writestatus{loading}{ConTeXt Support Macros / Random Number Generation}
-%D This module is downward compatible in the sense that we've kept
-%D the user interface (which uses intermediate variables).
+%D This module is downward compatible in the sense that we've kept the user
+%D interface (which uses intermediate variables).
+%D
+%D \starttyping
+%D \type{new}: \dorecurse{10}{\randomnumber{1}{100} }\par
+%D \setrandomseed{24}\type{set}: \dorecurse{10}{\randomnumber{1}{100} }\par
+%D \setrandomseed{24}\type{set}: \dorecurse{10}{\randomnumber{1}{100} }\par
+%D \setrandomseed{24}\type{set}: \dorecurse{10}{\randomnumber{1}{100} }\par
+%D \pushrandomseed \type{new}: \dorecurse{10}{\randomnumber{1}{100} }\par
+%D \poprandomseed \type{old}: \dorecurse{10}{\randomnumber{1}{100} }\par
+%D \type{new}: \dorecurse{10}{\randomnumber{1}{100} }\par
+%D \stoptyping
\registerctxluafile{supp-ran}{}
\unprotect
-\unexpanded\def\getrandomcount #1#2#3{#1=\clf_getrandomnumber\numexpr#2\relax\numexpr#3\relax\relax}
-\unexpanded\def\getrandomdimen #1#2#3{#1=\clf_getrandomdimen\dimexpr#2\relax\dimexpr#3\relax\scaledpoint\relax}
-\unexpanded\def\getrandomnumber#1#2#3{\edef#1{\clf_getrandomnumber\numexpr#2\relax\numexpr#3\relax}}
-\unexpanded\def\getrandomfloat #1#2#3{\edef#1{\clf_getrandomfloat\dimexpr#2\relax\dimexpr#3\relax}}
-\unexpanded\def\setrandomseed #1{\clf_setrandomseed\numexpr#1\relax}
-\unexpanded\def\getrandomseed #1{\edef#1{\clf_getrandomseed}}
-\unexpanded\def\pushrandomseed {\clf_pushrandomseed}
-\unexpanded\def\poprandomseed {\clf_poprandomseed}
-\unexpanded\def\reuserandomseed {\clf_reuserandomseed} % within push/pop
+\protected\def\getrandomcount #1#2#3{#1=\clf_getrandomnumber\numexpr#2\relax\numexpr#3\relax\relax}
+\protected\def\getrandomdimen #1#2#3{#1=\clf_getrandomdimen\dimexpr#2\relax\dimexpr#3\relax\scaledpoint\relax}
+\protected\def\getrandomnumber#1#2#3{\edef#1{\clf_getrandomnumber\numexpr#2\relax\numexpr#3\relax}}
+\protected\def\getrandomfloat #1#2#3{\edef#1{\clf_getrandomfloat\dimexpr#2\relax\dimexpr#3\relax}}
+\protected\def\setrandomseed #1{\clf_setrandomseed\numexpr#1\relax}
+\protected\def\getrandomseed #1{\edef#1{\clf_getrandomseed}}
+\protected\def\newrandomseed {\clf_getrandomseed}
+%protected\def\pushrandomseed {\clf_pushrandomseed}
+%protected\def\poprandomseed {\clf_poprandomseed}
+%protected\def\reuserandomseed {\clf_reuserandomseed} % within push/pop
\let\freezerandomseed \pushrandomseed
\let\defrostrandomseed\poprandomseed
+\setnewconstant \mpscaledmax 4095 % for old times sake
+
\def\randomnumber #1#2{\clf_getrandomnumber\numexpr#1\relax\numexpr#2\relax}
-\let\mprandomnumber \clf_getmprandomnumber
+\def\mprandomnumber {\clf_getrandomnumber\zerocount\mpscaledmax}
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/supp-vis.mkiv b/Master/texmf-dist/tex/context/base/mkiv/supp-vis.mkiv
index 23dfcb5fa75..f32f21ae0fa 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/supp-vis.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/supp-vis.mkiv
@@ -97,7 +97,7 @@
%D unwanted results. We can therefore turn all those things
%D off with \type{\dontinterfere}.
-\unexpanded\def\dontinterfere % or maybe just forgetall
+\protected\def\dontinterfere % or maybe just forgetall
{\reseteverypar
\parindent\zeropoint
\parskip \zeropoint
@@ -114,7 +114,7 @@
\ifdefined\dontcomplain \else
- \unexpanded\def\dontcomplain
+ \protected\def\dontcomplain
{\hbadness\plustenthousand
\vbadness\plustenthousand
\hfuzz \maxdimen
@@ -316,7 +316,7 @@
\let\dowithruledbox\relax % hook
-\unexpanded\def\makeruledbox#1%
+\protected\def\makeruledbox#1%
{\boxruleht\ht#1%
\boxruledp\dp#1%
\boxrulewd\wd#1%
@@ -397,7 +397,7 @@
%D
%D \ShowBufferedExampleBox
-\unexpanded\def\ruledhbox
+\protected\def\ruledhbox
{\normalhbox\bgroup
\dowithnextboxcs\supp_visualizers_hbox_finish\normalhbox}
@@ -419,7 +419,7 @@
%D
%D \ShowBufferedExampleBox
-\unexpanded\def\ruledvbox
+\protected\def\ruledvbox
{\normalvbox\bgroup
\dowithnextboxcs\supp_visualizers_vbox_finish\normalvbox}
@@ -441,7 +441,7 @@
%D
%D \ShowBufferedExampleBox
-\unexpanded\def\ruledvtop
+\protected\def\ruledvtop
{\normalvtop\bgroup
\dowithnextboxcs\supp_visualizers_vtop_finish\normalvtop}
@@ -462,7 +462,7 @@
%D
%D \ShowBufferedExampleBox
-\unexpanded\def\ruledvcenter
+\protected\def\ruledvcenter
{\normalvbox\bgroup
\dontinterfere
\dowithnextboxcs\supp_visualizers_vcenter_finish\normalvbox}
@@ -499,7 +499,7 @@
%D At the cost of some extra macros we can implement a
%D variant that does not need the~\type{=}, but we stick to:
-\unexpanded\def\ruledbox
+\protected\def\ruledbox
{\dowithnextboxcs\supp_visualizers_box_finish}
\def\supp_visualizers_box_finish
@@ -811,11 +811,11 @@
%D All five substitutions use the same auxiliary macro. Watch
%D the positive first -- negative next approach.
-\unexpanded\def\ruledhss {\doruledhfiller\normalhss \normalhfilneg {0}{0}}
-\unexpanded\def\ruledhfil {\doruledhfiller\normalhfil \normalhfilneg {10}{-6}}
-\unexpanded\def\ruledhfill {\doruledhfiller\normalhfill \normalhfillneg{18}{-14}}
-\unexpanded\def\ruledhfilneg {\doruledhfiller\normalhfilneg \normalhfil {-6}{10}}
-\unexpanded\def\ruledhfillneg{\doruledhfiller\normalhfillneg\normalhfill {-14}{18}}
+\protected\def\ruledhss {\doruledhfiller\normalhss \normalhfilneg {0}{0}}
+\protected\def\ruledhfil {\doruledhfiller\normalhfil \normalhfilneg {10}{-6}}
+\protected\def\ruledhfill {\doruledhfiller\normalhfill \normalhfillneg{18}{-14}}
+\protected\def\ruledhfilneg {\doruledhfiller\normalhfilneg \normalhfil {-6}{10}}
+\protected\def\ruledhfillneg{\doruledhfiller\normalhfillneg\normalhfill {-14}{18}}
%D \macros
%D {ruledvss,
@@ -889,11 +889,11 @@
%D Keep in mind that \type{\vfillneg} is not part of \PLAIN\
%D \TEX, but are mimmicked by a macro.
-\unexpanded\def\ruledvss {\doruledvfiller\normalvss \normalvfilneg {2}}
-\unexpanded\def\ruledvfil {\doruledvfiller\normalvfil \normalvfilneg {-4}}
-\unexpanded\def\ruledvfill {\doruledvfiller\normalvfill \normalvfillneg{-12}}
-\unexpanded\def\ruledvfilneg {\doruledvfiller\normalvfilneg \normalvfil {8}}
-\unexpanded\def\ruledvfillneg{\doruledvfiller\normalvfillneg\normalvfill {16}}
+\protected\def\ruledvss {\doruledvfiller\normalvss \normalvfilneg {2}}
+\protected\def\ruledvfil {\doruledvfiller\normalvfil \normalvfilneg {-4}}
+\protected\def\ruledvfill {\doruledvfiller\normalvfill \normalvfillneg{-12}}
+\protected\def\ruledvfilneg {\doruledvfiller\normalvfilneg \normalvfil {8}}
+\protected\def\ruledvfillneg{\doruledvfiller\normalvfillneg\normalvfill {16}}
%D \macros
%D {ruledhskip}
@@ -999,7 +999,7 @@
\fi
\egroup}
-\unexpanded\def\ruledhskip
+\protected\def\ruledhskip
{\bgroup
\afterassignment\supp_visualizers_hskip_indeed
\scratchskip=}
@@ -1149,7 +1149,7 @@
\fi
\egroup}
-\unexpanded\def\ruledvskip
+\protected\def\ruledvskip
{\bgroup
\afterassignment\doruledvskip
\scratchskip=}
@@ -1228,7 +1228,7 @@
\afterwards\scratchskip
\egroup}
-\unexpanded\def\ruledhkern#1%
+\protected\def\ruledhkern#1%
{\bgroup
\let\afterwards#1%
\afterassignment\supp_visualizers_hkern_indeed
@@ -1317,13 +1317,13 @@
\afterwards\scratchskip
\egroup}
-\unexpanded\def\ruledvkern#1%
+\protected\def\ruledvkern#1%
{\bgroup
\let\afterwards#1\relax
\afterassignment\supp_visualizers_vkern_indeed
\scratchskip=}
-\unexpanded\def\ruledkern
+\protected\def\ruledkern
{\ifvmode
\expandafter\ruledvkern
\else
@@ -1334,7 +1334,7 @@
%D A a bit more \TEX nice solution is:
%D
%D \starttyping
-%D \unexpanded\def\ruledkern%
+%D \protected\def\ruledkern%
%D {\csname ruled\ifvmode v\else h\fi kern\endcsname\normalkern}
%D \stoptyping
@@ -1370,7 +1370,7 @@
\spacefactor\scratchcounter
\egroup}
-\unexpanded\def\ruledhglue
+\protected\def\ruledhglue
{\bgroup
\afterassignment\supp_visualizers_hglue_indeed\scratchskip=}
@@ -1400,7 +1400,7 @@
\prevdepth\nextdepth
\egroup}
-\unexpanded\def\ruledvglue
+\protected\def\ruledvglue
{\bgroup
\afterassignment\supp_visualizers_vglue_indeed\scratchskip=}
@@ -1461,7 +1461,7 @@
%D
%D \ShowBufferedExample
-\unexpanded\def\ruledmkern
+\protected\def\ruledmkern
{\bgroup
\afterassignment\supp_visualizers_mkern_indeed
\scratchmuskip=}
@@ -1485,7 +1485,7 @@
\flexibletrue
\supp_visualizers_mkern_finish\normalmskip}
-\unexpanded\def\ruledmskip
+\protected\def\ruledmskip
{\bgroup
\afterassignment\supp_visualizers_mskip_indeed
\scratchmuskip=}
@@ -1589,7 +1589,7 @@
\fi}%
\smashbox#1}
-\unexpanded\def\ruledhpenalty
+\protected\def\ruledhpenalty
{\bgroup
\afterassignment\supp_visualizers_hpenalty_indeed
\scratchcounter=}
@@ -1639,7 +1639,7 @@
%D
%D \ShowBufferedExample
-\unexpanded\def\ruledvpenalty
+\protected\def\ruledvpenalty
{\bgroup
\afterassignment\supp_visualizers_vpenalty_indeed
\scratchcounter=}
@@ -1682,7 +1682,7 @@
%D This comes together in:
-\unexpanded\def\ruledpenalty
+\protected\def\ruledpenalty
{\ifvmode
\expandafter\ruledvpenalty
\else
@@ -1698,7 +1698,7 @@
%D For those who want to manipulate the visual cues in detail,
%D we have grouped them.
-\unexpanded\def\showfils
+\protected\def\showfils
{\showingcompositiontrue
\let\hss \ruledhss
\let\hfil \ruledhfil
@@ -1711,7 +1711,7 @@
\let\vfilneg \ruledvfilneg
\let\vfillneg \ruledvfillneg}
-\unexpanded\def\dontshowfils
+\protected\def\dontshowfils
{\let\hss \normalhss
\let\hfil \normalhfil
\let\hfill \normalhfill
@@ -1723,7 +1723,7 @@
\let\vfilneg \normalvfilneg
\let\vfillneg \normalvfillneg}
-\unexpanded\def\showboxes
+\protected\def\showboxes
{\showingcompositiontrue
\baselineruletrue
\let\hbox \ruledhbox
@@ -1731,13 +1731,13 @@
\let\vtop \ruledvtop
\let\vcenter \ruledvcenter}
-\unexpanded\def\dontshowboxes
+\protected\def\dontshowboxes
{\let\hbox \normalhbox
\let\vbox \normalvbox
\let\vtop \normalvtop
\let\vcenter \normalvcenter}
-\unexpanded\def\showskips
+\protected\def\showskips
{\showingcompositiontrue
\let\hskip \ruledhskip
\let\vskip \ruledvskip
@@ -1747,7 +1747,7 @@
\let\hglue \ruledhglue
\let\vglue \ruledvglue}
-\unexpanded\def\dontshowskips
+\protected\def\dontshowskips
{\let\hskip \normalhskip
\let\vskip \normalvskip
\let\kern \normalkern
@@ -1756,11 +1756,11 @@
\let\hglue \normalhglue
\let\vglue \normalvglue}
-\unexpanded\def\showpenalties
+\protected\def\showpenalties
{\showingcompositiontrue
\let\penalty \ruledpenalty}
-\unexpanded\def\dontshowpenalties
+\protected\def\dontshowpenalties
{\let\penalty \normalpenalty}
%D \macros
@@ -1787,7 +1787,7 @@
\newif\ifshowingcomposition
-\unexpanded\def\showcomposition
+\protected\def\showcomposition
{\ifshowingcomposition
\showfils
\showboxes
@@ -1795,7 +1795,7 @@
\showpenalties
\fi}
-\unexpanded\def\dontshowcomposition
+\protected\def\dontshowcomposition
{\ifshowingcomposition
\dontshowfils
\dontshowboxes
@@ -1829,7 +1829,7 @@
\def\defaulttestrulewidth{.02\bodyfontsize}
\fi
-\unexpanded\def\showmakeup
+\protected\def\showmakeup
{\testrulewidth\defaulttestrulewidth
\showingcompositiontrue
\showcomposition}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/symb-emj.mkiv b/Master/texmf-dist/tex/context/base/mkiv/symb-emj.mkiv
index e063b6a7a13..7bfe4c0232a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/symb-emj.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/symb-emj.mkiv
@@ -23,5 +23,4 @@
\unexpanded\def\emoji #1{\dontleavehmode{\setdirectsymbolicfont{emoji}\clf_resolvedemoji{#1}}}
\unexpanded\def\robustemoji #1{\dontleavehmode{\setdirectsymbolicfont{emoji}\clf_checkedemoji {#1}}}
-
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/symb-imp-cc.mkiv b/Master/texmf-dist/tex/context/base/mkiv/symb-imp-cc.mkiv
index e753d695f8c..d9f596b9c72 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/symb-imp-cc.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/symb-imp-cc.mkiv
@@ -69,8 +69,8 @@
\unexpanded\def\creativecommons#1%
{\dontleavehmode\lower.15\exheight\hbox\bgroup
- \let\inbetween\relax
- \processseparatedlist[#1][-]{\inbetween\let\inbetween\enspace\directsymbol{cc}}%
+ \overloaded\let\inbetween\relax
+ \processseparatedlist[#1][-]{\inbetween\overloaded\let\inbetween\enspace\directsymbol{cc}}%
\egroup}
\definesymbol [cc-by-sa-nc] [\creativecommons{cc-by-sa-nc}]
diff --git a/Master/texmf-dist/tex/context/base/mkiv/symb-imp-mis.mkiv b/Master/texmf-dist/tex/context/base/mkiv/symb-imp-mis.mkiv
index 2320ea59ae0..b02233baaf0 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/symb-imp-mis.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/symb-imp-mis.mkiv
@@ -72,9 +72,9 @@
\definesymbol [numero] [\textnumero]
\definesymbol [euro] [\texteuro]
-\let\euro\texteuro
+\aliased\let\euro\texteuro
-\def\Numero{\symbol[Numero]} % obsolete
-\def\numero{\symbol[numero]} % obsolete
+\permanent\protected\def\Numero{\symbol[Numero]} % obsolete
+\permanent\protected\def\numero{\symbol[numero]} % obsolete
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/symb-imp-nav.mkiv b/Master/texmf-dist/tex/context/base/mkiv/symb-imp-nav.mkiv
index 6e2f2c1f034..ce5b1d76afa 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/symb-imp-nav.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/symb-imp-nav.mkiv
@@ -24,7 +24,7 @@
\definefontsynonym [ContextNavigation] [contnav]
-\def\ContextNavigationGlyph{\getnamedglyphdirect{ContextNavigation}} % #1
+\permanent\protected\def\ContextNavigationGlyph{\getnamedglyphdirect{ContextNavigation}} % #1
\startsymbolset [navigation 1]
@@ -122,8 +122,15 @@
\stopsymbolset
-%D \showsymbolset[navigation 1]
-%D \showsymbolset[navigation 2]
-%D \showsymbolset[navigation 3]
+\protect
-\protect \endinput
+\continueifinputfile{symb-imp-nav.mkiv}
+
+\starttext
+ \showsymbolset[navigation 1]\page
+ \showsymbolset[navigation 2]\page
+ \showsymbolset[navigation 3]\page
+ \ContextNavigationGlyph{char03}\quad
+ \ContextNavigationGlyph{char67}\quad
+ \ContextNavigationGlyph{charcb}
+\stoptext
diff --git a/Master/texmf-dist/tex/context/base/mkiv/symb-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/symb-ini.lua
index 588e5d2ab5c..c0e717f465b 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/symb-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/symb-ini.lua
@@ -21,7 +21,6 @@ local report_symbols = logs.reporter ("fonts","symbols")
local status_symbols = logs.messenger("fonts","symbols")
local patterns = {
- CONTEXTLMTXMODE > 0 and "symb-imp-%s.mkxl" or "",
"symb-imp-%s.mkiv",
"symb-imp-%s.tex",
-- obsolete:
diff --git a/Master/texmf-dist/tex/context/base/mkiv/syst-aux.lua b/Master/texmf-dist/tex/context/base/mkiv/syst-aux.lua
index 46bb8e3f748..85604a2327d 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/syst-aux.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/syst-aux.lua
@@ -1,4 +1,4 @@
-if not modules then modules = { } end modules ['syst-aux'] = {
+ if not modules then modules = { } end modules ['syst-aux'] = {
version = 1.001,
comment = "companion to syst-aux.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
@@ -11,20 +11,19 @@ if not modules then modules = { } end modules ['syst-aux'] = {
-- utfmatch(str,"(.?)(.*)$")
-- utf.sub(str,1,1)
-local tonumber, next = tonumber, next
+local tonumber, next, type = tonumber, next, type
local utfsub = utf.sub
local P, S, R, C, Cc, Cs, Carg, lpegmatch = lpeg.P, lpeg.S, lpeg.R, lpeg.C, lpeg.Cc, lpeg.Cs, lpeg.Carg, lpeg.match
-local next = next
-local find = string.find
+local find, formatters = string.find, string.formatters
local context = context
local implement = interfaces.implement
-local formatters = string.formatters
+local setmacro = interfaces.setmacro
local setcatcode = tex.setcatcode
+local texget = tex.get
local utf8character = lpeg.patterns.utf8character
local settings_to_array = utilities.parsers.settings_to_array
local settings_to_set = utilities.parsers.settings_to_set
-local setmacro = interfaces.setmacro
local pattern = C(utf8character^-1) * C(P(1)^0)
@@ -131,115 +130,14 @@ local sentinel = spaces * (nohash^1 / "\\%0")
local sargument = (single * digit)^1
local dargument = (double * digit)^1
--- first variant:
---
--- local texpreamble = nil
--- local usespaces = nil
---
--- local pattern = Cs( -- ^-1
--- ( P("spaces") / function() usespaces = true return "" end )^0
--- * spaces
--- * ( P("nospaces") / function() usespaces = false return "" end )^0
--- * spaces
--- * ( P("global") / "\\global" )^0
--- * spaces
--- * ( P("unexpanded") / "\\unexpanded" )^0
--- * spaces
--- * Cc("\\expandafter\\")
--- * spaces
--- * ( P("expanded") / "e" )^0
--- * spaces
--- * ( P((1-S(" #"))^1) / "def\\csname %0\\endcsname" )
--- * spaces
--- * (
--- -- (double * digit)^1 * sentinel^-1 * double^-1
--- -- + (single * digit)^1 * sentinel^-1 * single^-1
--- ( P("[") * dargument * P("]") + dargument)^1 * sentinel^-1 * double^-1
--- + ( P("[") * sargument * P("]") + sargument)^1 * sentinel^-1 * single^-1
--- + sentinel^-1 * (double+single)^-1
--- )
--- )
---
--- local ctx_dostarttexdefinition = context.dostarttexdefinition
---
--- local function texdefinition_one(str)
--- usespaces = nil
--- texpreamble = lpegmatch(pattern,str)
--- if usespaces == true then
--- setcatcode(32,10) -- space
--- setcatcode(13, 5) -- endofline
--- elseif usespaces == false then
--- setcatcode(32, 9) -- ignore
--- setcatcode(13, 9) -- ignore
--- else
--- -- this is default
--- -- setcatcode(32,10) -- space
--- -- setcatcode(13, 9) -- ignore
--- end
--- ctx_dostarttexdefinition()
--- end
---
--- local function texdefinition_two()
--- context(texpreamble)
--- end
-
--- second variant:
---
--- -- default:
--- --
--- -- setcatcode(32,10) -- space
--- -- setcatcode(13, 9) -- ignore
---
--- local function catcodes_s()
--- setcatcode(32,10) -- space
--- setcatcode(13, 5) -- endofline
--- return ""
--- end
---
--- local function catcodes_n()
--- setcatcode(32, 9) -- ignore
--- setcatcode(13, 9) -- ignore
--- return ""
--- end
---
--- local pattern = Cs( -- ^-1
--- ( P("spaces") * space / catcodes_s )^0
--- * spaces * ( P("nospaces") * space / catcodes_n )^0
--- * spaces * ( P("global") * space / "\\global" )^0
--- * spaces * ( P("unexpanded") * space / "\\unexpanded" )^0
--- * spaces * Cc("\\expandafter\\")
--- * spaces * ( P("expanded") / "e" )^0
--- * spaces * ( P((1-S(" #["))^1) / "def\\csname %0\\endcsname" )
--- * spaces * (
--- -- (double * digit)^1 * sentinel^-1 * double^-1
--- -- + (single * digit)^1 * sentinel^-1 * single^-1
--- ( P("[") * dargument * P("]") + dargument)^1 * sentinel^-1 * double^-1
--- + ( P("[") * sargument * P("]") + sargument)^1 * sentinel^-1 * single^-1
--- + sentinel^-1 * (double+single)^-1
--- )
--- )
---
--- local texpreamble = nil
---
--- local ctx_dostarttexdefinition = context.dostarttexdefinition
---
--- local function texdefinition_one(str)
--- texpreamble = lpegmatch(pattern,str)
--- ctx_dostarttexdefinition()
--- end
---
--- local function texdefinition_two()
--- context(texpreamble)
--- end
-
-- third variant:
-local global = nil
-local unexpanded = nil
-local expanded = nil
-local optional = nil
-local csname = nil
-local rest = nil
+local global = nil
+local protected = nil
+local expanded = nil
+local optional = nil
+local csname = nil
+local rest = nil
local function catcodes_s()
setcatcode(32,10) -- space
@@ -264,12 +162,23 @@ local option = (
) * (P("empty") + P("argument"))
local pattern = (
- ( P("spaces") * space / catcodes_s )^0
- * spaces * ( P("nospaces") * space / catcodes_n )^0
- * spaces * ( P("global") * space * Cc(true) + Cc(false) )
- * spaces * ( P("unexpanded") * space * Cc(true) + Cc(false) )
- * spaces * ( P("expanded") * space * Cc(true) + Cc(false) )
- * spaces * ( C(option) * space + Cc(false) )
+ (
+ spaces * (
+ ( P("spaces") * space / catcodes_s )
+ + ( P("nospaces") * space / catcodes_n )
+ + ( P("global") * space / function() global = true end )
+ + ( P("protected") * space / function() protected = true end)
+ + ( P("permanent") * space )
+ + ( P("expanded") * space / function() expanded = true end)
+ + ( P("tolerant") * space )
+ + ( P("instance") * space )
+ + ( P("frozen") * space )
+ + ( P("mutable") * space )
+ + ( P("immutable") * space )
+ + ( P("unexpanded") * space / function() protected = true end)
+ + ( C(option) * space / function(s) optional = s end)
+ )
+ )^0
* spaces * ( C((1-S(" #["))^1) )
* spaces * Cs(
( P("[") * dargument * P("]") + dargument)^1 * sentinel^-1 * double^-1
@@ -281,40 +190,29 @@ local pattern = (
local ctx_dostarttexdefinition = context.dostarttexdefinition
local function texdefinition_one(str)
- global, unexpanded, expanded, optional, csname, rest = lpegmatch(pattern,str)
+ global = false
+ protected = false
+ expanded = false
+ optional = false
+ csname, rest = lpegmatch(pattern,str)
ctx_dostarttexdefinition()
end
local function texdefinition_two()
if optional then
context (
- [[\unexpanded\expandafter]] ..
- (global and [[\xdef]] or [[\edef]]) ..
- [[\csname ]] ..
- csname ..
- [[\endcsname{\expandafter\noexpand\expandafter\do]] ..
- optional ..
- [[\csname _do_]] ..
- csname ..
- -- [[_\endcsname}\unexpanded\expandafter]] ..
- [[_\endcsname}\expandafter]] ..
- (global and [[\gdef]] or [[\edef]]) ..
- [[\csname _do_]] ..
- csname ..
- [[_\endcsname ]] ..
+ (protected and [[\protected]] or "") ..
+ [[\expandafter]] .. (global and [[\xdef]] or [[\edef]]) ..
+ [[\csname ]] .. csname .. [[\endcsname{\expandafter\noexpand\expandafter\do]] .. optional ..
+ [[\csname _do_]] .. csname .. [[_\endcsname}\expandafter]] .. (global and [[\gdef]] or [[\edef]]) ..
+ [[\csname _do_]] .. csname .. [[_\endcsname ]] ..
rest
)
else
context (
- [[\unexpanded\expandafter]] ..
- ( global and (
- expanded and [[\xdef]] or [[\gdef]]
- ) or (
- expanded and [[\edef]] or [[\def]]
- ) ) ..
- [[\csname ]] ..
- csname ..
- [[\endcsname ]] ..
+ (protected and [[\protected]] or "") ..
+ [[\expandafter]] .. (global and (expanded and [[\xdef]] or [[\gdef]]) or (expanded and [[\edef]] or [[\def]])) ..
+ [[\csname ]] .. csname .. [[\endcsname ]] ..
rest
)
end
@@ -404,6 +302,20 @@ implement {
end
}
+implement {
+ name = "elapsedsteptime",
+ arguments = "integer",
+ actions = function(n)
+ statistics.stoptiming("whatever")
+ local t = statistics.elapsed("whatever")/(n > 0 and n or 1)
+ if t > 0 then
+ context("%0.9f",t)
+ else
+ context(0)
+ end
+ end
+}
+
local accuracy = table.setmetatableindex(function(t,k)
local v = formatters["%0." ..k .. "f"]
t[k] = v
@@ -771,15 +683,58 @@ implement {
local bp = number.dimenfactors.bp
-interfaces.implement {
+implement {
name = "tobigpoints",
actions = function(d) context("%.5F",bp * d) end,
arguments = "dimension",
}
-interfaces.implement {
+implement {
name = "towholebigpoints",
actions = function(d) context("%r",bp * d) end,
arguments = "dimension",
}
+-- for now here:
+
+local function getshape(s)
+ local t = texget(s)
+ local n = t and #t or 0
+ context(n)
+ if n > 0 then
+ for i=1,n do
+ local ti = t[i]
+ if type(ti) == "table" then
+ context(" %isp %isp",ti[1],ti[2])
+ else
+ context(" %i",ti)
+ end
+ end
+ end
+end
+
+implement {
+ name = "getparshape",
+ public = true,
+ actions = function() getshape("parshape") end,
+}
+implement {
+ name = "getclubpenalties",
+ public = true,
+ actions = function() getshape("clubpenalties") end,
+}
+implement {
+ name = "getinterlinepenalties",
+ public = true,
+ actions = function() getshape("interlinepenalties") end,
+ }
+implement {
+ name = "getdisplaywidowpenalties",
+ public = true,
+ actions = function() getshape("displaywidowpenalties") end,
+}
+implement {
+ name = "getwidowpenalties",
+ public = true,
+ actions = function() getshape("widowpenalties") end,
+}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/syst-aux.mkiv b/Master/texmf-dist/tex/context/base/mkiv/syst-aux.mkiv
index 255f0746c39..194f1de2cb1 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/syst-aux.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/syst-aux.mkiv
@@ -12,6 +12,7 @@
%C details.
\registerctxluafile{syst-aux}{}
+\registerctxluafile{syst-mac}{}
% A dedicated primitive \ifvoidmacro\cs == \ifx\cs\empty is some 10% faster but
% probably not that noticeable in practice. An \ifvoidtoks might make sense but we
@@ -47,7 +48,7 @@
%D code.
%D
%D \starttyping
-%D \unexpanded\def\somecommand{... ... ...}
+%D \protected\def\somecommand{... ... ...}
%D \stoptyping
%D
%D This overloads the \ETEX\ primitive but as we already had an \MKII\ solution we
@@ -55,21 +56,10 @@
\let\unexpanded\normalprotected
-\ifcase\contextlmtxmode
-
- \def\startlmtxmode#1\stoplmtxmode{}
- \let\stoplmtxmode \relax
- \let\startmkivmode\relax
- \let\stopmkivmode \relax
-
-\else
-
- \let\startlmtxmode\relax
- \let\stoplmtxmode \relax
- \def\startmkivmode#1\stopmkivmode{}
- \let\stopmkivmode \relax
-
-\fi
+\def\startlmtxmode#1\stoplmtxmode{}
+\let\stoplmtxmode \relax
+\let\startmkivmode\relax
+\let\stopmkivmode \relax
%D As we don't have namespace definers yet, we use a special one:
@@ -86,7 +76,7 @@
\fi
-\unexpanded\def\installsystemnamespace#1% maybe move this to syst-ini
+\protected\def\installsystemnamespace#1% maybe move this to syst-ini
{\ifcsname ??#1\endcsname
\writestatus\m!system{duplicate system namespace '#1'}\wait
\else
@@ -198,10 +188,10 @@
\let\m_syst_helpers_expanded\empty
-\unexpanded\def\expanded#1%
+\protected\def\expanded#1%
{\xdef\m_syst_helpers_expanded{\noexpand#1}\m_syst_helpers_expanded}
-\unexpanded\def\startexpanded#1\stopexpanded
+\protected\def\startexpanded#1\stopexpanded
{\xdef\m_syst_helpers_expanded{#1}\m_syst_helpers_expanded}
\let\stopexpanded\relax
@@ -296,13 +286,13 @@
\expandafter\m_syst_action_nop
\fi}
-\unexpanded\def\doifelsenextchar#1#2#3% #1 should not be {} !
+\protected\def\doifelsenextchar#1#2#3% #1 should not be {} !
{\let\charactertoken=#1% = needed here
\def\m_syst_action_yes{#2}%
\def\m_syst_action_nop{#3}%
\futurelet\nexttoken\syst_helpers_inspect_next_character}
-\unexpanded\def\doifelsenextcharcs#1#2#3% #1 should not be {} !
+\protected\def\doifelsenextcharcs#1#2#3% #1 should not be {} !
{\let\charactertoken=#1% = needed here
\let\m_syst_action_yes#2%
\let\m_syst_action_nop#3%
@@ -343,13 +333,13 @@
\expandafter\m_syst_action_nop
\fi}
-\unexpanded\def\doifelsenextoptional#1#2%
+\protected\def\doifelsenextoptional#1#2%
{\def\m_syst_action_yes{#1}%
\def\m_syst_action_nop{#2}%
\let\if_next_blank_space_token\iffalse
\futurelet\nexttoken\syst_helpers_inspect_next_optional_character}
-\unexpanded\def\doifelsenextoptionalcs#1#2% \cs \cs (upto 10% faster)
+\protected\def\doifelsenextoptionalcs#1#2% \cs \cs (upto 10% faster)
{\let\m_syst_action_yes#1%
\let\m_syst_action_nop#2%
\let\if_next_blank_space_token\iffalse
@@ -360,14 +350,14 @@
% fails on assignments
%
-% \unexpanded\def\doifelsenextoptional {\afterassignment\doifelsenextoptional_n \def\m_syst_action_yes}
-% \def\doifelsenextoptional_n {\afterassignment\doifelsenextoptional_n_n\def\m_syst_action_nop}
-% \def\doifelsenextoptional_n_n {\let\if_next_blank_space_token\iffalse
+% \protected\def\doifelsenextoptional {\afterassignment\doifelsenextoptional_n \def\m_syst_action_yes}
+% \def\doifelsenextoptional_n {\afterassignment\doifelsenextoptional_n_n\def\m_syst_action_nop}
+% \def\doifelsenextoptional_n_n {\let\if_next_blank_space_token\iffalse
% \futurelet\nexttoken\syst_helpers_inspect_next_optional_character}
%
-% \unexpanded\def\doifelsenextoptionalcs {\afterassignment\doifelsenextoptionalcs_n \let\m_syst_action_yes}
-% \def\doifelsenextoptionalcs_n {\afterassignment\doifelsenextoptionalcs_n_n\let\m_syst_action_nop}
-% \def\doifelsenextoptionalcs_n_n{\let\if_next_blank_space_token\iffalse
+% \protected\def\doifelsenextoptionalcs {\afterassignment\doifelsenextoptionalcs_n \let\m_syst_action_yes}
+% \def\doifelsenextoptionalcs_n {\afterassignment\doifelsenextoptionalcs_n_n\let\m_syst_action_nop}
+% \def\doifelsenextoptionalcs_n_n{\let\if_next_blank_space_token\iffalse
% \futurelet\nexttoken\syst_helpers_inspect_next_optional_character}
\let\syst_helpers_next_bgroup_character_token\bgroup
@@ -386,13 +376,13 @@
\expandafter\m_syst_action_nop
\fi}
-\unexpanded\def\doifelsenextbgroup#1#2%
+\protected\def\doifelsenextbgroup#1#2%
{\def\m_syst_action_yes{#1}%
\def\m_syst_action_nop{#2}%
\let\if_next_blank_space_token\iffalse
\futurelet\nexttoken\syst_helpers_inspect_next_bgroup_character}
-\unexpanded\def\doifelsenextbgroupcs#1#2%
+\protected\def\doifelsenextbgroupcs#1#2%
{\let\m_syst_action_yes#1%
\let\m_syst_action_nop#2%
\let\if_next_blank_space_token\iffalse
@@ -417,7 +407,7 @@
\expandafter\m_syst_action_nop
\fi}
-\unexpanded\def\doifelsenextparenthesis#1#2%
+\protected\def\doifelsenextparenthesis#1#2%
{\def\m_syst_action_yes{#1}%
\def\m_syst_action_nop{#2}%
\let\if_next_blank_space_token\iffalse
@@ -434,12 +424,12 @@
\expandafter\m_syst_action_nop
\fi}
-\unexpanded\def\doifelsefastoptionalcheck#1#2%
+\protected\def\doifelsefastoptionalcheck#1#2%
{\def\m_syst_action_yes{#1}%
\def\m_syst_action_nop{#2}%
\futurelet\nexttoken\syst_helpers_do_if_fast_optional_check_else}
-\unexpanded\def\doifelsefastoptionalcheckcs#1#2% \cs \cs
+\protected\def\doifelsefastoptionalcheckcs#1#2% \cs \cs
{\let\m_syst_action_yes#1%
\let\m_syst_action_nop#2%
\futurelet\nexttoken\syst_helpers_do_if_fast_optional_check_else}
@@ -455,7 +445,7 @@
%D {a few lines later}
%D \stoptyping
-% \unexpanded\def\assumelongusagecs#1%
+% \protected\def\assumelongusagecs#1%
% {\let\m_syst_action#1%
% \futurelet\nexttoken\syst_helpers_ignore_par_character}
%
@@ -476,7 +466,7 @@
% \def\syst_helpers_ignore_par_partoken
% {\afterassignment\m_syst_action\let\nexttoken}
-\unexpanded\def\assumelongusagecs#1%
+\protected\def\assumelongusagecs#1%
{\let\m_syst_action#1%
\futurelet\nexttoken\syst_helpers_ignore_spacing}
@@ -590,12 +580,12 @@
\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}
+\def\setuvalue #1{\protected\expandafter \def\csname#1\endcsname}
+\def\setuevalue #1{\protected\expandafter\edef\csname#1\endcsname}
+\def\setugvalue #1{\protected\expandafter\gdef\csname#1\endcsname}
+\def\setuxvalue #1{\protected\expandafter\xdef\csname#1\endcsname}
-\unexpanded\def\getuvalue#1{\csname#1\endcsname}
+\protected\def\getuvalue#1{\csname#1\endcsname}
%D \macros
%D {globallet,glet}
@@ -670,13 +660,13 @@
%D {\undefined}! In \ETEX\ we have \type {\ifcsname} and that way of testing on
%D existance is not the same as the one described here. Therefore we introduce:
-\unexpanded\def\letbeundefined#1% potential stack buildup when used \global
+\protected\def\letbeundefined#1% potential stack buildup when used \global
{\expandafter\let\csname#1\endcsname\undefined} % or use \undefinevalue to match \setvalue
-\unexpanded\def\localundefine#1% conditional
+\protected\def\localundefine#1% conditional
{\ifcsname#1\endcsname\expandafter\let\csname#1\endcsname\undefined\fi}
-\unexpanded\def\globalundefine#1% conditional
+\protected\def\globalundefine#1% conditional
{\ifcsname#1\endcsname\expandafter\glet\csname#1\endcsname\undefined\fi}
%D Beware, being \type {\undefined} in \ETEX\ means that the macro {\em is} defined!
@@ -685,7 +675,7 @@
%D behavior in text and math mode, which was due to this grouping subtilities. We
%D therefore decided to use \type{\begingroup} instead of \type{\bgroup}.
-\unexpanded\def\doifelsealldefined#1%
+\protected\def\doifelsealldefined#1%
{\begingroup
\donetrue % we could use a reserved one and avoid the group
\processcommalist[#1]\syst_helpers_do_if_all_defined_else
@@ -720,7 +710,7 @@
%D \doifelse {string1} {string2} {then ...}{else ...}
%D \stoptyping
-\unexpanded\def\doif#1#2%
+\protected\def\doif#1#2%
{\edef\m_syst_string_one{#1}%
\edef\m_syst_string_two{#2}%
\ifx\m_syst_string_one\m_syst_string_two
@@ -729,7 +719,7 @@
\expandafter\gobbleoneargument
\fi}
-\unexpanded\def\doifnot#1#2%
+\protected\def\doifnot#1#2%
{\edef\m_syst_string_one{#1}%
\edef\m_syst_string_two{#2}%
\ifx\m_syst_string_one\m_syst_string_two
@@ -738,7 +728,7 @@
\expandafter\firstofoneargument
\fi}
-\unexpanded\def\doifelse#1#2%
+\protected\def\doifelse#1#2%
{\edef\m_syst_string_one{#1}%
\edef\m_syst_string_two{#2}%
\ifx\m_syst_string_one\m_syst_string_two
@@ -760,7 +750,7 @@
%D
%D This time, the string is not expanded.
-\unexpanded\def\doifelseempty#1%
+\protected\def\doifelseempty#1%
{\def\m_syst_string_one{#1}%
\ifx\m_syst_string_one\empty
\expandafter\firstoftwoarguments
@@ -770,7 +760,7 @@
\let\doifemptyelse\doifelseempty
-\unexpanded\def\doifempty#1%
+\protected\def\doifempty#1%
{\def\m_syst_string_one{#1}%
\ifx\m_syst_string_one\empty
\expandafter\firstofoneargument
@@ -778,7 +768,7 @@
\expandafter\gobbleoneargument
\fi}
-\unexpanded\def\doifnotempty#1%
+\protected\def\doifnotempty#1%
{\def\m_syst_string_one{#1}%
\ifx\m_syst_string_one\empty
\expandafter\gobbleoneargument
@@ -835,7 +825,7 @@
% \def\syst_helpers_re_do_if_in_set {\expandafter\syst_helpers_do_check_if_item_in_set \m_syst_string_two,],\relax}
% \def\syst_helpers_re_do_if_not_in_set {\expandafter\syst_helpers_do_check_if_item_not_in_set \m_syst_string_two,],\relax}
%
-% \unexpanded\def\doifelseinset#1% make this two step too
+% \protected\def\doifelseinset#1% make this two step too
% {\edef\m_syst_string_one{#1}%
% \ifx\m_syst_string_one\empty
% \expandafter\thirdofthreearguments
@@ -853,7 +843,7 @@
% \expandafter\syst_helpers_re_do_if_in_set_else
% \fi}
%
-% \unexpanded\def\doifinset#1%
+% \protected\def\doifinset#1%
% {\edef\m_syst_string_one{#1}%
% \ifx\m_syst_string_one\empty
% \expandafter\gobbletwoarguments
@@ -869,7 +859,7 @@
% \expandafter\syst_helpers_re_do_if_in_set
% \fi}
%
-% \unexpanded\def\doifnotinset#1%
+% \protected\def\doifnotinset#1%
% {\edef\m_syst_string_one{#1}%
% \ifx\m_syst_string_one\empty
% \expandafter\secondoftwoarguments
@@ -951,9 +941,9 @@
% \expandafter\syst_helpers_do_check_if_item_not_in_set
% \fi}
-\unexpanded\def\doifelseinset#1#2{\clf_doifelseinset{#1}{#2}}
-\unexpanded\def\doifinset #1#2{\clf_doifinset {#1}{#2}}
-\unexpanded\def\doifnotinset #1#2{\clf_doifnotinset {#1}{#2}}
+\protected\def\doifelseinset#1#2{\clf_doifelseinset{#1}{#2}}
+\protected\def\doifinset #1#2{\clf_doifinset {#1}{#2}}
+\protected\def\doifnotinset #1#2{\clf_doifnotinset {#1}{#2}}
% \let\firstinset \clf_firstinset
\let\doifinsetelse\doifelseinset
@@ -1042,15 +1032,15 @@
% \fi\fi
% #1#2}
-% \unexpanded\def\doifelsecommon{\syst_helpers_do_do_if_common_else\firstoftwoarguments\secondoftwoarguments}
-% \unexpanded\def\doifcommon {\syst_helpers_do_do_if_common_else\firstofoneargument \gobbleoneargument }
-% \unexpanded\def\doifnotcommon {\syst_helpers_do_do_if_common_else\gobbleoneargument \firstofoneargument }
+% \protected\def\doifelsecommon{\syst_helpers_do_do_if_common_else\firstoftwoarguments\secondoftwoarguments}
+% \protected\def\doifcommon {\syst_helpers_do_do_if_common_else\firstofoneargument \gobbleoneargument }
+% \protected\def\doifnotcommon {\syst_helpers_do_do_if_common_else\gobbleoneargument \firstofoneargument }
%
% \let\doifcommonelse\doifelsecommon
-\unexpanded\def\doifelsecommon#1#2{\clf_doifelsecommon{#1}{#2}}
-\unexpanded\def\doifcommon #1#2{\clf_doifcommon {#1}{#2}}
-\unexpanded\def\doifnotcommon #1#2{\clf_doifnotcommon {#1}{#2}}
+\protected\def\doifelsecommon#1#2{\clf_doifelsecommon{#1}{#2}}
+\protected\def\doifcommon #1#2{\clf_doifcommon {#1}{#2}}
+\protected\def\doifnotcommon #1#2{\clf_doifnotcommon {#1}{#2}}
\let\doifcommonelse\doifelsecommon
@@ -1122,7 +1112,7 @@
%D Empty arguments are not processed. Empty items (\type {,,}) however are
%D treated. We have to check for the special case \type {[{a,b,c}]}.
-\unexpanded\def\processcommalist[%
+\protected\def\processcommalist[%
{\futurelet\nexttoken\syst_helpers_do_check_comma_item}
\def\syst_helpers_do_check_comma_item
@@ -1151,13 +1141,13 @@
%D One way of quitting a commalist halfway is:
-\unexpanded\def\quitcommalist
+\protected\def\quitcommalist
{\begingroup\let\syst_helpers_do_process_comma_item\syst_helpers_do_quit_comma_list}
\def\syst_helpers_do_quit_comma_list#1]%
{\endgroup}
-\unexpanded\def\quitprevcommalist
+\protected\def\quitprevcommalist
{\begingroup\let\syst_helpers_do_process_comma_item\syst_helpers_do_quit_prev_comma_list}
\def\syst_helpers_do_quit_prev_comma_list#1]%
@@ -1208,7 +1198,7 @@
%D Commands that are part of the list are expanded, so the use of this macro has its
%D limits.
-\unexpanded\def\processcommacommand[#1]%
+\protected\def\processcommacommand[#1]%
{\normalexpanded{\processcommalist[#1]}}
%D The argument to \type{\command} is not delimited. Because we often use \type {[]}
@@ -1224,7 +1214,7 @@
%D \def\command[#1]{... #1 ...}
%D \stoptyping
-\unexpanded\def\processcommalistwithparameters[#1]#2%
+\protected\def\processcommalistwithparameters[#1]#2%
{\def\syst_helpers_do_process_comma_list_with_parameters##1{#2[##1]}%
\processcommalist[#1]\syst_helpers_do_process_comma_list_with_parameters}
@@ -1235,11 +1225,11 @@
\let\syst_helpers_comma_list_step\relax
-\unexpanded\def\startprocesscommalist[#1]#2\stopprocesscommalist
+\protected\def\startprocesscommalist[#1]#2\stopprocesscommalist
{\def\syst_helpers_comma_list_step##1{\def\currentcommalistitem{##1}#2}%
\processcommalist[#1]\syst_helpers_comma_list_step}
-\unexpanded\def\startprocesscommacommand[#1]#2\stopprocesscommacommand
+\protected\def\startprocesscommacommand[#1]#2\stopprocesscommacommand
{\def\syst_helpers_comma_list_step##1{\def\currentcommalistitem{##1}#2}%
\normalexpanded{\processcommalist[#1]}\syst_helpers_comma_list_step}
@@ -1287,7 +1277,7 @@
% obsolete: \def\expandactions{\let\expandedaction\edef} \expandactions (see mkii)
-\unexpanded\def\syst_helpers_do_compare_process_action_a[#1=>#2][#3]%
+\protected\def\syst_helpers_do_compare_process_action_a[#1=>#2][#3]%
{\edef\m_syst_string_two{#1}%
\ifx\m_syst_string_two\s!default
\let\commalistelement\empty
@@ -1296,7 +1286,7 @@
% met \quitcommalist tot meer dan 25\% sneller
-\unexpanded\def\syst_helpers_do_compare_process_action_b[#1=>#2][#3]%
+\protected\def\syst_helpers_do_compare_process_action_b[#1=>#2][#3]%
{\edef\m_syst_string_two{#1}%
\ifx\m_syst_string_one\m_syst_string_two
\def\commalistelement{#3}%
@@ -1307,7 +1297,7 @@
#2%
\fi\fi}
-\unexpanded\def\processaction[#1]#2[%
+\protected\def\processaction[#1]#2[%
{\edef\m_syst_string_one{#1}%
\ifx\m_syst_string_one\empty
\let\syst_helpers_do_compare_process_action\syst_helpers_do_compare_process_action_a
@@ -1317,7 +1307,7 @@
\edef\syst_helpers_do_process_action##1{\syst_helpers_do_compare_process_action[##1][#1]}% expands #1
\processnextcommalist\relax\relax\syst_helpers_do_process_action[}
-\unexpanded\def\syst_helpers_do_compare_process_action_c[#1=>#2][#3]%
+\protected\def\syst_helpers_do_compare_process_action_c[#1=>#2][#3]%
{\edef\m_syst_string_one{#1}%
\edef\m_syst_string_two{#3}%
\ifx\m_syst_string_one\m_syst_string_two
@@ -1332,7 +1322,7 @@
\fi
\fi}
-\unexpanded\def\processfirstactioninset[#1]%
+\protected\def\processfirstactioninset[#1]%
{\edef\m_syst_string_one{#1}%
\ifx\m_syst_string_one\empty
\expandafter\processaction
@@ -1341,13 +1331,13 @@
\fi
[#1]}
-\unexpanded\def\syst_helpers_process_first_action_in_set_indeed[#1]#2[#3]%
+\protected\def\syst_helpers_process_first_action_in_set_indeed[#1]#2[#3]%
{\def\syst_helpers_do_process_action##1%
{\def\syst_helpers_do_do_process_action####1{\syst_helpers_do_compare_process_action_c[####1][##1]}%
\processcommalist[#3]\syst_helpers_do_do_process_action}%
\normalexpanded{\processcommalist[#1]}\syst_helpers_do_process_action}
-\unexpanded\def\syst_helpers_do_compare_process_action_d[#1=>#2][#3]%
+\protected\def\syst_helpers_do_compare_process_action_d[#1=>#2][#3]%
{\edef\m_syst_string_one{#1}%
\edef\m_syst_string_two{#3}%
\ifx\m_syst_string_one\m_syst_string_two
@@ -1364,10 +1354,10 @@
\installsystemnamespace{nextactionlevel}
-\unexpanded\def\syst_helpers_do_process_all_actions_in_set
+\protected\def\syst_helpers_do_process_all_actions_in_set
{\csname\??nextactionlevel\the\processlevel\endcsname}
-\unexpanded\def\processallactionsinset[#1]%
+\protected\def\processallactionsinset[#1]%
{\edef\m_syst_string_one{#1}%
\ifx\m_syst_string_one\empty
\expandafter\processaction
@@ -1376,7 +1366,7 @@
\fi
[#1]}
-\unexpanded\def\syst_helpers_process_all_actions_in_set_indeed[#1]#2[#3]%
+\protected\def\syst_helpers_process_all_actions_in_set_indeed[#1]#2[#3]%
{\advance\processlevel \plusone
\expandafter\def\csname\??nextactionlevel\the\processlevel\endcsname##1%
{\def\syst_helpers_do_do_process_action####1{\syst_helpers_do_compare_process_action_d[####1][##1]}%
@@ -1386,7 +1376,7 @@
%D These macros use:
-\unexpanded\def\processnextcommalist#1#2#3[#4#5]%
+\protected\def\processnextcommalist#1#2#3[#4#5]%
{#1%
\let\nexttoken#4%
\global\advance\commalevel \plusone
@@ -1412,10 +1402,10 @@
\let\firstcharacter \empty
\let\remainingcharacters\empty
-\unexpanded\def\getfirstcharacter #1{\clf_getfirstcharacter{#1}}
-\unexpanded\def\doifelsefirstchar #1#2{\clf_doifelsefirstchar{#1}{#2}}
-\unexpanded\def\thefirstcharacter #1{\clf_thefirstcharacter{#1}}
-\unexpanded\def\theremainingcharacters#1{\clf_theremainingcharacters{#1}}
+\protected\def\getfirstcharacter #1{\clf_getfirstcharacter{#1}}
+\protected\def\doifelsefirstchar #1#2{\clf_doifelsefirstchar{#1}{#2}}
+\protected\def\thefirstcharacter #1{\clf_thefirstcharacter{#1}}
+\protected\def\theremainingcharacters#1{\clf_theremainingcharacters{#1}}
\let\doiffirstcharelse\doifelsefirstchar
@@ -1430,7 +1420,7 @@
\let\m_syst_sub_string\empty
-\unexpanded\def\doifelseinstring#1%
+\protected\def\doifelseinstring#1%
{\edef\m_syst_sub_string{#1}% expand #1 here
\ifx\m_syst_sub_string\empty
\expandafter\thirdofthreearguments
@@ -1440,14 +1430,14 @@
\let\doifinstringelse\doifelseinstring
-\unexpanded\def\syst_helpers_do_if_in_string_else_indeed#1%
+\protected\def\syst_helpers_do_if_in_string_else_indeed#1%
{\syst_helpers_do_if_in_string_else\m_syst_sub_string{#1}%
\expandafter\firstoftwoarguments
\else
\expandafter\secondoftwoarguments
\fi}
-\unexpanded\def\doifinstring#1%%
+\protected\def\doifinstring#1%%
{\edef\m_syst_sub_string{#1}% expand #1 here
\ifx\m_syst_sub_string\empty
\expandafter\gobbletwoarguments
@@ -1455,22 +1445,23 @@
\expandafter\syst_helpers_do_if_in_string_indeed
\fi}
-\unexpanded\def\syst_helpers_do_if_in_string_indeed#1%
+\protected\def\syst_helpers_do_if_in_string_indeed#1%
{\syst_helpers_do_if_in_string_else\m_syst_sub_string{#1}%
\expandafter\firstofoneargument
\else
\expandafter\gobbleoneargument
\fi}
-\unexpanded\def\doifnotinstring#1%%
+\protected\def\doifnotinstring#1%%
{\edef\m_syst_sub_string{#1}% expand #1 here
\ifx\m_syst_sub_string\empty
- \expandafter\gobbletwoarguments
+ %\expandafter\gobbletwoarguments
+ \expandafter\secondoftwoarguments
\else
\expandafter\syst_helpers_do_if_not_in_string_indeed
\fi}
-\unexpanded\def\syst_helpers_do_if_not_in_string_indeed#1%
+\protected\def\syst_helpers_do_if_not_in_string_indeed#1%
{\syst_helpers_do_if_in_string_else\m_syst_sub_string{#1}%
\expandafter\gobbleoneargument
\else
@@ -1479,7 +1470,7 @@
% replaces prev
-\unexpanded\def\syst_helpers_do_if_in_string_else#1#2% ##2 can be {abc}
+\protected\def\syst_helpers_do_if_in_string_else#1#2% ##2 can be {abc}
{\expandafter\def\expandafter\syst_helpers_do_do_if_in_string_else
\expandafter##\expandafter1#1##2##3^^^^0004{\unless\if##2@}% expand #1 here
\expandafter\syst_helpers_do_do_if_in_string_else\normalexpanded{#2#1}@@^^^^0004} % expand #2 here
@@ -1495,12 +1486,12 @@
%D Where \type {\doifinstringelse} does as much expansion as possible, the latter
%D alternative does minimal (one level) expansion.
-\unexpanded\def\syst_helpers_do_if_in_csname_else#1#2%
+\protected\def\syst_helpers_do_if_in_csname_else#1#2%
{\def\syst_helpers_do_do_if_in_csname_else##1#1##2##3^^^^0004%
{\unless\if##2@}%
\expandafter\syst_helpers_do_do_if_in_csname_else#2#1@@^^^^0004}
-\unexpanded\def\doifelseincsname#1#2%
+\protected\def\doifelseincsname#1#2%
{\normalexpanded{\syst_helpers_do_if_in_csname_else{#1}}{#2}%
\expandafter\firstoftwoarguments
\else
@@ -1558,7 +1549,7 @@
\def\percentdimen#1#2% dimen percentage (with %)
{\dimexpr\clf_percentageof{#2}\dimexpr#1\relax}
-\unexpanded\def\setpercentdimen#1#2% dimen percentage (with %)
+\protected\def\setpercentdimen#1#2% dimen percentage (with %)
{#1=\clf_percentageof{#2}\dimexpr#1\relax}
%D \macros
@@ -1586,7 +1577,7 @@
%D The gain in speed depends on the length of the argument (the longer the argument,
%D the less we gain).
-\unexpanded\def\makerawcommalist[#1]#2% use \processnext ... here
+\protected\def\makerawcommalist[#1]#2% use \processnext ... here
{\def\syst_helpers_do_make_raw_comma_list##1% we don't expand ##1
{\ifx#2\empty
\def#2{##1}%
@@ -1602,28 +1593,28 @@
\expandafter\syst_helpers_raw_process_comma_item
\fi#2}
-\unexpanded\def\rawprocesscommalist[#1]#2% accepteert ook [\cs]
+\protected\def\rawprocesscommalist[#1]#2% accepteert ook [\cs]
{\global\advance\commalevel \plusone
\expandafter\let\csname\??nextcommalevel\the\commalevel\endcsname#2%
\expandafter\syst_helpers_raw_process_comma_item#1,],% \relax
\global\advance\commalevel \minusone }
-\unexpanded\def\rawprocesscommacommand[#1]% not really needed
+\protected\def\rawprocesscommacommand[#1]% not really needed
{\normalexpanded{\rawprocesscommalist[#1]}}
%D Here is one without nesting:
-\unexpanded\def\syst_helpers_fast_process_comma_item#1,#2% #2 eats up preceding space
+\protected\def\syst_helpers_fast_process_comma_item#1,#2% #2 eats up preceding space
{\if]#1\else
\syst_helpers_fast_process_comma_command{#1}%
\expandafter\syst_helpers_fast_process_comma_item
\fi#2}
-\unexpanded\def\fastprocesscommalist[#1]#2% accepteert ook [\cs]
+\protected\def\fastprocesscommalist[#1]#2% accepteert ook [\cs]
{\let\syst_helpers_fast_process_comma_command#2%
\expandafter\syst_helpers_fast_process_comma_item#1,],}% \relax
-\unexpanded\def\fastprocesscommacommand[#1]#2% accepteert ook [\cs]
+\protected\def\fastprocesscommacommand[#1]#2% accepteert ook [\cs]
{\let\syst_helpers_fast_process_comma_command#2%
\normalexpanded{\syst_helpers_fast_process_comma_item#1},],}% \relax
@@ -1632,7 +1623,7 @@
\def\m_syst_two_commas{,,}
-\unexpanded\def\rawdoifelseinset#1%
+\protected\def\rawdoifelseinset#1%
{\edef\m_syst_sub_string{,#1,}% expand #1 here
\ifx\m_syst_sub_string\m_syst_two_commas
\expandafter\thirdofthreearguments
@@ -1640,16 +1631,16 @@
\expandafter\syst_helpers_raw_do_if_in_set_else
\fi}
-\let\rawdoifinsetelse\rawdoifinsetelse
+\let\rawdoifinsetelse\rawdoifelseinset
-\unexpanded\def\syst_helpers_raw_do_if_in_set_else#1%
+\protected\def\syst_helpers_raw_do_if_in_set_else#1%
{\syst_helpers_do_if_in_string_else\m_syst_sub_string{,#1,}%
\expandafter\firstoftwoarguments
\else
\expandafter\secondoftwoarguments
\fi}
-\unexpanded\def\rawdoifinset#1%
+\protected\def\rawdoifinset#1%
{\edef\m_syst_sub_string{,#1,}% expand #1 here
\ifx\m_syst_sub_string\m_syst_two_commas
\expandafter\gobbletwoarguments
@@ -1657,7 +1648,7 @@
\expandafter\syst_helpers_raw_do_if_in_set
\fi}
-\unexpanded\def\syst_helpers_raw_do_if_in_set#1%%
+\protected\def\syst_helpers_raw_do_if_in_set#1%%
{\syst_helpers_do_if_in_string_else\m_syst_sub_string{,#1,}%
\expandafter\firstofoneargument
\else
@@ -1673,7 +1664,7 @@
\fi}%
\syst_helpers_do_do_raw_process_action,#2,#1=>,@^^^^0004}
-\unexpanded\def\rawprocessaction[#1]#2[#3]%
+\protected\def\rawprocessaction[#1]#2[#3]%
{\edef\m_syst_string_one{#1}%
\edef\m_syst_string_two{undefined}% better \!!undefined
\let\m_syst_helpers_process_action\m_syst_string_two
@@ -1731,6 +1722,14 @@
\def\docopyvalue#1#2#3%
{\expandafter\def\csname#1#3\endcsname{\csname#2#3\endcsname}}
+%D Experiment:
+
+\edef\m_syst_protected{\detokenize{protected}}
+
+\protected\def\aliasmacro#1#2%
+ {\doifinstring{\m_syst_protected}{\meaning#2}\protected
+ \def#1{#2}}
+
%D \macros
%D {doassign,undoassign,doassignempty}
%D
@@ -1763,10 +1762,10 @@
%D will redefine this macro later on, when a more advanced message mechanism is
%D implemented.
-\unexpanded\def\showassignerror#1#2%
+\protected\def\showassignerror#1#2%
{\writestatus{setup}{missing or ungrouped '=' after '#1' in line #2}}
-\unexpanded\def\doassignempty[#1][#2=#3]%
+\protected\def\doassignempty[#1][#2=#3]%
{\ifcsname#1#2\endcsname\else\dosetvalue{#1}{#2}{#3}\fi}
%D \macros
@@ -1836,15 +1835,15 @@
\let\currentvalue\empty
-\unexpanded\def\getparameters {\dogetparameters\dosetvalue}
-\unexpanded\def\geteparameters {\dogetparameters\dosetevalue}
-\unexpanded\def\getgparameters {\dogetparameters\dosetgvalue}
-\unexpanded\def\getxparameters {\dogetparameters\dosetxvalue}
-\unexpanded\def\forgetparameters{\dogetparameters\doignorevalue}
+\protected\def\getparameters {\dogetparameters\dosetvalue}
+\protected\def\geteparameters {\dogetparameters\dosetevalue}
+\protected\def\getgparameters {\dogetparameters\dosetgvalue}
+\protected\def\getxparameters {\dogetparameters\dosetxvalue}
+\protected\def\forgetparameters{\dogetparameters\doignorevalue}
\let\getexpandedparameters\geteparameters
-\unexpanded\def\dogetparameters#1[#2]#3[#4%
+\protected\def\dogetparameters#1[#2]#3[#4%
{\if\noexpand#4]%
\expandafter\gobbleoneargument
\else
@@ -1896,9 +1895,9 @@
\let\syst_helpers_get_parameters_assign_indeed\syst_helpers_get_parameters_assign_normal
-\unexpanded\def\doassign [#1][#2]{\let\setsomevalue\dosetvalue \syst_helpers_get_parameters_assign_indeed#1^^^^0004#2==\empty^^^^0004}
-\unexpanded\def\doeassign [#1][#2]{\let\setsomevalue\dosetevalue \syst_helpers_get_parameters_assign_indeed#1^^^^0004#2==\empty^^^^0004}
-\unexpanded\def\undoassign[#1][#2]{\let\setsomevalue\doresetvalue\syst_helpers_get_parameters_assign_indeed#1^^^^0004#2==\empty^^^^0004}
+\protected\def\doassign [#1][#2]{\let\setsomevalue\dosetvalue \syst_helpers_get_parameters_assign_indeed#1^^^^0004#2==\empty^^^^0004}
+\protected\def\doeassign [#1][#2]{\let\setsomevalue\dosetevalue \syst_helpers_get_parameters_assign_indeed#1^^^^0004#2==\empty^^^^0004}
+\protected\def\undoassign[#1][#2]{\let\setsomevalue\doresetvalue\syst_helpers_get_parameters_assign_indeed#1^^^^0004#2==\empty^^^^0004}
%D \macros
%D {processassignmentlist,processassignmentcommand,
@@ -1914,18 +1913,18 @@
%D We can optimize this one if needed but it's not a core macro so hardly worth the
%D trouble and tokens.
-\unexpanded\def\processassignmentlist[#1]#2% #2 == \command{key}{value]
+\protected\def\processassignmentlist[#1]#2% #2 == \command{key}{value]
{\def\syst_helpers_process_assignment_entry##1{#2}% {##2}{##3} % namespace is ignored
\dogetparameters\syst_helpers_process_assignment_entry[][#1]}
-\unexpanded\def\processassignmentcommand[#1]%
+\protected\def\processassignmentcommand[#1]%
{\normalexpanded{\processassignmentlist[#1]}}
-\unexpanded\def\startprocessassignmentlist[#1]#2\stopprocessassignmentlist
+\protected\def\startprocessassignmentlist[#1]#2\stopprocessassignmentlist
{\def\currentassignmentlistcommand##1##2{\def\currentassignmentlistkey{##1}\def\currentassignmentlistvalue{##2}#2}%
\processassignmentlist[#1]\currentassignmentlistcommand}
-\unexpanded\def\startprocessassignmentcommand[#1]#2\stopprocessassignmentcommand
+\protected\def\startprocessassignmentcommand[#1]#2\stopprocessassignmentcommand
{\def\currentassignmentlistcommand##1##2{\def\currentassignmentlistkey{##1}\def\currentassignmentlistvalue{##2}#2}%
\normalexpanded{\processassignmentlist[#1]}\currentassignmentlistcommand}
@@ -1979,7 +1978,7 @@
\let\syst_helpers_get_parameters\syst_helpers_get_parameters_normal % **
-\unexpanded\def\expandparameters
+\protected\def\expandparameters
{\let\syst_helpers_get_parameters\syst_helpers_get_parameters_expanded}
%D \macros
@@ -1992,7 +1991,7 @@
%D \getemptyparameters [label] [...=...,...=...]
%D \stoptyping
-\unexpanded\def\getemptyparameters[#1]#2[#3]%
+\protected\def\getemptyparameters[#1]#2[#3]%
{\def\syst_helpers_get_empty_parameters##1{\doassignempty[#1][##1]}%
\processcommalist[#3]\syst_helpers_get_empty_parameters}
@@ -2025,7 +2024,7 @@
%D By using \type {\docopyvalue} we've prepared this command for use in a
%D multi||lingual environment.
-\unexpanded\def\copyparameters[#1]#2[#3]#4[#5]%
+\protected\def\copyparameters[#1]#2[#3]#4[#5]%
{\doifnot{#1}{#3}
{\def\syst_helpers_copy_parameter{\docopyvalue{#1}{#3}}% ##1
\processcommalist[#5]\syst_helpers_copy_parameter}}
@@ -2048,7 +2047,7 @@
\def\syst_helpers_check_parameters#1=#2#3^^^^0004%
{\if#2^^^^0003\parametersfalse\else\parameterstrue\fi}
-\unexpanded\def\checkparameters[#1]%
+\protected\def\checkparameters[#1]%
{\syst_helpers_check_parameters#1=^^^^0003^^^^0003^^^^0004}
%D \macros
@@ -2085,7 +2084,7 @@
\def\syst_helpers_get_comma_list_size#1%
{\advance\commalistcounter\plusone}
-\unexpanded\def\getcommalistsize#1]% don't loose [{#1}]
+\protected\def\getcommalistsize#1]% don't loose [{#1}]
{\commalistcounter\zerocount
\processcommalist#1]\syst_helpers_get_comma_list_size % was [{#1}]
\edef\commalistsize{\the\commalistcounter}}
@@ -2095,7 +2094,7 @@
% \scratchtoks\expandafter{\expandafter[\commacommand]}%
% \expandafter\getcommalistsize\the\scratchtoks }
-\unexpanded\def\getcommacommandsize[#1]%
+\protected\def\getcommacommandsize[#1]%
{\normalexpanded{\getcommalistsize[#1]}}
\def\syst_helpers_get_from_comma_list#1%
@@ -2105,12 +2104,12 @@
\expandafter\quitcommalist
\fi}
-\unexpanded\def\getfromcommalist[#1]#2[#3]%
+\protected\def\getfromcommalist[#1]#2[#3]%
{\let\commalistelement\empty
\commalistcounter#3\relax
\processcommalist[#1]\syst_helpers_get_from_comma_list}
-\unexpanded\def\getfromcommacommand[#1]%
+\protected\def\getfromcommacommand[#1]%
{\normalexpanded{\getfromcommalist[#1]}}
%D Watertight (and efficient) solutions are hard to find, due to the handling of
@@ -2176,7 +2175,7 @@
%D \def\dosetupsomething[#1][#2]%
%D {... #1 ... #2 ...}
%D
-%D \unexpanded\def\setupsomething
+%D \protected\def\setupsomething
%D {\dodoubleargument\dosetupsomething}
%D \stoptyping
%D
@@ -2204,13 +2203,13 @@
% no longer a message:
%
-% \unexpanded\def\dosingleargument {\let\expectedarguments\plusone \dosingleempty }
-% \unexpanded\def\dodoubleargument {\let\expectedarguments\plustwo \dodoubleempty }
-% \unexpanded\def\dotripleargument {\let\expectedarguments\plusthree \dotripleempty }
-% \unexpanded\def\doquadrupleargument {\let\expectedarguments\plusfour \doquadrupleempty }
-% \unexpanded\def\doquintupleargument {\let\expectedarguments\plusfive \doquintupleempty }
-% \unexpanded\def\dosixtupleargument {\let\expectedarguments\plussix \dosixtupleempty }
-% \unexpanded\def\doseventupleargument{\let\expectedarguments\plusseven \doseventupleempty}
+% \protected\def\dosingleargument {\let\expectedarguments\plusone \dosingleempty }
+% \protected\def\dodoubleargument {\let\expectedarguments\plustwo \dodoubleempty }
+% \protected\def\dotripleargument {\let\expectedarguments\plusthree \dotripleempty }
+% \protected\def\doquadrupleargument {\let\expectedarguments\plusfour \doquadrupleempty }
+% \protected\def\doquintupleargument {\let\expectedarguments\plusfive \doquintupleempty }
+% \protected\def\dosixtupleargument {\let\expectedarguments\plussix \dosixtupleempty }
+% \protected\def\doseventupleargument{\let\expectedarguments\plusseven \doseventupleempty}
%D \macros
%D {iffirstagument,ifsecondargument,ifthirdargument,
@@ -2259,16 +2258,16 @@
% \setnewconstant\noexpectedarguments\zerocount
% \setnewconstant\expectedarguments \zerocount
%
-% \unexpanded\def\showargumenterror#1#2%
+% \protected\def\showargumenterror#1#2%
% {\writestatus{system}{\number#1 argument(s) expected in line #2}}
%
-% \unexpanded\def\syst_helpers_argument_error
+% \protected\def\syst_helpers_argument_error
% {\ifnum\expectedarguments>\noexpectedarguments
% \showargumenterror{\number\expectedarguments}{\number\inputlineno}%
% \fi
% \syst_helpers_argument_reset}
%
-% \unexpanded\def\syst_helpers_argument_reset
+% \protected\def\syst_helpers_argument_reset
% {\let\expectedarguments\noexpectedarguments}
% \def\test[#1]{(#1)}
@@ -2316,7 +2315,7 @@
%
% with
%
-% \unexpanded\def\dodoubleempty#1%
+% \protected\def\dodoubleempty#1%
% {\syst_helpers_argument_reset
% \let\m_syst_aux_do#1% alias
% \let\m_syst_action_yes\syst_helpers_double_empty_one_yes
@@ -2357,7 +2356,7 @@
%D Single:
-% \unexpanded\def\dosingleempty#1%
+% \protected\def\dosingleempty#1%
% {\syst_helpers_argument_reset
% \doifelsenextoptional
% {\firstargumenttrue#1}%
@@ -2367,7 +2366,7 @@
% {\firstargumentfalse
% #1[]}
-\unexpanded\def\dosingleempty#1%
+\protected\def\dosingleempty#1%
{%syst_helpers_argument_reset
\t_syst_aux{#1}%
\let\m_syst_action_yes\syst_helpers_single_empty_one_yes
@@ -2381,7 +2380,7 @@
%D Double
-% \unexpanded\def\dodoubleempty#1%
+% \protected\def\dodoubleempty#1%
% {\syst_helpers_argument_reset
% \doifelsenextoptional
% {\syst_helpers_double_empty_one_yes#1}%
@@ -2409,7 +2408,7 @@
% \def\syst_helpers_double_empty_one_spaced#1#2{#1[{#2}][] }
% \def\syst_helpers_double_empty_one_normal#1#2{#1[{#2}][]}
-\unexpanded\def\dodoubleempty#1%
+\protected\def\dodoubleempty#1%
{%syst_helpers_argument_reset
\t_syst_aux{#1}%
\let\m_syst_action_yes\syst_helpers_double_empty_one_yes
@@ -2440,7 +2439,7 @@
% Triple
-% \unexpanded\def\dotripleempty#1%
+% \protected\def\dotripleempty#1%
% {\syst_helpers_argument_reset
% \doifelsenextoptional
% {\syst_helpers_triple_empty_one_yes#1}%
@@ -2486,7 +2485,7 @@
% \def\syst_helpers_triple_empty_three_spaced#1#2#3{#1[{#2}][{#3}][] }
% \def\syst_helpers_triple_empty_three_normal#1#2#3{#1[{#2}][{#3}][]}
-\unexpanded\def\dotripleempty#1%
+\protected\def\dotripleempty#1%
{%syst_helpers_argument_reset
\t_syst_aux{#1}%
\let\m_syst_action_yes\syst_helpers_triple_empty_one_yes
@@ -2535,7 +2534,7 @@
%D Quadruple:
-% \unexpanded\def\doquadrupleempty#1%
+% \protected\def\doquadrupleempty#1%
% {\syst_helpers_argument_reset
% \doifelsenextoptional
% {\syst_helpers_quadruple_empty_one_yes#1}%
@@ -2600,7 +2599,7 @@
% \def\syst_helpers_quadruple_empty_four_spaced #1#2#3#4{#1[{#2}][{#3}][{#4}][] }
% \def\syst_helpers_quadruple_empty_four_normal #1#2#3#4{#1[{#2}][{#3}][{#4}][]}
-\unexpanded\def\doquadrupleempty#1%
+\protected\def\doquadrupleempty#1%
{%syst_helpers_argument_reset
\t_syst_aux{#1}%
\let\m_syst_action_yes\syst_helpers_quadruple_empty_one_yes
@@ -2668,7 +2667,7 @@
%D Quintuple:
-% \unexpanded\def\doquintupleempty#1%
+% \protected\def\doquintupleempty#1%
% {\syst_helpers_argument_reset
% \doifelsenextoptional
% {\syst_helpers_quintuple_empty_one_yes#1}%
@@ -2753,7 +2752,7 @@
% \def\syst_helpers_quintuple_empty_five_spaced #1#2#3#4#5{#1[{#2}][{#3}][{#4}][{#5}][] }
% \def\syst_helpers_quintuple_empty_five_normal #1#2#3#4#5{#1[{#2}][{#3}][{#4}][{#5}][]}
-\unexpanded\def\doquintupleempty#1%
+\protected\def\doquintupleempty#1%
{%syst_helpers_argument_reset
\t_syst_aux{#1}%
\let\m_syst_action_yes\syst_helpers_quintuple_empty_one_yes
@@ -2841,7 +2840,7 @@
%D Sixtuple:
-% \unexpanded\def\dosixtupleempty#1%
+% \protected\def\dosixtupleempty#1%
% {\syst_helpers_argument_reset
% \doifelsenextoptional
% {\syst_helpers_sixtuple_empty_one_yes#1}
@@ -2947,7 +2946,7 @@
% \def\syst_helpers_sixtuple_empty_six_spaced #1#2#3#4#5#6{#1[{#2}][{#3}][{#4}][{#5}][{#6}][] }
% \def\syst_helpers_sixtuple_empty_six_normal #1#2#3#4#5#6{#1[{#2}][{#3}][{#4}][{#5}][{#6}][]}
-\unexpanded\def\dosixtupleempty#1%
+\protected\def\dosixtupleempty#1%
{%syst_helpers_argument_reset
\t_syst_aux{#1}%
\let\m_syst_action_yes\syst_helpers_sixtuple_empty_one_yes
@@ -3056,7 +3055,7 @@
%D Seventuple:
-% \unexpanded\def\doseventupleempty#1%
+% \protected\def\doseventupleempty#1%
% {\syst_helpers_argument_reset
% \doifelsenextoptional
% {\syst_helpers_seventuple_empty_one_yes#1}%
@@ -3184,7 +3183,7 @@
% \def\syst_helpers_seventuple_empty_seven_spaced#1#2#3#4#5#6#7{#1[{#2}][{#3}][{#4}][{#5}][{#6}][{#7}][] }
% \def\syst_helpers_seventuple_empty_seven_normal#1#2#3#4#5#6#7{#1[{#2}][{#3}][{#4}][{#5}][{#6}][{#7}][]}
-\unexpanded\def\doseventupleempty#1%
+\protected\def\doseventupleempty#1%
{%syst_helpers_argument_reset
\t_syst_aux{#1}%
\let\m_syst_action_yes\syst_helpers_seventuple_empty_one_yes
@@ -3378,13 +3377,13 @@
%D Many \CONTEXT\ commands started as complex or simple ones, but changed into more
%D versatile (more object oriented) ones using the \type {\get..argument} commands.
-\unexpanded\def\complexorsimple#1%
+\protected\def\complexorsimple#1%
{% \relax % prevents lookahead, brrr
\doifelsenextoptional
{\firstargumenttrue \csname\s!complex\csstring#1\endcsname}
{\firstargumentfalse\csname\s!simple \csstring#1\endcsname}}
-\unexpanded\def\complexorsimpleempty#1%
+\protected\def\complexorsimpleempty#1%
{% \relax % prevents lookahead, brrr
\doifelsenextoptional
{\firstargumenttrue \csname\s!complex\csstring#1\endcsname}
@@ -3396,19 +3395,19 @@
%D The previous commands are used that often that we found it worthwile to offer two
%D more alternatives. Watch the build in protection.
-\unexpanded\def\syst_helpers_complex_or_simple#1#2%
+\protected\def\syst_helpers_complex_or_simple#1#2%
{\doifelsenextoptional{\firstargumenttrue#1}{\firstargumentfalse#2}}
-\unexpanded\def\syst_helpers_complex_or_simple_empty#1%
+\protected\def\syst_helpers_complex_or_simple_empty#1%
{\doifelsenextoptional{\firstargumenttrue#1}{\firstargumentfalse#1[]}}
-\unexpanded\def\definecomplexorsimple#1%
- {\unexpanded\edef#1{\syst_helpers_complex_or_simple
+\protected\def\definecomplexorsimple#1%
+ {\protected\edef#1{\syst_helpers_complex_or_simple
\expandafter\noexpand\csname\s!complex\csstring#1\endcsname
\expandafter\noexpand\csname\s!simple \csstring#1\endcsname}}
-\unexpanded\def\definecomplexorsimpleempty#1%
- {\unexpanded\edef#1{\syst_helpers_complex_or_simple_empty
+\protected\def\definecomplexorsimpleempty#1%
+ {\protected\edef#1{\syst_helpers_complex_or_simple_empty
\expandafter\noexpand\csname\s!complex\csstring#1\endcsname}}
%D These commands are called as:
@@ -3446,8 +3445,8 @@
\newconditional\c_syst_helpers_permit_spaces_between_groups
-\unexpanded\def \permitspacesbetweengroups{\settrue \c_syst_helpers_permit_spaces_between_groups}
-\unexpanded\def\dontpermitspacesbetweengroups{\setfalse\c_syst_helpers_permit_spaces_between_groups}
+\protected\def \permitspacesbetweengroups{\settrue \c_syst_helpers_permit_spaces_between_groups}
+\protected\def\dontpermitspacesbetweengroups{\setfalse\c_syst_helpers_permit_spaces_between_groups}
\dontpermitspacesbetweengroups
@@ -3456,7 +3455,7 @@
%D \type {conditional} token. Okay, these macros are not called that often but it
%D saves crap when tracing.
-\unexpanded\def\syst_helpers_get_grouped_argument#1#2%
+\protected\def\syst_helpers_get_grouped_argument#1#2%
{\let\syst_helpers_get_grouped_argument_yes#1%
\let\syst_helpers_get_grouped_argument_nop#2%
\futurelet\nextargument\syst_helpers_get_grouped_argument_indeed}
@@ -3495,13 +3494,13 @@
\expandafter\syst_helpers_get_grouped_argument_d % h
\fi}
-\unexpanded\def\dosinglegroupempty#1%
+\protected\def\dosinglegroupempty#1%
{\def\syst_helpers_get_grouped_argument_nested
{\dontpermitspacesbetweengroups
#1}%
\syst_helpers_get_grouped_argument\firstargumenttrue\firstargumentfalse}
-\unexpanded\def\dodoublegroupempty#1%
+\protected\def\dodoublegroupempty#1%
{\def\syst_helpers_get_grouped_argument_nested##1%
{\def\syst_helpers_get_grouped_argument_nested
{\dontpermitspacesbetweengroups
@@ -3509,7 +3508,7 @@
\syst_helpers_get_grouped_argument\secondargumenttrue\secondargumentfalse}%
\syst_helpers_get_grouped_argument\firstargumenttrue\firstargumentfalse}
-\unexpanded\def\dotriplegroupempty#1%
+\protected\def\dotriplegroupempty#1%
{\def\syst_helpers_get_grouped_argument_nested##1%
{\def\syst_helpers_get_grouped_argument_nested####1%
{\def\syst_helpers_get_grouped_argument_nested
@@ -3519,7 +3518,7 @@
\syst_helpers_get_grouped_argument\secondargumenttrue\secondargumentfalse}%
\syst_helpers_get_grouped_argument\firstargumenttrue\firstargumentfalse}
-\unexpanded\def\doquadruplegroupempty#1%
+\protected\def\doquadruplegroupempty#1%
{\def\syst_helpers_get_grouped_argument_nested##1%
{\def\syst_helpers_get_grouped_argument_nested####1%
{\def\syst_helpers_get_grouped_argument_nested########1%
@@ -3531,7 +3530,7 @@
\syst_helpers_get_grouped_argument\secondargumenttrue\secondargumentfalse}%
\syst_helpers_get_grouped_argument\firstargumenttrue\firstargumentfalse}
-\unexpanded\def\doquintuplegroupempty#1%
+\protected\def\doquintuplegroupempty#1%
{\def\syst_helpers_get_grouped_argument_nested##1%
{\def\syst_helpers_get_grouped_argument_nested####1%
{\def\syst_helpers_get_grouped_argument_nested########1%
@@ -3599,14 +3598,14 @@
\def\fifthofsixarguments #1#2#3#4#5#6{#5}
\def\sixthofsixarguments #1#2#3#4#5#6{#6}
-\unexpanded\def\firstofoneunexpanded #1{#1}
+\protected\def\firstofoneunexpanded #1{#1}
-\unexpanded\def\firstoftwounexpanded #1#2{#1}
-\unexpanded\def\secondoftwounexpanded #1#2{#2}
+\protected\def\firstoftwounexpanded #1#2{#1}
+\protected\def\secondoftwounexpanded #1#2{#2}
-\unexpanded\def\firstofthreeunexpanded #1#2#3{#1}
-\unexpanded\def\secondofthreeunexpanded#1#2#3{#2}
-\unexpanded\def\thirdofthreeunexpanded #1#2#3{#3}
+\protected\def\firstofthreeunexpanded #1#2#3{#1}
+\protected\def\secondofthreeunexpanded#1#2#3{#2}
+\protected\def\thirdofthreeunexpanded #1#2#3{#3}
%D \macros
%D {globalletempty,letempty,
@@ -3615,15 +3614,15 @@
%D
%D Trivial:
-\unexpanded\def\letempty #1{\let #1\empty}
-\unexpanded\def\globalletempty#1{\glet#1\empty}
+\protected\def\letempty #1{\let #1\empty}
+\protected\def\globalletempty#1{\glet#1\empty}
-\unexpanded\def\letvalueempty #1{\expandafter\let \csname#1\endcsname\empty}
-\unexpanded\def\letgvalueempty#1{\expandafter\glet\csname#1\endcsname\empty}
-\unexpanded\def\letvaluerelax #1{\expandafter\let \csname#1\endcsname\relax}
-\unexpanded\def\letgvalurelax #1{\expandafter\glet\csname#1\endcsname\relax}
+\protected\def\letvalueempty #1{\expandafter\let \csname#1\endcsname\empty}
+\protected\def\letgvalueempty#1{\expandafter\glet\csname#1\endcsname\empty}
+\protected\def\letvaluerelax #1{\expandafter\let \csname#1\endcsname\relax}
+\protected\def\letgvalurelax #1{\expandafter\glet\csname#1\endcsname\relax}
-\unexpanded\def\relaxvalueifundefined#1%
+\protected\def\relaxvalueifundefined#1%
{\ifcsname#1\endcsname \else
\expandafter\let\csname#1\endcsname\relax
\fi}
@@ -3634,7 +3633,7 @@
%D The next macro hardly needs explanation. Because no nesting is to be expected, we
%D can reuse \type {\wait} within \type {\wait} itself.
-\unexpanded\def\wait
+\protected\def\wait
{\begingroup
\read16 to \wait
\endgroup}
@@ -3661,12 +3660,12 @@
\ifdefined\writestring \else
- \unexpanded\def\writestring{\immediate\write\statuswrite}
- \unexpanded\def\writeline {\writestring{}}
+ \protected\def\writestring{\immediate\write\statuswrite}
+ \protected\def\writeline {\writestring{}}
\fi
-\unexpanded\def\normalwritestatus#1#2%
+\protected\def\normalwritestatus#1#2%
{\writestring{\expandafter\syst_helpers_split_status_yes\expandafter\statuswidth#1%
\space\space\space\space\space\space\space
\space\space\space\space\space\space\space
@@ -3692,13 +3691,13 @@
%D
%D A raw and dirty alternative for \type {\getparameters}; no checking is done!
-\unexpanded\def\rawsetparameter#1=#2,%
+\protected\def\rawsetparameter#1=#2,%
{\if]#1\else
\expandafter\def\csname\rawparameterprefix#1\endcsname{#2}%
\expandafter\rawsetparameter
\fi}
-\unexpanded\def\rawgetparameters[#1][#2% some 5-10% faster
+\protected\def\rawgetparameters[#1][#2% some 5-10% faster
{\ifx#2]% test is needed, else bomb on [#1][]
\expandafter\gobbleoneargument
\else
@@ -3719,13 +3718,13 @@
%D all preceding ones with \type {\redoglobal}. When using only alternatives, one
%D can reset this mechanism with \type {\resetglobal}.
-\unexpanded\def\resetglobal
+\protected\def\resetglobal
{\let\redoglobal\relax
\let\dodoglobal\relax}
\resetglobal
-\unexpanded\def\doglobal
+\protected\def\doglobal
{\ifx\redoglobal\relax
\let\redoglobal\global
\let\dodoglobal\syst_helpers_dodo_global
@@ -3759,7 +3758,7 @@
%D
%D Apart from the prefixes, a few more \type {\expandafters} are needed:
-% \unexpanded\def\newif#1% uses the original plain \@if
+% \protected\def\newif#1% uses the original plain \@if
% {\privatescratchcounter\escapechar
% \escapechar\minusone
% \expandafter\expandafter\expandafter
@@ -3771,7 +3770,7 @@
% \dodoglobal\@if#1{false}%
% \escapechar\privatescratchcounter}
-\normalprotected\def\newif#1% see syst-ini.mkiv
+\protected\def\newif#1% see syst-ini.mkiv
{\let\new_if_saved\newif
\let\newif\new_if_check
\expandafter\redoglobal\expandafter\def\csname\expandafter\newif\csstring#1true\endcsname {\let#1\iftrue }%
@@ -3781,26 +3780,26 @@
%D Also new:
-\unexpanded\def\define#1%
+\protected\def\define#1%
{\ifdefined#1%
\message{[\noexpand#1is already defined]}%
- \unexpanded\expandafter\def\expandafter\gobbleddefinition
+ \protected\expandafter\def\expandafter\gobbleddefinition
\else
- \unexpanded\expandafter\def
+ \protected\expandafter\def
\fi#1}
-\unexpanded\def\redefine#1%
+\protected\def\redefine#1%
{\ifdefined#1%
\message{[\noexpand#1is redefined]}%
\fi
- \unexpanded\def#1}
+ \protected\def#1}
-\unexpanded\def\definemacro#1%
+\protected\def\definemacro#1%
{\ifdefined#1%
\message{[\noexpand#1is already defined]}%
- \unexpanded\expandafter\def\expandafter\gobbleddefinition
+ \protected\expandafter\def\expandafter\gobbleddefinition
\else
- \unexpanded\expandafter\def
+ \protected\expandafter\def
\fi#1}
% \define\hans{hans}
@@ -3831,7 +3830,7 @@
%
% \glet\stoptexdefinition\relax
%
-% \unexpanded\gdef\starttexdefinition%
+% \protected\gdef\starttexdefinition%
% {\bgroup%
% \obeylines%
% \syst_helpers_start_tex_definition}
@@ -3854,7 +3853,7 @@
% \gdef\syst_helpers_start_tex_definition_yes_unexpanded#1#2 #3
% #4\stoptexdefinition%
% {\egroup% #1=unexpanded
-% \unexpanded\expandafter\def\csname#2\endcsname#3{#4}}
+% \protected\expandafter\def\csname#2\endcsname#3{#4}}
%
% \gdef\syst_helpers_start_tex_definition_yes_normal#1#2
% #3\stoptexdefinition%
@@ -3888,7 +3887,7 @@
%
% \glet\stoptexdefinition\relax
%
-% \unexpanded\gdef\starttexdefinition%
+% \protected\gdef\starttexdefinition%
% {\bgroup%
% \obeylines%
% \syst_helpers_start_tex_definition_one}
@@ -3907,7 +3906,7 @@
\glet\stoptexdefinition\relax
-\unexpanded\gdef\starttexdefinition%
+\protected\gdef\starttexdefinition%
{\bgroup%
\obeylines%
\syst_helpers_start_tex_definition}
@@ -3922,14 +3921,14 @@
\egroup
-% \unexpanded\def\texdefinition#1{\csname\ifcsname#1\endcsname#1\else donothing\fi\endcsname} % todo: a nop cs: char 0 or some corenamespace
+% \protected\def\texdefinition#1{\csname\ifcsname#1\endcsname#1\else donothing\fi\endcsname} % todo: a nop cs: char 0 or some corenamespace
-\unexpanded\def\texdefinition#1{\begincsname#1\endcsname}
+\protected\def\texdefinition#1{\begincsname#1\endcsname}
% This is a first variant, more might be added:
-\unexpanded\def\starttexcode{\unprotect}
-\unexpanded\def\stoptexcode {\protect}
+\protected\def\starttexcode{\unprotect}
+\protected\def\stoptexcode {\protect}
%D \macros
%D {newcounter,
@@ -3984,7 +3983,7 @@
\def\zerocountervalue{0}
-\unexpanded\def\newcounter#1%
+\protected\def\newcounter#1%
{\dodoglobal\let#1\zerocountervalue}
%D Nowadays we don't mind a few more tokens if we can gain a bit of speed.
@@ -4005,14 +4004,14 @@
\def\m_syst_action_nop{\syst_helpers_do_do_do_decrement#1,\plusone}%
\doifelsenextcharcs,\m_syst_action_yes\m_syst_action_nop}
-\unexpanded\def\increment{\doifelsenextcharcs(\syst_helpers_do_do_increment\syst_helpers_do_increment}
-\unexpanded\def\decrement{\doifelsenextcharcs(\syst_helpers_do_do_decrement\syst_helpers_do_decrement}
+\protected\def\increment{\doifelsenextcharcs(\syst_helpers_do_do_increment\syst_helpers_do_increment}
+\protected\def\decrement{\doifelsenextcharcs(\syst_helpers_do_do_decrement\syst_helpers_do_decrement}
-\unexpanded\def\fastincrement#1{\dodoglobal\edef#1{\the\numexpr#1+\plusone \relax}}
-\unexpanded\def\fastdecrement#1{\dodoglobal\edef#1{\the\numexpr#1+\minusone\relax}}
+\protected\def\fastincrement#1{\dodoglobal\edef#1{\the\numexpr#1+\plusone \relax}}
+\protected\def\fastdecrement#1{\dodoglobal\edef#1{\the\numexpr#1+\minusone\relax}}
-\unexpanded\def\incrementvalue#1{\expandafter\increment\csname#1\endcsname}
-\unexpanded\def\decrementvalue#1{\expandafter\decrement\csname#1\endcsname}
+\protected\def\incrementvalue#1{\expandafter\increment\csname#1\endcsname}
+\protected\def\decrementvalue#1{\expandafter\decrement\csname#1\endcsname}
%D \macros
%D {newsignal}
@@ -4031,7 +4030,7 @@
\newdimen\maximumsignal % step is about 0.00025pt
-\unexpanded\def\newsignal#1%
+\protected\def\newsignal#1%
{\ifdefined#1\else
\advance\maximumsignal 2\scaledpoint % to be save in rounding
\edef#1{\the\maximumsignal}%
@@ -4060,7 +4059,7 @@
%D
%D We will use this one in:
-\unexpanded\def\savenormalmeaning#1%
+\protected\def\savenormalmeaning#1%
{\ifcsname normal\csstring#1\endcsname \else
\expandafter\let\csname normal\csstring#1\endcsname#1%
\fi}
@@ -4113,7 +4112,7 @@
\installsystemnamespace{recurseindex}
\installsystemnamespace{recurseaction}
-\unexpanded\def\dostepwiserecurse#1#2#3#4% can be made faster by postponing #4
+\protected\def\dostepwiserecurse#1#2#3#4% can be made faster by postponing #4
{\global\advance\outerrecurse \plusone
\expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname{#4}%
\expandafter\glet\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
@@ -4135,7 +4134,7 @@
\fi
\fi\normalexpanded{\syst_helpers_stepwise_next{\number#1}{\number#2}{\number#3}}}
-\unexpanded\def\syst_helpers_stepwise_recurse#1#2#3% from to step
+\protected\def\syst_helpers_stepwise_recurse#1#2#3% from to step
{\ifnum#1>#2\relax
\expandafter\syst_helpers_stepwise_recurse_nop
\else
@@ -4143,14 +4142,14 @@
\doubleexpandafter\syst_helpers_stepwise_recurse_yes\expandafter
\fi\expandafter{\the\numexpr\recurselevel+#3\relax}{#2}{#3}}
-\unexpanded\def\syst_helpers_recurse_content
+\protected\def\syst_helpers_recurse_content
{\csname\??recurseaction\the\outerrecurse\endcsname}
-\unexpanded\def\syst_helpers_stepwise_recurse_yes
+\protected\def\syst_helpers_stepwise_recurse_yes
{\syst_helpers_recurse_content
\syst_helpers_stepwise_recurse}
-\unexpanded\def\syst_helpers_stepwise_reverse#1#2#3% from to step
+\protected\def\syst_helpers_stepwise_reverse#1#2#3% from to step
{\ifnum#1<#2\relax
\expandafter\syst_helpers_stepwise_recurse_nop
\else
@@ -4160,22 +4159,22 @@
\doubleexpandafter\syst_helpers_stepwise_reverse_yes\expandafter
\fi\expandafter{\the\innerrecurse}{#2}{#3}}
-\unexpanded\def\syst_helpers_stepwise_reverse_yes
+\protected\def\syst_helpers_stepwise_reverse_yes
{\syst_helpers_recurse_content
\syst_helpers_stepwise_reverse}
-\unexpanded\def\syst_helpers_stepwise_exit
+\protected\def\syst_helpers_stepwise_exit
{\syst_helpers_stepwise_recurse_nop\relax}
-\unexpanded\def\syst_helpers_stepwise_recurse_nop#1#2#3#4%
+\protected\def\syst_helpers_stepwise_recurse_nop#1#2#3#4%
{\expandafter\let\expandafter\recurselevel\csname\??recurseindex\the\outerrecurse\endcsname
\global\advance\outerrecurse\minusone}
-% \unexpanded\def\nonostepwiserecurse#1#2#3%
+% \protected\def\nonostepwiserecurse#1#2#3%
% {\expandafter\let\expandafter\recurselevel\csname\??recurseindex\the\outerrecurse\endcsname
% \global\advance\outerrecurse\minusone}
-\unexpanded\def\dorecurse#1%
+\protected\def\dorecurse#1%
{\dostepwiserecurse\plusone{#1}\plusone}
\def\doexpandedrecurse#1#2% user macro (also was \doxprecurse)
@@ -4200,7 +4199,7 @@
%D
%D Because the simple case is used often, we implement it more efficiently:
-\unexpanded\def\dorecurse#1%
+\protected\def\dorecurse#1%
{\ifcase#1\relax
\expandafter\gobbletwoarguments
\or
@@ -4209,13 +4208,13 @@
\expandafter\syst_helpers_recurse_x
\fi{#1}}
-\unexpanded\def\syst_helpers_recurse_x#1#2%
+\protected\def\syst_helpers_recurse_x#1#2%
{\global\advance\outerrecurse \plusone
\expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname{#2}%
\expandafter\glet\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
\expandafter\syst_helpers_recurse_indeed\expandafter1\expandafter{\number#1}}
-\unexpanded\def\syst_helpers_recurse_y#1#2%
+\protected\def\syst_helpers_recurse_y#1#2%
{\global\advance\outerrecurse \plusone
\expandafter\glet\csname\??recurseindex\the\outerrecurse\endcsname\recurselevel
\let\recurselevel\!!plusone
@@ -4223,7 +4222,7 @@
\expandafter\let\expandafter\recurselevel\csname\??recurseindex\the\outerrecurse\endcsname
\global\advance\outerrecurse \minusone}
-\unexpanded\def\syst_helpers_recurse_indeed#1#2% from to
+\protected\def\syst_helpers_recurse_indeed#1#2% from to
{\ifnum#1>#2\relax
\expandafter\syst_helpers_recurse_indeed_nop
\else
@@ -4231,7 +4230,7 @@
\doubleexpandafter\syst_helpers_recurse_indeed_yes
\fi\expandafter{\the\numexpr\recurselevel+\plusone\relax}{#2}}
-\unexpanded\def\syst_helpers_recurse_indeed#1#2% from to
+\protected\def\syst_helpers_recurse_indeed#1#2% from to
{\ifnum#1>#2\relax
\expandafter\syst_helpers_recurse_indeed_nop
\else
@@ -4240,11 +4239,11 @@
\doubleexpandafter\syst_helpers_recurse_indeed_yes
\fi\expandafter{\the\innerrecurse}{#2}}
-\unexpanded\def\syst_helpers_recurse_indeed_yes
+\protected\def\syst_helpers_recurse_indeed_yes
{\syst_helpers_recurse_content
\syst_helpers_recurse_indeed}
-\unexpanded\def\syst_helpers_recurse_indeed_nop#1#2#3%
+\protected\def\syst_helpers_recurse_indeed_nop#1#2#3%
{\expandafter\let\expandafter\recurselevel\csname\??recurseindex\the\outerrecurse\endcsname
\global\advance\outerrecurse \minusone }
@@ -4257,7 +4256,7 @@
%D \dowith{a,b,c}{[#1]}
%D \stoptyping
-\unexpanded\def\dowith#1#2%
+\protected\def\dowith#1#2%
{\def\syst_helpers_with##1{#2}%
\normalexpanded{\processcommalist[#1]}\syst_helpers_with}
@@ -4279,30 +4278,30 @@
\let\endofloop\donothing % maybe \syst_helpers_loop_end
-\unexpanded\def\doloop#1%
+\protected\def\doloop#1%
{\global\advance\outerrecurse \plusone
\expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname{#1}%
\expandafter\glet\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
\let\endofloop\syst_helpers_loop
\syst_helpers_loop1} % no \plusone else \recurselevel wrong
-\unexpanded\def\syst_helpers_loop#1%
+\protected\def\syst_helpers_loop#1%
{\def\recurselevel{#1}%
\expandafter\syst_helpers_loop_yes\expandafter{\the\numexpr\recurselevel+\plusone\relax}}
-\unexpanded\def\syst_helpers_loop_yes
+\protected\def\syst_helpers_loop_yes
{\syst_helpers_recurse_content
\endofloop}
-\unexpanded\def\syst_helpers_loop_nop#1%
+\protected\def\syst_helpers_loop_nop#1%
{\let\endofloop\syst_helpers_loop % new, permits nested \doloop's
\expandafter\let\expandafter\recurselevel\csname\??recurseindex\the\outerrecurse\endcsname
\global\advance\outerrecurse\minusone}
-\unexpanded\def\exitloop % \exitloop quits at end
+\protected\def\exitloop % \exitloop quits at end
{\let\endofloop\syst_helpers_loop_nop}
-\unexpanded\def\exitloopnow#1\endofloop % \exitloopnow quits directly
+\protected\def\exitloopnow#1\endofloop % \exitloopnow quits directly
{\syst_helpers_loop_nop}
%D The loop is executed at least once, so beware of situations
@@ -4345,13 +4344,13 @@
{\csname\??recurseaction\the\outerrecurse\expandafter\expandafter\expandafter\endcsname
\expandafter\expandafter\expandafter{\expandafter\recurselevel\expandafter}\expandafter{\the\outerrecurse}}
-\unexpanded\def\syst_helpers_recurse_x#1#2%
+\protected\def\syst_helpers_recurse_x#1#2%
{\global\advance\outerrecurse \plusone
\expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname##1##2{#2}%
\expandafter\glet\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
\expandafter\syst_helpers_recurse_indeed\expandafter1\expandafter{\number#1}}
-\unexpanded\def\syst_helpers_recurse_y#1#2%
+\protected\def\syst_helpers_recurse_y#1#2%
{\global\advance\outerrecurse \plusone
\expandafter\glet\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
\let\recurselevel\!!plusone
@@ -4360,7 +4359,7 @@
\expandafter\let\expandafter\recurselevel\csname\??recurseindex\the\outerrecurse\endcsname
\global\advance\outerrecurse \minusone}
-\unexpanded\def\doloop#1%
+\protected\def\doloop#1%
{\global\advance\outerrecurse \plusone
\expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname##1##2{#1}%
\expandafter\glet\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
@@ -4369,7 +4368,7 @@
% for instance:
%
-% \unexpanded\def\dostepwiserecurse#1#2#3#4% can be made faster by postponing #4
+% \protected\def\dostepwiserecurse#1#2#3#4% can be made faster by postponing #4
% {\global\advance\outerrecurse \plusone
% \expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname##1##2{#4}%
% \expandafter\glet\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
@@ -4393,7 +4392,7 @@
%
% faster:
%
-% \unexpanded\def\dostepwiserecurse#1#2#3#4% can be made faster by postponing #4
+% \protected\def\dostepwiserecurse#1#2#3#4% can be made faster by postponing #4
% {\global\advance\outerrecurse \plusone
% \expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname##1##2{#4}%
% \expandafter\glet\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
@@ -4413,7 +4412,7 @@
\installsystemnamespace{recursestepwise}
-\unexpanded\def\dostepwiserecurse#1#2#3#4% can be made faster by postponing #4
+\protected\def\dostepwiserecurse#1#2#3#4% can be made faster by postponing #4
{\global\advance\outerrecurse \plusone
\expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname##1##2{#4}%
\expandafter\glet\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
@@ -4423,6 +4422,8 @@
\ifnum#2<#1x\else d\fi
\else\ifnum#3<\zerocount
\ifnum#1<#2x\else r\fi
+ \else
+ x%
\fi\fi
\expandafter\endcsname\normalexpanded{{\number#1}{\number#2}{\number#3}}}
% \expandafter\endcsname\expandafter{\number#1\expandafter}\expandafter{\number#2\expandafter}\expandafter{\number#3}}
@@ -4463,7 +4464,7 @@
\let\m_syst_helpers_fast_loop_cs\relax
-\unexpanded\def\dofastloopcs#1%
+\protected\def\dofastloopcs#1%
{\fastloopfinal#1\relax
\ifcase\fastloopfinal
\expandafter\gobbleoneargument
@@ -4471,12 +4472,12 @@
\expandafter\syst_helpers_fast_loop_cs
\fi}
-\unexpanded\def\syst_helpers_fast_loop_cs#1%
+\protected\def\syst_helpers_fast_loop_cs#1%
{\let\m_syst_helpers_fast_loop_cs#1%
\fastloopindex\plusone
\syst_helpers_fast_loop_cs_step}
-\unexpanded\def\syst_helpers_fast_loop_cs_step
+\protected\def\syst_helpers_fast_loop_cs_step
{\ifnum\fastloopindex>\fastloopfinal
\let\m_syst_helpers_fast_loop_cs\relax
\else
@@ -4487,9 +4488,11 @@
% Helper:
-\unexpanded\def\resetrecurselevel{\let\recurselevel\!!zerocount}
+\protected\def\resetrecurselevel{\let\recurselevel\!!zerocount}
-\let\recurselevel\!!zerocount
+\let\recurselevel \!!zerocount
+\let\recurseaction\relax
+\let\recursestring\empty
% \appendtoks \resetrecurselevel \to \everydump
@@ -4516,7 +4519,7 @@
%D }
%D \stoptyping
-\unexpanded\def\doloopoverlist#1#2%
+\protected\def\doloopoverlist#1#2%
{\global\advance\outerrecurse\plusone
\expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname##1{\edef\recursestring{##1}#2}%
\expandafter\glet\csname\??recurseindex \the\outerrecurse\endcsname\recursestring
@@ -4548,26 +4551,26 @@
\installsystemnamespace{extraevery}
-% \unexpanded\def\newevery#1#2%
+% \protected\def\newevery#1#2%
% {\ifx#1\everypar\else\newtoks#1\fi% we test for redefinition elsewhere
% \ifx#2\relax\else\ifdefined#2\else
% \expandafter\newtoks\csname\??extraevery\csstring#1\endcsname
% \def#2{\syst_helpers_every#1}%
% \fi\fi}
%
-% \unexpanded\def\syst_helpers_every#1%
+% \protected\def\syst_helpers_every#1%
% {\expandafter\removetoks\expandafter\the\csname\??extraevery\csstring#1\endcsname\from#1%
% \expandafter\appendtoks\expandafter\the\csname\??extraevery\csstring#1\endcsname\to #1%
% \csname\??extraevery\csstring#1\endcsname}
-\unexpanded\def\newevery#1#2%
+\protected\def\newevery#1#2%
{\ifx#1\everypar\else\newtoks#1\fi% we test for redefinition elsewhere
\ifx#2\relax\else\ifdefined#2\else
\expandafter\newtoks\csname\??extraevery\csstring#1\endcsname
\edef#2{\syst_helpers_every#1\csname\??extraevery\csstring#1\endcsname}%
\fi\fi}
-\unexpanded\def\syst_helpers_every#1#2%
+\protected\def\syst_helpers_every#1#2%
{\removetoks\the#2\from#1%
\appendtoks\the#2\to #1%
#2}
@@ -4582,19 +4585,19 @@
% \newtoks \neverypar
% \newtoks \neveryendpar
%
-% \normalprotected\def\syst_helpers_forgotten_endpar
+% \protected\def\syst_helpers_forgotten_endpar
% {\the\neveryendpar\normalpar}
%
-% \unexpanded\def\forgeteverypar
+% \protected\def\forgeteverypar
% {\everypar{\the\neverypar}%
% \let\endpar\syst_helpers_forgotten_endpar}
%
-% \unexpanded\def\finishpar
+% \protected\def\finishpar
% {\ifvmode\else\par\fi}
\newtoks \neverypar
-\unexpanded\def\forgeteverypar
+\protected\def\forgeteverypar
{\everypar{\the\neverypar}}
%D Which we're going to use indeed! When the second argument equals \type {\relax},
@@ -4660,10 +4663,10 @@
%D
%D Both commands accept the prefix \type{\doglobal} for global assignments.
-\unexpanded\def\convertvalue#1\to
+\protected\def\convertvalue#1\to
{\expandafter\convertcommand\csname#1\endcsname\to}
-\unexpanded\def\defconvertedvalue#1#2% less sensitive for \to
+\protected\def\defconvertedvalue#1#2% less sensitive for \to
{\expandafter\defconvertedcommand\expandafter#1\csname#2\endcsname}
%D \macros
@@ -4687,14 +4690,14 @@
\def\syst_helpers_check_if_assignment_else#1=#2#3^^^^0004{\if#2^^^^0003}%
\def\syst_helpers_check_else_assignment_if#1=#2#3^^^^0004{\unless\if#2^^^^0003}%
-\unexpanded\def\doifelseassignment#1%
+\protected\def\doifelseassignment#1%
{\expandafter\syst_helpers_check_if_assignment_else\detokenize{#1}=^^^^0003^^^^0003^^^^0004%
\expandafter\secondoftwoarguments
\else
\expandafter\firstoftwoarguments
\fi}
-\unexpanded\def\doifelseassignmentcs#1#2#3%
+\protected\def\doifelseassignmentcs#1#2#3%
{\expandafter\syst_helpers_check_if_assignment_else\detokenize{#1}=^^^^0003^^^^0003^^^^0004%
\expandafter#3%
\else
@@ -4706,7 +4709,7 @@
\newif\ifassignment
-\unexpanded\def\docheckassignment#1%
+\protected\def\docheckassignment#1%
{\expandafter\syst_helpers_check_if_assignment_else\detokenize{#1}=^^^^0003^^^^0003^^^^0004%
\assignmentfalse
\else
@@ -4715,10 +4718,10 @@
%D These can be used for cases where we want less tracing noise.
-\unexpanded\def\validassignment#1%
+\protected\def\validassignment#1%
{\expandafter\syst_helpers_check_else_assignment_if\detokenize{#1}=^^^^0003^^^^0003^^^^0004}
-\unexpanded\def\novalidassignment#1%
+\protected\def\novalidassignment#1%
{\expandafter\syst_helpers_check_if_assignment_else\detokenize{#1}=^^^^0003^^^^0003^^^^0004}
%D In \ETEX\ we can use \type {\detokenize} and gain some speed, but in general far
@@ -4726,16 +4729,16 @@
%D This macro is more robust than the pure \TEX\ one, something I found out when
%D primitives like \type {\jobname} were fed (or something undefined).
-\unexpanded\def\convertargument#1\to#2{\dodoglobal\edef#2{\detokenize{#1}}}
-\unexpanded\def\convertcommand #1\to#2{\dodoglobal\edef#2{\expandafter\detokenize\expandafter{#1}}} % hm, only second is also ok
+\protected\def\convertargument#1\to#2{\dodoglobal\edef#2{\detokenize{#1}}}
+\protected\def\convertcommand #1\to#2{\dodoglobal\edef#2{\expandafter\detokenize\expandafter{#1}}} % hm, only second is also ok
-\unexpanded\def\defconvertedargument #1#2{\edef#1{\detokenize{#2}}}
-\unexpanded\def\defconvertedcommand #1#2{\edef#1{\detokenize\expandafter{#2}}}
-\unexpanded\def\edefconvertedargument#1#2{\edef#1{#2}%
+\protected\def\defconvertedargument #1#2{\edef#1{\detokenize{#2}}}
+\protected\def\defconvertedcommand #1#2{\edef#1{\detokenize\expandafter{#2}}}
+\protected\def\edefconvertedargument#1#2{\edef#1{#2}%
\edef#1{\detokenize\expandafter{#1}}}
-\unexpanded\def\gdefconvertedargument#1#2{\xdef#1{\detokenize{#2}}}
-\unexpanded\def\gdefconvertedcommand #1#2{\xdef#1{\detokenize\expandafter{#2}}}
-\unexpanded\def\xdefconvertedargument#1#2{\xdef#1{#2}%
+\protected\def\gdefconvertedargument#1#2{\xdef#1{\detokenize{#2}}}
+\protected\def\gdefconvertedcommand #1#2{\xdef#1{\detokenize\expandafter{#2}}}
+\protected\def\xdefconvertedargument#1#2{\xdef#1{#2}%
\xdef#1{\detokenize\expandafter{#1}}}
%D When you try to convert a primitive command, you'll find out that the \ETEX\
@@ -4759,7 +4762,7 @@
%D
%D Ahandy macro, for testing purposes only:
-\unexpanded\def\showvalue#1%
+\protected\def\showvalue#1%
{\ifcsname#1\endcsname
\expandafter\show\csname#1\endcsname
\else
@@ -4779,7 +4782,7 @@
%D
%D Watch the one level expansion of the second argument.
-\unexpanded\def\doifelsemeaning#1#2%
+\protected\def\doifelsemeaning#1#2%
{\edef\m_syst_string_one{\normalmeaning#1}%
\def \m_syst_string_two{#2}%
\edef\m_syst_string_two{\normalmeaning\m_syst_string_two}%
@@ -4808,9 +4811,9 @@
\edef\m_syst_string_two{\detokenize\expandafter{\normalexpanded{#4}}}%
\ifx\m_syst_string_one\m_syst_string_two\expandafter#1\else\expandafter#2\fi}
-\unexpanded\def\doifelsesamestring{\syst_helpers_if_samestring_else\firstoftwoarguments\secondoftwoarguments}
-\unexpanded\def\doifsamestring {\syst_helpers_if_samestring_else\firstofoneargument \gobbleoneargument }
-\unexpanded\def\doifnotsamestring {\syst_helpers_if_samestring_else\gobbleoneargument \firstofoneargument }
+\protected\def\doifelsesamestring{\syst_helpers_if_samestring_else\firstoftwoarguments\secondoftwoarguments}
+\protected\def\doifsamestring {\syst_helpers_if_samestring_else\firstofoneargument \gobbleoneargument }
+\protected\def\doifnotsamestring {\syst_helpers_if_samestring_else\gobbleoneargument \firstofoneargument }
\let\doifsamestringelse\doifelsesamestring
@@ -4838,7 +4841,7 @@
%D
%D In examples~2 and~3 both arguments equal, in~1 and~4 they differ.
-\unexpanded\def\ConvertToConstant#1#2#3%
+\protected\def\ConvertToConstant#1#2#3%
{\edef\m_syst_string_one{\expandafter\detokenize\expandafter{#2}}%
\edef\m_syst_string_two{\expandafter\detokenize\expandafter{#3}}%
#1{\m_syst_string_one}{\m_syst_string_two}}
@@ -4868,14 +4871,14 @@
%D
%D where \type {...} can be anything legally \TEX.
-\unexpanded\def\CheckConstantAfter#1#2%
+\protected\def\CheckConstantAfter#1#2%
{\expandafter\convertargument\v!prefix!\to\ascii
\convertargument#1\to#2\relax
\doifelseinstring\ascii{#2}
{\expandafter\convertargument#1\to#2}
{}}
-\unexpanded\def\ConvertConstantAfter#1#2#3%
+\protected\def\ConvertConstantAfter#1#2#3%
{\CheckConstantAfter{#2}\asciia
\CheckConstantAfter{#3}\asciib
#1{\asciia}{\asciib}}
@@ -4891,8 +4894,8 @@
%D
%D We don't explicitly test if the macro is defined.
-\unexpanded\def\assignifempty#1#2% can be sped up
- {\doifsomething{#1}{\def#1{#2}}} % {\doifnot{#1}{}{\def#1{#2}}}
+\protected\def\assignifempty#1#2% can be sped up
+ {\doifnothing{#1}{\def#1{#2}}}
%D \macros
%D {gobbleuntil,grabuntil,gobbleuntilrelax,
@@ -4904,7 +4907,7 @@
%D In \CONTEXT\ we use a lot of \type {\start}||\type {\stop} like constructions.
%D Sometimes, the \type {\stop} is used as a hard coded delimiter like in: %D
%D \starttyping
-%D \unexpanded\def\startcommand#1\stopcommand%
+%D \protected\def\startcommand#1\stopcommand%
%D {... #1 ...}
%D \stoptyping
%D
@@ -4922,7 +4925,7 @@
%D {\stop}. This means that:
%D
%D \starttyping
-%D \unexpanded\def\starthello%
+%D \protected\def\starthello%
%D {\grabuntil{stophello}\message}
%D
%D \starthello Hello world!\stophello
@@ -4932,10 +4935,10 @@
\let\syst_helpers_grab_indeed\relax
-\unexpanded\def\syst_helpers_grab#1#2%
+\protected\def\syst_helpers_grab#1#2%
{\def\syst_helpers_grab_indeed##1#1{#2{##1}}\syst_helpers_grab_indeed}
-\unexpanded\def\grabuntil#1%
+\protected\def\grabuntil#1%
{\expandafter\syst_helpers_grab\expandafter{\csname#1\endcsname}}
%D The next command build on this mechanism:
@@ -4962,15 +4965,21 @@
\let\syst_helpers_gobble_indeed\relax
-\unexpanded\def\processbetween#1#2%
+\protected\def\processbetween#1#2%
{\setvalue{\s!start#1}{\grabuntil{\s!stop#1}{#2}}}
-\unexpanded\def\gobbleuntil#1%
+\protected\def\gobbleuntil#1%
{\def\syst_helpers_gobble_indeed##1#1{}\syst_helpers_gobble_indeed}
-\unexpanded\def\gobbleuntilrelax#1\relax
+\protected\def\gobbleuntilrelax#1\relax
{}
+% experimental
+
+\protected\def\gobblenested#1#2#3%
+ {\normalexpanded{\def\noexpand\next##1\csname#2\endcsname}{\csname#3\endcsname}%
+ \next}%
+
%D The next one simply expands the pickup up tokens.
%D
%D \starttyping
@@ -4979,7 +4988,7 @@
\let\syst_helpers_until_indeed\relax
-\unexpanded\def\processuntil#1%
+\protected\def\processuntil#1%
{\def\syst_helpers_until_indeed##1#1{##1}\syst_helpers_until_indeed}
%D \macros
@@ -5051,14 +5060,14 @@
% keep:
%
-% \unexpanded\def\syst_helpers_handle_group_normal#1#2%
+% \protected\def\syst_helpers_handle_group_normal#1#2%
% {\bgroup
% \def\m_syst_helpers_handle_group_before{\bgroup#1\bgroup\aftergroup\m_syst_helpers_handle_group_after}% can't we remove the second \bgroup
% \def\m_syst_helpers_handle_group_after {#2\egroup\egroup}% and one \egroup here?
% \afterassignment\m_syst_helpers_handle_group_before
% \let\next=}
-% \unexpanded\def\syst_helpers_handle_group_normal#1#2%
+% \protected\def\syst_helpers_handle_group_normal#1#2%
% {\bgroup
% \def\m_syst_helpers_handle_group_before{#1}%
% \def\m_syst_helpers_handle_group_after {#2}%
@@ -5076,7 +5085,7 @@
% \egroup
% \egroup}
%
-% \unexpanded\def\syst_helpers_handle_group_simple#1#2% no inner group (so no kerning interference)
+% \protected\def\syst_helpers_handle_group_simple#1#2% no inner group (so no kerning interference)
% {\bgroup
% \def\m_syst_helpers_handle_group_before{#1}%
% \def\m_syst_helpers_handle_group_after {#2}%
@@ -5092,7 +5101,7 @@
% {\m_syst_helpers_handle_group_after
% \egroup}%
%
-% \unexpanded\def\syst_helpers_handle_group_pickup#1#2#3% no inner group (so no kerning interference)
+% \protected\def\syst_helpers_handle_group_pickup#1#2#3% no inner group (so no kerning interference)
% {\bgroup
% \def\m_syst_helpers_handle_group_before{#1}%
% \def\m_syst_helpers_handle_group_after {#2\egroup#3}%
@@ -5104,7 +5113,7 @@
% \aftergroup\m_syst_helpers_handle_group_after
% \m_syst_helpers_handle_group_before}
%
-% \unexpanded\def\syst_helpers_handle_group_nop
+% \protected\def\syst_helpers_handle_group_nop
% {\ifnum\currentgrouptype=\semisimplegroupcode
% \expandafter\syst_helpers_handle_group_nop_a
% \else
@@ -5123,7 +5132,7 @@
% \aftergroup\m_syst_helpers_handle_group_after
% #1}
-\unexpanded\def\syst_helpers_handle_group_nop
+\protected\def\syst_helpers_handle_group_nop
{\ifnum\currentgrouptype=\semisimplegroupcode
\expandafter\syst_helpers_handle_group_nop_a
\else
@@ -5142,7 +5151,7 @@
\aftergroup\egroup
\m_syst_helpers_handle_group_b}
-\unexpanded\def\syst_helpers_handle_group_normal
+\protected\def\syst_helpers_handle_group_normal
{\bgroup
\afterassignment\m_syst_helpers_handle_group_normal_before
\let\next=}
@@ -5155,7 +5164,7 @@
\aftergroup\egroup
\aftergroup\egroup}
-\unexpanded\def\syst_helpers_handle_group_simple% no inner group (so no kerning interference)
+\protected\def\syst_helpers_handle_group_simple% no inner group (so no kerning interference)
{\bgroup
\afterassignment\m_syst_helpers_handle_group_simple_before
\let\next=}
@@ -5169,7 +5178,7 @@
{\m_syst_helpers_handle_group_a
\egroup}%
-\unexpanded\def\syst_helpers_handle_group_pickup% no inner group (so no kerning interference)
+\protected\def\syst_helpers_handle_group_pickup% no inner group (so no kerning interference)
{\bgroup
\afterassignment\m_syst_helpers_handle_group_pickup_before
\let\next=}
@@ -5181,7 +5190,7 @@
\aftergroup\m_syst_helpers_handle_group_p
\m_syst_helpers_handle_group_b}
-\unexpanded\def\syst_helpers_handle_group_nop_x
+\protected\def\syst_helpers_handle_group_nop_x
{\ifnum\currentgrouptype=\semisimplegroupcode
\begingroup
\aftergroup\endgroup
@@ -5191,7 +5200,7 @@
\fi
\m_syst_helpers_handle_group_b}
-\unexpanded\def\syst_helpers_handle_group_normal_x
+\protected\def\syst_helpers_handle_group_normal_x
{\bgroup
\afterassignment\m_syst_helpers_handle_group_normal_before_x
\let\next=}
@@ -5214,50 +5223,50 @@
%D {\futurelet} obeys blank spaces, and a line||ending token is treated as a blank
%D space. So the final implementation became:
-% \unexpanded\def\groupedcommand#1#2%
+% \protected\def\groupedcommand#1#2%
% {\doifelsenextbgroup{\syst_helpers_handle_group_normal{#1}{#2}}{\syst_helpers_handle_group_nop{#1}{#2}}}
%
-% \unexpanded\def\groupedcommandcs#1#2%
+% \protected\def\groupedcommandcs#1#2%
% {\doifelsenextbgroup{\syst_helpers_handle_group_normal{#1}{#2}}{\syst_helpers_handle_group_nop{#1}{#2}}}
%
-% \unexpanded\def\triggergroupedcommand#1%
+% \protected\def\triggergroupedcommand#1%
% {\doifelsenextbgroup{\syst_helpers_handle_group_normal{#1}{}}{\syst_helpers_handle_group_nop{#1}{}}}
%
-% \unexpanded\def\triggergroupedcommandcs#1%
+% \protected\def\triggergroupedcommandcs#1%
% {\doifelsenextbgroup{\syst_helpers_handle_group_normal{#1}{}}{\syst_helpers_handle_group_nop{#1}{}}}
%
-% \unexpanded\def\simplegroupedcommand#1#2%
+% \protected\def\simplegroupedcommand#1#2%
% {\doifelsenextbgroup{\syst_helpers_handle_group_simple{#1}{#2}}{\syst_helpers_handle_group_nop{#1}{#2}}}
%
-% \unexpanded\def\pickupgroupedcommand#1#2#3%
+% \protected\def\pickupgroupedcommand#1#2#3%
% {\doifelsenextbgroup{\syst_helpers_handle_group_pickup{#1}{#2}{#3}}{\syst_helpers_handle_group_nop{#1}{#2}}}
-\unexpanded\def\groupedcommand#1#2%
+\protected\def\groupedcommand#1#2%
{\def\m_syst_helpers_handle_group_b{#1}%
\def\m_syst_helpers_handle_group_a{#2}%
\doifelsenextbgroupcs\syst_helpers_handle_group_normal\syst_helpers_handle_group_nop}
-\unexpanded\def\groupedcommandcs#1#2%
+\protected\def\groupedcommandcs#1#2%
{\let\m_syst_helpers_handle_group_b#1%
\let\m_syst_helpers_handle_group_a#2%
\doifelsenextbgroupcs\syst_helpers_handle_group_normal\syst_helpers_handle_group_nop}
-\unexpanded\def\simplegroupedcommand#1#2%
+\protected\def\simplegroupedcommand#1#2%
{\def\m_syst_helpers_handle_group_b{#1}%
\def\m_syst_helpers_handle_group_a{#2}%
\doifelsenextbgroupcs\syst_helpers_handle_group_simple\syst_helpers_handle_group_nop}
-\unexpanded\def\pickupgroupedcommand#1#2#3%
+\protected\def\pickupgroupedcommand#1#2#3%
{\def\m_syst_helpers_handle_group_b{#1}%
\def\m_syst_helpers_handle_group_a{#2}%
\def\m_syst_helpers_handle_group_p{#3}%
\doifelsenextbgroupcs\syst_helpers_handle_group_pickup\syst_helpers_handle_group_nop}
-\unexpanded\def\triggergroupedcommand#1%
+\protected\def\triggergroupedcommand#1%
{\def\m_syst_helpers_handle_group_b{#1}%
\doifelsenextbgroupcs\syst_helpers_handle_group_normal_x\syst_helpers_handle_group_nop_x}
-\unexpanded\def\triggergroupedcommandcs#1%
+\protected\def\triggergroupedcommandcs#1%
{\let\m_syst_helpers_handle_group_b#1%
\doifelsenextbgroupcs\syst_helpers_handle_group_normal_x\syst_helpers_handle_group_nop_x}
@@ -5286,10 +5295,10 @@
%D The user is warned with the suggestion to use \type {CAPITALS}. This suggestion
%D is feasible, because \CONTEXT only defines lowcased macros.
-\unexpanded\def\showdefinederror#1#2%
+\protected\def\showdefinederror#1#2%
{\writestatus\m!system{#1 #2 replaces a macro, use CAPITALS!}}
-\unexpanded\def\checkdefined#1#2#3%
+\protected\def\checkdefined#1#2#3%
{\doifdefined{#3}{\showdefinederror{#2}{#3}}}
%D \macros
@@ -5344,25 +5353,29 @@
\newtoks\BeforePar
\newtoks\AfterPar
-\def\redowithpar\par
+\protected\def\redowithpar\par
{\doifelsenextchar\par\redowithpar\dodowithpar}%
-\def\dowithpar#1#2%
+\protected\def\dowithpar#1#2%
{\def\dodowithpar##1\par{#1##1#2}%
\redowithpar\par}
-\def\redogotopar\par
+\protected\def\redogotopar\par
{\doifelsenextchar\par\redogotopar\dodogotopar}%
-\def\dogotopar#1%
+\protected\def\dogotopar#1%
{\def\dodogotopar{#1}%
\redogotopar\par}
-\def\dogotoparcs#1%
+\protected\def\dogotoparcs#1%
{\let\dodogotopar#1%
\redogotopar\par}
-\unexpanded\def\GetPar
+\ifdefined \ignorepars \else
+ \protected\def\ignorepars{\dogotoparcs\relax}
+\fi
+
+\protected\def\GetPar
{\expanded
{\dowithpar
{\the\BeforePar
@@ -5371,7 +5384,7 @@
\BeforePar\emptytoks
\AfterPar\emptytoks}}}
-\unexpanded\def\GotoPar
+\protected\def\GotoPar
{\expanded
{\dogotopar
{\the\BeforePar
@@ -5410,7 +5423,7 @@
\let\syst_helpers_next_par\relax
\let\syst_helpers_next_arg\relax
-\unexpanded\def\dowithpargument#1%
+\protected\def\dowithpargument#1%
{\def\syst_helpers_next_par##1 \par{#1{##1}}%
\def\syst_helpers_next_arg##1{#1{##1}}%
\doifelsenextbgroup\syst_helpers_next_arg{\doifelsenextchar\par{#1{}}\syst_helpers_next_par}}
@@ -5438,7 +5451,7 @@
\let\syst_helpers_next_war\relax
\let\syst_helpers_next_arg\relax
-\unexpanded\def\dowithwargument#1%
+\protected\def\dowithwargument#1%
{\def\syst_helpers_next_war##1 {#1{##1}}%
\def\syst_helpers_next_arg##1{#1{##1}}%
\doifelsenextbgroup\syst_helpers_next_arg\syst_helpers_next_war}
@@ -5472,7 +5485,7 @@
%D commands, the \type {n*} is optional. When this specification is missing, the
%D command executes once.
-\unexpanded\def\dorepeatwithcommand[#1]%
+\protected\def\dorepeatwithcommand[#1]%
{\syst_helpers_repeat_with_command#1*\empty*\relax}
\def\syst_helpers_repeat_with_command#1*#2#3*#4\relax#5%
@@ -5563,10 +5576,10 @@
% no longer \def but \let to target toks .. the space gobbling \relax will go
-% \unexpanded\def\appendtoks {\syst_helpers_append_toks \relax}
-% \unexpanded\def\prependtoks {\syst_helpers_prepend_toks \relax}
-% \unexpanded\def\appendtoksonce {\syst_helpers_append_toks_once \relax}
-% \unexpanded\def\prependtoksonce{\syst_helpers_prepend_toks_once\relax}
+% \protected\def\appendtoks {\syst_helpers_append_toks \relax}
+% \protected\def\prependtoks {\syst_helpers_prepend_toks \relax}
+% \protected\def\appendtoksonce {\syst_helpers_append_toks_once \relax}
+% \protected\def\prependtoksonce{\syst_helpers_prepend_toks_once\relax}
%
% \def\syst_helpers_append_toks_indeed
% {\dodoglobal\m_syst_helpers_scratch\doubleexpandafter{\expandafter\the\expandafter\m_syst_helpers_scratch\the\t_syst_helpers_scratch}}
@@ -5598,13 +5611,13 @@
% \donothing
% \syst_helpers_prepend_toks_indeed}
-% \unexpanded\def\appendtoks#1\to#2%
+% \protected\def\appendtoks#1\to#2%
% {\toksapp#2{#1}%
% \ifx\dodoglobal\relax\else
% \dodoglobal#2#2%
% \fi}
%
-% \unexpanded\def\prependtoks#1\to#2%
+% \protected\def\prependtoks#1\to#2%
% {\tokspre#2{#1}%
% \ifx\dodoglobal\relax\else
% \dodoglobal#2#2%
@@ -5622,7 +5635,7 @@
% \dodoglobal\m_syst_helpers_scratch\m_syst_helpers_scratch
% \fi}
-\unexpanded\def\appendtoks#1\to#2%
+\protected\def\appendtoks#1\to#2%
{\ifx\dodoglobal\relax
\expandafter\toksapp
\else
@@ -5630,7 +5643,7 @@
\expandafter\gtoksapp
\fi#2{#1}}
-\unexpanded\def\prependtoks#1\to#2%
+\protected\def\prependtoks#1\to#2%
{\ifx\dodoglobal\relax
\expandafter\tokspre
\else
@@ -5654,14 +5667,14 @@
\expandafter\gtokspre
\fi\m_syst_helpers_scratch\t_syst_helpers_scratch}
-\unexpanded\def\appendtoksonce#1\to#2%
+\protected\def\appendtoksonce#1\to#2%
{\let\m_syst_helpers_scratch#2%
\t_syst_helpers_scratch{#1}%
\doifelseintoks\t_syst_helpers_scratch\m_syst_helpers_scratch
\donothing
\syst_helpers_append_toks_indeed}
-\unexpanded\def\prependtoksonce#1\to#2%
+\protected\def\prependtoksonce#1\to#2%
{\let\m_syst_helpers_scratch#2%
\t_syst_helpers_scratch{#1}%
\doifelseintoks\t_syst_helpers_scratch\m_syst_helpers_scratch
@@ -5670,7 +5683,7 @@
%D The test macro:
-\unexpanded\def\doifelseintoks#1#2% #1 en #2 zijn toks
+\protected\def\doifelseintoks#1#2% #1 en #2 zijn toks
{\edef\asciia{\detokenize\expandafter{\the#1}}%
\edef\asciib{\detokenize\expandafter{\the#2}}%
\doifelsestringinstring\asciia\asciib}
@@ -5698,14 +5711,14 @@
\newtoks \collectingtoks
-\unexpanded\def\startcollect #1\stopcollect {\toksapp \collectingtoks{#1}}
-\unexpanded\def\startexpandedcollect#1\stopexpandedcollect{\etoksapp\collectingtoks{#1}}
+\protected\def\startcollect #1\stopcollect {\toksapp \collectingtoks{#1}}
+\protected\def\startexpandedcollect#1\stopexpandedcollect{\etoksapp\collectingtoks{#1}}
-\unexpanded\def\startcollecting{\collectingtoks\emptytoks}
-\unexpanded\def\stopcollecting {\the\collectingtoks}
+\protected\def\startcollecting{\collectingtoks\emptytoks}
+\protected\def\stopcollecting {\the\collectingtoks}
-\unexpanded\def\collect {\toksapp \collectingtoks}
-\unexpanded\def\collectexpanded{\etoksapp\collectingtoks}
+\protected\def\collect {\toksapp \collectingtoks}
+\protected\def\collectexpanded{\etoksapp\collectingtoks}
%D A nice one too:
@@ -5715,7 +5728,7 @@
% {\scratchtoks{xaa} \removetoks x\from\scratchtoks [\the\scratchtoks]}
% {\scratchtoks{a\relax b} \removetoks \relax\from\scratchtoks [\showthe\scratchtoks]}
-\unexpanded\def\removetoks#1\from#2%
+\protected\def\removetoks#1\from#2%
{\def\syst_helpers_remove_toks##1#1##2\empty\empty\empty##3^^^^0004%
{\def\m_syst_string_one{##3}%
\ifx\m_syst_string_one\empty#2{##1}\else#2{##1##2}\fi}%
@@ -5723,22 +5736,22 @@
%D Also:
-% \unexpanded\def\appendetoks #1\to{\normalexpanded{\appendtoks #1}\to}
-% \unexpanded\def\prependetoks#1\to{\normalexpanded{\prependtoks#1}\to}
+% \protected\def\appendetoks #1\to{\normalexpanded{\appendtoks #1}\to}
+% \protected\def\prependetoks#1\to{\normalexpanded{\prependtoks#1}\to}
-% \unexpanded\def\appendetoks#1\to#2%
+% \protected\def\appendetoks#1\to#2%
% {\etoksapp#2{#1}%
% \ifx\dodoglobal\relax\else
% \global#2#2%
% \fi}
%
-% \unexpanded\def\prependetoks#1\to#2%
+% \protected\def\prependetoks#1\to#2%
% {\etokspre#2{#1}%
% \ifx\dodoglobal\relax\else
% \global#2#2%
% \fi}
-\unexpanded\def\appendetoks#1\to#2%
+\protected\def\appendetoks#1\to#2%
{\ifx\dodoglobal\relax
\expandafter\etoksapp
\else
@@ -5746,7 +5759,7 @@
\expandafter\xtoksapp
\fi#2{#1}}
-\unexpanded\def\prependetoks#1\to#2%
+\protected\def\prependetoks#1\to#2%
{\ifx\dodoglobal\relax
\expandafter\etokspre
\else
@@ -5756,7 +5769,7 @@
%D Hm.
-\unexpanded\def\flushtoks#1% nb: can reassign to #1 again, hence the indirectness
+\protected\def\flushtoks#1% nb: can reassign to #1 again, hence the indirectness
{\t_syst_helpers_scratch#1\relax
\dodoglobal#1\emptytoks
\the\t_syst_helpers_scratch\relax}
@@ -5783,12 +5796,12 @@
\let\syst_helpers_split_string\relax
-\unexpanded\def\beforesplitstring#1\at#2\to#3%
+\protected\def\beforesplitstring#1\at#2\to#3%
{\def\syst_helpers_split_string##1#2##2#2##3\\%
{\def#3{##1}}%
\expandafter\syst_helpers_split_string#1#2#2\\}
-\unexpanded\def\aftersplitstring#1\at#2\to#3%
+\protected\def\aftersplitstring#1\at#2\to#3%
{\def\syst_helpers_split_string##1#2##2@@@##3\\%
{\def#3{##2}}%
\expandafter\syst_helpers_split_string#1@@@#2@@@\\}
@@ -5798,7 +5811,7 @@
%D
%D A bonus macro.
-\unexpanded\def\splitstring#1\at#2\to#3\and#4%
+\protected\def\splitstring#1\at#2\to#3\and#4%
{\def\syst_helpers_split_string##1#2##2\empty\empty\empty##3\\%
{\def#3{##1}%
\def\syst_helpers_split_string{##3}%
@@ -5809,7 +5822,7 @@
\fi}%
\expandafter\syst_helpers_split_string#1\empty\empty\empty#2\empty\empty\empty\\}
-\unexpanded\def\greedysplitstring#1\at#2\to#3\and#4%
+\protected\def\greedysplitstring#1\at#2\to#3\and#4%
{\edef\asciib{#1}%
\let\asciic\asciib
\let#3\empty
@@ -5831,12 +5844,12 @@
%D aftertestandsplitstring,
%D testandsplitstring}
-\unexpanded\def\beforetestandsplitstring#1\at#2\to#3%
+\protected\def\beforetestandsplitstring#1\at#2\to#3%
{\def\syst_helpers_split_string##1#2##2#2##3##4\\%
{\ifx##3\empty\let#3\empty\else\def#3{##1}\fi}%
\expandafter\syst_helpers_split_string#1#2#2\empty\\}
-\unexpanded\def\aftertestandsplitstring#1\at#2\to#3%
+\protected\def\aftertestandsplitstring#1\at#2\to#3%
{\def\syst_helpers_split_string ##1#2##2@@@##3##4\\%
{\ifx##3\empty\let#3\empty\else\def#3{##2}\fi}%
\expandafter\syst_helpers_split_string #1@@@#2@@@\empty\\}
@@ -5853,17 +5866,17 @@
%D splitatcolon,
%D splitatcolons}
-\unexpanded\def\splitatperiod #1{\normalexpanded{\syst_helpers_splitatperiod #1}..\relax}
-\unexpanded\def\splitatcomma #1{\normalexpanded{\syst_helpers_splitatcomma #1},,\relax} % not at ", "
-\unexpanded\def\splitatasterisk#1{\normalexpanded{\syst_helpers_splitatasterisk#1}**\relax}
-\unexpanded\def\splitatcolon #1{\normalexpanded{\syst_helpers_splitatcolon #1}::\relax}
-\unexpanded\def\splitatcolons #1{\normalexpanded{\syst_helpers_splitatcolons #1}::::\relax}
+\protected\def\splitatperiod #1{\normalexpanded{\syst_helpers_splitatperiod #1}..\relax}
+\protected\def\splitatcomma #1{\normalexpanded{\syst_helpers_splitatcomma #1},,\relax} % not at ", "
+\protected\def\splitatasterisk#1{\normalexpanded{\syst_helpers_splitatasterisk#1}**\relax}
+\protected\def\splitatcolon #1{\normalexpanded{\syst_helpers_splitatcolon #1}::\relax}
+\protected\def\splitatcolons #1{\normalexpanded{\syst_helpers_splitatcolons #1}::::\relax}
-\unexpanded\def\syst_helpers_splitatperiod #1.#2.#3\relax#4#5{\def#4{#1}\def#5{#2}}
-\unexpanded\def\syst_helpers_splitatcomma #1,#2,#3\relax#4#5{\def#4{#1}\def#5{#2}}
-\unexpanded\def\syst_helpers_splitatasterisk #1*#2*#3\relax#4#5{\def#4{#1}\def#5{#2}}
-\unexpanded\def\syst_helpers_splitatcolon #1:#2:#3\relax#4#5{\def#4{#1}\def#5{#2}}
-\unexpanded\def\syst_helpers_splitatcolons #1::#2::#3\relax#4#5{\edef#4{#1}\edef#5{#2}}
+\protected\def\syst_helpers_splitatperiod #1.#2.#3\relax#4#5{\def#4{#1}\def#5{#2}}
+\protected\def\syst_helpers_splitatcomma #1,#2,#3\relax#4#5{\def#4{#1}\def#5{#2}}
+\protected\def\syst_helpers_splitatasterisk #1*#2*#3\relax#4#5{\def#4{#1}\def#5{#2}}
+\protected\def\syst_helpers_splitatcolon #1:#2:#3\relax#4#5{\def#4{#1}\def#5{#2}}
+\protected\def\syst_helpers_splitatcolons #1::#2::#3\relax#4#5{\edef#4{#1}\edef#5{#2}}
%D \macros
%D {removesubstring}
@@ -5876,7 +5889,7 @@
%D
%D Which in terms of \TEX\ looks like:
-\unexpanded\def\removesubstring#1\from#2\to#3%
+\protected\def\removesubstring#1\from#2\to#3%
{\splitstring#2\to\m_syst_string_one\and\m_syst_string_two
\dodoglobal#3{\m_syst_string_one\m_syst_string_two}}
@@ -5933,36 +5946,36 @@
%D
%D The faster alternatives are:
-\unexpanded\def\appendtocommalist#1#2%
+\protected\def\appendtocommalist#1#2%
{\dodoglobal\edef#2{\ifx#2\empty\else#2,\fi#1}}
-\unexpanded\def\prependtocommalist#1#2%
+\protected\def\prependtocommalist#1#2%
{\dodoglobal\edef#2{#1\ifx#2\empty\else,#2\fi}}
-\unexpanded\def\addtocommalist#1#2% {item} \cs
+\protected\def\addtocommalist#1#2% {item} \cs
{\rawdoifelseinset{#1}#2\resetglobal
{\dodoglobal\edef#2{\ifx#2\empty\else#2,\fi#1}}}
-\unexpanded\def\pretocommalist#1#2% {item} \cs
+\protected\def\pretocommalist#1#2% {item} \cs
{\rawdoifelseinset{#1}#2\resetglobal
{\dodoglobal\edef#2{#1\ifx#2\empty\else,#2\fi}}}
-\unexpanded\def\robustdoifelseinset#1#2%
+\protected\def\robustdoifelseinset#1#2%
{\edef\m_syst_string_one{\detokenize\expandafter{\normalexpanded{#1}}}%
\edef\m_syst_string_two{\detokenize\expandafter{\normalexpanded{#2}}}%
\rawdoifelseinset\m_syst_string_one\m_syst_string_two}
\let\robustdoifinsetelse\robustdoifelseinset
-\unexpanded\def\robustaddtocommalist#1#2% {item} \cs
+\protected\def\robustaddtocommalist#1#2% {item} \cs
{\robustdoifelseinset{#1}#2\resetglobal
{\dodoglobal\edef#2{\ifx#2\empty\else#2,\fi#1}}}
-\unexpanded\def\robustpretocommalist#1#2% {item} \cs
+\protected\def\robustpretocommalist#1#2% {item} \cs
{\robustdoifelseinset{#1}#2\resetglobal
{\dodoglobal\edef#2{#1\ifx#2\empty\else,#2\fi}}}
-\unexpanded\def\xsplitstring#1#2% \cs {str}
+\protected\def\xsplitstring#1#2% \cs {str}
{\def\syst_helpers_split_string##1,#2,##2,#2,##3\\%
{\edef\m_syst_string_one{\bcleanedupcommalist##1\empty\empty\relax}%
\edef\m_syst_string_two{\acleanedupcommalist##2,,\relax}}%
@@ -5972,7 +5985,7 @@
\def\bcleanedupcommalist#1#2\relax{\if#1,\else#1\fi#2}
\def\acleanedupcommalist#1,,#2\relax{#1}
-\unexpanded\def\removefromcommalist#1#2% to be sped up
+\protected\def\removefromcommalist#1#2% to be sped up
{\rawdoifelseinset{#1}#2%
{\normalexpanded{\xsplitstring\noexpand#2{#1}}%
\dodoglobal\edef#2%
@@ -5983,10 +5996,10 @@
\fi}}
\resetglobal}
-% \unexpanded\def\addtocommalist#1#2% upto 3 times slower
+% \protected\def\addtocommalist#1#2% upto 3 times slower
% {\dodoglobal\edef#2{\ctxcommand{addtocommalist(\!!bs#1\!!es,\!!bs#2\!!es)}}}
%
-% \unexpanded\def\removefromcommalist#1#2% faster and more robust
+% \protected\def\removefromcommalist#1#2% faster and more robust
% {\dodoglobal\edef#2{\ctxcommand{addtocommalist(\!!bs#1\!!es,\!!bs#2\!!es)}}}
%D \macros
@@ -6008,7 +6021,7 @@
\edef\m_syst_string_four{\ifx\m_syst_string_four\empty\else\m_syst_string_four,\fi#1}%
\fi}
-\unexpanded\def\substituteincommalist#1#2#3% old, new, list (slooow)
+\protected\def\substituteincommalist#1#2#3% old, new, list (slooow)
{\edef\m_syst_string_one{#1}%
\edef\m_syst_string_two{#2}%
\let\m_syst_string_four\empty
@@ -6071,7 +6084,7 @@
\fi
\advance\commalistcounter\plusone}
-\unexpanded\def\replaceincommalist#1#2% #1 = commalistelement #2 = position starts at 1
+\protected\def\replaceincommalist#1#2% #1 = commalistelement #2 = position starts at 1
{\c_syst_helpers_comma_list_index#2\relax
\let\m_syst_helpers_comma_list_target\empty
\let\commalistelement\empty
@@ -6095,7 +6108,7 @@
\expandafter\syst_helpers_comma_list_command_global_step
\fi}
-\unexpanded\def\globalprocesscommalist[#1]#2%
+\protected\def\globalprocesscommalist[#1]#2%
{\glet\m_syst_helpers_comma_list_command_global#2%
\expandafter\syst_helpers_comma_list_command_global_step#1,],}
@@ -6142,23 +6155,26 @@
\def\numberofpoints #1{\the\numexpr\dimexpr#1\relax/\maxcard\relax}
%D \macros
-%D {swapdimens,swapcounts,swapmacros,
+%D {swapdimens,swapskips,swapcounts,swapmacros,
%D globalswapdimens,globalswapcounts,globalswapmacros}
%D
%D Simple but effective are the next two macros. There name exactly states their
%D purpose.
\newdimen\d_syst_helpers_swapped
+\newskip \s_syst_helpers_swapped
\newcount\c_syst_helpers_swapped
\let \m_syst_helpers_swapped\relax
-\unexpanded\def\swapdimens#1#2{\d_syst_helpers_swapped #1\relax#1#2\relax#2\d_syst_helpers_swapped}
-\unexpanded\def\swapcounts#1#2{\c_syst_helpers_swapped #1\relax#1#2\relax#2\c_syst_helpers_swapped}
-\unexpanded\def\swapmacros#1#2{\let\m_syst_helpers_swapped#1\let #1#2\let #2\m_syst_helpers_swapped}
+\protected\def\swapdimens#1#2{\d_syst_helpers_swapped #1\relax#1#2\relax#2\d_syst_helpers_swapped}
+\protected\def\swapskips #1#2{\s_syst_helpers_swapped #1\relax#1#2\relax#2\s_syst_helpers_swapped}
+\protected\def\swapcounts#1#2{\c_syst_helpers_swapped #1\relax#1#2\relax#2\c_syst_helpers_swapped}
+\protected\def\swapmacros#1#2{\let\m_syst_helpers_swapped#1\let #1#2\let #2\m_syst_helpers_swapped}
-\unexpanded\def\globalswapdimens#1#2{\d_syst_helpers_swapped #1\global#1#2\global#2\d_syst_helpers_swapped}
-\unexpanded\def\globalswapcounts#1#2{\c_syst_helpers_swapped #1\global#1#2\global#2\c_syst_helpers_swapped}
-\unexpanded\def\globalswapmacros#1#2{\let\m_syst_helpers_swapped#1\glet #1#2\glet #2\m_syst_helpers_swapped}
+\protected\def\globalswapdimens#1#2{\d_syst_helpers_swapped #1\global#1#2\global#2\d_syst_helpers_swapped}
+\protected\def\globalswapskips #1#2{\s_syst_helpers_swapped #1\global#1#2\global#2\s_syst_helpers_swapped}
+\protected\def\globalswapcounts#1#2{\c_syst_helpers_swapped #1\global#1#2\global#2\c_syst_helpers_swapped}
+\protected\def\globalswapmacros#1#2{\let\m_syst_helpers_swapped#1\glet #1#2\glet #2\m_syst_helpers_swapped}
%D \macros
%D {pushmacro,popmacro}
@@ -6177,7 +6193,7 @@
% \let\m_syst_helpers_push_macro\empty
%
-% \unexpanded\def\globalpushmacro#1%
+% \protected\def\globalpushmacro#1%
% {\xdef\m_syst_helpers_push_macro{\string#1}%
% \ifcsname\??globalpushedmacro\m_syst_helpers_push_macro\endcsname \else
% \expandafter\newcount\csname\??globalpushedmacro\m_syst_helpers_push_macro\endcsname
@@ -6185,12 +6201,12 @@
% \global\advance\csname\??globalpushedmacro\m_syst_helpers_push_macro\endcsname \plusone
% \expandafter\glet\csname\the\csname\??globalpushedmacro\m_syst_helpers_push_macro\endcsname\m_syst_helpers_push_macro\endcsname#1}
%
-% \unexpanded\def\globalpopmacro#1%
+% \protected\def\globalpopmacro#1%
% {\xdef\m_syst_helpers_push_macro{\string#1}%
% \expandafter\glet\expandafter#1\csname\the\csname\??globalpushedmacro\m_syst_helpers_push_macro\endcsname\m_syst_helpers_push_macro\endcsname
% \global\advance\csname\??globalpushedmacro\m_syst_helpers_push_macro\endcsname \minusone}
%
-% \unexpanded\def\localpushmacro#1% this one can be used to push a value over an \egroup
+% \protected\def\localpushmacro#1% this one can be used to push a value over an \egroup
% {\xdef\m_syst_helpers_push_macro{\string#1}%
% \ifcsname\??localpushedmacro\m_syst_helpers_push_macro\endcsname \else
% \expandafter\newcount\csname\??localpushedmacro\m_syst_helpers_push_macro\endcsname
@@ -6198,7 +6214,7 @@
% \global\advance\csname\??localpushedmacro\m_syst_helpers_push_macro\endcsname \plusone
% \expandafter\glet\csname\the\csname\??localpushedmacro\m_syst_helpers_push_macro\endcsname\m_syst_helpers_push_macro\endcsname#1}
%
-% \unexpanded\def\localpopmacro#1%
+% \protected\def\localpopmacro#1%
% {\xdef\m_syst_helpers_push_macro{\string#1}%
% \expandafter\let\expandafter#1\csname\the\csname\??localpushedmacro\m_syst_helpers_push_macro\endcsname\m_syst_helpers_push_macro\endcsname
% \global\advance\csname\??localpushedmacro\m_syst_helpers_push_macro\endcsname \minusone }
@@ -6222,7 +6238,7 @@
{\expandafter\newcount\csname\??localpushedmacro\m_syst_helpers_push_macro\endcsname
\global\advance\csname\??localpushedmacro\m_syst_helpers_push_macro\endcsname\plusone}
-\unexpanded\def\globalpushmacro#1%
+\protected\def\globalpushmacro#1%
{\xdef\m_syst_helpers_push_macro{\csstring#1}%
\ifcsname\??globalpushedmacro\m_syst_helpers_push_macro\endcsname
\global\advance\lastnamedcs\plusone
@@ -6231,7 +6247,7 @@
\fi
\expandafter\glet\csname\the\lastnamedcs\m_syst_helpers_push_macro\endcsname#1}
-\unexpanded\def\localpushmacro#1% this one can be used to push a value over an \egroup
+\protected\def\localpushmacro#1% this one can be used to push a value over an \egroup
{\xdef\m_syst_helpers_push_macro{\csstring#1}%
\ifcsname\??localpushedmacro\m_syst_helpers_push_macro\endcsname
\global\advance\lastnamedcs\plusone
@@ -6240,13 +6256,13 @@
\fi
\expandafter\glet\csname\the\lastnamedcs\m_syst_helpers_push_macro\endcsname#1}
-\unexpanded\def\globalpopmacro#1%
+\protected\def\globalpopmacro#1%
{\xdef\m_syst_helpers_push_macro{\csstring#1}%
\c_syst_helpers_pop_count\csname\??globalpushedmacro\m_syst_helpers_push_macro\endcsname
\global\advance\lastnamedcs \minusone
\expandafter\glet\expandafter#1\csname\the\c_syst_helpers_pop_count\m_syst_helpers_push_macro\endcsname}
-\unexpanded\def\localpopmacro#1%
+\protected\def\localpopmacro#1%
{\xdef\m_syst_helpers_push_macro{\csstring#1}%
\c_syst_helpers_pop_count\csname\??localpushedmacro\m_syst_helpers_push_macro\endcsname
\global\advance\lastnamedcs \minusone
@@ -6273,7 +6289,7 @@
\newdimen\localhsize
-\unexpanded\def\setlocalhsize % don't change !
+\protected\def\setlocalhsize % don't change !
{\doifelsenextoptional
\syst_helpers_set_local_hsize_yes
\syst_helpers_set_local_hsize_nop}
@@ -6309,7 +6325,7 @@
%D three tokens per call. Anyone familiar with the not||values ones, can derive
%D their meaning from the definitions.
-\unexpanded\def\doifvalue#1#2%
+\protected\def\doifvalue#1#2%
{\edef\m_syst_string_one{\csname#1\endcsname}%
\edef\m_syst_string_two{#2}%
\ifx\m_syst_string_one\m_syst_string_two
@@ -6318,7 +6334,7 @@
\expandafter\gobbleoneargument
\fi}
-\unexpanded\def\doifnotvalue#1#2%
+\protected\def\doifnotvalue#1#2%
{\edef\m_syst_string_one{\csname#1\endcsname}%
\edef\m_syst_string_two{#2}%
\ifx\m_syst_string_one\m_syst_string_two
@@ -6327,7 +6343,7 @@
\expandafter\firstofoneargument
\fi}
-\unexpanded\def\doifelsevalue#1#2%
+\protected\def\doifelsevalue#1#2%
{\edef\m_syst_string_one{\csname#1\endcsname}%
\edef\m_syst_string_two{#2}%
\ifx\m_syst_string_one\m_syst_string_two
@@ -6336,7 +6352,7 @@
\expandafter\secondoftwoarguments
\fi}
-\unexpanded\def\doifnothing#1%
+\protected\def\doifnothing#1%
{\edef\m_syst_string_one{#1}%
\ifx\m_syst_string_one\empty
\expandafter\firstofoneargument
@@ -6344,7 +6360,7 @@
\expandafter\gobbleoneargument
\fi}
-\unexpanded\def\doifsomething#1%
+\protected\def\doifsomething#1%
{\edef\m_syst_string_one{#1}%
\ifx\m_syst_string_one\empty
\expandafter\gobbleoneargument
@@ -6352,7 +6368,7 @@
\expandafter\firstofoneargument
\fi}
-\unexpanded\def\doifelsenothing#1%
+\protected\def\doifelsenothing#1%
{\edef\m_syst_string_one{#1}%
\ifx\m_syst_string_one\empty
\expandafter\firstoftwoarguments
@@ -6360,7 +6376,7 @@
\expandafter\secondoftwoarguments
\fi}
-\unexpanded\def\doifelsesomething#1%
+\protected\def\doifelsesomething#1%
{\edef\m_syst_string_one{#1}%
\ifx\m_syst_string_one\empty
\expandafter\secondoftwoarguments
@@ -6368,7 +6384,7 @@
\expandafter\firstoftwoarguments
\fi}
-\unexpanded\def\doifvaluenothing#1%
+\protected\def\doifvaluenothing#1%
{\edef\m_syst_string_one{\csname#1\endcsname}%
\ifx\m_syst_string_one\empty
\expandafter\firstofoneargument
@@ -6376,7 +6392,7 @@
\expandafter\gobbleoneargument
\fi}
-\unexpanded\def\doifvaluesomething#1%
+\protected\def\doifvaluesomething#1%
{\edef\m_syst_string_one{\csname#1\endcsname}%
\ifx\m_syst_string_one\empty
\expandafter\gobbleoneargument
@@ -6384,7 +6400,7 @@
\expandafter\firstofoneargument
\fi}
-\unexpanded\def\doifelsevaluenothing#1%
+\protected\def\doifelsevaluenothing#1%
{\edef\m_syst_string_one{\csname#1\endcsname}%
\ifx\m_syst_string_one\empty
\expandafter\firstoftwoarguments
@@ -6439,9 +6455,9 @@
\processcommalist[#3]\syst_helpers_do_common_check_all
\ifdone\expandafter#1\else\expandafter#2\fi}
-\unexpanded\def\doifelseallcommon{\syst_helpers_do_if_all_common_else\firstoftwoarguments\secondoftwoarguments}
-\unexpanded\def\doifallcommon {\syst_helpers_do_if_all_common_else\firstofonearguments\gobbleoneargument }
-\unexpanded\def\doifnotallcommon {\syst_helpers_do_if_all_common_else\gobbleoneargument \firstofonearguments }
+\protected\def\doifelseallcommon{\syst_helpers_do_if_all_common_else\firstoftwoarguments\secondoftwoarguments}
+\protected\def\doifallcommon {\syst_helpers_do_if_all_common_else\firstofonearguments\gobbleoneargument }
+\protected\def\doifnotallcommon {\syst_helpers_do_if_all_common_else\gobbleoneargument \firstofonearguments }
\let\doifallcommonelse\doifelseallcommon
@@ -6464,38 +6480,38 @@
%D These might end up as \LUA based helpers (i.e. consider these
%D obsolete:
-\unexpanded\def\syst_helpers_do_IF#1#2%
+\protected\def\syst_helpers_do_IF#1#2%
{\uppercase{\syst_helpers_do_if_in_string_else{$#1$}{$#2$}}%
\expandafter\firstofoneargument
\else
\expandafter\gobbleoneargument
\fi}
-\unexpanded\def\syst_helpers_do_IF_NOT#1#2%
+\protected\def\syst_helpers_do_IF_NOT#1#2%
{\uppercase{\syst_helpers_do_if_in_string_else{$#1$}{$#2$}}%
\expandafter\gobbleoneargument
\else
\expandafter\firstofoneargument
\fi}
-\unexpanded\def\syst_helpers_do_IF_ELSE#1#2%
+\protected\def\syst_helpers_do_IF_ELSE#1#2%
{\uppercase{\syst_helpers_do_if_in_string_else{$#1$}{$#2$}}%
\expandafter\firstoftwoarguments
\else
\expandafter\secondoftwoarguments
\fi}
-\unexpanded\def\syst_helpers_do_IF_INSTRING_ELSE#1#2%
+\protected\def\syst_helpers_do_IF_INSTRING_ELSE#1#2%
{\uppercase{\syst_helpers_do_if_in_string_else{$#1$}{$#2$}}%
\expandafter\firstoftwoarguments
\else
\expandafter\secondoftwoarguments
\fi}
-\unexpanded\def\DOIF #1#2{\normalexpanded{\syst_helpers_do_IF {#1}{#2}}}% will become obsolete
-\unexpanded\def\DOIFNOT #1#2{\normalexpanded{\syst_helpers_do_IF_NOT {#1}{#2}}}% will become obsolete
-\unexpanded\def\DOIFELSE #1#2{\normalexpanded{\syst_helpers_do_IF_ELSE {#1}{#2}}}% will become obsolete
-\unexpanded\def\DOIFINSTRINGELSE #1#2{\normalexpanded{\syst_helpers_do_IF_INSTRING_ELSE{#1}{#2}}}% will become obsolete
+\protected\def\DOIF #1#2{\normalexpanded{\syst_helpers_do_IF {#1}{#2}}}% will become obsolete
+\protected\def\DOIFNOT #1#2{\normalexpanded{\syst_helpers_do_IF_NOT {#1}{#2}}}% will become obsolete
+\protected\def\DOIFELSE #1#2{\normalexpanded{\syst_helpers_do_IF_ELSE {#1}{#2}}}% will become obsolete
+\protected\def\DOIFINSTRINGELSE #1#2{\normalexpanded{\syst_helpers_do_IF_INSTRING_ELSE{#1}{#2}}}% will become obsolete
%D \macros
%D {dosingleargumentwithset,
@@ -6520,7 +6536,7 @@
%D \def\dodefinesomething[#1][#2]%
%D {\getparameters[\??xx#1][#2]}
%D
-%D \unexpanded\def\definesomething%
+%D \protected\def\definesomething%
%D {\dodoubleargumentwithset\dodefinesomething}
%D \stoptyping
%D
@@ -6574,7 +6590,7 @@
\let\m_syst_helpers_strip_character\empty
-\unexpanded\def\stripcharacter#1\from#2\to#3%
+\protected\def\stripcharacter#1\from#2\to#3%
{\def\syst_helpers_strip_character##1#1##2\end
{\edef\m_syst_helpers_strip_character{\m_syst_helpers_strip_character##1}%
\doifnotempty{##2}{\syst_helpers_strip_character##2\end}}%
@@ -6583,7 +6599,7 @@
\expandafter\syst_helpers_strip_character\m_syst_string_one#1\end
\dodoglobal\let#3\m_syst_helpers_strip_character}
-\unexpanded\def\stripspaces\from#1\to#2% will become \unspacestring#1\from#2
+\protected\def\stripspaces\from#1\to#2% will become \unspacestring#1\from#2
{\stripcharacter{ }\from#1\to#2}
%D \macros
@@ -6592,7 +6608,7 @@
%D The next macro does the same but is more compatible with other macros, like \type
%D {\convert...}.
-\unexpanded\def\unspacestring#1\to#2%
+\protected\def\unspacestring#1\to#2%
{\stripcharacter{ }\from#1\to#2}
%D \macros
@@ -6697,7 +6713,7 @@
\syst_helpers_process_separated_list_step}%
\expandafter\syst_helpers_process_separated_list_step\gobbleoneargument#1#3]#3}
-\unexpanded\def\processseparatedlist[%
+\protected\def\processseparatedlist[%
{\syst_helpers_process_separated_list\relax}
%D \macros
@@ -6720,7 +6736,7 @@
\let\syst_helpers_process_any_list_indeed\relax
\let\syst_helpers_process_any_list_step \relax
-\unexpanded\def\processlist#1#2#3#4% no blank skipping !
+\protected\def\processlist#1#2#3#4% no blank skipping !
{\def\syst_helpers_process_any_list_indeed##1#2%
{\def\syst_helpers_process_any_list_step####1####2#3%
{\ifx#2####1%
@@ -6749,7 +6765,7 @@
%D This command can be integrated in \type {\getparameters}, but we decided best not
%D to do so.
-\unexpanded\def\processassignlist#1[#2]#3%
+\protected\def\processassignlist#1[#2]#3%
{\def\syst_helpers_process_assign_list_assign[##1=##2=##3]%
{\doif{##3}\relax{#3{##1}}}%
\def\syst_helpers_process_assign_list_step##1%
@@ -6772,7 +6788,7 @@
\let\m_syst_helpers_untexed\empty
-\unexpanded\def\untexsomething
+\protected\def\untexsomething
{\begingroup
\catcode\leftbraceasciicode \ignorecatcode
\catcode\rightbraceasciicode\ignorecatcode
@@ -6784,8 +6800,8 @@
\endgroup
\let#3\m_syst_helpers_untexed}
-\unexpanded\def\untexargument{\untexsomething\convertargument}
-\unexpanded\def\untexcommand {\untexsomething\convertcommand}
+\protected\def\untexargument{\untexsomething\convertargument}
+\protected\def\untexcommand {\untexsomething\convertcommand}
%D \macros
%D {ScaledPointsToBigPoints,ScaledPointsToWholeBigPoints}
@@ -6801,16 +6817,16 @@
%D
%D In pure \TEX:
-% \unexpanded\def\PointsToBigPoints#1#2%
+% \protected\def\PointsToBigPoints#1#2%
% {\edef#2{\withoutpt\the\dimexpr.996264\dimexpr#1\relax\relax}}
%
-% \unexpanded\def\PointsToWholeBigPoints#1#2%
+% \protected\def\PointsToWholeBigPoints#1#2%
% {\edef#2{\the\numexpr\dimexpr.996264\dimexpr#1\relax\relax/\maxcard\relax}}
%
-% \unexpanded\def\ScaledPointsToBigPoints#1% % #2
+% \protected\def\ScaledPointsToBigPoints#1% % #2
% {\PointsToBigPoints{\number#1\scaledpoint}} % {#2}
%
-% \unexpanded\def\ScaledPointsToWholeBigPoints#1% % #2
+% \protected\def\ScaledPointsToWholeBigPoints#1% % #2
% {\PointsToWholeBigPoints{\number#1\scaledpoint}} % {#2}
%D This is slower but cleaner and more accurate too. The only place these are still
@@ -6819,10 +6835,10 @@
\let\tobigpoints \clf_tobigpoints
\let\towholebigpoints\clf_towholebigpoints
-\unexpanded\def\PointsToBigPoints #1#2{\edef#2{\tobigpoints #1}} % can be avoided
-\unexpanded\def\PointsToWholeBigPoints #1#2{\edef#2{\towholebigpoints#1}} % can be avoided
-\unexpanded\def\ScaledPointsToBigPoints #1#2{\edef#2{\tobigpoints #1\scaledpoint}} % obsolete
-\unexpanded\def\ScaledPointsToWholeBigPoints#1#2{\edef#2{\towholebigpoints#1\scaledpoint}} % obsolete
+\protected\def\PointsToBigPoints #1#2{\edef#2{\tobigpoints #1}} % can be avoided
+\protected\def\PointsToWholeBigPoints #1#2{\edef#2{\towholebigpoints#1}} % can be avoided
+\protected\def\ScaledPointsToBigPoints #1#2{\edef#2{\tobigpoints #1\scaledpoint}} % obsolete
+\protected\def\ScaledPointsToWholeBigPoints#1#2{\edef#2{\towholebigpoints#1\scaledpoint}} % obsolete
%D \macros
%D {PointsToReal}
@@ -6834,7 +6850,7 @@
%D \PointsToReal {dimension} \target
%D \stoptyping
-\unexpanded\def\PointsToReal#1#2%
+\protected\def\PointsToReal#1#2%
{\edef#2{\withoutpt\the\dimexpr#1}}
%D \macros
@@ -6869,7 +6885,7 @@
%D \starttyping
%D \newbox\b_syst_helpers_dlh
%D
-%D \unexpanded\def\dontleavehmode
+%D \protected\def\dontleavehmode
%D {\ifhmode\else \ifmmode\else
%D \setbox\b_syst_helpers_dlh\hbox{\mathsurround\zeropoint\everymath\emptytoks$ $}\unhbox\b_syst_helpers_dlh
%D \fi \fi}
@@ -6891,10 +6907,10 @@
%D
%D The first argument may be a \type{\macro}.
-% \unexpanded\def\uppercasestring#1\to#2%
+% \protected\def\uppercasestring#1\to#2%
% {\uppercase\expandafter{\expandafter\dodoglobal\expandafter\edef\expandafter#2\expandafter{\normalexpanded{#1}}}}
%
-% \unexpanded\def\lowercasestring#1\to#2%
+% \protected\def\lowercasestring#1\to#2%
% {\lowercase\expandafter{\expandafter\dodoglobal\expandafter\edef\expandafter#2\expandafter{\normalexpanded{#1}}}}
%D These macros are sort of obsolete as we never use uppercase this way. But
@@ -6903,8 +6919,8 @@
\def\utfupper#1{\clf_upper{#1}} % expandable
\def\utflower#1{\clf_lower{#1}} % expandable
-\unexpanded\def\uppercasestring#1\to#2{\dodoglobal\edef#2{\clf_upper{#1}}}
-\unexpanded\def\lowercasestring#1\to#2{\dodoglobal\edef#2{\clf_lower{#1}}}
+\protected\def\uppercasestring#1\to#2{\dodoglobal\edef#2{\clf_upper{#1}}}
+\protected\def\lowercasestring#1\to#2{\dodoglobal\edef#2{\clf_lower{#1}}}
%D \macros
%D {handletokens}
@@ -6949,14 +6965,14 @@
\expandafter\syst_helpers_count_token
\fi}
-\unexpanded\def\counttoken#1\in#2\to#3%
+\protected\def\counttoken#1\in#2\to#3%
{\privatescratchcounter\zerocount
\def\m_syst_string_one{#1}%
\def\m_syst_string_two{\end}%
\syst_helpers_count_token#2\end
\dodoglobal#3\privatescratchcounter}
-\unexpanded\def\counttokens#1\to#2%
+\protected\def\counttokens#1\to#2%
{\privatescratchcounter\zerocount
\def\syst_helpers_count_token##1{\advance\privatescratchcounter\plusone}%
\handletokens#1\with\syst_helpers_count_token
@@ -6968,7 +6984,7 @@
%D Running this one not always gives the expected results. Consider for instance the
%D macro for which I originally wrote this token handler.
-\unexpanded\def\splitofftokens#1\from#2\to#3% slow but hardly used
+\protected\def\splitofftokens#1\from#2\to#3% slow but hardly used
{\ifnum#1>\zerocount
\privatescratchcounter#1\relax
\def\syst_helpers_split_off_tokens##1%
@@ -7012,7 +7028,7 @@
%D assignment, this time by using \type {\futurelet}, and grabbing an argument as
%D well. That way we can handle the sentinal, a blank space and grouped tokens.
-\unexpanded\def\syst_helpers_handle_tokens % \nexthandledtoken is part of interface
+\protected\def\syst_helpers_handle_tokens % \nexthandledtoken is part of interface
{\futurelet\nexthandledtoken\syst_helpers_handle_tokens_indeed}
\def\handletokens#1\with#2%
@@ -7064,8 +7080,8 @@
\newtoks\everysettrialtypesetting
\newtoks\everyresettrialtypesetting
-\unexpanded\def\settrialtypesetting {\the\everysettrialtypesetting } % obeys grouping so
-\unexpanded\def\resettrialtypesetting{\the\everyresettrialtypesetting} % this one is seldom needed
+\protected\def\settrialtypesetting {\the\everysettrialtypesetting } % obeys grouping so
+\protected\def\resettrialtypesetting{\the\everyresettrialtypesetting} % this one is seldom needed
\let\iftrialtypesetting\iffalse % so we have no \trialtypesettingtrue|false in mkiv !
@@ -7104,15 +7120,15 @@
%D This macro is first used in the tabulation macros.
%D
%D \starttyping
-%D \unexpanded\def\starthans%
+%D \protected\def\starthans%
%D {\processcontent{stophans}\test{\message{\test}\wait}}
%D \stoptyping
-\unexpanded\def\processcontent#1%
+\protected\def\processcontent#1%
{\begingroup\expandafter\syst_helpers_process_content\csname#1\endcsname}
-\unexpanded\def\syst_helpers_process_content#1#2#3%
- {\unexpanded\def\syst_helpers_process_content##1#1%
+\protected\def\syst_helpers_process_content#1#2#3%
+ {\protected\def\syst_helpers_process_content##1#1%
{\endgroup\def#2{##1}#3}%
\syst_helpers_process_content}
@@ -7158,10 +7174,10 @@
%D As an alternative for the next macro we can use a global assignment inside a box.
%D The \type {\empty}'s permits gobbling while preventing spurious \type {\relax}'s.
-\unexpanded\def\setdimensionwithunit#1#2#3% number unit dimension / nice trick
+\protected\def\setdimensionwithunit#1#2#3% number unit dimension / nice trick
{\afterassignment\gobblefourarguments#1=#2#3pt\relax\empty\empty\empty\empty}
-\unexpanded\def\freezedimensionwithunit#1#2%
+\protected\def\freezedimensionwithunit#1#2%
{\setdimensionwithunit\privatescratchdimen#1{#2}\edef#1{\the\privatescratchdimen}}
%D \macros
@@ -7169,7 +7185,7 @@
%D
%D Not that fast I guess, but here's a way to test for token registers being empty.
-\unexpanded\def\doifelsesometoks#1%
+\protected\def\doifelsesometoks#1%
{\edef\m_syst_string_one{\the#1}% one level expansion so quite ok
\ifx\m_syst_string_one\empty
\expandafter\secondoftwoarguments
@@ -7177,7 +7193,7 @@
\expandafter\firstoftwoarguments
\fi}
-\unexpanded\def\doifsometoks#1%
+\protected\def\doifsometoks#1%
{\edef\m_syst_string_one{\the#1}% one level expansion so quite ok
\ifx\m_syst_string_one\empty
\expandafter\gobbleoneargument
@@ -7185,7 +7201,7 @@
\expandafter\firstofoneargument
\fi}
-\unexpanded\def\doifemptytoks#1%
+\protected\def\doifemptytoks#1%
{\edef\m_syst_string_one{\the#1}% one level expansion so quite ok
\ifx\m_syst_string_one\empty
\expandafter\firstofoneargument
@@ -7209,7 +7225,7 @@
\expandafter\m_syst_action_nop
\fi}
-\unexpanded\def\strictdoifelsenextoptional#1#2%
+\protected\def\strictdoifelsenextoptional#1#2%
{\def\m_syst_action_yes{#1}%
\def\m_syst_action_nop{#2}%
\futurelet\nexttoken\syst_helpers_strict_inspect_next_character}
@@ -7258,7 +7274,7 @@
\def\syst_helpers_serialize_comma_list_step#1%
{\edef\serializedcommalist{\serializedcommalist#1}}
-\unexpanded\def\serializecommalist[#1]%
+\protected\def\serializecommalist[#1]%
{\let\serializedcommalist\empty
\processcommacommand[#1]\syst_helpers_serialize_comma_list_step}
@@ -7353,22 +7369,22 @@
\installsystemnamespace{measure}
-\unexpanded\def\definemeasure
+\protected\def\definemeasure
{\dodoubleargument\syst_helpers_define_measure}
\def\syst_helpers_define_measure[#1][#2]%
{\expandafter\def\csname\??measure#1\endcsname{#2}}
-\unexpanded\def\freezemeasure
+\protected\def\freezemeasure
{\dodoubleargument\syst_helpers_freeze_measure}
\def\syst_helpers_freeze_measure[#1][#2]%
{\expandafter\edef\csname\??measure#1\endcsname{\the\dimexpr#2}}
-\unexpanded\def\setmeasure #1#2{\expandafter\def \csname\??measure#1\endcsname{#2}} % quick way
-\unexpanded\def\setgmeasure#1#2{\expandafter\gdef\csname\??measure#1\endcsname{#2}} % quick way
-\unexpanded\def\setemeasure#1#2{\expandafter\edef\csname\??measure#1\endcsname{\the\dimexpr#2}} % quick way
-\unexpanded\def\setxmeasure#1#2{\expandafter\xdef\csname\??measure#1\endcsname{\the\dimexpr#2}} % quick way
+\protected\def\setmeasure #1#2{\expandafter\def \csname\??measure#1\endcsname{#2}} % quick way
+\protected\def\setgmeasure#1#2{\expandafter\gdef\csname\??measure#1\endcsname{#2}} % quick way
+\protected\def\setemeasure#1#2{\expandafter\edef\csname\??measure#1\endcsname{\the\dimexpr#2}} % quick way
+\protected\def\setxmeasure#1#2{\expandafter\xdef\csname\??measure#1\endcsname{\the\dimexpr#2}} % quick way
\def\measure
{\the\measured}
@@ -7393,22 +7409,22 @@
\installsystemnamespace{quantity}
-\unexpanded\def\definequantity
+\protected\def\definequantity
{\dodoubleargument\syst_helpers_define_quantity}
\def\syst_helpers_define_quantity[#1][#2]%
{\expandafter\def\csname\??quantity#1\endcsname{#2}}
-\unexpanded\def\freezequantity
+\protected\def\freezequantity
{\dodoubleargument\syst_helpers_freeze_quantity}
\def\syst_helpers_freeze_quantity[#1][#2]%
{\expandafter\edef\csname\??quantity#1\endcsname{\the\numexpr#2}}
-\unexpanded\def\setquantity #1#2{\expandafter\def \csname\??quantity#1\endcsname{#2}} % quick way
-\unexpanded\def\setgquantity#1#2{\expandafter\gdef\csname\??quantity#1\endcsname{#2}} % quick way
-\unexpanded\def\setequantity#1#2{\expandafter\edef\csname\??quantity#1\endcsname{\the\numexpr#2}} % quick way
-\unexpanded\def\setxquantity#1#2{\expandafter\xdef\csname\??quantity#1\endcsname{\the\numexpr#2}} % quick way
+\protected\def\setquantity #1#2{\expandafter\def \csname\??quantity#1\endcsname{#2}} % quick way
+\protected\def\setgquantity#1#2{\expandafter\gdef\csname\??quantity#1\endcsname{#2}} % quick way
+\protected\def\setequantity#1#2{\expandafter\edef\csname\??quantity#1\endcsname{\the\numexpr#2}} % quick way
+\protected\def\setxquantity#1#2{\expandafter\xdef\csname\??quantity#1\endcsname{\the\numexpr#2}} % quick way
\def\quantity
{\the\quantitied}
@@ -7538,9 +7554,9 @@
\def\comparedimension#1#2%
{\compresult
- \ifdim#1<#2%
+ \ifdim#1<#2 % space wil be skipped
\zerocount
- \else\ifdim#1<#2%
+ \else\ifdim#1<#2 % space wil be skipped
\plusone
\else
\plustwo
@@ -7552,7 +7568,7 @@
\zerocount
\else\ifdim\dimexpr#2-#1\relax<\roudingeps
\zerocount
- \else\ifdim#1<#2%
+ \else\ifdim#1<#2 % space wil be skipped
\plusone
\else
\plustwo
@@ -7562,19 +7578,19 @@
% \copycsname xxx\endcsname\csname ..\endcsname
-\unexpanded\def\copycsname{\expandafter\expandafter\expandafter\let\expandafter\expandafter\csname}
+\protected\def\copycsname{\expandafter\expandafter\expandafter\let\expandafter\expandafter\csname}
% \letcscsname \crap \csname ..\endcsname
% \letcsnamecs \csname ..\endcsname\crap
% \letcsnamecsname\csname ..\endcsname\csname ..\endcsname
-\unexpanded\def\letcscsname {\expandafter\let\expandafter}
-\unexpanded\def\letcsnamecs {\expandafter\let}
-\unexpanded\def\letcsnamecsname{\expandafter\expandafter\expandafter\let\expandafter\expandafter}
+\protected\def\letcscsname {\expandafter\let\expandafter}
+\protected\def\letcsnamecs {\expandafter\let}
+\protected\def\letcsnamecsname{\expandafter\expandafter\expandafter\let\expandafter\expandafter}
% another one, add an item to a commalist
-\unexpanded\def\addvalue#1#2% cs item
+\protected\def\addvalue#1#2% cs item
{\ifcsname#1\endcsname\else\expandafter\let\csname#1\endcsname\empty\fi
\normalexpanded{\noexpand\addtocommalist{#2}\expandafter\noexpand\csname#1\endcsname}}
@@ -7589,25 +7605,25 @@
\fi
\syst_helpers_unspaced}
-\unexpanded\def\unspaceargument#1\to#2%
+\protected\def\unspaceargument#1\to#2%
{\privatescratchcounter\catcode\spaceasciicode
\catcode\spaceasciicode\ignorecatcode
\scantextokens{\edef#2{#1}}%
\catcode\spaceasciicode\privatescratchcounter}
-\unexpanded\def\unspaceafter#1#2%
+\protected\def\unspaceafter#1#2%
{\unspaceargument#2\to\ascii
\expandafter#1\expandafter{\ascii}}
% sometimes handy:
-\unexpanded\def\doifelsehasspace#1%
+\protected\def\doifelsehasspace#1%
{\edef\m_syst_string_one{#1}%
\normalexpanded{\syst_helpers_if_has_space_else#1\space}\empty\relax}
\let\doifhasspaceelse\doifelsehasspace
-\unexpanded\def\syst_helpers_if_has_space_else#1 #2#3\relax % \space\empty\relax
+\protected\def\syst_helpers_if_has_space_else#1 #2#3\relax % \space\empty\relax
{\ifx\m_syst_string_one\space
\expandafter\firstoftwoarguments
\else\ifx#2\empty
@@ -7620,8 +7636,8 @@
\installsystemnamespace{flag}
-\unexpanded\def\setflag #1{\expandafter\dodoglobal\expandafter\let\csname\??flag#1\endcsname\zerocount}
-\unexpanded\def\resetflag#1{\expandafter\dodoglobal\expandafter\let\csname\??flag#1\endcsname\plusone}
+\protected\def\setflag #1{\expandafter\dodoglobal\expandafter\let\csname\??flag#1\endcsname\zerocount}
+\protected\def\resetflag#1{\expandafter\dodoglobal\expandafter\let\csname\??flag#1\endcsname\plusone}
\def\flag#1{\csname\??flag#1\endcsname}
@@ -7645,7 +7661,7 @@
\doubleexpandafter\firstofoneargument
\fi\fi}
-\unexpanded\def\inheritparameter[#1]#2[#3]#4[#5]% tag tokey fromkey
+\protected\def\inheritparameter[#1]#2[#3]#4[#5]% tag tokey fromkey
{\expandafter\def\csname#1#3\expandafter\endcsname\expandafter{\csname#1#5\endcsname}}
\def\syst_helpers_if_non_zero_positive_else#1#2\end % #3#4%
@@ -7671,50 +7687,56 @@
% here ?
-\unexpanded\def\dosetrawvalue #1#2#3{\expandafter \def\csname#1#2\endcsname{#3}}
-\unexpanded\def\dosetrawevalue#1#2#3{\expandafter\edef\csname#1#2\endcsname{#3}}
-\unexpanded\def\dosetrawgvalue#1#2#3{\expandafter\gdef\csname#1#2\endcsname{#3}}
-\unexpanded\def\dosetrawxvalue#1#2#3{\expandafter\xdef\csname#1#2\endcsname{#3}}
+\protected\def\dosetrawvalue #1#2#3{\expandafter \def\csname#1#2\endcsname{#3}}
+\protected\def\dosetrawevalue#1#2#3{\expandafter\edef\csname#1#2\endcsname{#3}}
+\protected\def\dosetrawgvalue#1#2#3{\expandafter\gdef\csname#1#2\endcsname{#3}}
+\protected\def\dosetrawxvalue#1#2#3{\expandafter\xdef\csname#1#2\endcsname{#3}}
-\unexpanded\def\getrawparameters {\dogetparameters\dosetrawvalue }
-\unexpanded\def\getraweparameters {\dogetparameters\dosetrawevalue}
-\unexpanded\def\getrawgparameters {\dogetparameters\dosetrawgvalue}
-\unexpanded\def\getrawxparameters {\dogetparameters\dosetrawxvalue}
+\protected\def\getrawparameters {\dogetparameters\dosetrawvalue }
+\protected\def\getraweparameters {\dogetparameters\dosetrawevalue}
+\protected\def\getrawgparameters {\dogetparameters\dosetrawgvalue}
+\protected\def\getrawxparameters {\dogetparameters\dosetrawxvalue}
-\unexpanded\def\globalgetrawparameters{\dogetparameters\dosetrawgvalue} % obsolete
+\protected\def\globalgetrawparameters{\dogetparameters\dosetrawgvalue} % obsolete
%D Sort of obsolete:
\newcount\c_syst_helpers_mod
-\unexpanded\def\dosetmodulo#1#2#3%
+\protected\def\dosetmodulo#1#2#3%
{\c_syst_helpers_mod#1\divide\c_syst_helpers_mod#2\multiply\c_syst_helpers_mod#2%
#3#1\advance#3-\c_syst_helpers_mod}
-\unexpanded\def\dosetdivision#1#2#3%
+\protected\def\dosetdivision#1#2#3%
{#3#1\divide#3 #2\relax}
-\unexpanded\def\DoMod#1by#2to#3{\dosetmodulo {#1}{#2}{#3}}
-\unexpanded\def\DoDiv#1by#2to#3{\dosetdivision{#1}{#2}{#3}}
+\protected\def\DoMod#1by#2to#3{\dosetmodulo {#1}{#2}{#3}}
+\protected\def\DoDiv#1by#2to#3{\dosetdivision{#1}{#2}{#3}}
\def\syst_helpers_unprotected#1\par
{#1\protect}
-\unexpanded\def\unprotected
+\protected\def\unprotected
{\unprotect
\syst_helpers_unprotected}
\let\resettimer \clf_resettimer
\let\elapsedtime \clf_elapsedtime
-\let\elapsedseconds \elapsedtime
+\let\elapsedseconds\elapsedtime
+
+\let\elapsedsteps\!!zerocount
+
+\protected\def\elapsedsteptime % unexpanded ! a bit useless but who knows ...
+ {\clf_elapsedsteptime\elapsedsteps\relax}
\newcount\c_syst_helpers_test_feature_n
\newcount\c_syst_helpers_test_feature_m
\def\currentfeaturetest{\number\c_syst_helpers_test_feature_n}
-\unexpanded\def\testfeature#1#2%
+\protected\def\testfeature#1#2%
{\c_syst_helpers_test_feature_m#1\relax
+ \xdef\elapsedsteps{\number\c_syst_helpers_test_feature_m}%
\def\syst_helpers_test_feature_yes
{\advance\c_syst_helpers_test_feature_n\plusone
\ifnum\c_syst_helpers_test_feature_n>\c_syst_helpers_test_feature_m\else
@@ -7727,7 +7749,7 @@
\fi}%
\retestfeature}
-\unexpanded\def\retestfeature % timer support is new per 10/5/2005
+\protected\def\retestfeature % timer support is new per 10/5/2005
{\bgroup
\ifcase\interactionmode\let\wait\relax\fi
\clf_resettimer
@@ -7741,10 +7763,10 @@
\wait
\egroup}
-\unexpanded\def\showtimer#1%
+\protected\def\showtimer#1%
{\writestatus{runtime}{\elapsedseconds\space s / #1}}
-\unexpanded\def\testfeatureonce#1#2%
+\protected\def\testfeatureonce#1#2%
{\begingroup
\let\wait\relax
\testfeature{#1}{#2}%
@@ -7759,7 +7781,7 @@
%D \freezedimenmacro\leftmargindistance
%D \stoptyping
-\unexpanded\def\freezedimenmacro#1%
+\protected\def\freezedimenmacro#1%
{\edef#1{\the\dimexpr#1}}
%D The next macro negates a macro (dimension or number, or actually, whatever. It's
@@ -7777,17 +7799,17 @@
\def\assigndimen#1#2%
{\afterassignment\gobbleassigndimen#1=#2\zeropoint\\}
-\unexpanded\def\appended#1#2#3{\expandafter#1\expandafter#2\expandafter{#2#3}}
-\unexpanded\def\appendvalue #1{\expandafter\appended\expandafter \def\csname#1\endcsname}
-\unexpanded\def\appendgvalue#1{\expandafter\appended\expandafter\gdef\csname#1\endcsname}
+\protected\def\appended#1#2#3{\expandafter#1\expandafter#2\expandafter{#2#3}}
+\protected\def\appendvalue #1{\expandafter\appended\expandafter \def\csname#1\endcsname}
+\protected\def\appendgvalue#1{\expandafter\appended\expandafter\gdef\csname#1\endcsname}
-\unexpanded\def\prepended#1#2#3%
+\protected\def\prepended#1#2#3%
{\t_syst_helpers_scratch{#3}%
\expandafter\expandafter\expandafter#1\expandafter\expandafter\expandafter#2\expandafter\expandafter\expandafter
{\expandafter\the\expandafter\t_syst_helpers_scratch#2}}
-\unexpanded\def\prependvalue #1{\expandafter\prepended\expandafter \def\csname#1\endcsname}
-\unexpanded\def\prependgvalue#1{\expandafter\prepended\expandafter\gdef\csname#1\endcsname}
+\protected\def\prependvalue #1{\expandafter\prepended\expandafter \def\csname#1\endcsname}
+\protected\def\prependgvalue#1{\expandafter\prepended\expandafter\gdef\csname#1\endcsname}
%D \macros
%D {dowithrange}
@@ -7809,11 +7831,11 @@
\ifx\m_syst_helpers_range_to\empty\let\m_syst_helpers_range_to\m_syst_helpers_range_from\fi
\dostepwiserecurse\m_syst_helpers_range_from\m_syst_helpers_range_to\plusone{\m_helpers_range_action{##1}}}%
-\unexpanded\def\processranges[#1]#2% #1= n:m,p,q:r
+\protected\def\processranges[#1]#2% #1= n:m,p,q:r
{\def\m_helpers_range_action{#2}%
\processcommacommand[#1]\syst_helpers_with_range}
-\unexpanded\def\dowithrange#1#2%
+\protected\def\dowithrange#1#2%
{\def\m_helpers_range_action{#2}%
\processcommacommand[#1]\syst_helpers_with_range}
@@ -7832,7 +7854,7 @@
%D
%D \typebuffer \getbuffer
-\unexpanded\def\ignoreimplicitspaces
+\protected\def\ignoreimplicitspaces
{\doifelsenextchar\relax\relax\relax}
%D \macros
@@ -7859,11 +7881,11 @@
\newbox\b_syst_helpers_no_interference
-\unexpanded\def\startnointerference % not even grouped !
+\protected\def\startnointerference % not even grouped !
{\setbox\b_syst_helpers_no_interference\vbox
\bgroup}
-\unexpanded\def\stopnointerference
+\protected\def\stopnointerference
{\egroup
\setbox\b_syst_helpers_no_interference\emptybox}
@@ -7878,9 +7900,9 @@
%D Signal. Some fonts have a char0 rendering so we need to make sure that it is not
%D set in the font! (This will be overloaded)
-\unexpanded\def\signalcharacter{\char\zerocount} % \zwj
+\protected\def\signalcharacter{\char\zerocount} % \zwj
-% \unexpanded\def\signalcharacter
+% \protected\def\signalcharacter
% {\scratchcounter\normallanguage
% \normallanguage\zerocount
% \char\zerocount
@@ -7914,9 +7936,9 @@
%D \typebuffer \startlines \getbuffer \stoplines
\def\docheckedpair#1%
- {\syst_helpers_checked_pair#1,,\_o_e_p_}
+ {\syst_helpers_checked_pair#1,,\_e_o_p_}
-\def\syst_helpers_checked_pair#1,#2,#3\_o_e_p_
+\def\syst_helpers_checked_pair#1,#2,#3\_e_o_p_
{#1,#2}
%D Here are some nasty helpers. They can be used to fill often expanded token
@@ -8046,7 +8068,7 @@
% {title} {\texdefinition{btx:apa:title-subtitle-type}}
% {default} {\btxflush{author}}
-% \unexpanded\def\doifcase#1%
+% \protected\def\doifcase#1%
% {\edef\m_case_asked{#1}%
% \syst_aux_case}
%
@@ -8093,8 +8115,8 @@
%D Not that useful:
-% \unexpanded\def\doifelsestringbefore{\clf_doifelsestringbefore}
-% \unexpanded\def\doifelsestringafter {\clf_doifelsestringafter}
+% \protected\def\doifelsestringbefore{\clf_doifelsestringbefore}
+% \protected\def\doifelsestringafter {\clf_doifelsestringafter}
% Could have been useful but not faster that addtocommalist and also expansion mess:
%
@@ -8102,30 +8124,30 @@
%D Experiment (sometimes looks nicer in code):
-\unexpanded\def\sameargumentscondition#1#2%
+\protected\def\sameargumentscondition#1#2%
{\edef\m_syst_string_one{#1}%
\edef\m_syst_string_two{#2}%
\ifx\m_syst_string_one\m_syst_string_two}
-\unexpanded\def\emptyargumentcondition#1%
+\protected\def\emptyargumentcondition#1%
{\edef\m_syst_string_one{#1}%
\ifx\m_syst_string_one\empty}
-% \unexpanded\def\hascommonargumentcondition#1#2{\clf_hascommonargumentcondition{#1}{#2}}
+% \protected\def\hascommonargumentcondition#1#2{\clf_hascommonargumentcondition{#1}{#2}}
% \let\hascommonargumentcondition \clf_hascommonargumentcondition
-% \unexpanded\def\hascommonargumentcondition{\clf_hascommonargumentcondition}
+% \protected\def\hascommonargumentcondition{\clf_hascommonargumentcondition}
\protect \endinput
% \edef\choicetokenyes{+}
% \edef\choicetokennop{-}
%
-% \unexpanded\def\startchoice#1%
+% \protected\def\startchoice#1%
% {\pushmacro\currentchoicevalue
% \edef\currentchoicevalue{#1}%
% \checkchoicetoken}
%
-% \unexpanded\def\checkchoicetoken#1%
+% \protected\def\checkchoicetoken#1%
% {\edef\choicetoken{#1}%
% \ifx\choicetoken\choicetokenyes
% \singleexpandafter\checkchoiceyes
@@ -8210,7 +8232,7 @@
%
% \showvalue{mylist}
-% \unexpanded\def\showtokenlist#1%
+% \protected\def\showtokenlist#1%
% {\begingroup
% \edef\tempstring{\the#1}%
% \tx\ttbf\string#1: \tttf\meaning\tempstring
@@ -8220,7 +8242,7 @@
%
% \chardef\_E_O_T_0
%
-% \unexpanded\def\doifelsetokens#1%
+% \protected\def\doifelsetokens#1%
% {\dodoifelsetokens#1\_E_O_T_\_e_o_t_}
%
% \def\dodoifelsetokens#1#2\_e_o_t_
diff --git a/Master/texmf-dist/tex/context/base/mkiv/syst-aux.mkxl b/Master/texmf-dist/tex/context/base/mkiv/syst-aux.mkxl
deleted file mode 100644
index 7ade250d970..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/syst-aux.mkxl
+++ /dev/null
@@ -1,6587 +0,0 @@
-%D \module
-%D [ file=syst-aux, % merge of syst-gen cum suis
-%D version=1996.03.20,
-%D title=\CONTEXT\ System Macros,
-%D subtitle=General,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\registerctxluafile{syst-aux}{}
-
-%D This fils is a follow up in \type {syst-aux.mkii} and \type {syst-aux.mkiv}
-%D where you can find some more pure \TEX\ or \LUATEX| variants.
-
-\unprotect
-
-%D \macros
-%D {unexpanded}
-%D
-%D Because we use this module only in \MKIV, we have removed the old protection
-%D code.
-%D
-%D \starttyping
-%D \unexpanded\def\somecommand{... ... ...}
-%D \stoptyping
-%D
-%D This overloads the \ETEX\ primitive but as we already had an \MKII\ solution we
-%D keep the same name for a similar mechanism.
-
-\let\unexpanded\normalprotected
-
-\ifcase\contextlmtxmode
-
- \def\startlmtxmode#1\stoplmtxmode{}
- \let\stoplmtxmode \relax
- \let\startmkivmode\relax
- \let\stopmkivmode \relax
-
-\else
-
- \let\startlmtxmode\relax
- \let\stoplmtxmode \relax
- \def\startmkivmode#1\stopmkivmode{}
- \let\stopmkivmode \relax
-
-\fi
-
-%D As we don't have namespace definers yet, we use a special one:
-
-\ifdefined\c_syst_helpers_n_of_namespaces
-
- % lets plug in a better error message
-
-\else
-
- \newcount\c_syst_helpers_n_of_namespaces \c_syst_helpers_n_of_namespaces\pluseight % 1-8 reserved for catcodes
-
- \def\v_interfaces_prefix_template_system{\number \c_syst_helpers_n_of_namespaces>>}
- %def\v_interfaces_prefix_template_system{\characters\c_syst_helpers_n_of_namespaces>>} % no \characters yet
-
-\fi
-
-\unexpanded\def\installsystemnamespace#1% maybe move this to syst-ini
- {\ifcsname ??#1\endcsname
- \writestatus\m!system{duplicate system namespace '#1'}\wait
- \else
- \global\advance\c_syst_helpers_n_of_namespaces\plusone
- \expandafter\edef\csname ??#1\endcsname{\v_interfaces_prefix_template_system}%
- \fi}
-
-%D \macros
-%D {normalspace}
-%D
-%D There is already \type{\space} but just to be sure we also provide:
-
-\def\normalspace{ }
-
-%D \macros
-%D {!!count, !!toks, !!dimen, !!box,
-%D !!width, !!height, !!depth, !!string, !!done}
-%D
-%D We define some more \COUNTERS\ and \DIMENSIONS. We also define some shortcuts to
-%D the local scatchregisters~0, 2, 4, 6 and~8.
-
-\newcount\!!counta \newtoks\!!toksa \newdimen\!!dimena \newbox\!!boxa
-\newcount\!!countb \newtoks\!!toksb \newdimen\!!dimenb \newbox\!!boxb
-\newcount\!!countc \newtoks\!!toksc \newdimen\!!dimenc \newbox\!!boxc
-\newcount\!!countd \newtoks\!!toksd \newdimen\!!dimend \newbox\!!boxd
-\newcount\!!counte \newtoks\!!tokse \newdimen\!!dimene \newbox\!!boxe
-\newcount\!!countf \newtoks\!!toksf \newdimen\!!dimenf \newbox\!!boxf
- \newdimen\!!dimeng
- \newdimen\!!dimenh
- \newdimen\!!dimeni
- \newdimen\!!dimenj
- \newdimen\!!dimenk
-
-\let\!!stringa\empty \let\!!stringb\empty \let\!!stringc\empty
-\let\!!stringd\empty \let\!!stringe\empty \let\!!stringf\empty
-
-\newdimen\!!widtha \newdimen\!!heighta \newdimen\!!deptha
-\newdimen\!!widthb \newdimen\!!heightb \newdimen\!!depthb
-\newdimen\!!widthc \newdimen\!!heightc \newdimen\!!depthc
-\newdimen\!!widthd \newdimen\!!heightd \newdimen\!!depthd
-
-\newif\if!!donea \newif\if!!doneb \newif\if!!donec
-\newif\if!!doned \newif\if!!donee \newif\if!!donef
-
-\def\!!zerocount {0} % alongside \zerocount
-\def\!!minusone {-1} % ...
-\def\!!plusone {1} % ...
-\def\!!plustwo {2} % ...
-\def\!!plusthree {3} % ...
-\def\!!plusfour {4} % ...
-\def\!!plusfive {5} % ...
-\def\!!plussix {6} % ...
-\def\!!plusseven {7} % ...
-\def\!!pluseight {8} % ...
-\def\!!plusnine {9} % alongside \plusnine
-
-\setnewconstant \uprotationangle 0
-\setnewconstant\rightrotationangle 90
-\setnewconstant \downrotationangle 180
-\setnewconstant \leftrotationangle 270
-
-\ifdefined\data \else \let\data \relax \fi % dep checker
-
-%D \macros
-%D {s!,c!,e!,p!,v!,@@,??}
-%D
-%D To save memory, we use constants (sometimes called variables). Redefining these
-%D constants can have disastrous results.
-
-\def\v!prefix! {v!}
-\def\c!prefix! {c!}
-\def\s!prefix! {s!}
-
-\def\s!next {next}
-\def\s!default {default}
-\def\s!dummy {dummy}
-\def\s!unknown {unknown}
-
-\def\s!do {do}
-\def\s!dodo {dodo}
-
-\def\s!complex {complex}
-\def\s!start {start}
-\def\s!simple {simple}
-\def\s!stop {stop}
-
-\def\s!empty {empty}
-
-%D Sometimes we pass macros as arguments to commands that don't expand them
-%D before interpretation. Such commands can be enclosed with \type {\expanded},
-%D like:
-%D
-%D \starttyping
-%D \expanded{\setupsomething[\alfa]}
-%D \stoptyping
-%D
-%D Such situations occur for instance when \type{\alfa} is a commalist or when data
-%D stored in macros is fed to index of list commands. If needed, one should use
-%D \type{\noexpand} inside the argument. Later on we will meet some more clever
-%D alternatives to this command. Beware, only the simple one has \type {\noexpand}
-%D before its argument.
-
-\let\m_syst_helpers_expanded\empty
-
-\unexpanded\def\expanded#1%
- {\xdef\m_syst_helpers_expanded{\noexpand#1}\m_syst_helpers_expanded}
-
-\unexpanded\def\startexpanded#1\stopexpanded
- {\xdef\m_syst_helpers_expanded{#1}\m_syst_helpers_expanded}
-
-\let\stopexpanded\relax
-
-%D Recent \TEX\ engines have a primitive \type {\expanded} and we will use that when
-%D possible. After all, we can make not expandable macros now.
-
-% We cannot use the next variant as first we need to adapt \type {##}'s in callers:
-%
-% \def\expanded#1%
-% {\normalexpanded{\noexpand#1}}
-%
-% \def\startexpanded#1\stopexpanded
-% {\normalexpanded{#1}}
-
-%D \macros
-%D {gobbleoneargument,gobble...arguments}
-%D
-%D The next set of macros just do nothing, except that they get rid of a number of
-%D arguments.
-
-\def\gobbleoneargument #1{}
-\def\gobbletwoarguments #1#2{}
-\def\gobblethreearguments#1#2#3{}
-\def\gobblefourarguments #1#2#3#4{}
-\def\gobblefivearguments #1#2#3#4#5{}
-\def\gobblesixarguments #1#2#3#4#5#6{}
-\def\gobblesevenarguments#1#2#3#4#5#6#7{}
-\def\gobbleeightarguments#1#2#3#4#5#6#7#8{}
-\def\gobbleninearguments #1#2#3#4#5#6#7#8#9{}
-\def\gobbletenarguments #1{\gobbleninearguments}
-
-\def\gobbleoneoptional [#1]{}
-\def\gobbletwooptionals [#1][#2]{}
-\def\gobblethreeoptionals[#1][#2][#3]{}
-\def\gobblefouroptionals [#1][#2][#3][#4]{}
-\def\gobblefiveoptionals [#1][#2][#3][#4][#5]{}
-
-%D Reserved macros for tests:
-
-\let\donothing\empty
-
-\let\m_syst_string_one \empty
-\let\m_syst_string_two \empty
-\let\m_syst_string_three\empty
-\let\m_syst_string_four \empty
-
-\let\m_syst_action_yes \empty
-\let\m_syst_action_nop \empty
-
-%D \macros
-%D {doifnextcharelse}
-%D
-%D When we started using \TEX\ in the late eighties, our first experiences with
-%D programming concerned a simple shell around \LATEX. The commands probably use
-%D most at \PRAGMA, are the itemizing ones. One of those few shell commands took
-%D care of an optional argument, that enabled us to specify what kind of item symbol
-%D we wanted. Without understanding anything we were able to locate a \LATEX\ macro
-%D that could be used to inspect the next character.
-%D
-%D It's this macro that the ancester of the next one presented here. It executes one
-%D of two actions, dependant of the next character. Disturbing spaces and line
-%D endings, which are normally interpreted as spaces too, are skipped.
-%D
-%D \starttyping
-%D \doifnextcharelse {karakter} {then ...} {else ...}
-%D \stoptyping
-%D
-%D This macro differs from the original in the use of \type {\localnext} because we
-%D don't want clashes with \type {\next}.
-
-\let\next \relax
-\let\nextnext \relax
-\let\nextnextnext \relax
-\let\nexttoken \relax
-\let\charactertoken\relax
-
-\let\m_syst_action_yes\relax
-\let\m_syst_action_nop\relax
-
-% \def\syst_helpers_inspect_next_character
-% {\ifx\nexttoken\blankspace
-% \expandafter\syst_helpers_reinspect_next_character
-% \else
-% \expandafter\syst_helpers_inspect_next_character_indeed
-% \fi}
-%
-% \def\syst_helpers_inspect_next_character_indeed
-% {\ifx\nexttoken\charactertoken
-% \expandafter\m_syst_action_yes
-% \else
-% \expandafter\m_syst_action_nop
-% \fi}
-
-\unexpanded\def\doifelsenextchar#1#2#3% #1 should not be {} !
- {\def\m_syst_action_yes{#2}%
- \def\m_syst_action_nop{#3}%
- \futureexpandis#1\m_syst_action_yes\m_syst_action_nop}
-
-\unexpanded\def\doifelsenextcharcs % #1#2#3% #1 should not be {} !
- {\futureexpandis}
-
-\let\doifnextcharelse \doifelsenextchar
-\let\doifnextcharcselse\doifelsenextcharcs
-
-%D Because we will mostly use this macro for testing if the next character is \type
-%D {[}, we also make a slightly faster variant as it is not uncommon to have tens of
-%D thousands of calls to this test in a run. Of course it also is more convenient to
-%D read a trace then.
-
-% \newif\if_next_blank_space_token
-
-% \let\syst_helpers_next_optional_character_token=[
-%
-% \def\syst_helpers_inspect_next_optional_character
-% {\ifx\nexttoken\blankspace
-% \expandafter\syst_helpers_reinspect_next_optional_character
-% \else
-% \expandafter\syst_helpers_inspect_next_optional_character_indeed
-% \fi}
-%
-% \def\syst_helpers_inspect_next_optional_character_indeed
-% {\ifx\nexttoken\syst_helpers_next_optional_character_token
-% \expandafter\m_syst_action_yes
-% \else
-% \expandafter\m_syst_action_nop
-% \fi}
-
-\unexpanded\def\doifelsenextoptional#1#2%
- {\def\m_syst_action_yes{#1}%
- \def\m_syst_action_nop{#2}%
- \futureexpandis[\m_syst_action_yes\m_syst_action_nop}
-
-\unexpanded\def\doifelsenextoptionalcs
- {\futureexpandis[}
-
-\let\doifnextoptionalelse \doifelsenextoptional
-\let\doifnextoptionalcselse\doifelsenextoptionalcs
-
-% \let\syst_helpers_next_bgroup_character_token\bgroup
-%
-% \def\syst_helpers_inspect_next_bgroup_character
-% {\ifx\nexttoken\blankspace
-% \expandafter\syst_helpers_reinspect_next_bgroup_character
-% \else
-% \expandafter\syst_helpers_inspect_next_bgroup_character_indeed
-% \fi}
-%
-% \def\syst_helpers_inspect_next_bgroup_character_indeed
-% {\ifx\nexttoken\syst_helpers_next_bgroup_character_token
-% \expandafter\m_syst_action_yes
-% \else
-% \expandafter\m_syst_action_nop
-% \fi}
-
-\unexpanded\def\doifelsenextbgroup#1#2%
- {\def\m_syst_action_yes{#1}%
- \def\m_syst_action_nop{#2}%
- \futureexpandis\bgroup\m_syst_action_yes\m_syst_action_nop}
-
-\unexpanded\def\doifelsenextbgroupcs % #1#2
- {\futureexpandis\bgroup}
-
-\let\doifnextbgroupelse \doifelsenextbgroup
-\let\doifnextbgroupcselse\doifelsenextbgroupcs
-
-% \let\syst_helpers_next_parenthesis_character_token(
-%
-% \def\syst_helpers_inspect_next_parenthesis_character
-% {\ifx\nexttoken\blankspace
-% \expandafter\syst_helpers_reinspect_next_parenthesis_character
-% \else
-% \expandafter\syst_helpers_inspect_next_parenthesis_character_indeed
-% \fi}
-%
-% \def\syst_helpers_inspect_next_parenthesis_character_indeed
-% {\ifx\nexttoken\syst_helpers_next_parenthesis_character_token
-% \expandafter\m_syst_action_yes
-% \else
-% \expandafter\m_syst_action_nop
-% \fi}
-
-\unexpanded\def\doifelsenextparenthesis#1#2%
- {\def\m_syst_action_yes{#1}%
- \def\m_syst_action_nop{#2}%
- \futureexpandis(\m_syst_action_yes\m_syst_action_nop}
-
-\let\doifnextparenthesiselse\doifelsenextparenthesis
-
-%D The next one is handy in predictable situations:
-
-\def\syst_helpers_do_if_fast_optional_check_else
- {\ifx\nexttoken\syst_helpers_next_optional_character_token
- \expandafter\m_syst_action_yes
- \else
- \expandafter\m_syst_action_nop
- \fi}
-
-\unexpanded\def\doifelsefastoptionalcheck#1#2%
- {\def\m_syst_action_yes{#1}%
- \def\m_syst_action_nop{#2}%
- \futureexpandis[\m_syst_action_yes\m_syst_action_nop}
-
-\unexpanded\def\doifelsefastoptionalcheckcs
- {\futureexpandis[}
-
-\let\doiffastoptionalcheckelse \doifelsefastoptionalcheck
-\let\doiffastoptionalcheckcselse\doifelsefastoptionalcheckcs
-
-%D Here's one for skipping spaces and pars, handy for:
-%D
-%D \starttyping
-%D \hbox
-%D
-%D {a few lines later}
-%D \stoptyping
-%D
-%D like:
-%D
-%D \starttyping
-%D \def\somecommand{\dowithnextbox{\box\nextbox}\ruledhbox}
-%D
-%D \assumelongusagecs\somecommand
-%D
-%D \bgroup
-%D oeps
-%D \egroup
-%D \stoptyping
-
-%D The cumbersome original:
-
-% \unexpanded\def\assumelongusagecs#1%
-% {\let\m_syst_action#1%
-% \futurelet\nexttoken\syst_helpers_ignore_spacing}
-%
-% \def\syst_helpers_ignore_spacing
-% {\ifx\nexttoken\blankspace
-% \expandafter\syst_helpers_ignore_spacing_blankspace
-% \orelse\ifx\nexttoken\par
-% \expandafter\syst_helpers_ignore_spacing_partoken
-% \else
-% \expandafter\m_syst_action
-% \fi}
-%
-% \def\syst_helpers_ignore_spacing_partoken\par
-% {\futurelet\nexttoken\syst_helpers_ignore_spacing}
-
-%D A bit less tracing noise:
-
-% \def\assume_long_usage_cs
-% {\futureexpandis\par\assume_long_usage_par\m_syst_action}
-%
-% \def\assume_long_usage_par\par%
-% {\assume_long_usage_cs}
-%
-% \unexpanded\def\assumelongusagecs#1{\let\m_syst_action#1\assume_long_usage_cs}
-
-%D Ok, using \type {\futureexpandisap} is maybe feature creep but I'd like to experiment
-%D with more tolerant user input. It might go away in which case we use the above.
-
-\unexpanded\def\assumelongusagecs#1%
- {\futureexpandisap\relax#1#1}
-
-% D These macros use some auxiliary macros. Although we were able to program quite
-% D complicated things, I only understood these after rereading the \TEX book. The
-% D trick is in using a command with a one character name. Such commands differ from
-% D the longer ones in the fact that trailing spaces are {\em not} skipped. This
-% D enables us to indirectly define a long named macro that gobbles a space. In the
-% D first line we define \type {\blankspace}. Next we make \type {\:} equivalent to
-% D \type {\reinspect...}. This one||character command is expanded before the next
-% D \type {\def} comes into action. This way the space after \type {\:} becomes a
-% D delimiter of the longer named \type {\reinspectnextcharacter}.
-
-\let\next\:
-
-\def\:{\let\blankspace= } \:
-
-% \def\:{\syst_helpers_reinspect_next_character}
-% \expandafter\def\: {\let\if_next_blank_space_token\iftrue\futurelet\nexttoken\syst_helpers_inspect_next_character}
-%
-% \def\:{\syst_helpers_reinspect_next_optional_character}
-% \expandafter\def\: {\let\if_next_blank_space_token\iftrue\futurelet\nexttoken\syst_helpers_inspect_next_optional_character}
-%
-% \def\:{\syst_helpers_reinspect_next_bgroup_character}
-% \expandafter\def\: {\let\if_next_blank_space_token\iftrue\futurelet\nexttoken\syst_helpers_inspect_next_bgroup_character}
-%
-% \def\:{\syst_helpers_reinspect_next_parenthesis_character}
-% \expandafter\def\: {\let\if_next_blank_space_token\iftrue\futurelet\nexttoken\syst_helpers_inspect_next_parenthesis_character}
-%
-% \def\:{\syst_helpers_ignore_spacing_blankspace}
-% \expandafter\def\: {\futurelet\nexttoken\syst_helpers_ignore_spacing}
-
-\let\:\next
-
-%D \macros
-%D {setvalue,setgvalue,setevalue,setxvalue,
-%D letvalue,letgvalue,getvalue,resetvalue,
-%D undefinevalue,ignorevalue}
-%D
-%D \TEX's primitive \type {\csname} can be used to construct all kind of commands
-%D that cannot be defined with \type {\def} and \type {\let}. Every macro programmer
-%D sooner or later wants macros like these.
-%D
-%D \starttyping
-%D \setvalue {name}{...} = \def\name{...}
-%D \setgvalue {name}{...} = \gdef\name{...}
-%D \setevalue {name}{...} = \edef\name{...}
-%D \setxvalue {name}{...} = \xdef\name{...}
-%D \letvalue {name}=\... = \let\name=\...
-%D \letgvalue {name}=\... = \glet\name=\...
-%D \getvalue {name} = \name
-%D \resetvalue {name} = \def\name{}
-%D \stoptyping
-%D
-%D As we will see, \CONTEXT\ uses these commands many times, which is mainly due to
-%D its object oriented and parameter driven character.
-
-\def\setvalue #1{\expandafter\def \csname#1\endcsname}
-\def\setgvalue #1{\expandafter\gdef\csname#1\endcsname}
-\def\setevalue #1{\expandafter\edef\csname#1\endcsname}
-\def\setxvalue #1{\expandafter\xdef\csname#1\endcsname}
-\def\getvalue #1{\csname#1\endcsname} % maybe: \begincsname#1\endcsname
-\def\letvalue #1{\expandafter\let \csname#1\endcsname}
-\def\letgvalue #1{\expandafter\glet\csname#1\endcsname}
-\def\resetvalue #1{\expandafter\let \csname#1\endcsname\empty}
-\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}
-
-\unexpanded\def\getuvalue#1{\csname#1\endcsname}
-
-%D \macros
-%D {globallet,glet}
-%D
-%D In \CONTEXT\ of May 2000 using \type {\globallet} instead of the two tokens will
-%D save us some $300\times4=1200$ bytes of format file on a 32~bit system. Not that
-%D it matters much today. This shortcut is already defined:
-
-\let\globallet\glet
-
-%D \macros
-%D {doifundefined,doifdefined,
-%D doifundefinedelse,doifdefinedelse,
-%D doifalldefinedelse}
-%D
-%D The standard way of testing if a macro is defined is comparing its meaning with
-%D another undefined one, usually \type{\undefined}. To garantee correct working of
-%D the next set of macros, \type{\undefined} may never be defined!
-%D
-%D \starttyping
-%D \doifundefined {string} {...}
-%D \doifdefined {string} {...}
-%D \doifundefinedelse {string} {then ...} {else ...}
-%D \doifdefinedelse {string} {then ...} {else ...}
-%D \doifalldefinedelse {commalist} {then ...} {else ...}
-%D \stoptyping
-%D
-%D Every macroname that \TEX\ builds gets an entry in the hash table, which is of
-%D limited size. It is expected that \ETEX\ will offer a less memory||consuming
-%D alternative.
-
-%D Although it will probably never be a big problem, it is good to be aware of the
-%D difference between testing on a macro name to be build by using \type{\csname} and
-%D \type{\endcsname} and testing the \type{\name} directly.
-%D
-%D \starttyping
-%D \expandafter\ifx\csname NameA\endcsname\relax ... \else ... \fi
-%D
-%D \ifundefined\NameB ... \else ... \fi
-%D \stoptyping
-
-% \suppressifcsnameerror\plusone % already set
-
-\def\doifelseundefined#1%
- {\ifcsname#1\endcsname
- \expandafter\secondoftwoarguments\else\expandafter\firstoftwoarguments
- \fi}
-
-\def\doifelsedefined#1%
- {\ifcsname#1\endcsname
- \expandafter\firstoftwoarguments\else\expandafter\secondoftwoarguments
- \fi}
-
-\def\doifundefined#1%
- {\ifcsname#1\endcsname
- \expandafter\gobbleoneargument\else\expandafter\firstofoneargument
- \fi}
-
-\def\doifdefined#1%
- {\ifcsname#1\endcsname
- \expandafter\firstofoneargument\else\expandafter\gobbleoneargument
- \fi}
-
-\let\doifundefinedelse\doifelseundefined
-\let\doifdefinedelse \doifelsedefined
-
-%D \macros
-%D {letbeundefined}
-%D
-%D Testing for being undefined comes down to testing on \type {\relax} when we use
-%D \type {\csname}, but when using \type {\ifx}, we test on being \type
-%D {\undefined}! In \ETEX\ we have \type {\ifcsname} and that way of testing on
-%D existance is not the same as the one described here. Therefore we introduce:
-
-\unexpanded\def\letbeundefined#1% potential stack buildup when used \global
- {\expandafter\let\csname#1\endcsname\undefined} % or use \undefinevalue to match \setvalue
-
-\unexpanded\def\localundefine#1% conditional
- {\ifcsname#1\endcsname\expandafter\let\csname#1\endcsname\undefined\fi}
-
-\unexpanded\def\globalundefine#1% conditional
- {\ifcsname#1\endcsname\expandafter\glet\csname#1\endcsname\undefined\fi}
-
-%D Beware, being \type {\undefined} in \ETEX\ means that the macro {\em is} defined!
-%D
-%D When we were developing the scientific units module, we encountered different
-%D behavior in text and math mode, which was due to this grouping subtilities. We
-%D therefore decided to use \type{\begingroup} instead of \type{\bgroup}.
-
-\unexpanded\def\doifelsealldefined#1%
- {\begingroup
- \donetrue % we could use a reserved one and avoid the group
- \processcommalist[#1]\syst_helpers_do_if_all_defined_else
- \ifdone
- \endgroup\expandafter\firstoftwoarguments
- \else
- \endgroup\expandafter\secondoftwoarguments
- \fi}
-
-\let\doifalldefinedelse\doifelsealldefined
-
-\def\syst_helpers_do_if_all_defined_else#1%
- {\ifcsname#1\endcsname\else
- \donefalse
- \expandafter\quitcommalist % added
- \fi}
-
-%D \macros
-%D {doif,doifelse,doifnot}
-%D
-%D Programming in \TEX\ differs from programming in procedural languages like
-%D \MODULA. This means that one --- well, let me speek for myself --- tries to do
-%D the things in the well known way. Therefore the next set of \type{\ifthenelse}
-%D commands were between the first ones we needed. A few years later, the opposite
-%D became true: when programming in \MODULA, I sometimes miss handy things like
-%D grouping, runtime redefinition, expansion etc. While \MODULA\ taught me to
-%D structure, \TEX\ taught me to think recursive.
-%D
-%D \starttyping
-%D \doif {string1} {string2} {...}
-%D \doifnot {string1} {string2} {...}
-%D \doifelse {string1} {string2} {then ...}{else ...}
-%D \stoptyping
-
-\unexpanded\def\doifelse#1#2%
- {\iftok{#1}{#2}%
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\unexpanded\def\doif#1#2%
- {\iftok{#1}{#2}%
- \expandafter\firstofoneargument
- \else
- \expandafter\gobbleoneargument
- \fi}
-
-\unexpanded\def\doifnot#1#2%
- {\iftok{#1}{#2}%
- \expandafter\gobbleoneargument
- \else
- \expandafter\firstofoneargument
- \fi}
-
-%D \macros
-%D {doifempty,doifemptyelse,doifnotempty}
-%D
-%D We complete our set of conditionals with:
-%D
-%D \starttyping
-%D \doifempty {string} {...}
-%D \doifnotempty {string} {...}
-%D \doifemptyelse {string} {then ...} {else ...}
-%D \stoptyping
-%D
-%D This time, the string is not expanded.
-
-\unexpanded\def\doifelseempty#1%
- {\def\m_syst_string_one{#1}%
- \ifx\m_syst_string_one\empty
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\let\doifemptyelse\doifelseempty
-
-\unexpanded\def\doifempty#1%
- {\def\m_syst_string_one{#1}%
- \ifx\m_syst_string_one\empty
- \expandafter\firstofoneargument
- \else
- \expandafter\gobbleoneargument
- \fi}
-
-\unexpanded\def\doifnotempty#1%
- {\def\m_syst_string_one{#1}%
- \ifx\m_syst_string_one\empty
- \expandafter\gobbleoneargument
- \else
- \expandafter\firstofoneargument
- \fi}
-
-%D \macros
-%D {doifinset,doifnotinset,doifinsetelse}
-%D
-%D We can check if a string is present in a comma separated set of strings.
-%D Depending on the result, some action is taken.
-%D
-%D \starttyping
-%D \doifinset {string} {string,...} {...}
-%D \doifnotinset {string} {string,...} {...}
-%D \doifinsetelse {string} {string,...} {then ...} {else ...}
-%D \stoptyping
-
-% !0nop=\doifinsetelse{ccc}{,}{yes}{nop}
-% !0nop=\doifinsetelse{ccc}{,,}{yes}{nop}
-% !0nop=\doifinsetelse{ccc}{,,,}{yes}{nop}
-
-% !1nop=\doifinsetelse{}{}{yes}{nop}
-% !2yes=\doifinsetelse{aaa}{bbb,ccc,ddd,aaa,eee}{yes}{nop}
-% !3nop=\doifinsetelse{aaa}{bbb}{yes}{nop}
-% !4yes=\doifinsetelse{aaa}{aaa}{yes}{nop}
-% !5nop=\doifinsetelse{aaaa}{bbb,ccc,ddd,aaa,eee}{yes}{nop}
-% !6nop=\doifinsetelse{}{}{yes}{nop}
-% !7nop=\doifinsetelse{}{aaa}{yes}{nop}
-% !8nop=\doifinsetelse{aaa}{}{yes}{nop}
-
-% !1=\doifinset{}{}{yes}
-% !2yes=\doifinset{aaa}{bbb,ccc,ddd,aaa,eee}{yes}
-% !3=\doifinset{aaa}{bbb}{yes}
-% !4yes=\doifinset{aaa}{aaa}{yes}
-% !5=\doifinset{}{}{yes}
-% !6=\doifinset{aaa}{}{yes}
-
-% !1yes=\doifnotinset{}{}{yes}
-% !2=\doifnotinset{aaa}{bbb,ccc,ddd,aaa,eee}{yes}
-% !3yes=\doifnotinset{aaa}{bbb}{yes}
-% !4=\doifnotinset{aaa}{aaa}{yes}
-% !5yes=\doifnotinset{}{}{yes}
-% !6yes=\doifnotinset{aaa}{}{yes}
-
-\unexpanded\def\doifelseinset#1#2{\clf_doifelseinset{#1}{#2}}
-\unexpanded\def\doifinset #1#2{\clf_doifinset {#1}{#2}}
-\unexpanded\def\doifnotinset #1#2{\clf_doifnotinset {#1}{#2}}
- % \let\firstinset \clf_firstinset
-
-\let\doifinsetelse\doifelseinset
-
-%D \macros
-%D {doifcommon,doifnotcommon,doifcommonelse}
-%D
-%D Probably the most time consuming tests are those that test for overlap in sets
-%D of strings.
-%D
-%D \starttyping
-%D \doifcommon {string,...} {string,...} {...}
-%D \doifnotcommon {string,...} {string,...} {...}
-%D \doifcommonelse {string,...} {string,...} {then ...} {else ...}
-%D \stoptyping
-
-% !1yes=\doifcommonelse{aaa,bbb,ccc}{aaa,bbb,ccc}{yes}{nop}
-% !2nop=\doifcommonelse{aaa,bbb,ccc}{ddd,eee,fff}{yes}{nop}
-% !3nop=\doifcommonelse{aaa}{ddd,eee,fff}{yes}{nop}
-% !4yes=\doifcommonelse{aaa}{aaa}{yes}{nop}
-% !5nop=\doifcommonelse{bbb}{aaa}{yes}{nop}
-% !6nop=\doifcommonelse{}{aaa,bbb,ccc}{yes}{nop}
-% !7nop=\doifcommonelse{aaa,bbb,ccc}{}{yes}{nop}
-% !8nop=\doifcommonelse{}{}{yes}{nop}
-
-% !9nop=\doifcommonelse{,,}{,,}{yes}{nop}
-% !9yes=\doifcommonelse{,a,}{,a,}{yes}{nop}
-% !9yes=\doifcommonelse{,,a,}{,a,}{yes}{nop}
-% !9yes=\doifcommonelse{,a,}{,,a,}{yes}{nop}
-% !9yes=\doifcommonelse{,a,}{,,,a,}{yes}{nop}
-% !9yes=\doifcommonelse{,,a,}{,,,a,}{yes}{nop}
-
-\unexpanded\def\doifelsecommon#1#2{\clf_doifelsecommon{#1}{#2}}
-\unexpanded\def\doifcommon #1#2{\clf_doifcommon {#1}{#2}}
-\unexpanded\def\doifnotcommon #1#2{\clf_doifnotcommon {#1}{#2}}
-
-\let\doifcommonelse\doifelsecommon
-
-%D \macros
-%D {processcommalist,processcommacommand,quitcommalist,
-%D processcommalistwithparameters}
-%D
-%D We've already seen some macros that take care of comma separated lists. Such
-%D list can be processed with
-%D
-%D \starttyping
-%D \processcommalist[string,string,...]\commando
-%D \stoptyping
-%D
-%D The user supplied command \type{\commando} receives one argument: the string.
-%D This command permits nesting and spaces after commas are skipped. Empty sets
-%D are no problem.
-%D
-%D \startbuffer
-%D \def\dosomething#1{(#1)}
-%D
-%D 1: \processcommalist [\hbox{$a,b,c,d,e,f$}] \dosomething \par
-%D 2: \processcommalist [{a,b,c,d,e,f}] \dosomething \par
-%D 3: \processcommalist [{a,b,c},d,e,f] \dosomething \par
-%D 4: \processcommalist [a,b,{c,d,e},f] \dosomething \par
-%D 5: \processcommalist [a{b,c},d,e,f] \dosomething \par
-%D 6: \processcommalist [{a,b}c,d,e,f] \dosomething \par
-%D 7: \processcommalist [] \dosomething \par
-%D 8: \processcommalist [{[}] \dosomething \par
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D Before we show the result, we present the macro's:
-
-\newcount\commalevel
-
-\installsystemnamespace{nextcommalevel}
-
-\def\syst_helpers_do_do_do_process_comma_item
- {\csname\??nextcommalevel\the\commalevel\endcsname}
-
-% \ifcase\contextlmtxmode
-
- \def\syst_helpers_do_process_comma_item
- {\futurelet\nexttoken\syst_helpers_do_do_process_comma_item}
-
- \def\syst_helpers_do_do_process_comma_item
- {\ifx\nexttoken\blankspace
- \expandafter\syst_helpers_re_do_process_comma_item
- \else
- \expandafter\syst_helpers_do_do_process_comma_item_indeed
- \fi}
-
- \def\syst_helpers_do_do_process_comma_item_indeed
- {\ifx\nexttoken]%
- \expandafter\gobbleoneargument
- \else
- \expandafter\syst_helpers_do_do_do_process_comma_item
- \fi}
-
-% \else
-%
-% \def\syst_helpers_do_process_comma_item
-% {\futureexpandis]\gobbleoneargument\syst_helpers_do_do_do_process_comma_item}
-%
-% \fi
-
-%D Empty arguments are not processed. Empty items (\type {,,}) however are
-%D treated. We have to check for the special case \type {[{a,b,c}]}.
-
-\unexpanded\def\processcommalist[%
- {\futurelet\nexttoken\syst_helpers_do_check_comma_item}
-
-\def\syst_helpers_do_check_comma_item
- {\ifx\nexttoken]%
- \expandafter\gobblethreearguments
- \else
- \expandafter\syst_helpers_do_process_comma_list
- \fi
- \relax} % this one preserved the next {}
-
-\def\syst_helpers_do_process_comma_list#1]#2%
- {\global\advance\commalevel \plusone
- \expandafter\def\csname\??nextcommalevel\the\commalevel\endcsname##1,%
- {#2{##1}\syst_helpers_do_process_comma_item}%
- \syst_helpers_do_do_process_comma_item_gobble#1,]\relax
- \global\advance\commalevel \minusone }
-
-\def\syst_helpers_do_do_process_comma_item_gobble#1{\syst_helpers_do_do_process_comma_item}
-
-%D One way of quitting a commalist halfway is:
-
-\unexpanded\def\quitcommalist
- {\begingroup\let\syst_helpers_do_process_comma_item\syst_helpers_do_quit_comma_list}
-
-\def\syst_helpers_do_quit_comma_list#1]%
- {\endgroup}
-
-\unexpanded\def\quitprevcommalist
- {\begingroup\let\syst_helpers_do_process_comma_item\syst_helpers_do_quit_prev_comma_list}
-
-\def\syst_helpers_do_quit_prev_comma_list#1]%
- {\let\syst_helpers_do_process_comma_item\syst_helpers_do_quit_comma_list}
-
-%D The hack we used for checking the next character \type {\doifnextcharelse}
-%D is also used here.
-
-% \ifcase\contextlmtxmode
-
- \let\next\:
-
- \def\:{\syst_helpers_re_do_process_comma_item} % \:not saved ?
-
- \expandafter\def\: {\futurelet\nexttoken\syst_helpers_do_do_process_comma_item}
-
- \let\:\next
-
-% \fi
-
-%D The previous examples lead to:
-%D
-%D \getbuffer
-
-%D When a list is saved in a macro, we can use a construction like:
-%D
-%D \starttyping
-%D \expandafter\processcommalist\expandafter[\list]\command
-%D \stoptyping
-%D
-%D Such solutions suit most situations, but we wanted a bit more.
-%D
-%D \starttyping
-%D \processcommacommand[string,\stringset,string]\commando
-%D \stoptyping
-%D
-%D where \type{\stringset} is a predefined set, like:
-%D
-%D \starttyping
-%D \def\first{aap,noot,mies}
-%D \def\second{laatste}
-%D
-%D \processcommacommand[\first]\message
-%D \processcommacommand[\first,second,third]\message
-%D \processcommacommand[\first,between,\second]\message
-%D \stoptyping
-%D
-%D Commands that are part of the list are expanded, so the use of this macro has its
-%D limits.
-
-\unexpanded\def\processcommacommand[#1]%
- {\normalexpanded{\processcommalist[#1]}}
-
-%D The argument to \type{\command} is not delimited. Because we often use \type {[]}
-%D as delimiters, we also have:
-%D
-%D \starttyping
-%D \processcommalistwithparameters[string,string,...]\command
-%D \stoptyping
-%D
-%D where \type{\command} looks like:
-%D
-%D \starttyping
-%D \def\command[#1]{... #1 ...}
-%D \stoptyping
-
-\unexpanded\def\processcommalistwithparameters[#1]#2%
- {\def\syst_helpers_do_process_comma_list_with_parameters##1{#2[##1]}%
- \processcommalist[#1]\syst_helpers_do_process_comma_list_with_parameters}
-
-%D \macros
-%D {startprocesscommalist,startprocesscommacommand}
-%D
-%D Two more:
-
-\let\syst_helpers_comma_list_step\relax
-
-\unexpanded\def\startprocesscommalist[#1]#2\stopprocesscommalist
- {\def\syst_helpers_comma_list_step##1{\def\currentcommalistitem{##1}#2}%
- \processcommalist[#1]\syst_helpers_comma_list_step}
-
-\unexpanded\def\startprocesscommacommand[#1]#2\stopprocesscommacommand
- {\def\syst_helpers_comma_list_step##1{\def\currentcommalistitem{##1}#2}%
- \normalexpanded{\processcommalist[#1]}\syst_helpers_comma_list_step}
-
-\let\stopprocesscommalist \relax
-\let\stopprocesscommacommand\relax
-
-%D \macros
-%D {processaction,
-%D processfirstactioninset,
-%D processallactionsinset}
-%D
-%D \CONTEXT\ makes extensive use of a sort of case or switch command. Depending of
-%D the presence of one or more provided items, some actions is taken. These macros
-%D can be nested without problems.
-%D
-%D \starttyping
-%D \processaction [x] [a=>\a,b=>\b,c=>\c]
-%D \processfirstactioninset [x,y,z] [a=>\a,b=>\b,c=>\c]
-%D \processallactionsinset [x,y,z] [a=>\a,b=>\b,c=>\c]
-%D \stoptyping
-%D
-%D We can supply both a \type {default} action and an action to be undertaken when
-%D an \type {unknown} value is met:
-%D
-%D \starttyping
-%D \processallactionsinset
-%D [x,y,z]
-%D [ a=>\a,
-%D b=>\b,
-%D c=>\c,
-%D default=>\default,
-%D unknown=>\unknown{... \commalistelement ...}]
-%D \stoptyping
-%D
-%D When \type {#1} is empty, this macro scans list \type {#2} for the keyword \type
-%D {default} and executed the related action if present. When \type {#1} is non
-%D empty and not in the list, the action related to \type {unknown} is executed.
-%D Both keywords must be at the end of list \type{#2}. Afterwards, the actually
-%D found keyword is available in \type {\commalistelement}. An advanced example of
-%D the use of this macro can be found in \PPCHTEX, where we completely rely on \TEX\
-%D for interpreting user supplied keywords like \type {SB}, \type {SB1..6}, \type
-%D {SB125} etc.
-
-\newcount\processlevel
-
-\unexpanded\def\syst_helpers_do_compare_process_action_a[#1=>#2][#3]%
- {\edef\m_syst_string_two{#1}%
- \ifx\m_syst_string_two\s!default
- \let\commalistelement\empty
- #2%
- \fi}
-
-% met \quitcommalist tot meer dan 25\% sneller
-
-\unexpanded\def\syst_helpers_do_compare_process_action_b[#1=>#2][#3]%
- {\edef\m_syst_string_two{#1}%
- \ifx\m_syst_string_one\m_syst_string_two
- \def\commalistelement{#3}%
- #2%
- \expandafter\quitcommalist
- \orelse\ifx\m_syst_string_two\s!unknown
- \def\commalistelement{#3}% beware of loops
- #2%
- \fi}
-
-\unexpanded\def\processaction[#1]#2[%
- {\edef\m_syst_string_one{#1}%
- \ifx\m_syst_string_one\empty
- \let\syst_helpers_do_compare_process_action\syst_helpers_do_compare_process_action_a
- \else
- \let\syst_helpers_do_compare_process_action\syst_helpers_do_compare_process_action_b
- \fi
- \edef\syst_helpers_do_process_action##1{\syst_helpers_do_compare_process_action[##1][#1]}% expands #1
- \processnextcommalist\relax\relax\syst_helpers_do_process_action[}
-
-\unexpanded\def\syst_helpers_do_compare_process_action_c[#1=>#2][#3]%
- {\edef\m_syst_string_one{#1}%
- \edef\m_syst_string_two{#3}%
- \ifx\m_syst_string_one\m_syst_string_two
- \def\commalistelement{#3}%
- #2%
- \expandafter\quitprevcommalist
- \else
- \edef\m_syst_string_one{#1}%
- \ifx\m_syst_string_one\s!unknown
- \def\commalistelement{#3}%
- #2%
- \fi
- \fi}
-
-\unexpanded\def\processfirstactioninset[#1]%
- {\edef\m_syst_string_one{#1}%
- \ifx\m_syst_string_one\empty
- \expandafter\processaction
- \else
- \expandafter\syst_helpers_process_first_action_in_set_indeed
- \fi
- [#1]}
-
-\unexpanded\def\syst_helpers_process_first_action_in_set_indeed[#1]#2[#3]%
- {\def\syst_helpers_do_process_action##1%
- {\def\syst_helpers_do_do_process_action####1{\syst_helpers_do_compare_process_action_c[####1][##1]}%
- \processcommalist[#3]\syst_helpers_do_do_process_action}%
- \normalexpanded{\processcommalist[#1]}\syst_helpers_do_process_action}
-
-\unexpanded\def\syst_helpers_do_compare_process_action_d[#1=>#2][#3]%
- {\edef\m_syst_string_one{#1}%
- \edef\m_syst_string_two{#3}%
- \ifx\m_syst_string_one\m_syst_string_two
- \def\commalistelement{#3}%
- #2%
- \expandafter\quitcommalist
- \else
- \edef\m_syst_string_one{#1}%
- \ifx\m_syst_string_one\s!unknown
- \def\commalistelement{#3}%
- #2%
- \fi
- \fi}
-
-\installsystemnamespace{nextactionlevel}
-
-\unexpanded\def\syst_helpers_do_process_all_actions_in_set
- {\csname\??nextactionlevel\the\processlevel\endcsname}
-
-\unexpanded\def\processallactionsinset[#1]%
- {\edef\m_syst_string_one{#1}%
- \ifx\m_syst_string_one\empty
- \expandafter\processaction
- \else
- \expandafter\syst_helpers_process_all_actions_in_set_indeed
- \fi
- [#1]}
-
-\unexpanded\def\syst_helpers_process_all_actions_in_set_indeed[#1]#2[#3]%
- {\advance\processlevel \plusone
- \expandafter\def\csname\??nextactionlevel\the\processlevel\endcsname##1%
- {\def\syst_helpers_do_do_process_action####1{\syst_helpers_do_compare_process_action_d[####1][##1]}%
- \processcommalist[#3]\syst_helpers_do_do_process_action}%
- \normalexpanded{\processcommalist[#1]}\syst_helpers_do_process_all_actions_in_set
- \advance\processlevel\minusone}
-
-%D These macros use:
-
-\unexpanded\def\processnextcommalist#1#2#3[#4#5]%
- {#1%
- \let\nexttoken#4%
- \global\advance\commalevel \plusone
- \expandafter\def\csname\??nextcommalevel\the\commalevel\endcsname##1,%
- {#3{##1}\syst_helpers_do_process_comma_item}%
- \syst_helpers_do_do_process_comma_item#4#5,]\relax
- \global\advance\commalevel\minusone
- #2}
-
-%D \macros
-%D {getfirstcharacter, firstcharacter, remainingcharacters, doiffirstcharacter}
-%D
-%D Sometimes the action to be undertaken depends on the next character. This macro
-%D get this character and puts it in \type {\firstcharacter}.
-%D
-%D \starttyping
-%D \getfirstcharacter {string}
-%D \stoptyping
-%D
-%D A two step expansion is used to prevent problems with complicated arguments, for
-%D instance arguments that consist of two or more expandable tokens.
-
-\let\firstcharacter \empty
-\let\remainingcharacters\empty
-
-\unexpanded\def\getfirstcharacter #1{\clf_getfirstcharacter{#1}}
-\unexpanded\def\doifelsefirstchar #1#2{\clf_doifelsefirstchar{#1}{#2}}
-\unexpanded\def\thefirstcharacter #1{\clf_thefirstcharacter{#1}}
-\unexpanded\def\theremainingcharacters#1{\clf_theremainingcharacters{#1}}
-
-\let\doiffirstcharelse\doifelsefirstchar
-
-%D \macros
-%D {doifinstringelse, doifincsnameelse}
-%D
-%D We can check for the presence of a substring in a given sequence of characters.
-%D
-%D \starttyping
-%D \doifinsetelse {substring} {string} {then ...} {else ...}
-%D \stoptyping
-
-\let\m_syst_sub_string\empty
-
-\unexpanded\def\doifelseinstring#1%
- {\edef\m_syst_sub_string{#1}% expand #1 here
- \ifx\m_syst_sub_string\empty
- \expandafter\thirdofthreearguments
- \else
- \expandafter\syst_helpers_do_if_in_string_else_indeed
- \fi}
-
-\let\doifinstringelse\doifelseinstring
-
-\unexpanded\def\syst_helpers_do_if_in_string_else_indeed#1%
- {\syst_helpers_do_if_in_string_else\m_syst_sub_string{#1}%
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\unexpanded\def\doifinstring#1%%
- {\edef\m_syst_sub_string{#1}% expand #1 here
- \ifx\m_syst_sub_string\empty
- \expandafter\gobbletwoarguments
- \else
- \expandafter\syst_helpers_do_if_in_string_indeed
- \fi}
-
-\unexpanded\def\syst_helpers_do_if_in_string_indeed#1%
- {\syst_helpers_do_if_in_string_else\m_syst_sub_string{#1}%
- \expandafter\firstofoneargument
- \else
- \expandafter\gobbleoneargument
- \fi}
-
-\unexpanded\def\doifnotinstring#1%%
- {\edef\m_syst_sub_string{#1}% expand #1 here
- \ifx\m_syst_sub_string\empty
- \expandafter\gobbletwoarguments
- \else
- \expandafter\syst_helpers_do_if_not_in_string_indeed
- \fi}
-
-\unexpanded\def\syst_helpers_do_if_not_in_string_indeed#1%
- {\syst_helpers_do_if_in_string_else\m_syst_sub_string{#1}%
- \expandafter\gobbleoneargument
- \else
- \expandafter\firstofoneargument
- \fi}
-
-% replaces prev
-
-\unexpanded\def\syst_helpers_do_if_in_string_else#1#2% ##2 can be {abc}
- {\expandafter\def\expandafter\syst_helpers_do_do_if_in_string_else
- \expandafter##\expandafter1#1##2##3^^^^0004{\unless\if##2@}% expand #1 here
- \expandafter\syst_helpers_do_do_if_in_string_else\normalexpanded{#2#1}@@^^^^0004} % expand #2 here
-
-%D The next alternative proved to be upto twice as fast on tasks like checking
-%D reserved words in pretty verbatim typesetting! This is mainly due to the fact
-%D that passing (expanded) strings is much slower that passing a macro.
-%D
-%D \starttyping
-%D \doifincsnameelse {substring} {\string} {then ...} {else ...}
-%D \stoptyping
-%D
-%D Where \type {\doifinstringelse} does as much expansion as possible, the latter
-%D alternative does minimal (one level) expansion.
-
-\unexpanded\def\syst_helpers_do_if_in_csname_else#1#2%
- {\def\syst_helpers_do_do_if_in_csname_else##1#1##2##3^^^^0004%
- {\unless\if##2@}%
- \expandafter\syst_helpers_do_do_if_in_csname_else#2#1@@^^^^0004}
-
-\unexpanded\def\doifelseincsname#1#2%
- {\normalexpanded{\syst_helpers_do_if_in_csname_else{#1}}{#2}%
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\let\doifincsnameelse\doifelseincsname
-
-%D \macros
-%D {doifnumberelse,doifnumber,doifnotnumber}
-%D
-%D The next macro executes a command depending of the outcome of a test on numerals.
-%D This is probably one of the fastest test possible, exept from a less robust
-%D 10||step \type {\if}||ladder or some tricky \type {\lcode} checking.
-%D
-%D \starttyping
-%D \doifnumberelse {string} {then ...} {else ...}
-%D \stoptyping
-%D
-%D The macro accepts \type {123}, \type {abc}, \type {{}}, \type {\getal} and \type
-%D {\the\count...}. This macro is a rather dirty one.
-
-\def\doifelsenumber#1%
- {\ifchknum#1\or
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\def\doifnumber#1%
- {\ifchknum#1\or
- \expandafter\firstoftwoarguments
- \else
- \expandafter\gobbleoneargument
- \fi}
-
-\def\doifnotnumber#1%
- {\ifchknum#1\or
- \expandafter\gobbleoneargument
- \else
- \expandafter\firstofoneargument
- \fi}
-
-\let\doifnumberelse\doifelsenumber
-
-%D \macros
-%D {setpercentdimen}
-%D
-%D \starttyping
-%D \scratchdimen=100pt \setpercentdimen\scratchdimen{10\letterpercent}
-%D \scratchdimen=100pt \setpercentdimen\scratchdimen{5pt}
-%D \scratchdimen \percentdimen \hsize {10\letterpercent}
-%D \stoptyping
-
-\def\percentdimen#1#2% dimen percentage (with %)
- {\dimexpr\clf_percentageof{#2}\dimexpr#1\relax}
-
-\unexpanded\def\setpercentdimen#1#2% dimen percentage (with %)
- {#1=\clf_percentageof{#2}\dimexpr#1\relax}
-
-%D \macros
-%D {makerawcommalist,
-%D rawdoinsetelse,
-%D rawprocesscommalist,
-%D rawprocessaction}
-%D
-%D Some of the commands mentioned earlier are effective but slow. When one is
-%D desperately in need of faster alternatives and when the conditions are
-%D predictable safe, the \type {\raw} alternatives come into focus. A major drawback
-%D is that they do not take \type {\c!constants} into account, simply because no
-%D expansion is done. This is no problem with \type {\rawprocesscommalist}, because
-%D this macro does not compare anything. Expandable macros are permitted as search
-%D string.
-%D
-%D \starttyping
-%D \makerawcommalist[string,string,...]\stringlist
-%D \rawdoifelseinset{string}{string,...}{...}{...}
-%D \rawprocesscommalist[string,string,...]\commando
-%D \rawprocessaction[x][a=>\a,b=>\b,c=>\c]
-%D \stoptyping
-%D
-%D Spaces embedded in the list, for instance after commas, spoil the search process.
-%D The gain in speed depends on the length of the argument (the longer the argument,
-%D the less we gain).
-
-\unexpanded\def\makerawcommalist[#1]#2% use \processnext ... here
- {\def\syst_helpers_do_make_raw_comma_list##1% we don't expand ##1
- {\ifx#2\empty
- \def#2{##1}%
- \else
- \expandafter\def\expandafter#2\expandafter{#2,##1}%
- \fi}%
- \let#2\empty
- \processcommalist[#1]\syst_helpers_do_make_raw_comma_list}
-
-\def\syst_helpers_raw_process_comma_item#1,#2% #2 eats up preceding space
- {\if]#1\else
- \csname\??nextcommalevel\the\commalevel\endcsname{#1}%
- \expandafter\syst_helpers_raw_process_comma_item
- \fi#2}
-
-\unexpanded\def\rawprocesscommalist[#1]#2% accepteert ook [\cs]
- {\global\advance\commalevel \plusone
- \expandafter\let\csname\??nextcommalevel\the\commalevel\endcsname#2%
- \expandafter\syst_helpers_raw_process_comma_item#1,],% \relax
- \global\advance\commalevel \minusone }
-
-\unexpanded\def\rawprocesscommacommand[#1]% not really needed
- {\normalexpanded{\rawprocesscommalist[#1]}}
-
-%D Here is one without nesting:
-
-\unexpanded\def\syst_helpers_fast_process_comma_item#1,#2% #2 eats up preceding space
- {\if]#1\else
- \syst_helpers_fast_process_comma_command{#1}%
- \expandafter\syst_helpers_fast_process_comma_item
- \fi#2}
-
-\unexpanded\def\fastprocesscommalist[#1]#2% accepteert ook [\cs]
- {\let\syst_helpers_fast_process_comma_command#2%
- \expandafter\syst_helpers_fast_process_comma_item#1,],}% \relax
-
-\unexpanded\def\fastprocesscommacommand[#1]#2% accepteert ook [\cs]
- {\let\syst_helpers_fast_process_comma_command#2%
- \normalexpanded{\syst_helpers_fast_process_comma_item#1},],}% \relax
-
-% \def\rawdoifelseinset#1#2{\doifinstringelse{,#1,}{,#2,}}
-% \def\rawdoifinset #1#2{\doifinstring {,#1,}{,#2,}}
-
-\def\m_syst_two_commas{,,}
-
-\unexpanded\def\rawdoifelseinset#1%
- {\edef\m_syst_sub_string{,#1,}% expand #1 here
- \ifx\m_syst_sub_string\m_syst_two_commas
- \expandafter\thirdofthreearguments
- \else
- \expandafter\syst_helpers_raw_do_if_in_set_else
- \fi}
-
-\let\rawdoifinsetelse\rawdoifinsetelse
-
-\unexpanded\def\syst_helpers_raw_do_if_in_set_else#1%
- {\syst_helpers_do_if_in_string_else\m_syst_sub_string{,#1,}%
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\unexpanded\def\rawdoifinset#1%
- {\edef\m_syst_sub_string{,#1,}% expand #1 here
- \ifx\m_syst_sub_string\m_syst_two_commas
- \expandafter\gobbletwoarguments
- \else
- \expandafter\syst_helpers_raw_do_if_in_set
- \fi}
-
-\unexpanded\def\syst_helpers_raw_do_if_in_set#1%%
- {\syst_helpers_do_if_in_string_else\m_syst_sub_string{,#1,}%
- \expandafter\firstofoneargument
- \else
- \expandafter\gobbleoneargument
- \fi}
-
-%D Some more raw material:
-
-\def\syst_helpers_do_raw_process_action[#1][#2]%
- {\def\syst_helpers_do_do_raw_process_action##1,#1=>##2,##3^^^^0004%
- {\if##3@\else
- \def\m_syst_helpers_process_action{##2}%
- \fi}%
- \syst_helpers_do_do_raw_process_action,#2,#1=>,@^^^^0004}
-
-\unexpanded\def\rawprocessaction[#1]#2[#3]%
- {\edef\m_syst_string_one{#1}%
- \edef\m_syst_string_two{undefined}% better \!!undefined
- \let\m_syst_helpers_process_action\m_syst_string_two
- \ifx\m_syst_string_one\empty
- \expandafter\syst_helpers_do_raw_process_action\expandafter[\s!default][#3]%
- \else
- \expandafter\syst_helpers_do_raw_process_action\expandafter[\m_syst_string_one][#3]%
- \ifx\m_syst_helpers_process_action\m_syst_string_two
- \expandafter\syst_helpers_do_raw_process_action\expandafter[\s!unknown][#3]%
- \fi
- \fi
- \ifx\m_syst_helpers_process_action\m_syst_string_two
- \else
- \m_syst_helpers_process_action
- \fi}
-
-%D When we process the list \type {a,b,c,d,e}, the raw routine takes over 30\% less
-%D time, when we feed $20+$ character strings we gain about 20\%. Alternatives which
-%D use \type {\futurelet} perform worse. Part of the speedup is due to the \type
-%D {\let} and \type {\expandafter} in the test.
-%D
-%D \macros
-%D {dosetvalue,dosetevalue,dosetgvalue,docopyvalue,doresetvalue,
-%D dogetvalue}
-%D
-%D When we are going to do assignments, we have to take multi||linguality into account.
-%D For the moment we keep things simple and single||lingual.
-%D
-%D \starttyping
-%D \dosetvalue {label} {variable} {value}
-%D \dosetevalue {label} {variable} {value}
-%D \dosetgvalue {label} {variable} {value}
-%D \docopyvalue {to label} {from label} {variable}
-%D \doresetvalue {label} {variable}
-%D \stoptyping
-%D
-%D These macros are in fact auxiliary ones and are not meant for use outside the
-%D assignment macros.
-
-\def\dosetvalue#1#2% #3
- {\expandafter\def\csname#1#2\endcsname} % {#3}}
-
-\def\dosetevalue#1#2% #3
- {\expandafter\edef\csname#1#2\endcsname} % {#3}}
-
-\def\dosetgvalue#1#2% #3
- {\expandafter\gdef\csname#1#2\endcsname} % {#3}}
-
-\def\doresetvalue#1#2%
- {\expandafter\let\csname#1#2\endcsname\empty}
-
-\def\doignorevalue#1#2#3%
- {\expandafter\let\csname#1#2\endcsname\empty}
-
-\def\docopyvalue#1#2#3%
- {\expandafter\def\csname#1#3\endcsname{\csname#2#3\endcsname}}
-
-%D \macros
-%D {doassign,undoassign,doassignempty}
-%D
-%D Assignments are the backbone of \CONTEXT. Abhorred by the concept of style file
-%D hacking, we took a considerable effort in building a parameterized system.
-%D Unfortunately there is a price to pay in terms of speed. Compared to other
-%D packages and taking the functionality of \CONTEXT\ into account, the total size
-%D of the format file is still very acceptable. Now how are these assignments done.
-%D
-%D Assignments can be realized with:
-%D
-%D \starttyping
-%D \doassign[label][variable=value]
-%D \undoassign[label][variable=value]
-%D \stoptyping
-%D
-%D and:
-%D
-%D \starttyping
-%D \doassignempty[label][variable=value]
-%D \stoptyping
-%D
-%D Assignments like \type{\doassign} are compatible with:
-%D
-%D \starttyping
-%D \def\labelvariable{value}
-%D \stoptyping
-%D
-%D We do check for the presence of an \type{=} and loudly complain of it's missed. We
-%D will redefine this macro later on, when a more advanced message mechanism is
-%D implemented.
-
-\unexpanded\def\showassignerror#1#2%
- {\writestatus{setup}{missing or ungrouped '=' after '#1' in line #2}}
-
-\unexpanded\def\doassignempty[#1][#2=#3]%
- {\ifcsname#1#2\endcsname\else\dosetvalue{#1}{#2}{#3}\fi}
-
-%D \macros
-%D {getparameters,geteparameters,getgparameters,
-%D forgetparameters}
-%D
-%D Using the assignment commands directly is not our ideal of user friendly interfacing,
-%D so we take some further steps.
-%D
-%D \starttyping
-%D \getparameters [label] [...=...,...=...]
-%D \forgetparameters [label] [...=...,...=...]
-%D \stoptyping
-%D
-%D Again, the label identifies the category a variable belongs to. The second argument
-%D can be a comma separated list of assignments.
-%D
-%D \starttyping
-%D \getparameters
-%D [demo]
-%D [alfa=1,
-%D beta=2]
-%D \stoptyping
-%D
-%D is equivalent to
-%D
-%D \starttyping
-%D \def\demoalfa{1}
-%D \def\demobeta{2}
-%D \stoptyping
-%D
-%D
-%D In the pre||multi||lingual stadium \CONTEXT\ took the next approach. With
-%D
-%D \starttyping
-%D \def\??demo {@@demo}
-%D \def\!!alfa {alfa}
-%D \def\!!beta {beta}
-%D \stoptyping
-%D
-%D calling
-%D
-%D \starttyping
-%D \getparameters
-%D [\??demo]
-%D [\!!alfa=1,
-%D \!!beta=2]
-%D \stoptyping
-%D
-%D lead to:
-%D
-%D \starttyping
-%D \def\@@demoalfa{1}
-%D \def\@@demobeta{2}
-%D \stoptyping
-%D
-%D Because we want to be able to distinguish the \type{!!} pre||tagged user supplied
-%D variables from internal counterparts, we will introduce a slightly different tag
-%D in the multi||lingual modules. There we will use \type{c!} or \type{v!},
-%D depending on the context.
-%D
-%D By calling \type{doassign} directly, we save ourselves some argument passing
-%D and gain some speed. Whatever optimizations we do, this command will always be
-%D one of the bigger bottlenecks. The alternative \type{\geteparameters} --- it's
-%D funny to see that this alternative saw the light so lately --- can be used to do
-%D expanded assigments.
-
-\let\currentvalue\empty
-
-\unexpanded\def\getparameters {\dogetparameters\dosetvalue}
-\unexpanded\def\geteparameters {\dogetparameters\dosetevalue}
-\unexpanded\def\getgparameters {\dogetparameters\dosetgvalue}
-\unexpanded\def\getxparameters {\dogetparameters\dosetxvalue}
-\unexpanded\def\forgetparameters{\dogetparameters\doignorevalue}
-
-\let\getexpandedparameters\geteparameters
-
-\unexpanded\def\dogetparameters#1[#2]#3[#4%
- {\if\noexpand#4]%
- \expandafter\gobbleoneargument
- \else
- \let\setsomevalue#1%
- \def\syst_helpers_get_parameters_assign{\syst_helpers_get_parameters_assign_indeed#2}%
- \expandafter\syst_helpers_get_parameters
- \fi#4}
-
-\def\syst_helpers_get_parameters#1]%
- {\xprocesscommaitem#1,],^^^^0004}
-
-\def\syst_helpers_process_comma_item#1,#2% #2 takes space before ,
- {\if,#1,% dirty trick for testing #1=empty
- \expandafter\syst_helpers_process_comma_item
- \orelse\if]#1%
- \expandafter\gobbleoneargument
- \else
- \syst_helpers_get_parameters_assign^^^^0004#1==\empty^^^^0004%
- \expandafter\syst_helpers_process_comma_item
- \fi#2}
-
-\def\syst_helpers_assign_error#1#2#3%
- {\showassignerror{#2}{\the\inputlineno\space(#1)}}
-
-\def\syst_helpers_get_parameters_assign_normal#1^^^^0004#2=#3=#4#5^^^^0004%
- {\ifx\empty#2\empty
- \expandafter\syst_helpers_assign_error
- \orelse\ifx#4\empty
- \expandafter\syst_helpers_assign_error
- \else
- \expandafter\setsomevalue
- \fi
- {#1}{#2}{#3}}
-
-\def\syst_helpers_get_parameters_assign_error#1^^^^0004#2=#3=#4#5^^^^0004%
- {\ifx\empty#2\empty
- \expandafter\syst_helpers_assign_error
- \orelse\ifx#4\empty
- \expandafter\syst_helpers_assign_error
- \orelse\ifcsname#1#2\endcsname
- \expandafter\let\expandafter\currentvalue\csname#1#2\endcsname
- \expandafter\setsomevalue
- \else
- \let\currentvalue\empty
- \expandafter\setsomevalue
- \fi
- {#1}{#2}{#3}}
-
-\let\syst_helpers_get_parameters_assign_indeed\syst_helpers_get_parameters_assign_normal
-
-\unexpanded\def\doassign [#1][#2]{\let\setsomevalue\dosetvalue \syst_helpers_get_parameters_assign_indeed#1^^^^0004#2==\empty^^^^0004}
-\unexpanded\def\doeassign [#1][#2]{\let\setsomevalue\dosetevalue \syst_helpers_get_parameters_assign_indeed#1^^^^0004#2==\empty^^^^0004}
-\unexpanded\def\undoassign[#1][#2]{\let\setsomevalue\doresetvalue\syst_helpers_get_parameters_assign_indeed#1^^^^0004#2==\empty^^^^0004}
-
-%D \macros
-%D {processassignmentlist,processassignmentcommand,
-%D startprocessassignmentlist,startprocessassignmentcommand}
-%D
-%D For Wolfgang:
-%D
-%D \starttyping
-%D \def\showpair#1#2{key:#1, value:#2\par}
-%D \processassignmentlist[a=1,b=2]\showpair
-%D \stoptyping
-%D
-%D We can optimize this one if needed but it's not a core macro so hardly worth the
-%D trouble and tokens.
-
-\unexpanded\def\processassignmentlist[#1]#2% #2 == \command{key}{value]
- {\def\syst_helpers_process_assignment_entry##1{#2}% {##2}{##3} % namespace is ignored
- \dogetparameters\syst_helpers_process_assignment_entry[][#1]}
-
-\unexpanded\def\processassignmentcommand[#1]%
- {\normalexpanded{\processassignmentlist[#1]}}
-
-\unexpanded\def\startprocessassignmentlist[#1]#2\stopprocessassignmentlist
- {\def\currentassignmentlistcommand##1##2{\def\currentassignmentlistkey{##1}\def\currentassignmentlistvalue{##2}#2}%
- \processassignmentlist[#1]\currentassignmentlistcommand}
-
-\unexpanded\def\startprocessassignmentcommand[#1]#2\stopprocessassignmentcommand
- {\def\currentassignmentlistcommand##1##2{\def\currentassignmentlistkey{##1}\def\currentassignmentlistvalue{##2}#2}%
- \normalexpanded{\processassignmentlist[#1]}\currentassignmentlistcommand}
-
-%D \macros{currentvalue}
-%D
-%D Just in case a \type{\getparameter} argument itself ends up inside a \type
-%D {\write} or other expandable location, our new macro needs a default value.
-%D
-%D \starttyping
-%D \getparameters[xxx][aaa=bbb]\par
-%D \getparameters[xxx][=bbb]\par
-%D \getparameters[xxx][aaa=]\par
-%D \getparameters[xxx][=]\par
-%D \getparameters[xxx][aaa]\par
-%D \stoptyping
-
-%D \macros
-%D {expandparameters}
-%D
-%D Example usage:
-%D
-%D \startbuffer
-%D \getparameters[taco][name=taco]
-%D \convertcommand\taconame\to\ascii \ascii
-%D \expandparameters \getparameters[taco][name=\currentvalue\space hoekwater]
-%D \convertcommand\taconame\to\ascii \ascii
-%D \getparameters[taco][name=\currentvalue\space hoekwater]
-%D \convertcommand\taconame\to\ascii \ascii
-%D \stopbuffer
-%D
-%D \typebuffer
-%D \startlines
-%D \getbuffer
-%D \stoplines
-%D
-%D Here we hook in the code (beware, this is the optimized get **):
-
-\def\syst_helpers_get_parameters_normal#1]%
- {\syst_helpers_process_comma_item#1,],^^^^0004}
-
-\def\syst_helpers_get_parameters_expanded#1]%
- {\let\dosetnvalue\setsomevalue
- \let\setsomevalue\dosetevalue
- \let\syst_helpers_get_parameters_assign_indeed\syst_helpers_get_parameters_assign_error
- \let\setsomevalue\dosetevalue
- \syst_helpers_process_comma_item#1,],^^^^0004%
- \let\syst_helpers_get_parameters_assign_indeed\syst_helpers_get_parameters_assign_normal
- \let\setsomevalue\dosetnvalue
- \let\syst_helpers_get_parameters\syst_helpers_get_parameters_normal
- \let\currentvalue\empty}
-
-\let\syst_helpers_get_parameters\syst_helpers_get_parameters_normal % **
-
-\unexpanded\def\expandparameters
- {\let\syst_helpers_get_parameters\syst_helpers_get_parameters_expanded}
-
-%D \macros
-%D {getemptyparameters}
-%D
-%D Sometimes we explicitly want variables to default to an empty string, so we
-%D welcome:
-%D
-%D \starttyping
-%D \getemptyparameters [label] [...=...,...=...]
-%D \stoptyping
-
-\unexpanded\def\getemptyparameters[#1]#2[#3]%
- {\def\syst_helpers_get_empty_parameters##1{\doassignempty[#1][##1]}%
- \processcommalist[#3]\syst_helpers_get_empty_parameters}
-
-%D \macros
-%D {copyparameters}
-%D
-%D Some \CONTEXT\ commands take their default setups from others. All commands that
-%D are able to provide backgounds or rules around some content, for instance default
-%D to the standard command for ruled boxes. Is situations like this we can use:
-%D
-%D \starttyping
-%D \copyparameters [to-label] [from-label] [name1,name2,...]
-%D \stoptyping
-%D
-%D For instance
-%D
-%D \starttyping
-%D \copyparameters
-%D [internal][external]
-%D [alfa,beta]
-%D \stoptyping
-%D
-%D Leads to:
-%D
-%D \starttyping
-%D \def\internalalfa {\externalalfa}
-%D \def\internalbeta {\externalbeta}
-%D \stoptyping
-%D
-%D By using \type {\docopyvalue} we've prepared this command for use in a
-%D multi||lingual environment.
-
-\unexpanded\def\copyparameters[#1]#2[#3]#4[#5]%
- {\doifnot{#1}{#3}
- {\def\syst_helpers_copy_parameter{\docopyvalue{#1}{#3}}% ##1
- \processcommalist[#5]\syst_helpers_copy_parameter}}
-
-%D \macros
-%D {ifparameters,checkparameters}
-%D
-%D A slightly different one is \type {\checkparameters}, which also checks on the
-%D presence of a~\type {=}.
-%D
-%D The boolean \type {\ifparameters} can be used afterwards. Combining both in one
-%D \type {\if}||macro would lead to problems with nested \type {\if}'s.
-%D
-%D \starttyping
-%D \checkparameters[argument]
-%D \stoptyping
-
-\newif\ifparameters
-
-\def\syst_helpers_check_parameters#1=#2#3^^^^0004%
- {\if#2^^^^0003\parametersfalse\else\parameterstrue\fi}
-
-\unexpanded\def\checkparameters[#1]%
- {\syst_helpers_check_parameters#1=^^^^0003^^^^0003^^^^0004}
-
-%D \macros
-%D {getfromcommalist,getfromcommacommand,
-%D commalistelement,
-%D getcommalistsize,getcommacommandsize}
-%D
-%D It's possible to get an element from a commalist or a command representing
-%D a commalist.
-%D
-%D \starttyping
-%D \getfromcommalist [string] [n]
-%D \getfromcommacommand [string,\strings,string,...] [n]
-%D \stoptyping
-%D
-%D The difference betwee the two of them is the same as the difference between
-%D \type {\processcomma...}. The found string is stored in \type
-%D {\commalistelement}.
-%D
-%D We can calculate the size of a comma separated list by using:
-%D
-%D \starttyping
-%D \getcommalistsize [string,string,...]
-%D \getcommacommandsize [string,\strings,string,...]
-%D \stoptyping
-%D
-%D Afterwards, the length is available in the macro \type {\commalistsize}
-%D (not a \COUNTER).
-
-\newcount\commalistcounter
-
-\def\commalistsize{0}
-
-\def\syst_helpers_get_comma_list_size#1%
- {\advance\commalistcounter\plusone}
-
-\unexpanded\def\getcommalistsize#1]% don't loose [{#1}]
- {\commalistcounter\zerocount
- \processcommalist#1]\syst_helpers_get_comma_list_size % was [{#1}]
- \edef\commalistsize{\the\commalistcounter}}
-
-% \def\getcommacommandsize[#1]%
-% {\edef\commacommand{#1}%
-% \scratchtoks\expandafter{\expandafter[\commacommand]}%
-% \expandafter\getcommalistsize\the\scratchtoks }
-
-\unexpanded\def\getcommacommandsize[#1]%
- {\normalexpanded{\getcommalistsize[#1]}}
-
-\def\syst_helpers_get_from_comma_list#1%
- {\advance\commalistcounter \minusone
- \ifcase\commalistcounter
- \def\commalistelement{#1}%
- \expandafter\quitcommalist
- \fi}
-
-\unexpanded\def\getfromcommalist[#1]#2[#3]%
- {\let\commalistelement\empty
- \commalistcounter#3\relax
- \processcommalist[#1]\syst_helpers_get_from_comma_list}
-
-\unexpanded\def\getfromcommacommand[#1]%
- {\normalexpanded{\getfromcommalist[#1]}}
-
-%D Watertight (and efficient) solutions are hard to find, due to the handling of
-%D braces during parameters passing and scanning. Nevertheless:
-%D
-%D \startbuffer
-%D \def\dosomething#1{(#1=\commalistsize) }
-%D
-%D \getcommalistsize [\hbox{$a,b,c,d,e,f$}] \dosomething 1
-%D \getcommalistsize [{a,b,c,d,e,f}] \dosomething 1
-%D \getcommalistsize [{a,b,c},d,e,f] \dosomething 4
-%D \getcommalistsize [a,b,{c,d,e},f] \dosomething 4
-%D \getcommalistsize [a{b,c},d,e,f] \dosomething 4
-%D \getcommalistsize [{a,b}c,d,e,f] \dosomething 4
-%D \getcommalistsize [] \dosomething 0
-%D \getcommalistsize [{[}] \dosomething 1
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D reports:
-%D
-%D \getbuffer
-
-%D \macros
-%D {dogetcommalistelement,dogetcommacommandelement}
-%D
-%D For low level (fast) purposes, we can also use the next alternative, which can
-%D handle 8~elements at most.
-%D
-%D \starttyping
-%D \dogetcommalistelement1\from a,b,c\to\commalistelement
-%D \stoptyping
-
-\def\syst_helpers_get_comma_list_element#1\from#2,#3,#4,#5,#6,#7,#8\to#9%
- {\edef#9{\ifcase#1\relax\or#2\or#3\or#4\or#5\or#6\or#7\or#8\fi}}
-
-\def\dogetcommacommandelement#1\from#2\to%
- {\expandafter\syst_helpers_get_comma_list_element\expandafter#1\expandafter\from#2,,,,,,\to}
-
-%D \macros
-%D {dosingleargument,dodoubleargument,dotripleargument,
-%D doquadrupleargument,doquintupleargument,dosixtupleargument,
-%D doseventupleargument}
-%D
-%D When working with delimited arguments, spaces and lineendings can interfere. The
-%D next set of macros uses \TEX' internal scanner for grabbing everything between
-%D arguments. Forgive me the funny names.
-%D
-%D \starttyping
-%D \dosingleargument\commando = \commando[#1]
-%D \dodoubleargument\commando = \commando[#1][#2]
-%D \dotripleargument\commando = \commando[#1][#2][#3]
-%D \doquadrupleargument\commando = \commando[#1][#2][#3][#4]
-%D \doquintupleargument\commando = \commando[#1][#2][#3][#4][#5]
-%D \dosixtupleargument\commando = \commando[#1][#2][#3][#4][#5][#6]
-%D \doseventupleargument\command = \commando[#1][#2][#3][#4][#5][#6][#7]
-%D \stoptyping
-%D
-%D These macros are used in the following way:
-%D
-%D \starttyping
-%D \def\dosetupsomething[#1][#2]%
-%D {... #1 ... #2 ...}
-%D
-%D \unexpanded\def\setupsomething
-%D {\dodoubleargument\dosetupsomething}
-%D \stoptyping
-%D
-%D The implementation can be surprisingly simple and needs no
-%D further explanation, like:
-%D
-%D \starttyping
-%D \def\dosingleargument#1[#2]%
-%D {#1[#2]}
-%D \def\dotripleargument#1[#2]#3[#4]#5[#6]%
-%D {#1[#2][#4][#6]}
-%D \def\doquintupleargument#1%
-%D {\def\dodoquintupleargument[##1]##2[##3]##4[##5]##6[##7]##8[##9]%
-%D {#1[##1][##3][##5][##7][##9]}%
-%D \dodoquintupleargument}
-%D \stoptyping
-%D
-%D Because \TEX\ accepts 9~arguments at most, we have to use two||step solution when
-%D getting five or more arguments.
-%D
-%D When developing more and more of the real \CONTEXT, we started using some
-%D alternatives that provided empty arguments (in fact optional ones) whenever the
-%D user failed to supply them. Because this more complicated macros enable us to do
-%D some checking, we reimplemented the non||empty ones.
-
-%D \macros
-%D {iffirstagument,ifsecondargument,ifthirdargument,
-%D iffourthargument,iffifthargument,ifsixthargument,
-%D ifseventhargument}
-%D
-%D We use some signals for telling the calling macros if all wanted arguments are
-%D indeed supplied by the user.
-
-\newif\iffirstargument
-\newif\ifsecondargument
-\newif\ifthirdargument
-\newif\iffourthargument
-\newif\iffifthargument
-\newif\ifsixthargument
-\newif\ifseventhargument
-
-%D \macros
-%D {dosingleempty,dodoubleempty,dotripleempty,
-%D doquadrupleempty,doquintupleempty,dosixtupeempty,
-%D doseventupleempty}
-%D
-%D The empty argument supplying macros mentioned before, look like:
-%D
-%D \starttyping
-%D \dosingleempty \command
-%D \dodoubleempty \command
-%D \dotripleempty \command
-%D \doquadrupleempty \command
-%D \doquintupleempty \command
-%D \dosixtuple_empty \command
-%D \doseventupleempty\command
-%D \stoptyping
-%D
-%D So \type{\dodoubleempty} leads to:
-%D
-%D \starttyping
-%D \command[#1][#2]
-%D \command[#1][]
-%D \command[][]
-%D \stoptyping
-%D
-%D Depending of the generousity of the user. Afterwards one can use the \type
-%D {\if...argument} boolean. For novice: watch the stepwise doubling of \type {#}'s.
-
-%D Common:
-
-\newtoks\t_syst_aux
-
-\def\syst_helpers_single_empty_one_yes {\firstargumenttrue \the\t_syst_aux}
-\def\syst_helpers_double_empty_two_yes {\secondargumenttrue \the\t_syst_aux}
-\def\syst_helpers_triple_empty_three_yes {\thirdargumenttrue \the\t_syst_aux}
-\def\syst_helpers_quadruple_empty_four_yes {\fourthargumenttrue \the\t_syst_aux}
-\def\syst_helpers_quintuple_empty_five_yes {\fifthargumenttrue \the\t_syst_aux}
-\def\syst_helpers_sixtuple_empty_six_yes {\sixthargumenttrue \the\t_syst_aux}
-\def\syst_helpers_seventuple_empty_seven_yes{\seventhargumenttrue\the\t_syst_aux}
-
-%D Single:
-
-\unexpanded\def\dosingleempty#1%
- {%syst_helpers_argument_reset
- \t_syst_aux{#1}%
- \futureexpand[\syst_helpers_single_empty_one_yes\syst_helpers_single_empty_one_nop}
-
-\def\syst_helpers_single_empty_one_nop
- {\firstargumentfalse
- \the\t_syst_aux[]}
-
-%D Double
-
-\unexpanded\def\dodoubleempty#1%
- {%syst_helpers_argument_reset
- \t_syst_aux{#1}%
- \futureexpand[\syst_helpers_double_empty_one_yes\syst_helpers_double_empty_one_nop}
-
-\def\syst_helpers_double_empty_one_yes[#1]%
- {\firstargumenttrue
- \toksapp\t_syst_aux{[{#1}]}%
- \futureexpand[\syst_helpers_double_empty_two_yes\syst_helpers_double_empty_two_nop}
-
-\def\syst_helpers_double_empty_one_nop
- {\firstargumentfalse
- \secondargumentfalse
- \the\t_syst_aux[][]}
-
-\def\syst_helpers_double_empty_two_nop
- {\secondargumentfalse
- \the\t_syst_aux[]}
-
-% Triple
-
-\unexpanded\def\dotripleempty#1%
- {%syst_helpers_argument_reset
- \t_syst_aux{#1}%
- \futureexpand[\syst_helpers_triple_empty_one_yes\syst_helpers_triple_empty_one_nop}
-
-\def\syst_helpers_triple_empty_one_yes[#1]%
- {\firstargumenttrue
- \toksapp\t_syst_aux{[{#1}]}%
- \futureexpand[\syst_helpers_triple_empty_two_yes\syst_helpers_triple_empty_two_nop}
-
-\def\syst_helpers_triple_empty_two_yes[#1]%
- {\secondargumenttrue
- \toksapp\t_syst_aux{[{#1}]}%
- \futureexpand[\syst_helpers_triple_empty_three_yes\syst_helpers_triple_empty_three_nop}
-
-\def\syst_helpers_triple_empty_one_nop
- {\firstargumentfalse
- \secondargumentfalse
- \thirdargumentfalse
- \the\t_syst_aux[][][]}
-
-\def\syst_helpers_triple_empty_two_nop
- {\secondargumentfalse
- \thirdargumentfalse
- \the\t_syst_aux[][]}
-
-\def\syst_helpers_triple_empty_three_nop
- {\thirdargumentfalse
- \the\t_syst_aux[]}
-
-%D Quadruple:
-
-\unexpanded\def\doquadrupleempty#1%
- {%syst_helpers_argument_reset
- \t_syst_aux{#1}%
- \futureexpand[\syst_helpers_quadruple_empty_one_yes\syst_helpers_quadruple_empty_one_nop}
-
-\def\syst_helpers_quadruple_empty_one_yes[#1]%
- {\firstargumenttrue
- \toksapp\t_syst_aux{[{#1}]}%
- \futureexpand[\syst_helpers_quadruple_empty_two_yes\syst_helpers_quadruple_empty_two_nop}
-
-\def\syst_helpers_quadruple_empty_two_yes[#1]%
- {\secondargumenttrue
- \toksapp\t_syst_aux{[{#1}]}%
- \futureexpand[\syst_helpers_quadruple_empty_three_yes\syst_helpers_quadruple_empty_three_nop}
-
-\def\syst_helpers_quadruple_empty_three_yes[#1]%
- {\thirdargumenttrue
- \toksapp\t_syst_aux{[{#1}]}%
- \futureexpand[\syst_helpers_quadruple_empty_four_yes\syst_helpers_quadruple_empty_four_nop}
-
-\def\syst_helpers_quadruple_empty_one_nop
- {\firstargumentfalse
- \secondargumentfalse
- \thirdargumentfalse
- \fourthargumentfalse
- \the\t_syst_aux[][][][]}
-
-\def\syst_helpers_quadruple_empty_two_nop
- {\secondargumentfalse
- \thirdargumentfalse
- \fourthargumentfalse
- \the\t_syst_aux[][][]}
-
-\def\syst_helpers_quadruple_empty_three_nop
- {\thirdargumentfalse
- \fourthargumentfalse
- \the\t_syst_aux[][]}
-
-\def\syst_helpers_quadruple_empty_four_nop
- {\fourthargumentfalse
- \the\t_syst_aux[]}
-
-%D Quintuple:
-
-\unexpanded\def\doquintupleempty#1%
- {%syst_helpers_argument_reset
- \t_syst_aux{#1}%
- \futureexpand[\syst_helpers_quintuple_empty_one_yes\syst_helpers_quintuple_empty_one_nop}
-
-\def\syst_helpers_quintuple_empty_one_yes[#1]%
- {\firstargumenttrue
- \toksapp\t_syst_aux{[{#1}]}%
- \futureexpand[\syst_helpers_quintuple_empty_two_yes\syst_helpers_quintuple_empty_two_nop}
-
-\def\syst_helpers_quintuple_empty_two_yes[#1]%
- {\secondargumenttrue
- \toksapp\t_syst_aux{[{#1}]}%
- \futureexpand[\syst_helpers_quintuple_empty_three_yes\syst_helpers_quintuple_empty_three_nop}
-
-\def\syst_helpers_quintuple_empty_three_yes[#1]%
- {\thirdargumenttrue
- \toksapp\t_syst_aux{[{#1}]}%
- \futureexpand[\syst_helpers_quintuple_empty_four_yes\syst_helpers_quintuple_empty_four_nop}
-
-\def\syst_helpers_quintuple_empty_four_yes[#1]%
- {\fourthargumenttrue
- \toksapp\t_syst_aux{[{#1}]}%
- \futureexpand[\syst_helpers_quintuple_empty_five_yes\syst_helpers_quintuple_empty_five_nop}
-
-\def\syst_helpers_quintuple_empty_one_nop
- {\firstargumentfalse
- \secondargumentfalse
- \thirdargumentfalse
- \fourthargumentfalse
- \fifthargumentfalse
- \the\t_syst_aux[][][][][]}
-
-\def\syst_helpers_quintuple_empty_two_nop
- {\secondargumentfalse
- \thirdargumentfalse
- \fourthargumentfalse
- \fifthargumentfalse
- \the\t_syst_aux[][][][]}
-
-\def\syst_helpers_quintuple_empty_three_nop
- {\thirdargumentfalse
- \fourthargumentfalse
- \fifthargumentfalse
- \the\t_syst_aux[][][]}
-
-\def\syst_helpers_quintuple_empty_four_nop
- {\fourthargumentfalse
- \fifthargumentfalse
- \the\t_syst_aux[][]}
-
-\def\syst_helpers_quintuple_empty_five_nop
- {\fifthargumentfalse
- \the\t_syst_aux[]}
-
-%D Sixtuple:
-
-\unexpanded\def\dosixtupleempty#1%
- {%syst_helpers_argument_reset
- \t_syst_aux{#1}%
- \futureexpand[\syst_helpers_sixtuple_empty_one_yes\syst_helpers_sixtuple_empty_one_nop}
-
-\def\syst_helpers_sixtuple_empty_one_yes[#1]%
- {\firstargumenttrue
- \toksapp\t_syst_aux{[{#1}]}%
- \futureexpand[\syst_helpers_sixtuple_empty_two_yes\syst_helpers_sixtuple_empty_two_nop}
-
-\def\syst_helpers_sixtuple_empty_two_yes[#1]%
- {\secondargumenttrue
- \toksapp\t_syst_aux{[{#1}]}%
- \futureexpand[\syst_helpers_sixtuple_empty_three_yes\syst_helpers_sixtuple_empty_three_nop}
-
-\def\syst_helpers_sixtuple_empty_three_yes[#1]%
- {\thirdargumenttrue
- \toksapp\t_syst_aux{[{#1}]}%
- \futureexpand[\syst_helpers_sixtuple_empty_four_yes\syst_helpers_sixtuple_empty_four_nop}
-
-\def\syst_helpers_sixtuple_empty_four_yes[#1]%
- {\fourthargumenttrue
- \toksapp\t_syst_aux{[{#1}]}%
- \futureexpand[\syst_helpers_sixtuple_empty_five_yes\syst_helpers_sixtuple_empty_five_nop}
-
-\def\syst_helpers_sixtuple_empty_five_yes[#1]%
- {\fifthargumenttrue
- \toksapp\t_syst_aux{[{#1}]}%
- \futureexpand[\syst_helpers_sixtuple_empty_six_yes\syst_helpers_sixtuple_empty_six_nop}
-
-\def\syst_helpers_sixtuple_empty_one_nop
- {\firstargumentfalse
- \secondargumentfalse
- \thirdargumentfalse
- \fourthargumentfalse
- \fifthargumentfalse
- \sixthargumentfalse
- \the\t_syst_aux[][][][][][]}
-
-\def\syst_helpers_sixtuple_empty_two_nop
- {\secondargumentfalse
- \thirdargumentfalse
- \fourthargumentfalse
- \fifthargumentfalse
- \sixthargumentfalse
- \the\t_syst_aux[][][][][]}
-
-\def\syst_helpers_sixtuple_empty_three_nop
- {\thirdargumentfalse
- \fourthargumentfalse
- \fifthargumentfalse
- \sixthargumentfalse
- \the\t_syst_aux[][][][]}
-
-\def\syst_helpers_sixtuple_empty_four_nop
- {\fourthargumentfalse
- \fifthargumentfalse
- \sixthargumentfalse
- \the\t_syst_aux[][][]}
-
-\def\syst_helpers_sixtuple_empty_five_nop
- {\fifthargumentfalse
- \sixthargumentfalse
- \the\t_syst_aux[][]}
-
-\def\syst_helpers_sixtuple_empty_six_nop
- {\sixthargumentfalse
- \the\t_syst_aux[]}
-
-%D Seventuple:
-
-\unexpanded\def\doseventupleempty#1%
- {%syst_helpers_argument_reset
- \t_syst_aux{#1}%
- \futureexpand[\syst_helpers_seventuple_empty_one_yes\syst_helpers_seventuple_empty_one_nop}
-
-\def\syst_helpers_seventuple_empty_one_yes[#1]%
- {\firstargumenttrue
- \toksapp\t_syst_aux{[{#1}]}%
- \futureexpand[\syst_helpers_seventuple_empty_two_yes\syst_helpers_seventuple_empty_two_nop}
-
-\def\syst_helpers_seventuple_empty_two_yes[#1]%
- {\secondargumenttrue
- \toksapp\t_syst_aux{[{#1}]}%
- \futureexpand[\syst_helpers_seventuple_empty_three_yes\syst_helpers_seventuple_empty_three_nop}
-
-\def\syst_helpers_seventuple_empty_three_yes[#1]%
- {\thirdargumenttrue
- \toksapp\t_syst_aux{[{#1}]}%
- \futureexpand[\syst_helpers_seventuple_empty_four_yes\syst_helpers_seventuple_empty_four_nop}
-
-\def\syst_helpers_seventuple_empty_four_yes[#1]%
- {\fourthargumenttrue
- \toksapp\t_syst_aux{[{#1}]}%
- \futureexpand[\syst_helpers_seventuple_empty_five_yes\syst_helpers_seventuple_empty_five_nop}
-
-\def\syst_helpers_seventuple_empty_five_yes[#1]%
- {\fifthargumenttrue
- \toksapp\t_syst_aux{[{#1}]}%
- \futureexpand[\syst_helpers_seventuple_empty_six_yes\syst_helpers_seventuple_empty_six_nop}
-
-\def\syst_helpers_seventuple_empty_six_yes[#1]%
- {\sixthargumenttrue
- \toksapp\t_syst_aux{[{#1}]}%
- \futureexpand[\syst_helpers_seventuple_empty_seven_yes\syst_helpers_seventuple_empty_seven_nop}
-
-\def\syst_helpers_seventuple_empty_one_nop
- {\firstargumentfalse
- \secondargumentfalse
- \thirdargumentfalse
- \fourthargumentfalse
- \fifthargumentfalse
- \sixthargumentfalse
- \seventhargumentfalse
- \the\t_syst_aux[][][][][][][]}
-
-\def\syst_helpers_seventuple_empty_two_nop
- {\secondargumentfalse
- \thirdargumentfalse
- \fourthargumentfalse
- \fifthargumentfalse
- \sixthargumentfalse
- \seventhargumentfalse
- \the\t_syst_aux[][][][][][]}
-
-\def\syst_helpers_seventuple_empty_three_nop
- {\thirdargumentfalse
- \fourthargumentfalse
- \fifthargumentfalse
- \sixthargumentfalse
- \seventhargumentfalse
- \the\t_syst_aux[][][][][]}
-
-\def\syst_helpers_seventuple_empty_four_nop
- {\fourthargumentfalse
- \fifthargumentfalse
- \sixthargumentfalse
- \seventhargumentfalse
- \the\t_syst_aux[][][][]}
-
-\def\syst_helpers_seventuple_empty_five_nop
- {\fifthargumentfalse
- \sixthargumentfalse
- \seventhargumentfalse
- \the\t_syst_aux[][][]}
-
-\def\syst_helpers_seventuple_empty_six_nop
- {\sixthargumentfalse
- \seventhargumentfalse
- \the\t_syst_aux[][]}
-
-\def\syst_helpers_seventuple_empty_seven_nop
- {\seventhargumentfalse
- \the\t_syst_aux[]}
-
-%D Aliases:
-
-\let\dosingleargument \dosingleempty
-\let\dodoubleargument \dodoubleempty
-\let\dotripleargument \dotripleempty
-\let\doquadrupleargument \doquadrupleempty
-\let\doquintupleargument \doquintupleempty
-\let\dosixtupleargument \dosixtupleempty
-\let\doseventupleargument\doseventupleempty
-
-%D \macros
-%D {strippedcsname}
-%D
-%D The next macro can be very useful when using \type{\csname} like in:
-%D
-%D \starttyping
-%D \csname if\strippedcsname\something\endcsname
-%D \stoptyping
-%D
-%D This expands to \type{\ifsomething}.
-
-% \def\strippedcsname
-% {\expandafter\gobbleoneargument\string}
-
-\let\strippedcsname\csstring
-
-%D \macros
-%D {complexorsimple,complexorsimpleempty}
-%D
-%D Setups can be optional. A command expecting a setup is prefixed by \type
-%D {\complex}, a command without one gets the prefix \type {\simple}. Commands like
-%D this can be defined by:
-%D
-%D \starttyping
-%D \complexorsimple\command
-%D \stoptyping
-%D
-%D When \type{\command} is followed by a \type{[setup]}, then
-%D
-%D \starttyping
-%D \complexcommand [setup]
-%D \stoptyping
-%D
-%D executes, else we get
-%D
-%D \starttyping
-%D \simplecommand
-%D \stoptyping
-%D
-%D An alternative for \type{\complexorsimple} is:
-%D
-%D \starttyping
-%D \complexorsimpleempty {command}
-%D \stoptyping
-%D
-%D Depending on the presence of \type{[setup]}, this one leads to one of:
-%D
-%D \starttyping
-%D \complexcommando [setup]
-%D \complexcommando []
-%D \stoptyping
-%D
-%D Many \CONTEXT\ commands started as complex or simple ones, but changed into more
-%D versatile (more object oriented) ones using the \type {\get..argument} commands.
-
-\unexpanded\def\complexorsimple#1%
- {% \relax % prevents lookahead, brrr
- \doifelsenextoptional
- {\firstargumenttrue \csname\s!complex\csstring#1\endcsname}
- {\firstargumentfalse\csname\s!simple \csstring#1\endcsname}}
-
-\unexpanded\def\complexorsimpleempty#1%
- {% \relax % prevents lookahead, brrr
- \doifelsenextoptional
- {\firstargumenttrue \csname\s!complex\csstring#1\endcsname}
- {\firstargumentfalse\csname\s!complex\csstring#1\endcsname[]}}
-
-%D \macros
-%D {definecomplexorsimple,definecomplexorsimpleempty}
-%D
-%D The previous commands are used that often that we found it worthwile to offer two
-%D more alternatives. Watch the build in protection.
-
-\unexpanded\def\syst_helpers_complex_or_simple#1#2%
- {\doifelsenextoptional{\firstargumenttrue#1}{\firstargumentfalse#2}}
-
-\unexpanded\def\syst_helpers_complex_or_simple_empty#1%
- {\doifelsenextoptional{\firstargumenttrue#1}{\firstargumentfalse#1[]}}
-
-\unexpanded\def\definecomplexorsimple#1%
- {\unexpanded\edef#1{\syst_helpers_complex_or_simple
- \expandafter\noexpand\csname\s!complex\csstring#1\endcsname
- \expandafter\noexpand\csname\s!simple \csstring#1\endcsname}}
-
-\unexpanded\def\definecomplexorsimpleempty#1%
- {\unexpanded\edef#1{\syst_helpers_complex_or_simple_empty
- \expandafter\noexpand\csname\s!complex\csstring#1\endcsname}}
-
-%D These commands are called as:
-%D
-%D \starttyping
-%D \definecomplexorsimple\command
-%D \stoptyping
-%D
-%D Of course, we must have available
-%D
-%D \starttyping
-%D \def\complexcommand[#1]{...}
-%D \def\simplecommand {...}
-%D \stoptyping
-%D
-%D Using this construction saves a few string now and then.
-
-%D \macros
-%D {dosinglegroupempty,dodoublegroupempty,dotriplegroupempty,
-%D doquadruplegroupempty, doquintuplegroupempty}
-%D
-%D We've already seen some commands that take care of
-%D optional arguments between \type{[]}. The next two commands
-%D handle the ones with \type{{}}. They are called as:
-%D
-%D \starttyping
-%D \dosinglegroupempty \ineedONEargument
-%D \dodoublegroupempty \ineedTWOarguments
-%D \dotriplegroupempty \ineedTHREEarguments
-%D \doquadruplegroupempty \ineedFOURarguments
-%D \doquintuplegroupempty \ineedFIVEarguments
-%D \stoptyping
-%D
-%D We can add additional definitions later when we have defined \type {\appendtoks}.
-
-\newconditional\c_syst_helpers_permit_spaces_between_groups
-
-\unexpanded\def \permitspacesbetweengroups{\settrue \c_syst_helpers_permit_spaces_between_groups}
-\unexpanded\def\dontpermitspacesbetweengroups{\setfalse\c_syst_helpers_permit_spaces_between_groups}
-
-\dontpermitspacesbetweengroups
-
-%D We can avoid the nasty if handling in \type {syst-gen} by splitting the lot in
-%D pieces so that we have no nested \type {\nextarguments} potentially being an
-%D \type {conditional} token. Okay, these macros are not called that often but it
-%D saves crap when tracing.
-
-\unexpanded\def\dosinglegroupempty#1%
- {\t_syst_aux{#1}%
- \futureexpand\bgroup\syst_helpers_single_empty_one_yes\syst_helpers_single_group_empty_one_nop}
-
-\def\syst_helpers_single_group_empty_one_nop
- {\firstargumentfalse
- \the\t_syst_aux{}}
-
-\unexpanded\def\dodoublegroupempty#1%
- {\t_syst_aux{#1}%
- \futureexpand\bgroup\syst_helpers_group_double_empty_one_yes\syst_helpers_group_double_empty_one_nop}
-
-\def\syst_helpers_group_double_empty_one_yes#1%
- {\firstargumenttrue
- \toksapp\t_syst_aux{{#1}}%
- \futureexpand\bgroup\syst_helpers_double_empty_two_yes\syst_helpers_group_double_empty_two_nop}
-
-\def\syst_helpers_group_double_empty_one_nop
- {\firstargumentfalse
- \secondargumentfalse
- \the\t_syst_aux{}{}}
-
-\def\syst_helpers_group_double_empty_two_nop
- {\secondargumentfalse
- \the\t_syst_aux{}}
-
-\unexpanded\def\dotriplegroupempty#1%
- {\t_syst_aux{#1}%
- \futureexpand\bgroup\syst_helpers_group_triple_empty_one_yes\syst_helpers_group_triple_empty_one_nop}
-
-\def\syst_helpers_group_triple_empty_one_yes#1%
- {\firstargumenttrue
- \toksapp\t_syst_aux{{#1}}%
- \futureexpand\bgroup\syst_helpers_group_triple_empty_two_yes\syst_helpers_group_triple_empty_two_nop}
-
-\def\syst_helpers_group_triple_empty_two_yes#1%
- {\secondargumenttrue
- \toksapp\t_syst_aux{{#1}}%
- \futureexpand\bgroup\syst_helpers_triple_empty_three_yes\syst_helpers_group_triple_empty_three_nop}
-
-\def\syst_helpers_group_triple_empty_one_nop
- {\firstargumentfalse
- \secondargumentfalse
- \thirdargumentfalse
- \the\t_syst_aux{}{}{}}
-
-\def\syst_helpers_group_triple_empty_two_nop
- {\secondargumentfalse
- \thirdargumentfalse
- \the\t_syst_aux{}{}}
-
-\def\syst_helpers_group_triple_empty_three_nop
- {\thirdargumentfalse
- \the\t_syst_aux{}}
-
-\unexpanded\def\doquadruplegroupempty#1%
- {\t_syst_aux{#1}%
- \futureexpand\bgroup\syst_helpers_group_quadruple_empty_one_yes\syst_helpers_group_quadruple_empty_one_nop}
-
-\def\syst_helpers_group_quadruple_empty_one_yes#1%
- {\firstargumenttrue
- \toksapp\t_syst_aux{{#1}}%
- \futureexpand\bgroup\syst_helpers_group_quadruple_empty_two_yes\syst_helpers_group_quadruple_empty_two_nop}
-
-\def\syst_helpers_group_quadruple_empty_two_yes#1%
- {\secondargumenttrue
- \toksapp\t_syst_aux{{#1}}%
- \futureexpand\bgroup\syst_helpers_group_quadruple_empty_three_yes\syst_helpers_group_quadruple_empty_three_nop}
-
-\def\syst_helpers_group_quadruple_empty_three_yes#1%
- {\thirdargumenttrue
- \toksapp\t_syst_aux{{#1}}%
- \futureexpand\bgroup\syst_helpers_quadruple_empty_four_yes\syst_helpers_group_quadruple_empty_four_nop}
-
-\def\syst_helpers_group_quadruple_empty_one_nop
- {\firstargumentfalse
- \secondargumentfalse
- \thirdargumentfalse
- \fourthargumentfalse
- \the\t_syst_aux{}{}{}{}}
-
-\def\syst_helpers_group_quadruple_empty_two_nop
- {\secondargumentfalse
- \thirdargumentfalse
- \fourthargumentfalse
- \the\t_syst_aux{}{}{}}
-
-\def\syst_helpers_group_quadruple_empty_three_nop
- {\thirdargumentfalse
- \fourthargumentfalse
- \the\t_syst_aux{}{}}
-
-\def\syst_helpers_group_quadruple_empty_four_nop
- {\fourthargumentfalse
- \the\t_syst_aux{}}
-
-\unexpanded\def\doquintuplegroupempty#1%
- {\t_syst_aux{#1}%
- \futureexpand\bgroup\syst_helpers_group_quintuple_empty_one_yes\syst_helpers_group_quintuple_empty_one_nop}
-
-\def\syst_helpers_group_quintuple_empty_one_yes#1%
- {\firstargumenttrue
- \toksapp\t_syst_aux{{#1}}%
- \futureexpand\bgroup\syst_helpers_group_quintuple_empty_two_yes\syst_helpers_group_quintuple_empty_two_nop}
-
-\def\syst_helpers_group_quintuple_empty_two_yes#1%
- {\secondargumenttrue
- \toksapp\t_syst_aux{{#1}}%
- \futureexpand\bgroup\syst_helpers_group_quintuple_empty_three_yes\syst_helpers_group_quintuple_empty_three_nop}
-
-\def\syst_helpers_group_quintuple_empty_three_yes#1%
- {\thirdargumenttrue
- \toksapp\t_syst_aux{{#1}}%
- \futureexpand\bgroup\syst_helpers_group_quintuple_empty_four_yes\syst_helpers_group_quintuple_empty_four_nop}
-
-\def\syst_helpers_group_quintuple_empty_four_yes#1%
- {\fourthargumenttrue
- \toksapp\t_syst_aux{{#1}}%
- \futureexpand\bgroup\syst_helpers_quintuple_empty_five_yes\syst_helpers_group_quintuple_empty_five_nop}
-
-\def\syst_helpers_group_quintuple_empty_one_nop
- {\firstargumentfalse
- \secondargumentfalse
- \thirdargumentfalse
- \fourthargumentfalse
- \fifthargumentfalse
- \the\t_syst_aux{}{}{}{}{}}
-
-\def\syst_helpers_group_quintuple_empty_two_nop
- {\secondargumentfalse
- \thirdargumentfalse
- \fourthargumentfalse
- \fifthargumentfalse
- \the\t_syst_aux{}{}{}{}}
-
-\def\syst_helpers_group_quintuple_empty_three_nop
- {\thirdargumentfalse
- \fourthargumentfalse
- \fifthargumentfalse
- \the\t_syst_aux{}{}{}}
-
-\def\syst_helpers_group_quintuple_empty_four_nop
- {\fourthargumentfalse
- \fifthargumentfalse
- \the\t_syst_aux{}{}}
-
-\def\syst_helpers_group_quintuple_empty_five_nop
- {\fifthargumentfalse
- \the\t_syst_aux{}}
-
-%D These macros can explictly take care of spaces, which means that the next
-%D definition and calls are valid:
-%D
-%D \starttyping
-%D \def\test#1#2#3{[#1#2#3]}
-%D
-%D \dotriplegroupempty\test {a}{b}{c}
-%D \dotriplegroupempty\test {a}{b}
-%D \dotriplegroupempty\test {a}
-%D \dotriplegroupempty\test
-%D \dotriplegroupempty\test {a} {b} {c}
-%D \dotriplegroupempty\test {a} {b}
-%D \dotriplegroupempty\test
-%D {a}
-%D {b}
-%D \stoptyping
-%D
-%D And alike.
-
-%D \macros
-%D {firstofoneargument, firstoftwoarguments, firstofthreearguments
-%D secondoftwoarguments, secondofthreearguments,
-%D thirdofthreearguments}
-%D
-%D The next six macros (dedicated to Taco) can conveniently used to select
-%D arguments. Their names explain their functionality.
-
-\def\firstofoneargument #1{#1}
-
-\def\firstoftwoarguments #1#2{#1}
-\def\secondoftwoarguments #1#2{#2}
-
-\def\firstofthreearguments #1#2#3{#1}
-\def\secondofthreearguments #1#2#3{#2}
-\def\thirdofthreearguments #1#2#3{#3}
-
-\def\firstoffourarguments #1#2#3#4{#1}
-\def\secondoffourarguments #1#2#3#4{#2}
-\def\thirdoffourarguments #1#2#3#4{#3}
-\def\fourthoffourarguments #1#2#3#4{#4}
-
-\def\firstoffivearguments #1#2#3#4#5{#1}
-\def\secondoffivearguments #1#2#3#4#5{#2}
-\def\thirdoffivearguments #1#2#3#4#5{#3}
-\def\fourthoffivearguments #1#2#3#4#5{#4}
-\def\fifthoffivearguments #1#2#3#4#5{#5}
-
-\def\firstofsixarguments #1#2#3#4#5#6{#1}
-\def\secondofsixarguments#1#2#3#4#5#6{#2}
-\def\thirdofsixarguments #1#2#3#4#5#6{#3}
-\def\fourthofsixarguments#1#2#3#4#5#6{#4}
-\def\fifthofsixarguments #1#2#3#4#5#6{#5}
-\def\sixthofsixarguments #1#2#3#4#5#6{#6}
-
-\unexpanded\def\firstofoneunexpanded #1{#1}
-
-\unexpanded\def\firstoftwounexpanded #1#2{#1}
-\unexpanded\def\secondoftwounexpanded #1#2{#2}
-
-\unexpanded\def\firstofthreeunexpanded #1#2#3{#1}
-\unexpanded\def\secondofthreeunexpanded#1#2#3{#2}
-\unexpanded\def\thirdofthreeunexpanded #1#2#3{#3}
-
-%D \macros
-%D {globalletempty,letempty,
-%D letvalueempty,letgvalueempty,
-%D letvaluerelax,letgvaluerelax}
-%D
-%D Trivial:
-
-\unexpanded\def\letempty #1{\let #1\empty}
-\unexpanded\def\globalletempty#1{\glet#1\empty}
-
-\unexpanded\def\letvalueempty #1{\expandafter\let \csname#1\endcsname\empty}
-\unexpanded\def\letgvalueempty#1{\expandafter\glet\csname#1\endcsname\empty}
-\unexpanded\def\letvaluerelax #1{\expandafter\let \csname#1\endcsname\relax}
-\unexpanded\def\letgvalurelax #1{\expandafter\glet\csname#1\endcsname\relax}
-
-\unexpanded\def\relaxvalueifundefined#1%
- {\ifcsname#1\endcsname \else
- \expandafter\let\csname#1\endcsname\relax
- \fi}
-
-%D \macros
-%D {wait}
-%D
-%D The next macro hardly needs explanation. Because no nesting is to be expected, we
-%D can reuse \type {\wait} within \type {\wait} itself.
-
-\unexpanded\def\wait
- {\begingroup
- \read16 to \wait
- \endgroup}
-
-%D \macros
-%D {writestring,writeline,
-%D writestatus,statuswidth,normalwritestatus}
-%D
-%D Maybe one didn't notice, but we've already introduced a macro for showing
-%D messages. In the multi||lingual modules, we will also introduce a mechanism for
-%D message passing. For the moment we stick to the core macros:
-%D
-%D \starttyping
-%D \writestring {string}
-%D \writeline
-%D \writestatus {category} {message}
-%D \stoptyping
-%D
-%D Messages are formatted. One can provide the maximum with of the identification
-%D string with the macro \type {\statuswidth}.
-
-\setnewconstant\statuswidth 15
-\setnewconstant\statuswrite 128 % \pluscxxviii
-
-\ifdefined\writestring \else
-
- \unexpanded\def\writestring{\immediate\write\statuswrite}
- \unexpanded\def\writeline {\writestring{}}
-
-\fi
-
-\unexpanded\def\normalwritestatus#1#2%
- {\writestring{\expandafter\syst_helpers_split_status_yes\expandafter\statuswidth#1%
- \space\space\space\space\space\space\space
- \space\space\space\space\space\space\space
- \space\space\space\space\space\space\end
- \space:\space#2}}
-
-\def\syst_helpers_split_status_yes#1#2%
- {\ifcase#1 \expandafter\syst_helpers_split_status_nop\fi#2%
- \expandafter\syst_helpers_split_status_yes\expandafter{\the\numexpr#1+\minusone\relax}}
-
-\def\syst_helpers_split_status_nop#1\end
- {}
-
-%D \macros
-%D {immediatemessage}
-%D
-%D A fully expandable message:
-
-\let\immediatemessage\clf_immediatemessage % {} mandate
-
-%D \macros
-%D {rawgetparameters}
-%D
-%D A raw and dirty alternative for \type {\getparameters}; no checking is done!
-
-\unexpanded\def\rawsetparameter#1=#2,%
- {\if]#1\else
- \expandafter\def\csname\rawparameterprefix#1\endcsname{#2}%
- \expandafter\rawsetparameter
- \fi}
-
-\unexpanded\def\rawgetparameters[#1][#2% some 5-10% faster
- {\ifx#2]% test is needed, else bomb on [#1][]
- \expandafter\gobbleoneargument
- \else
- \def\rawparameterprefix{#1}%
- \expandafter\dorawgetparameters
- \fi#2}
-
-\def\dorawgetparameters#1]%
- {\expandafter\rawsetparameter#1,]=,}
-
-%D \macros
-%D {doglobal,
-%D redoglobal,dodoglobal,resetglobal}
-%D
-%D The two macros \type {\redoglobal} and \type{\dodoglobal} are used in this and
-%D some other modules to enforce a user specified \type {\doglobal} action. The last
-%D and often only global assignment in a macro is done with \type {\dodoglobal}, but
-%D all preceding ones with \type {\redoglobal}. When using only alternatives, one
-%D can reset this mechanism with \type {\resetglobal}.
-
-\unexpanded\def\resetglobal
- {\let\redoglobal\relax
- \let\dodoglobal\relax}
-
-\resetglobal
-
-\unexpanded\def\doglobal
- {\ifx\redoglobal\relax
- \let\redoglobal\global
- \let\dodoglobal\syst_helpers_dodo_global
- \fi}
-
-\def\syst_helpers_dodo_global
- {\resetglobal\global}
-
-\def\saveglobal
- {\let\syst_helpers_dodo_global\dodoglobal
- \let\syst_helpers_redo_global\redoglobal}
-
-\def\restoreglobal
- {\let\redoglobal\syst_helpers_redo_global
- \let\dodoglobal\syst_helpers_dodo_global}
-
-%D A very useful application of this macro is \type {\newif}, \TEX's fake boolean
-%D type. Not being a primitive, \type {\global} hopelessly fails here. But a slight
-%D adaption of Knuth's original macro permits:
-%D
-%D \starttyping
-%D \doglobal\newif\iftest
-%D \stoptyping
-%D
-%D Of course one can still say:
-%D
-%D \starttyping
-%D \global\testtrue
-%D \global\testfalse
-%D \stoptyping
-%D
-%D Apart from the prefixes, a few more \type {\expandafters} are needed:
-
-% \unexpanded\def\newif#1% uses the original plain \@if
-% {\privatescratchcounter\escapechar
-% \escapechar\minusone
-% \expandafter\expandafter\expandafter
-% \redoglobal\expandafter\expandafter\expandafter
-% \edef\@if#1{true}{\let\noexpand#1\noexpand\iftrue}%
-% \expandafter\expandafter\expandafter
-% \redoglobal\expandafter\expandafter\expandafter
-% \edef\@if#1{false}{\let\noexpand#1\noexpand\iffalse}%
-% \dodoglobal\@if#1{false}%
-% \escapechar\privatescratchcounter}
-
-\normalprotected\def\newif#1% see syst-ini.mkiv
- {\let\new_if_saved\newif
- \let\newif\new_if_check
- \expandafter\redoglobal\expandafter\def\csname\expandafter\newif\csstring#1true\endcsname {\let#1\iftrue }%
- \expandafter\redoglobal\expandafter\def\csname\expandafter\newif\csstring#1false\endcsname{\let#1\iffalse}%
- \dodoglobal\csname\expandafter\newif\csstring#1false\endcsname
- \let\newif\new_if_saved}
-
-%D Also new:
-
-\unexpanded\def\define#1%
- {\ifdefined#1%
- \message{[\noexpand#1is already defined]}%
- \unexpanded\expandafter\def\expandafter\gobbleddefinition
- \else
- \unexpanded\expandafter\def
- \fi#1}
-
-\unexpanded\def\redefine#1%
- {\ifdefined#1%
- \message{[\noexpand#1is redefined]}%
- \fi
- \unexpanded\def#1}
-
-\unexpanded\def\definemacro#1%
- {\ifdefined#1%
- \message{[\noexpand#1is already defined]}%
- \unexpanded\expandafter\def\expandafter\gobbleddefinition
- \else
- \unexpanded\expandafter\def
- \fi#1}
-
-% \define\hans{hans}
-% \redefine\hans{hans}
-% \define\hans#1[]#2#3{hans}
-
-%D The next variant fits nicely in the setups syntax:
-%D
-%D \starttyping
-%D \starttexdefinition bagger [#1] #2
-%D oeps
-%D #1
-%D oeps
-%D \stoptexdefinition
-%D
-%D \bagger [a] {b}
-%D \stoptyping
-
-% \starttexdefinition test
-% oeps
-% \stoptexdefinition
-%
-% [\test]
-
-\def\s!unexpanded{unexpanded}
-
-\bgroup \obeylines
-
-\glet\stoptexdefinition\relax
-
-\unexpanded\gdef\starttexdefinition%
- {\bgroup%
- \obeylines%
- \syst_helpers_start_tex_definition}
-
-\gdef\syst_helpers_start_tex_definition#1
- {\catcode\endoflineasciicode\ignorecatcode%
- \clf_texdefinition_one{#1}}
-
-\gdef\dostarttexdefinition#1\stoptexdefinition%
- {\egroup%
- \clf_texdefinition_two{#1}}
-
-\egroup
-
-% \unexpanded\def\texdefinition#1{\csname\ifcsname#1\endcsname#1\else donothing\fi\endcsname} % todo: a nop cs: char 0 or some corenamespace
-
-\unexpanded\def\texdefinition#1{\begincsname#1\endcsname}
-
-% This is a first variant, more might be added:
-
-\unexpanded\def\starttexcode{\unprotect}
-\unexpanded\def\stoptexcode {\protect}
-
-%D \macros
-%D {newcounter,
-%D increment,decrement}
-%D
-%D Unfortunately the number of \COUNTERS\ in \TEX\ is limited, but fortunately we
-%D can store numbers in a macro. We can increment such pseudo \COUNTERS\ with \type
-%D {\increment}.
-%D
-%D \starttyping
-%D \increment(\counter,20)
-%D \increment(\counter,-4)
-%D \increment(\counter)
-%D \increment\counter
-%D \stoptyping
-%D
-%D After this sequence of commands, the value of \type {\counter} is 20, 16, 17
-%D and~18. Of course there is also the complementary command \type {\decrement}.
-%D
-%D Global assignments are possible too, using \type{\doglobal}:
-%D
-%D \starttyping
-%D \doglobal\increment\counter
-%D \stoptyping
-%D
-%D When \type {\counter} is undefined, it's value is initialized at~0. It is
-%D nevertheless better to define a \COUNTER\ explicitly. One reason could be that
-%D the \COUNTER\ can be part of a test with \type {\ifnum} and this conditional does
-%D not accept undefined macro's. The \COUNTER\ in our example can for instance be
-%D defined with:
-%D
-%D \starttyping
-%D \newcounter\counter
-%D \stoptyping
-%D
-%D The command \type {\newcounter} must not be confused with \type {\newcount}! Of
-%D course this mechanism is much slower than using \TEX's \COUNTERS\ directly. In
-%D practice \COUNTERS\ (and therefore our pseudo counters too) are seldom the
-%D bottleneck in the processing of a text. Apart from some other incompatilities we
-%D want to mention a pitfal when using \type {\ifnum}.
-%D
-%D \starttyping
-%D \ifnum\normalcounter=\pseudocounter \doif \else \doelse \fi
-%D \ifnum\pseudocounter=\normalcounter \doif \else \doelse \fi
-%D \stoptyping
-%D
-%D In the first test, \TEX\ continues it's search for the second number after
-%D reading \type {\pseudocounter}, while in the second test, it stops reading after
-%D having encountered a real one. Tests like the first one therefore can give
-%D unexpected results, for instance execution of \type {\doif} even if both numbers
-%D are unequal.
-
-\def\zerocountervalue{0}
-
-\unexpanded\def\newcounter#1%
- {\dodoglobal\let#1\zerocountervalue}
-
-%D Nowadays we don't mind a few more tokens if we can gain a bit of speed.
-
-\def\syst_helpers_do_increment#1{\dodoglobal\edef#1{\the\numexpr\ifdefined#1\ifx#1\relax\else#1\fi\fi+\plusone \relax}}
-\def\syst_helpers_do_decrement#1{\dodoglobal\edef#1{\the\numexpr\ifdefined#1\ifx#1\relax\else#1\fi\fi+\minusone\relax}}
-
-\def\syst_helpers_do_do_do_increment#1,#2){\dodoglobal\edef#1{\the\numexpr\ifdefined#1\ifx#1\relax\else#1\fi\fi+#2\relax}}
-\def\syst_helpers_do_do_do_decrement#1,#2){\dodoglobal\edef#1{\the\numexpr\ifdefined#1\ifx#1\relax\else#1\fi\fi-#2\relax}}
-
-\def\syst_helpers_do_do_increment(#1%
- {\def\m_syst_action_yes{\syst_helpers_do_do_do_increment#1}%
- \def\m_syst_action_nop{\syst_helpers_do_do_do_increment#1,\plusone}%
- \doifelsenextcharcs,\m_syst_action_yes\m_syst_action_nop}
-
-\def\syst_helpers_do_do_decrement(#1%
- {\def\m_syst_action_yes{\syst_helpers_do_do_do_decrement#1}%
- \def\m_syst_action_nop{\syst_helpers_do_do_do_decrement#1,\plusone}%
- \doifelsenextcharcs,\m_syst_action_yes\m_syst_action_nop}
-
-\unexpanded\def\increment{\doifelsenextcharcs(\syst_helpers_do_do_increment\syst_helpers_do_increment}
-\unexpanded\def\decrement{\doifelsenextcharcs(\syst_helpers_do_do_decrement\syst_helpers_do_decrement}
-
-\unexpanded\def\fastincrement#1{\dodoglobal\edef#1{\the\numexpr#1+\plusone \relax}}
-\unexpanded\def\fastdecrement#1{\dodoglobal\edef#1{\the\numexpr#1+\minusone\relax}}
-
-\unexpanded\def\incrementvalue#1{\expandafter\increment\csname#1\endcsname}
-\unexpanded\def\decrementvalue#1{\expandafter\decrement\csname#1\endcsname}
-
-%D \macros
-%D {newsignal}
-%D
-%D When writing advanced macros, we cannot do without signaling. A signal is a small
-%D (invisible) kern or penalty that signals the next macro that something just
-%D happened. This macro can take any action depending on the previous signal.
-%D Signals must be unique and the next macro takes care of that.
-%D
-%D \starttyping
-%D \newsignal\somesignal
-%D \stoptyping
-%D
-%D Signals old dimensions and can be used in skips, kerns and tests like \type
-%D {\ifdim}.
-
-\newdimen\maximumsignal % step is about 0.00025pt
-
-\unexpanded\def\newsignal#1%
- {\ifdefined#1\else
- \advance\maximumsignal 2\scaledpoint % to be save in rounding
- \edef#1{\the\maximumsignal}%
- \fi}
-
-%D \macros
-%D {strippedcsname}
-%D
-%D The next macro can be very useful when using \type {\csname} like in:
-%D
-%D \starttyping
-%D \csname if\strippedcsname\something\endcsname
-%D \stoptyping
-
-\let\checkedstrippedcsname\csstring
-
-%D \macros
-%D {savenormalmeaning}
-%D
-%D We will use this one in:
-
-\unexpanded\def\savenormalmeaning#1%
- {\ifcsname normal\csstring#1\endcsname \else
- \expandafter\let\csname normal\csstring#1\endcsname#1%
- \fi}
-
-%D \macros
-%D {dorecurse,recurselevel,recursedepth,
-%D dostepwiserecurse}
-%D
-%D \TEX\ does not offer us powerfull for||loop mechanisms. On the other hand its
-%D recursion engine is quite unique. We therefore identify the for||looping macros
-%D by this method. The most simple alternative is the one that only needs a number.
-%D
-%D \starttyping
-%D \dorecurse {n} {whatever we want}
-%D \stoptyping
-%D
-%D This macro can be nested without problems and therefore be used in situations
-%D where \PLAIN\ \TEX's \type {\loop} macro ungracefully fails. The current value of
-%D the counter is available in \type {\recurselevel}, before as well as after the
-%D \typ {whatever we wat} stuff.
-%D
-%D \starttyping
-%D \dorecurse % inner loop
-%D {10}
-%D {\recurselevel: % outer value
-%D \dorecurse % inner loop
-%D {\recurselevel} % outer value
-%D {\recurselevel} % inner value
-%D \dorecurse % inner loop
-%D {\recurselevel} % outer value
-%D {\recurselevel} % inner value
-%D \endgraf}
-%D \stoptyping
-%D
-%D In this example the first, second and fourth \type {\recurselevel} concern the
-%D outer loop, while the third and fifth one concern the inner loop. The depth of
-%D the nesting is available for inspection in \type {\recursedepth}.
-%D
-%D Both \type {\recurselevel} and \type {\recursedepth} are macros. The real
-%D \COUNTERS\ are hidden from the user because we don't want any interference.
-
-\newcount\outerrecurse
-\newcount\innerrecurse
-
-\def\recursedepth{\the\outerrecurse}
-\def\recurselevel{0}
-
-\let\syst_helpers_stepwise_next\relax
-
-\installsystemnamespace{recurseindex}
-\installsystemnamespace{recurseaction}
-
-\unexpanded\def\dostepwiserecurse#1#2#3#4% can be made faster by postponing #4
- {\global\advance\outerrecurse \plusone
- \expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname{#4}%
- \expandafter\glet\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
- \ifnum#3>\zerocount\relax
- \ifnum#2<#1\relax
- \let\syst_helpers_stepwise_next\syst_helpers_stepwise_exit
- \else
- \let\syst_helpers_stepwise_next\syst_helpers_stepwise_recurse
- \fi
- \orelse\ifnum#3<\zerocount\relax
- \ifnum#1<#2\relax
- \let\syst_helpers_stepwise_next\syst_helpers_stepwise_exit
- \else
- \let\syst_helpers_stepwise_next\syst_helpers_stepwise_reverse
- \fi
- \else
- \let\syst_helpers_stepwise_next\syst_helpers_stepwise_exit
- \fi\normalexpanded{\syst_helpers_stepwise_next{\number#1}{\number#2}{\number#3}}}
-
-\unexpanded\def\syst_helpers_stepwise_recurse#1#2#3% from to step
- {\ifnum#1>#2\relax
- \expandafter\syst_helpers_stepwise_recurse_nop
- \else
- \def\recurselevel{#1}%
- \doubleexpandafter\syst_helpers_stepwise_recurse_yes\expandafter
- \fi\expandafter{\the\numexpr\recurselevel+#3\relax}{#2}{#3}}
-
-\unexpanded\def\syst_helpers_recurse_content
- {\csname\??recurseaction\the\outerrecurse\endcsname}
-
-\unexpanded\def\syst_helpers_stepwise_recurse_yes
- {\syst_helpers_recurse_content
- \syst_helpers_stepwise_recurse}
-
-\unexpanded\def\syst_helpers_stepwise_reverse#1#2#3% from to step
- {\ifnum#1<#2\relax
- \expandafter\syst_helpers_stepwise_recurse_nop
- \else
- \def\recurselevel{#1}%
- \innerrecurse#1\relax
- \advance\innerrecurse#3\relax
- \doubleexpandafter\syst_helpers_stepwise_reverse_yes\expandafter
- \fi\expandafter{\the\innerrecurse}{#2}{#3}}
-
-\unexpanded\def\syst_helpers_stepwise_reverse_yes
- {\syst_helpers_recurse_content
- \syst_helpers_stepwise_reverse}
-
-\unexpanded\def\syst_helpers_stepwise_exit
- {\syst_helpers_stepwise_recurse_nop\relax}
-
-\unexpanded\def\syst_helpers_stepwise_recurse_nop#1#2#3#4%
- {\expandafter\let\expandafter\recurselevel\csname\??recurseindex\the\outerrecurse\endcsname
- \global\advance\outerrecurse\minusone}
-
-\unexpanded\def\dorecurse#1%
- {\dostepwiserecurse\plusone{#1}\plusone}
-
-\def\doexpandedrecurse#1#2% user macro (also was \doxprecurse)
- {\ifnum#1>\zerocount
- #2\expandafter\doexpandedrecurse\expandafter{\the\numexpr#1-\plusone\relax}{#2}%
- \fi}
-
-%D As we can see here, the simple command \type{\dorecurse} is a special case of the
-%D more general:
-%D
-%D \starttyping
-%D \dostepwiserecurse {from} {to} {step} {action}
-%D \stoptyping
-%D
-%D This commands accepts positive and negative steps. Illegal values are handles as
-%D good as possible and the macro accepts numbers and \COUNTERS.
-%D
-%D \starttyping
-%D \dostepwiserecurse {1} {10} {2} {...}
-%D \dostepwiserecurse {10} {1} {-2} {...}
-%D \stoptyping
-%D
-%D Because the simple case is used often, we implement it more efficiently:
-
-\unexpanded\def\dorecurse#1%
- {\ifcase#1\relax
- \expandafter\gobbletwoarguments
- \or
- \expandafter\syst_helpers_recurse_y
- \else
- \expandafter\syst_helpers_recurse_x
- \fi{#1}}
-
-\unexpanded\def\syst_helpers_recurse_x#1#2%
- {\global\advance\outerrecurse \plusone
- \expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname{#2}%
- \expandafter\glet\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
- \expandafter\syst_helpers_recurse_indeed\expandafter1\expandafter{\number#1}}
-
-\unexpanded\def\syst_helpers_recurse_y#1#2%
- {\global\advance\outerrecurse \plusone
- \expandafter\glet\csname\??recurseindex\the\outerrecurse\endcsname\recurselevel
- \let\recurselevel\!!plusone
- #2%
- \expandafter\let\expandafter\recurselevel\csname\??recurseindex\the\outerrecurse\endcsname
- \global\advance\outerrecurse \minusone}
-
-\unexpanded\def\syst_helpers_recurse_indeed#1#2% from to
- {\ifnum#1>#2\relax
- \expandafter\syst_helpers_recurse_indeed_nop
- \else
- \def\recurselevel{#1}%
- \doubleexpandafter\syst_helpers_recurse_indeed_yes
- \fi\expandafter{\the\numexpr\recurselevel+\plusone\relax}{#2}}
-
-\unexpanded\def\syst_helpers_recurse_indeed#1#2% from to
- {\ifnum#1>#2\relax
- \expandafter\syst_helpers_recurse_indeed_nop
- \else
- \def\recurselevel{#1}%
- \innerrecurse#1\advance\innerrecurse\plusone
- \doubleexpandafter\syst_helpers_recurse_indeed_yes
- \fi\expandafter{\the\innerrecurse}{#2}}
-
-\unexpanded\def\syst_helpers_recurse_indeed_yes
- {\syst_helpers_recurse_content
- \syst_helpers_recurse_indeed}
-
-\unexpanded\def\syst_helpers_recurse_indeed_nop#1#2#3%
- {\expandafter\let\expandafter\recurselevel\csname\??recurseindex\the\outerrecurse\endcsname
- \global\advance\outerrecurse \minusone }
-
-%D \macros
-%D {dowith}
-%D
-%D Here's a loop over whatever is in a list:
-%D
-%D \starttyping
-%D \dowith{a,b,c}{[#1]}
-%D \stoptyping
-
-\unexpanded\def\dowith#1#2%
- {\def\syst_helpers_with##1{#2}%
- \normalexpanded{\processcommalist[#1]}\syst_helpers_with}
-
-%D \macros
-%D {doloop,exitloop}
-%D
-%D Sometimes loops are not determined by counters, but by (a combinations of)
-%D conditions. We therefore implement a straightforward loop, which can only be left
-%D when we explictly exit it. Nesting is supported. First we present a more
-%D extensive alternative.
-%D
-%D \starttyping
-%D \doloop
-%D {Some kind of typesetting punishment \par
-%D \ifnum\pageno>100 \exitloop \fi}
-%D \stoptyping
-%D
-%D When needed, one can call for \type {\looplevel} and \type {\loopdepth}.
-
-\let\endofloop\donothing % maybe \syst_helpers_loop_end
-
-\unexpanded\def\doloop#1%
- {\global\advance\outerrecurse \plusone
- \expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname{#1}%
- \expandafter\glet\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
- \let\endofloop\syst_helpers_loop
- \syst_helpers_loop1} % no \plusone else \recurselevel wrong
-
-\unexpanded\def\syst_helpers_loop#1%
- {\def\recurselevel{#1}%
- \expandafter\syst_helpers_loop_yes\expandafter{\the\numexpr\recurselevel+\plusone\relax}}
-
-\unexpanded\def\syst_helpers_loop_yes
- {\syst_helpers_recurse_content
- \endofloop}
-
-\unexpanded\def\syst_helpers_loop_nop#1%
- {\let\endofloop\syst_helpers_loop % new, permits nested \doloop's
- \expandafter\let\expandafter\recurselevel\csname\??recurseindex\the\outerrecurse\endcsname
- \global\advance\outerrecurse\minusone}
-
-\unexpanded\def\exitloop % \exitloop quits at end
- {\let\endofloop\syst_helpers_loop_nop}
-
-\unexpanded\def\exitloopnow#1\endofloop % \exitloopnow quits directly
- {\syst_helpers_loop_nop}
-
-%D The loop is executed at least once, so beware of situations
-%D like:
-%D
-%D \starttyping
-%D \doloop {\exitloop some commands}
-%D \stoptyping
-%D
-%D It's just a matter of putting the text into the \type {\if} statement that should
-%D be there anyway, like in:
-%D
-%D \starttyping
-%D \doloop {\ifwhatever \exitloop \else some commands\fi}
-%D \stoptyping
-%D
-%D You can also quit a loop immediately, by using \type
-%D {\exitloopnow} instead. Beware, this is more sensitive
-%D for conditional errors.
-
-%D Krzysztof Leszczynski suggested to provide access to the level by means of a
-%D \type {#1}. I decided to pass the more frequently used level as \type {#1} and
-%D the less favoured depth as \type {#2}. The intended usage is:
-%D
-%D \starttyping
-%D \dorecurse{3}{\definesymbol[test-#1][xx-#1]}
-%D
-%D \def\test{\dorecurse{3}{\definesymbol[test-##1][xx-##1]}} \test
-%D
-%D \symbol[test-1]\quad\symbol[test-2]\quad\symbol[test-3]
-%D \stoptyping
-%D
-%D Since the hashed arguments are expanded, we don't need tricky expansion here.
-%D
-%D \starttyping
-%D \dorecurse{3}{\expanded{\definesymbol[test-\recurselevel][xx-\recurselevel]}}
-%D \stoptyping
-
-\def\syst_helpers_recurse_content
- {\csname\??recurseaction\the\outerrecurse\expandafter\expandafter\expandafter\endcsname
- \expandafter\expandafter\expandafter{\expandafter\recurselevel\expandafter}\expandafter{\the\outerrecurse}}
-
-\unexpanded\def\syst_helpers_recurse_x#1#2%
- {\global\advance\outerrecurse \plusone
- \expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname##1##2{#2}%
- \expandafter\glet\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
- \expandafter\syst_helpers_recurse_indeed\expandafter1\expandafter{\number#1}}
-
-\unexpanded\def\syst_helpers_recurse_y#1#2%
- {\global\advance\outerrecurse \plusone
- \expandafter\glet\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
- \let\recurselevel\!!plusone
- \expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname##1##2{#2}%
- \syst_helpers_recurse_content
- \expandafter\let\expandafter\recurselevel\csname\??recurseindex\the\outerrecurse\endcsname
- \global\advance\outerrecurse \minusone}
-
-\unexpanded\def\doloop#1%
- {\global\advance\outerrecurse \plusone
- \expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname##1##2{#1}%
- \expandafter\glet\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
- \let\endofloop\syst_helpers_loop
- \syst_helpers_loop1} % no \plusone else \recurselevel wrong
-
-\installsystemnamespace{recursestepwise}
-
-\unexpanded\def\dostepwiserecurse#1#2#3#4% can be made faster by postponing #4
- {\global\advance\outerrecurse \plusone
- \expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname##1##2{#4}%
- \expandafter\glet\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
- \csname\??recursestepwise
- % we need the x in order to avoid the \relax that tex adds
- \ifnum#3>\zerocount
- \ifnum#2<#1x\else d\fi
- \orelse\ifnum#3<\zerocount
- \ifnum#1<#2x\else r\fi
- \fi
- \expandafter\endcsname\normalexpanded{{\number#1}{\number#2}{\number#3}}}
- % \expandafter\endcsname\expandafter{\number#1\expandafter}\expandafter{\number#2\expandafter}\expandafter{\number#3}}
-
-\letvalue{\??recursestepwise x}\syst_helpers_stepwise_exit
-\letvalue{\??recursestepwise d}\syst_helpers_stepwise_recurse
-\letvalue{\??recursestepwise r}\syst_helpers_stepwise_reverse
-
-\newcount\fastloopindex
-\newcount\fastloopfinal
-
-\let\m_syst_helpers_fast_loop_cs\relax
-
-\unexpanded\def\dofastloopcs#1%
- {\fastloopfinal#1\relax
- \ifcase\fastloopfinal
- \expandafter\gobbleoneargument
- \else
- \expandafter\syst_helpers_fast_loop_cs
- \fi}
-
-\unexpanded\def\syst_helpers_fast_loop_cs#1%
- {\let\m_syst_helpers_fast_loop_cs#1%
- \fastloopindex\plusone
- \syst_helpers_fast_loop_cs_step}
-
-\unexpanded\def\syst_helpers_fast_loop_cs_step
- {\ifnum\fastloopindex>\fastloopfinal
- \let\m_syst_helpers_fast_loop_cs\relax
- \else
- \m_syst_helpers_fast_loop_cs
- \advance\fastloopindex\plusone
- \expandafter\syst_helpers_fast_loop_cs_step
- \fi}
-
-% Helper:
-
-\unexpanded\def\resetrecurselevel{\let\recurselevel\!!zerocount}
-
-\let\recurselevel\!!zerocount
-
-% \appendtoks \resetrecurselevel \to \everydump
-
-%D \macros
-%D {doloopoverlist}
-%D
-%D \starttyping
-%D \doloopoverlist {red,green,blue} {
-%D \setuppalet[\recursestring]
-%D \doloopoverlist {light,normal,dark} {
-%D \blackrule[color=\recursestring,width=20cm,height=2cm,depth=0cm]\par
-%D }
-%D }
-%D \stoptyping
-%D
-%D or:
-%D
-%D \starttyping
-%D \doloopoverlist {red,green,blue} {
-%D \setuppalet[#1]
-%D \doloopoverlist {light,normal,dark} {
-%D \blackrule[color=##1,width=20cm,height=2cm,depth=0cm]\par
-%D }
-%D }
-%D \stoptyping
-
-\unexpanded\def\doloopoverlist#1#2%
- {\global\advance\outerrecurse\plusone
- \expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname##1{\edef\recursestring{##1}#2}%
- \expandafter\glet\csname\??recurseindex \the\outerrecurse\endcsname\recursestring
- \normalexpanded{\processcommalist[#1]{\expandafter\noexpand\csname\??recurseaction\the\outerrecurse\endcsname}}%
- \expandafter\let\expandafter\recursestring\csname\??recurseindex\the\outerrecurse\endcsname
- \global\advance\outerrecurse\minusone}
-
-%D \macros
-%D {newevery,everyline,EveryLine,EveryPar}
-%D
-%D Lets skip to something quite different. It's common use to use \type {\everypar}
-%D for special purposes. In \CONTEXT\ we use this primitive for locating sidefloats.
-%D This means that when user assignments to \type {\everypar} can interfere with
-%D those of the package. We therefore introduce \type {\EveryPar}.
-%D
-%D The same goes for \type {\EveryLine}. Because \TEX\ offers no \type {\everyline}
-%D primitive, we have to call for \type {\everyline} when we are working on a line
-%D by line basis. Just by calling \type {\EveryPar{}} and \type {\EveryLine{}} we
-%D restore the old situation.
-
-% \dorecurse{2}{
-% \expanded{\everypar{before \recurselevel\space}}
-% \EveryPar{x } [before \recurselevel\space x] \par
-% \EveryPar{y } [before \recurselevel\space y] \par
-% \EveryPar{} [before \recurselevel] \par
-% \EveryPar{x } \EveryPar{y } \EveryPar{} [before \recurselevel] \par
-% \EveryPar{y } \everypar{before } [before] \par
-% }
-
-\installsystemnamespace{extraevery}
-
-\unexpanded\def\newevery#1#2%
- {\ifx#1\everypar\else\newtoks#1\fi% we test for redefinition elsewhere
- \ifx#2\relax\orelse\ifdefined#2\else
- \expandafter\newtoks\csname\??extraevery\csstring#1\endcsname
- \edef#2{\syst_helpers_every#1\csname\??extraevery\csstring#1\endcsname}%
- \fi}
-
-\unexpanded\def\syst_helpers_every#1#2%
- {\removetoks\the#2\from#1%
- \appendtoks\the#2\to #1%
- #2}
-
-%D This one permits definitions like:
-
-\newevery \everypar \EveryPar % we get a warning which is ok
-\newevery \everyline \EveryLine
-
-%D and how about:
-
-\newtoks \neverypar
-
-\unexpanded\def\forgeteverypar
- {\everypar{\the\neverypar}}
-
-%D Which we're going to use indeed! When the second argument equals \type {\relax},
-%D the first token list is created unless it is already defined.
-%D
-%D Technically spoken we could have used the method we are going to present in the
-%D visual debugger. First we save the primitive \type{\everypar}:
-%D
-%D \starttyping
-%D \let\normaleverypar=\everypar
-%D \stoptyping
-%D
-%D Next we allocate a \TOKENLIST\ named \type{\everypar}, which means that
-%D \type{\everypar} is no longer a primitive but something like \type{\toks44}.
-%D
-%D \starttyping
-%D \newtoks\everypar
-%D \stoptyping
-%D
-%D Because \TEX\ now executes \type{\normaleverypar} instead of \type{\everypar}, we
-%D are ready to assign some tokens to this internally known and used \TOKENLIST.
-%D
-%D \starttyping
-%D \normaleverypar={all the things the system wants to do \the\everypar}
-%D \stoptyping
-%D
-%D Where the user can provide his own tokens to be expanded every time he expects
-%D them to expand.
-%D
-%D \starttyping
-%D \everypar={something the user wants to do}
-%D \stoptyping
-%D
-%D We don't use this method because it undoubtly leads to confusing situations,
-%D especially when other packages are used, but it's this kind of tricks that make
-%D \TEX\ so powerful.
-
-%D \macros
-%D {convertargument,convertcommand,convertvalue}
-%D
-%D Some persistent experimenting led us to the next macro. This macro converts a
-%D parameter or an expanded macro to it's textual meaning.
-%D
-%D \starttyping
-%D \convertargument ... \to \command
-%D \stoptyping
-%D
-%D For example,
-%D
-%D \starttyping
-%D \convertargument{one \two \three{four}}\to\ascii
-%D \stoptyping
-%D
-%D The resulting macro \type{\ascii} can be written to a file or the terminal
-%D without problems. In \CONTEXT\ we use this macro for generating registers and
-%D tables of contents.
-%D
-%D The second conversion alternative accepts a command:
-%D
-%D \starttyping
-%D \convertcommand\command\to\ascii
-%D \stoptyping
-%D
-%D Both commands accept the prefix \type{\doglobal} for global assignments.
-
-\unexpanded\def\convertvalue#1\to
- {\expandafter\convertcommand\csname#1\endcsname\to}
-
-\unexpanded\def\defconvertedvalue#1#2% less sensitive for \to
- {\expandafter\defconvertedcommand\expandafter#1\csname#2\endcsname}
-
-%D \macros
-%D {doifassignmentelse}
-%D
-%D A lot of \CONTEXT\ commands take optional arguments, for instance:
-%D
-%D \starttyping
-%D \dothisorthat[alfa,beta]
-%D \dothisorthat[first=foo,second=bar]
-%D \dothisorthat[alfa,beta][first=foo,second=bar]
-%D \stoptyping
-%D
-%D Although a combined solution is possible, we prefer a seperation. The next
-%D command takes care of propper handling of such multi||faced commands.
-%D
-%D \starttyping
-%D \doifassignmentelse {...} {then ...} {else ...}
-%D \stoptyping
-
-\def\syst_helpers_check_if_assignment_else#1=#2#3^^^^0004{\if#2^^^^0003}%
-\def\syst_helpers_check_else_assignment_if#1=#2#3^^^^0004{\unless\if#2^^^^0003}%
-
-\unexpanded\def\doifelseassignment#1%
- {\expandafter\syst_helpers_check_if_assignment_else\detokenize{#1}=^^^^0003^^^^0003^^^^0004%
- \expandafter\secondoftwoarguments
- \else
- \expandafter\firstoftwoarguments
- \fi}
-
-\unexpanded\def\doifelseassignmentcs#1#2#3%
- {\expandafter\syst_helpers_check_if_assignment_else\detokenize{#1}=^^^^0003^^^^0003^^^^0004%
- \expandafter#3%
- \else
- \expandafter#2%
- \fi}
-
-\let\doifassignmentelse \doifelseassignment
-\let\doifassignmentelsecs\doifelseassignmentcs
-
-\newif\ifassignment
-
-\unexpanded\def\docheckassignment#1%
- {\expandafter\syst_helpers_check_if_assignment_else\detokenize{#1}=^^^^0003^^^^0003^^^^0004%
- \assignmentfalse
- \else
- \assignmenttrue
- \fi}
-
-%D These can be used for cases where we want less tracing noise.
-
-\unexpanded\def\validassignment#1%
- {\expandafter\syst_helpers_check_else_assignment_if\detokenize{#1}=^^^^0003^^^^0003^^^^0004}
-
-\unexpanded\def\novalidassignment#1%
- {\expandafter\syst_helpers_check_if_assignment_else\detokenize{#1}=^^^^0003^^^^0003^^^^0004}
-
-%D In \ETEX\ we can use \type {\detokenize} and gain some speed, but in general far
-%D less that 1\% for \type {\convertargument} and nil for \type {\convertcommand}.
-%D This macro is more robust than the pure \TEX\ one, something I found out when
-%D primitives like \type {\jobname} were fed (or something undefined).
-
-\unexpanded\def\convertargument#1\to#2{\dodoglobal\edef#2{\detokenize{#1}}}
-\unexpanded\def\convertcommand #1\to#2{\dodoglobal\edef#2{\expandafter\detokenize\expandafter{#1}}} % hm, only second is also ok
-
-\unexpanded\def\defconvertedargument #1#2{\edef#1{\detokenize{#2}}}
-\unexpanded\def\defconvertedcommand #1#2{\edef#1{\detokenize\expandafter{#2}}}
-\unexpanded\def\edefconvertedargument#1#2{\edef#1{#2}%
- \edef#1{\detokenize\expandafter{#1}}}
-\unexpanded\def\gdefconvertedargument#1#2{\xdef#1{\detokenize{#2}}}
-\unexpanded\def\gdefconvertedcommand #1#2{\xdef#1{\detokenize\expandafter{#2}}}
-\unexpanded\def\xdefconvertedargument#1#2{\xdef#1{#2}%
- \xdef#1{\detokenize\expandafter{#1}}}
-
-%D When you try to convert a primitive command, you'll find out that the \ETEX\
-%D method fails on for instance \type {\jobname} in the sense that it returns the
-%D filename instead of just \type {\jobname}. So far this does not give real
-%D problems.
-
-%D This is typically a macro that one comes to after reading the \TEX book
-%D carefully. Even then, the definite solution was found after rereading the \TEX
-%D book. The first implementation was:
-%D
-%D \starttyping
-%D \def\doconvertargument#1->#2\\\\{#2}
-%D \stoptyping
-%D
-%D The \type {-}, the delimiter \type {\\\\} and the the second argument are
-%D completely redundant.
-
-%D \macros
-%D {showvalue}
-%D
-%D Ahandy macro, for testing purposes only:
-
-\unexpanded\def\showvalue#1%
- {\ifcsname#1\endcsname
- \expandafter\show\csname#1\endcsname
- \else
- \show\undefined
- \fi}
-
-%D \macros
-%D {doifmeaningelse}
-%D
-%D We can use both commands in testing, but alas, not all meanings expand to
-%D something \type {->}. This is no problem in the \ETEX\ implementation, but since
-%D we want compatibility, we need:
-%D
-%D \starttyping
-%D \doifmeaningelse {\next} {\something} {true} {false}
-%D \stoptyping
-%D
-%D Watch the one level expansion of the second argument.
-
-\unexpanded\def\doifelsemeaning#1#2%
- {\edef\m_syst_string_one{\normalmeaning#1}%
- \def \m_syst_string_two{#2}%
- \edef\m_syst_string_two{\normalmeaning\m_syst_string_two}%
- \ifx\m_syst_string_one\m_syst_string_two
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\let\doifmeaningelse\doifelsemeaning
-
-%D \macros
-%D {doifsamestringselse,doifsamestring,doifnotsamestring}
-%D
-%D The next comparison macro converts the arguments into expanded strings. This
-%D command can be used to compare for instance \type {\jobname} with a name stored
-%D in a macro.
-%D
-%D \starttyping
-%D \doifelse {\jobname}{oeps}{YES}{NO}
-%D \doifsamestringelse{\jobname}{oeps}{YES}{NO}
-%D \stoptyping
-
-\def\syst_helpers_if_samestring_else#1#2#3#4%
- {\edef\m_syst_string_one{\detokenize\expandafter{\normalexpanded{#3}}}%
- \edef\m_syst_string_two{\detokenize\expandafter{\normalexpanded{#4}}}%
- \ifx\m_syst_string_one\m_syst_string_two\expandafter#1\else\expandafter#2\fi}
-
-\unexpanded\def\doifelsesamestring{\syst_helpers_if_samestring_else\firstoftwoarguments\secondoftwoarguments}
-\unexpanded\def\doifsamestring {\syst_helpers_if_samestring_else\firstofoneargument \gobbleoneargument }
-\unexpanded\def\doifnotsamestring {\syst_helpers_if_samestring_else\gobbleoneargument \firstofoneargument }
-
-\let\doifsamestringelse\doifelsesamestring
-
-%D \macros
-%D {ConvertToConstant,ConvertConstantAfter}
-%D
-%D When comparing arguments with a constant, we can get into trouble when this
-%D argument consists of tricky expandable commands. One solution for this is
-%D converting the argument to a string of unexpandable characters. To make
-%D comparison possible, we have to convert the constant too.
-%D
-%D \starttyping
-%D \ConvertToConstant\doifelse {...} {...} {then ...} {else ...}
-%D \stoptyping
-%D
-%D This construction is only needed when the first argument can give troubles.
-%D Misuse can slow down processing.
-%D
-%D \starttyping
-%D \ConvertToConstant\doifelse{\c!alfa} {\c!alfa}{...}{...}
-%D \ConvertToConstant\doifelse{alfa} {\c!alfa}{...}{...}
-%D \ConvertToConstant\doifelse{alfa} {alfa} {...}{...}
-%D \ConvertToConstant\doifelse{alfa \alfa test}{\c!alfa}{...}{...}
-%D \stoptyping
-%D
-%D In examples~2 and~3 both arguments equal, in~1 and~4 they differ.
-
-\unexpanded\def\ConvertToConstant#1#2#3%
- {\edef\m_syst_string_one{\expandafter\detokenize\expandafter{#2}}%
- \edef\m_syst_string_two{\expandafter\detokenize\expandafter{#3}}%
- #1{\m_syst_string_one}{\m_syst_string_two}}
-
-%D When the argument \type{#1} consists of commands, we had better use
-%D
-%D \starttyping
-%D \ConvertConstantAfter\processaction[#1][...]
-%D \ConvertConstantAfter\doifelse{#1}{\v!something}{}{}
-%D \stoptyping
-%D
-%D This commands accepts things like:
-%D
-%D \starttyping
-%D \v!constant
-%D constant
-%D \hbox to \hsize{\rubish}
-%D \stoptyping
-%D
-%D As we will see in the core modules, this macro permits constructions like:
-%D
-%D \starttyping
-%D \setupfootertexts[...][...]
-%D \setupfootertexts[margin][...][...]
-%D \setupfootertexts[\v!margin][...][...]
-%D \stoptyping
-%D
-%D where \type {...} can be anything legally \TEX.
-
-\unexpanded\def\CheckConstantAfter#1#2%
- {\expandafter\convertargument\v!prefix!\to\ascii
- \convertargument#1\to#2\relax
- \doifelseinstring\ascii{#2}
- {\expandafter\convertargument#1\to#2}
- {}}
-
-\unexpanded\def\ConvertConstantAfter#1#2#3%
- {\CheckConstantAfter{#2}\asciia
- \CheckConstantAfter{#3}\asciib
- #1{\asciia}{\asciib}}
-
-%D \macros
-%D {assignifempty}
-%D
-%D We can assign a default value to an empty macro using:
-%D
-%D \starttyping
-%D \assignifempty \macros {default value}
-%D \stoptyping
-%D
-%D We don't explicitly test if the macro is defined.
-
-\unexpanded\def\assignifempty#1#2% can be sped up
- {\doifsomething{#1}{\def#1{#2}}} % {\doifnot{#1}{}{\def#1{#2}}}
-
-%D \macros
-%D {gobbleuntil,grabuntil,gobbleuntilrelax,
-%D processbetween,processuntil}
-%D
-%D In \TEX\ gobbling usually stand for skipping arguments, so here are our gobbling
-%D macros.
-%D
-%D In \CONTEXT\ we use a lot of \type {\start}||\type {\stop} like constructions.
-%D Sometimes, the \type {\stop} is used as a hard coded delimiter like in: %D
-%D \starttyping
-%D \unexpanded\def\startcommand#1\stopcommand%
-%D {... #1 ...}
-%D \stoptyping
-%D
-%D In many cases the \type {\start}||\type {\stop} pair is defined at format
-%D generation time or during a job. This means that we cannot hardcode the \type
-%D {\stop} criterium. Only after completely understanding \type {\csname} and \type
-%D {\expandafter} I was able to to implement a solution, starting with:
-%D
-%D \starttyping
-%D \grabuntil{stop}\command
-%D \stoptyping
-%D
-%D This commands executes, after having encountered \type {\stop} the command \type
-%D {\command}. This command receives as argument the text preceding the \type
-%D {\stop}. This means that:
-%D
-%D \starttyping
-%D \unexpanded\def\starthello%
-%D {\grabuntil{stophello}\message}
-%D
-%D \starthello Hello world!\stophello
-%D \stoptyping
-%D
-%D results in: \type{\message{Hello world!}}.
-
-\let\syst_helpers_grab_indeed\relax
-
-\unexpanded\def\syst_helpers_grab#1#2%
- {\def\syst_helpers_grab_indeed##1#1{#2{##1}}\syst_helpers_grab_indeed}
-
-\unexpanded\def\grabuntil#1%
- {\expandafter\syst_helpers_grab\expandafter{\csname#1\endcsname}}
-
-%D The next command build on this mechanism:
-%D
-%D \starttyping
-%D \processbetween{string}\command
-%D \stoptyping
-%D
-%D Here:
-%D
-%D \starttyping
-%D \processbetween{hello}\message
-%D \starthello Hello again!\stophello
-%D \stoptyping
-%D
-%D leads to: \type{\message{Hello again!}}. The command
-%D
-%D \starttyping
-%D \gobbleuntil{sequence}
-%D \stoptyping
-%D
-%D is related to these commands. This one simply throws away
-%D everything preceding \type{\command}.
-
-\let\syst_helpers_gobble_indeed\relax
-
-\unexpanded\def\processbetween#1#2%
- {\setvalue{\s!start#1}{\grabuntil{\s!stop#1}{#2}}}
-
-\unexpanded\def\gobbleuntil#1%
- {\def\syst_helpers_gobble_indeed##1#1{}\syst_helpers_gobble_indeed}
-
-\unexpanded\def\gobbleuntilrelax#1\relax
- {}
-
-%D The next one simply expands the pickup up tokens.
-%D
-%D \starttyping
-%D \processuntil{sequence}
-%D \stoptyping
-
-\let\syst_helpers_until_indeed\relax
-
-\unexpanded\def\processuntil#1%
- {\def\syst_helpers_until_indeed##1#1{##1}\syst_helpers_until_indeed}
-
-%D \macros
-%D {groupedcommand}
-%D
-%D Commands often manipulate argument as in:
-%D
-%D \starttyping
-%D \def\doezomaarwat#1{....#1....}
-%D \stoptyping
-%D
-%D A disadvantage of this approach is that the tokens that form \type{#1} are fixed
-%D the the moment the argument is read in. Normally this is no problem, but for
-%D instance verbatim environments adapt the \CATCODES\ of characters and therefore
-%D are not always happy with already fixed tokens.
-%D
-%D Another problem arises when the argument is grouped not by \type {{}} but by
-%D \type {\bgroup} and \type {\egroup}. Such an argument fails, because the \type
-%D {\bgroup} is een as the argument (which is quite normal).
-%D
-%D The next macro offers a solution for both unwanted situations:
-%D
-%D \starttyping
-%D \groupedcommand {before} {after}
-%D \stoptyping
-%D
-%D Which can be used like:
-%D
-%D \starttyping
-%D \def\cite%
-%D {\groupedcommand{\rightquote\rightquote}{\leftquote\leftquote}}
-%D \stoptyping
-%D
-%D This command is equivalent to, but more 'robust' than:
-%D
-%D \starttyping
-%D \def\cite#1%
-%D {\rightquote\rightquote#1\leftquote\leftquote}
-%D \stoptyping
-%D
-%D \starttyping
-%D \def\rightword%
-%D {\groupedcommand{\hfill\hbox}{\parfillskip\zeropoint}}
-%D
-%D .......... \rightword{the right way}
-%D \stoptyping
-%D
-%D Here \TEX\ typesets \type {\bf the right way} unbreakable at the end of the line.
-%D The solution mentioned before does not work here. We also handle
-%D
-%D \starttyping
-%D to be \bold{bold} or not, that's the question
-%D \stoptyping
-%D
-%D and
-%D
-%D \starttyping
-%D to be {\bold bold} or not, that's the question
-%D \stoptyping
-%D
-%D This alternative checks for a \type {\bgroup} token first. The internal
-%D alternative does not accept the box handling mentioned before, but further
-%D nesting works all right. The extra \type {\bgroup}||\type {\egroup} is needed to
-%D keep \type {\m_syst_helpers_handle_group_after} both into sight and local.
-
-\let\m_syst_helpers_handle_group_after \relax
-\let\m_syst_helpers_handle_group_before\relax
-
-\unexpanded\def\syst_helpers_handle_group_nop
- {\ifnum\currentgrouptype=\semisimplegroupcode
- \expandafter\syst_helpers_handle_group_nop_a
- \else
- \expandafter\syst_helpers_handle_group_nop_b
- \fi}
-
-\def\syst_helpers_handle_group_nop_a
- {\begingroup
- \aftergroup\m_syst_helpers_handle_group_a
- \aftergroup\endgroup
- \m_syst_helpers_handle_group_b}
-
-\def\syst_helpers_handle_group_nop_b
- {\bgroup
- \aftergroup\m_syst_helpers_handle_group_a
- \aftergroup\egroup
- \m_syst_helpers_handle_group_b}
-
-\unexpanded\def\syst_helpers_handle_group_normal
- {\bgroup
- \afterassignment\m_syst_helpers_handle_group_normal_before
- \let\next=}
-
-\def\m_syst_helpers_handle_group_normal_before
- {\bgroup
- \m_syst_helpers_handle_group_b
- \bgroup
- \aftergroup\m_syst_helpers_handle_group_a
- \aftergroup\egroup
- \aftergroup\egroup}
-
-\unexpanded\def\syst_helpers_handle_group_simple% no inner group (so no kerning interference)
- {\bgroup
- \afterassignment\m_syst_helpers_handle_group_simple_before
- \let\next=}
-
-\def\m_syst_helpers_handle_group_simple_before
- {\bgroup
- \aftergroup\m_syst_helpers_handle_group_simple_after
- \m_syst_helpers_handle_group_b}
-
-\def\m_syst_helpers_handle_group_simple_after
- {\m_syst_helpers_handle_group_a
- \egroup}%
-
-\unexpanded\def\syst_helpers_handle_group_pickup% no inner group (so no kerning interference)
- {\bgroup
- \afterassignment\m_syst_helpers_handle_group_pickup_before
- \let\next=}
-
-\def\m_syst_helpers_handle_group_pickup_before
- {\bgroup
- \aftergroup\m_syst_helpers_handle_group_a
- \aftergroup\egroup
- \aftergroup\m_syst_helpers_handle_group_p
- \m_syst_helpers_handle_group_b}
-
-\unexpanded\def\syst_helpers_handle_group_nop_x
- {\ifnum\currentgrouptype=\semisimplegroupcode
- \begingroup
- \aftergroup\endgroup
- \else
- \bgroup
- \aftergroup\egroup
- \fi
- \m_syst_helpers_handle_group_b}
-
-\unexpanded\def\syst_helpers_handle_group_normal_x
- {\bgroup
- \afterassignment\m_syst_helpers_handle_group_normal_before_x
- \let\next=}
-
-\def\m_syst_helpers_handle_group_normal_before_x
- {\bgroup
- \m_syst_helpers_handle_group_b
- \bgroup
- \aftergroup\egroup
- \aftergroup\egroup}
-
-%D I considered it a nuisance that
-%D
-%D \starttyping
-%D \color[green]
-%D {as grass}
-%D \stoptyping
-%D
-%D was not interpreted as one would expect. This is due to the fact that \type
-%D {\futurelet} obeys blank spaces, and a line||ending token is treated as a blank
-%D space. So the final implementation became:
-
-\unexpanded\def\groupedcommand#1#2%
- {\def\m_syst_helpers_handle_group_b{#1}%
- \def\m_syst_helpers_handle_group_a{#2}%
- \futureexpandis\bgroup\syst_helpers_handle_group_normal\syst_helpers_handle_group_nop}
-
-\unexpanded\def\groupedcommandcs#1#2%
- {\let\m_syst_helpers_handle_group_b#1%
- \let\m_syst_helpers_handle_group_a#2%
- \futureexpandis\bgroup\syst_helpers_handle_group_normal\syst_helpers_handle_group_nop}
-
-\unexpanded\def\simplegroupedcommand#1#2%
- {\def\m_syst_helpers_handle_group_b{#1}%
- \def\m_syst_helpers_handle_group_a{#2}%
- \futureexpandis\bgroup\syst_helpers_handle_group_simple\syst_helpers_handle_group_nop}
-
-\unexpanded\def\pickupgroupedcommand#1#2#3%
- {\def\m_syst_helpers_handle_group_b{#1}%
- \def\m_syst_helpers_handle_group_a{#2}%
- \def\m_syst_helpers_handle_group_p{#3}%
- \futureexpandis\bgroup\syst_helpers_handle_group_pickup\syst_helpers_handle_group_nop}
-
-\unexpanded\def\triggergroupedcommand#1%
- {\def\m_syst_helpers_handle_group_b{#1}%
- \futureexpandis\bgroup\syst_helpers_handle_group_normal_x\syst_helpers_handle_group_nop_x}
-
-\unexpanded\def\triggergroupedcommandcs#1%
- {\let\m_syst_helpers_handle_group_b#1%
- \futureexpandis\bgroup\syst_helpers_handle_group_normal_x\syst_helpers_handle_group_nop_x}
-
-%D Users should be aware of the fact that grouping can interfere with ones paragraph
-%D settings that are executed after the paragraph is closed. One should therefore
-%D explictly close the paragraph with \type {\par}, else the settings will be
-%D forgotten and not applied. So it's:
-%D
-%D \starttyping
-%D \def\BoldRaggedCenter%
-%D {\groupedcommand{\raggedcenter\bf}{\par}}
-%D \stoptyping
-
-%D \macros
-%D {checkdefined}
-%D
-%D The bigger the system, the greater the change that user defined commands collide
-%D with those that are part of the system. The next macro gives a warning when a
-%D command is already defined. We considered blocking the definition, but this is
-%D not always what we want.
-%D
-%D \starttyping
-%D \checkdefined {category} {class} {command}
-%D \stoptyping
-%D
-%D The user is warned with the suggestion to use \type {CAPITALS}. This suggestion
-%D is feasible, because \CONTEXT only defines lowcased macros.
-
-\unexpanded\def\showdefinederror#1#2%
- {\writestatus\m!system{#1 #2 replaces a macro, use CAPITALS!}}
-
-\unexpanded\def\checkdefined#1#2#3%
- {\doifdefined{#3}{\showdefinederror{#2}{#3}}}
-
-%D \macros
-%D {GotoPar,GetPar}
-%D
-%D Typesetting a paragraph in a special way can be done by first grabbing the
-%D contents of the paragraph and processing this contents grouped. The next macro
-%D for instance typesets a paragraph in boldface.
-%D
-%D \starttyping
-%D \def\remark#1\par%
-%D {\bgroup\bf#1\egroup}
-%D \stoptyping
-%D
-%D This macro has to be called like
-%D
-%D \starttyping
-%D \remark some text ... ending with \par
-%D \stoptyping
-%D
-%D Instead of \type {\par} we can of course use an empty line. When we started
-%D typesetting with \TEX, we already had produced lots of text in plain \ASCII. In
-%D producing such simple formatted texts, we adopted an open layout, and when
-%D switching to \TEX, we continued this open habit. Although \TEX\ permits a cramped
-%D and badly formatted source, it adds to confusion and sometimes introduces errors.
-%D So we prefer:
-%D
-%D \starttyping
-%D \remark
-%D
-%D some text ... ending with an empty line
-%D \stoptyping
-%D
-%D We are going to implement a mechanism that allows such open specifications. The
-%D definition of the macro handling \type {\remark} becomes:
-%D
-%D \starttyping
-%D \def\remark%
-%D {\BeforePar{\bgroup\bf}%
-%D \AfterPar{\egroup}%
-%D \GetPar}
-%D \stoptyping
-%D
-%D A macro like \type {\GetPar} can be defined in several ways. The recent version,
-%D the fourth one in a row, originally was far more complicated, but some
-%D functionality has been moved to other macros.
-%D
-%D We start with the more simple but in some cases more appropriate alternative is
-%D \type {\GotoPar}. This one leaves \type {\par} unchanged and is therefore more
-%D robust. On the other hand, \type {\AfterPar} is not supported.
-
-\newtoks\BeforePar
-\newtoks\AfterPar
-
-\def\redowithpar\par
- {\doifelsenextchar\par\redowithpar\dodowithpar}%
-
-\def\dowithpar#1#2%
- {\def\dodowithpar##1\par{#1##1#2}%
- \redowithpar\par}
-
-\def\redogotopar\par
- {\doifelsenextchar\par\redogotopar\dodogotopar}%
-
-\def\dogotopar#1%
- {\def\dodogotopar{#1}%
- \redogotopar\par}
-
-\def\dogotoparcs#1%
- {\let\dodogotopar#1%
- \redogotopar\par}
-
-\unexpanded\def\GetPar
- {\expanded
- {\dowithpar
- {\the\BeforePar
- \BeforePar\emptytoks}
- {\the\AfterPar
- \BeforePar\emptytoks
- \AfterPar\emptytoks}}}
-
-\unexpanded\def\GotoPar
- {\expanded
- {\dogotopar
- {\the\BeforePar
- \BeforePar\emptytoks}}}
-
-%D \macros
-%D {dowithpargument,dowithwargument}
-%D
-%D The next macros are a variation on \type {\GetPar}. When macros expect an
-%D argument, it interprets a grouped sequence of characters a one token. While this
-%D adds to robustness and less ambiguous situations, we sometimes want to be a bit
-%D more flexible, or at least want to be a bit more tolerant to user input.
-%D
-%D We start with a commands that acts on paragraphs. This
-%D command is called as:
-%D
-%D \starttyping
-%D \dowithpargument\command
-%D \dowithpargument{\command ... }
-%D \stoptyping
-%D
-%D In \CONTEXT\ we use this one to read in the titles of chapters, sections etc. The
-%D commands responsible for these activities accept several alternative ways of
-%D argument passing. In these examples, the \type {\par} can be omitted when an
-%D empty line is present.
-%D
-%D \starttyping
-%D \command{...}
-%D \command ... \par
-%D \command
-%D {...}
-%D \command
-%D ... \par
-%D \stoptyping
-
-\let\syst_helpers_next_par\relax
-\let\syst_helpers_next_arg\relax
-
-\unexpanded\def\dowithpargument#1%
- {\def\syst_helpers_next_par##1 \par{#1{##1}}%
- \def\syst_helpers_next_arg##1{#1{##1}}%
- \doifelsenextbgroup\syst_helpers_next_arg{\doifelsenextchar\par{#1{}}\syst_helpers_next_par}}
-
-%D The \type {p} in the previous command stands for paragraph. When we want to act
-%D upon words we can use the \type{w} alternative.
-%D
-%D \starttyping
-%D \dowithwargument\command
-%D \dowithwargument{... \command ...}
-%D \stoptyping
-%D
-%D The main difference bwteen two alternatives is in the handling of \type {\par}'s.
-%D This time the space token acts as a delimiter.
-%D
-%D \starttyping
-%D \command{...}
-%D \command ...
-%D \command
-%D {...}
-%D \command
-%D ...
-%D \stoptyping
-
-\let\syst_helpers_next_war\relax
-\let\syst_helpers_next_arg\relax
-
-\unexpanded\def\dowithwargument#1%
- {\def\syst_helpers_next_war##1 {#1{##1}}%
- \def\syst_helpers_next_arg##1{#1{##1}}%
- \doifelsenextbgroup\syst_helpers_next_arg\syst_helpers_next_war}
-
-%D \macros
-%D {dorepeat,dorepeatwithcommand}
-%D
-%D When doing repetitive tasks, we stromgly advice to use \type {\dorecurse}. The
-%D next alternative however, suits better some of the \CONTEXT\ interface commands.
-%D
-%D \starttyping
-%D \dorepeat[n*\command]
-%D \stoptyping
-%D
-%D The value of the used \COUNTER\ can be called within
-%D \type{\command} by \type{\repeater}.
-%D
-%D A slightly different alternative is:
-%D
-%D \starttyping
-%D \dorepeatwithcommand[n*{...}]\command
-%D \stoptyping
-%D
-%D When we call for something like:
-%D
-%D \starttyping
-%D \dorepeatwithcommand[3*{Hello}]\message
-%D \stoptyping
-%D
-%D we get ourselves three \type {\message{Hello}} messages in a row. In both
-%D commands, the \type {n*} is optional. When this specification is missing, the
-%D command executes once.
-
-\unexpanded\def\dorepeatwithcommand[#1]%
- {\syst_helpers_repeat_with_command#1*\empty*\relax}
-
-\def\syst_helpers_repeat_with_command#1*#2#3*#4\relax#5%
- {\ifx#2\empty\syst_helpers_repeat_with_command_again[#1]#5\else\syst_helpers_repeat_with_command_indeed{#1}{#2}{#3}#5\fi}
-
-\def\syst_helpers_repeat_with_command_indeed#1#2#3#4%
- {\ifx#2\empty % redundant but gives cleaner extensions
- #4{#1}%
- \orelse\ifnum#1<\zerocount
- %\normalexpanded{\dorecurse{\number-\number#1}}{#4{-#2#3}}%
- \dorecurse{-#1}{#4{-#2#3}}%
- \orelse\ifx#2+%
- \dorecurse{#1}{#4{#3}}%
- \else
- \dorecurse{#1}{#4{#2#3}}%
- \fi}
-
-\def\syst_helpers_repeat_with_command_again[#1]#2%
- {#2{#1}}
-
-%D The extension hook permits something like:
-%D
-%D \starttyping
-%D \bgroup
-%D
-%D \catcode`\*=\superscriptcatcode
-%D
-%D \gdef\syst_helpers_repeat_with_command_again[#1]%
-%D {\redodorepeatwithcommand#1*\empty*\relax}
-%D
-%D \gdef\redodorepeatwithcommand#1*#2#3*#4\relax#5%
-%D {\syst_helpers_repeat_with_command_indeed{#1}{#2}{#3}#5}
-%D
-%D \egroup
-%D \stoptyping
-%D
-%D although one may wonder if changing the catcode of \type {*} is wise.
-
-%D \macros
-%D {doifstringinstringelse}
-%D
-%D The next macro is meant for situations where both strings are macros. This save
-%D some unneeded expansion.
-%D
-%D \starttyping
-%D \def\doifstringinstringelse#1#2%
-%D {\syst_helpers_do_if_in_string_else#1#2%
-%D \expandafter\firstoftwoarguments
-%D \else
-%D \expandafter\secondoftwoarguments
-%D \fi}
-%D \stoptyping
-%D
-%D A bit faster is:
-
-\def\syst_helpers_if_instring_else_indeed#1%
- {\if#1@%
- \expandafter\secondoftwoarguments
- \else
- \expandafter\firstoftwoarguments
- \fi}
-
-\def\doifelsestringinstring#1#2%
- {\expandafter\def\expandafter\syst_helpers_if_instring_else\expandafter##\expandafter1#1##2##3^^^^0004%
- {\syst_helpers_if_instring_else_indeed##2}%
- \expandafter\expandafter\expandafter\syst_helpers_if_instring_else\expandafter#2#1@@^^^^0004}
-
-\let\doifstringinstringelse\doifelsestringinstring
-
-%D \macros
-%D {appendtoks,prependtoks,appendtoksonce,prependtoksonce,
-%D doifintokselse,flushtoks,dotoks}
-%D
-%D We use tokenlists sparsely within \CONTEXT, because the comma separated lists are
-%D more suitable for the user interface. Nevertheless we have:
-%D
-%D \starttyping
-%D (\doglobal) \appendtoks ... \to\tokenlist
-%D (\doglobal) \prependtoks ... \to\tokenlist
-%D (\doglobal) \flushtoks\tokenlist
-%D \dotoks\tokenlist
-%D \stoptyping
-%D
-%D These macros are clones of the ones implemented in page~378 of Knuth's \TEX book.
-
-\newtoks\t_syst_helpers_scratch
-\let \m_syst_helpers_scratch\empty
-
-\unexpanded\def\appendtoks#1\to#2%
- {\ifx\dodoglobal\relax
- \expandafter\toksapp
- \else
- \resetglobal
- \expandafter\gtoksapp
- \fi#2{#1}}
-
-\unexpanded\def\prependtoks#1\to#2%
- {\ifx\dodoglobal\relax
- \expandafter\tokspre
- \else
- \resetglobal
- \expandafter\gtokspre
- \fi#2{#1}}
-
-\def\syst_helpers_append_toks_indeed
- {\ifx\dodoglobal\relax
- \expandafter\toksapp
- \else
- \resetglobal
- \expandafter\gtoksapp
- \fi\m_syst_helpers_scratch\t_syst_helpers_scratch}
-
-\def\syst_helpers_prepend_toks_indeed
- {\ifx\dodoglobal\relax
- \expandafter\tokspre
- \else
- \resetglobal
- \expandafter\gtokspre
- \fi\m_syst_helpers_scratch\t_syst_helpers_scratch}
-
-\unexpanded\def\appendtoksonce#1\to#2%
- {\let\m_syst_helpers_scratch#2%
- \t_syst_helpers_scratch{#1}%
- \doifelseintoks\t_syst_helpers_scratch\m_syst_helpers_scratch
- \donothing
- \syst_helpers_append_toks_indeed}
-
-\unexpanded\def\prependtoksonce#1\to#2%
- {\let\m_syst_helpers_scratch#2%
- \t_syst_helpers_scratch{#1}%
- \doifelseintoks\t_syst_helpers_scratch\m_syst_helpers_scratch
- \donothing
- \syst_helpers_prepend_toks_indeed}
-
-%D The test macro:
-
-\unexpanded\def\doifelseintoks#1#2% #1 en #2 zijn toks
- {\edef\asciia{\detokenize\expandafter{\the#1}}%
- \edef\asciib{\detokenize\expandafter{\the#2}}%
- \doifelsestringinstring\asciia\asciib}
-
-\let\doifintokselse\doifelseintoks
-
-%D Moved from \type {lxml-ini.tex} to here. This one is for generators that collect
-%D stuff piecewise, which is sometimes hard on mechanisms that grab content using
-%D delimiters:
-%D
-%D \starttyping
-%D \startcollecting
-%D \startcollect \bTABLE \stopcollect
-%D \startcollect \bTR \stopcollect
-%D \startcollect \bTD \stopcollect
-%D \startcollect foo\stopcollect
-%D \startcollect \eTD \stopcollect
-%D \startcollect \bTD \stopcollect
-%D \startcollect bar\stopcollect
-%D \startcollect \eTD \stopcollect
-%D \startcollect \eTR \stopcollect
-%D \startcollect \eTABLE \stopcollect
-%D \stopcollecting
-%D \stoptyping
-
-\newtoks \collectingtoks
-
-\unexpanded\def\startcollect #1\stopcollect {\toksapp \collectingtoks{#1}}
-\unexpanded\def\startexpandedcollect#1\stopexpandedcollect{\etoksapp\collectingtoks{#1}}
-
-\unexpanded\def\startcollecting{\collectingtoks\emptytoks}
-\unexpanded\def\stopcollecting {\the\collectingtoks}
-
-\unexpanded\def\collect {\toksapp \collectingtoks}
-\unexpanded\def\collectexpanded{\etoksapp\collectingtoks}
-
-%D A nice one too:
-
-% {\scratchtoks{abc} \removetoks b\from\scratchtoks [\the\scratchtoks]}
-% {\scratchtoks{abc} \removetoks x\from\scratchtoks [\the\scratchtoks]}
-% {\scratchtoks{} \removetoks x\from\scratchtoks [\the\scratchtoks]}
-% {\scratchtoks{xaa} \removetoks x\from\scratchtoks [\the\scratchtoks]}
-% {\scratchtoks{a\relax b} \removetoks \relax\from\scratchtoks [\showthe\scratchtoks]}
-
-\unexpanded\def\removetoks#1\from#2%
- {\def\syst_helpers_remove_toks##1#1##2\empty\empty\empty##3^^^^0004%
- {\def\m_syst_string_one{##3}%
- \ifx\m_syst_string_one\empty#2{##1}\else#2{##1##2}\fi}%
- \expandafter\syst_helpers_remove_toks\the#2\empty\empty\empty#1\empty\empty\empty^^^^0004}
-
-%D Also:
-
-\unexpanded\def\appendetoks#1\to#2%
- {\ifx\dodoglobal\relax
- \expandafter\etoksapp
- \else
- \resetglobal
- \expandafter\xtoksapp
- \fi#2{#1}}
-
-\unexpanded\def\prependetoks#1\to#2%
- {\ifx\dodoglobal\relax
- \expandafter\etokspre
- \else
- \resetglobal
- \expandafter\xtokspre
- \fi#2{#1}}
-
-%D Hm.
-
-\unexpanded\def\flushtoks#1% nb: can reassign to #1 again, hence the indirectness
- {\t_syst_helpers_scratch#1\relax
- \dodoglobal#1\emptytoks
- \the\t_syst_helpers_scratch\relax}
-
-\let\dotoks\the
-
-%D \macros
-%D {beforesplitstring,aftersplitstring}
-%D
-%D These both commands split a string at a given point in two
-%D parts, so \type{x.y} becomes \type{x} or \type{y}.
-%D
-%D \starttyping
-%D \beforesplitstring test.tex\at.\to\filename
-%D \aftersplitstring test.tex\at.\to\extension
-%D \stoptyping
-%D
-%D The first routine looks (and is indeed) a bit simpler than the second one. The
-%D alternative looking more or less like the first one did not always give the
-%D results we needed. Both implementations show some insight in the manipulation of
-%D arguments.
-
-\let\syst_helpers_split_string\relax
-
-\unexpanded\def\beforesplitstring#1\at#2\to#3%
- {\def\syst_helpers_split_string##1#2##2#2##3\\%
- {\def#3{##1}}%
- \expandafter\syst_helpers_split_string#1#2#2\\}
-
-\unexpanded\def\aftersplitstring#1\at#2\to#3%
- {\def\syst_helpers_split_string##1#2##2@@@##3\\%
- {\def#3{##2}}%
- \expandafter\syst_helpers_split_string#1@@@#2@@@\\}
-
-%D \macros
-%D {splitstring,greedysplitstring}
-%D
-%D A bonus macro.
-
-\unexpanded\def\splitstring#1\at#2\to#3\and#4%
- {\def\syst_helpers_split_string##1#2##2\empty\empty\empty##3\\%
- {\def#3{##1}%
- \def\syst_helpers_split_string{##3}%
- \ifx\syst_helpers_split_string\empty
- \let#4\empty
- \else
- \def#4{##2}%
- \fi}%
- \expandafter\syst_helpers_split_string#1\empty\empty\empty#2\empty\empty\empty\\}
-
-\unexpanded\def\greedysplitstring#1\at#2\to#3\and#4%
- {\edef\asciib{#1}%
- \let\asciic\asciib
- \let#3\empty
- \let#4\empty
- \doloop
- {\expandafter\splitstring\asciib\at#2\to\asciia\and\asciib
- \ifx\asciib\empty
- \exitloop
- \else
- % not \edef#3{\ifx#3\empty\else#3#2\fi\asciia} else
- % /root/path fails because then #3==empty
- \edef#3{\ifcase\recurselevel\or\else#3#2\fi\asciia}%
- \let#4\asciib
- \fi}%
- \ifx#3\empty\let#3\asciic\fi}
-
-%D \macros
-%D {beforetestandsplitstring,
-%D aftertestandsplitstring,
-%D testandsplitstring}
-
-\unexpanded\def\beforetestandsplitstring#1\at#2\to#3%
- {\def\syst_helpers_split_string##1#2##2#2##3##4\\%
- {\ifx##3\empty\let#3\empty\else\def#3{##1}\fi}%
- \expandafter\syst_helpers_split_string#1#2#2\empty\\}
-
-\unexpanded\def\aftertestandsplitstring#1\at#2\to#3%
- {\def\syst_helpers_split_string ##1#2##2@@@##3##4\\%
- {\ifx##3\empty\let#3\empty\else\def#3{##2}\fi}%
- \expandafter\syst_helpers_split_string #1@@@#2@@@\empty\\}
-
-\def\testandsplitstring#1\at#2\to#3\and#4%
- {\def\syst_helpers_split_string##1#2##2#2##3##4\\%
- {\ifx##3\empty\let#3\empty\let#4\empty\else\def#3{##1}\def#4{##2}\fi}%
- \expandafter\syst_helpers_split_string#1#2#2\empty\\}
-
-%D \macros
-%D {splitatperiod,
-%D {splitatcomma,
-%D splitatasterisk,
-%D splitatcolon,
-%D splitatcolons}
-
-\unexpanded\def\splitatperiod #1{\normalexpanded{\syst_helpers_splitatperiod #1}..\relax}
-\unexpanded\def\splitatcomma #1{\normalexpanded{\syst_helpers_splitatcomma #1},,\relax} % not at ", "
-\unexpanded\def\splitatasterisk#1{\normalexpanded{\syst_helpers_splitatasterisk#1}**\relax}
-\unexpanded\def\splitatcolon #1{\normalexpanded{\syst_helpers_splitatcolon #1}::\relax}
-\unexpanded\def\splitatcolons #1{\normalexpanded{\syst_helpers_splitatcolons #1}::::\relax}
-
-\unexpanded\def\syst_helpers_splitatperiod #1.#2.#3\relax#4#5{\def#4{#1}\def#5{#2}}
-\unexpanded\def\syst_helpers_splitatcomma #1,#2,#3\relax#4#5{\def#4{#1}\def#5{#2}}
-\unexpanded\def\syst_helpers_splitatasterisk #1*#2*#3\relax#4#5{\def#4{#1}\def#5{#2}}
-\unexpanded\def\syst_helpers_splitatcolon #1:#2:#3\relax#4#5{\def#4{#1}\def#5{#2}}
-\unexpanded\def\syst_helpers_splitatcolons #1::#2::#3\relax#4#5{\edef#4{#1}\edef#5{#2}}
-
-%D \macros
-%D {removesubstring}
-%D
-%D A first application of the two routines defined above is:
-%D
-%D \starttyping
-%D \removesubstring-\from first-last\to\nothyphenated
-%D \stoptyping
-%D
-%D Which in terms of \TEX\ looks like:
-
-\unexpanded\def\removesubstring#1\from#2\to#3%
- {\splitstring#2\to\m_syst_string_one\and\m_syst_string_two
- \dodoglobal#3{\m_syst_string_one\m_syst_string_two}}
-
-%D \macros
-%D {appendtocommalist,prependtocommalist,
-%D addtocommalist,removefromcommalist}
-%D
-%D When working with comma separated lists, one sooner or later want the tools to
-%D append or remove items from such a list. When we add an item, we first check if
-%D it's already there. This means that every item in the list is unique.
-%D
-%D \starttyping
-%D \addtocommalist {alfa} \name
-%D \addtocommalist {beta} \name
-%D \addtocommalist {gamma} \name
-%D \removefromcommalist {beta} \name
-%D \stoptyping
-%D
-%D These commands can be prefixed with \type {\doglobal}. The implementation of the
-%D second command is more complecated, because we have to take leading spaces into
-%D account. Keep in mind that users may provide lists with spaces after the commas.
-%D When one item is left, we also have to get rid of trailing spaces.
-%D
-%D \starttyping
-%D \def\words{alfa, beta, gamma, delta}
-%D \def\words{alfa,beta,gamma,delta}
-%D \stoptyping
-%D
-%D Removing an item takes more time than adding one. A fast appending alternative,
-%D without any testing, is also provided:
-%D
-%D \starttyping
-%D \appendtocommalist {something} \name
-%D \prependtocommalist {something} \name
-%D \stoptyping
-%D
-%D This can be implemented as follows:
-%D
-%D \starttyping
-%D \def\appendtocommalist#1#2%
-%D {\ifx#2\empty
-%D \dodoglobal\edef#2{#1}%
-%D \else % no test on empty
-%D \dodoglobal\edef#2{#2,#1}%
-%D \fi}
-%D
-%D \def\prependtocommalist#1#2%
-%D {\ifx#2\empty
-%D \dodoglobal\edef#2{#1}%
-%D \else % no test on empty
-%D \dodoglobal\edef#2{#1,#2}%
-%D \fi}
-%D \stoptyping
-%D
-%D The faster alternatives are:
-
-\unexpanded\def\appendtocommalist#1#2%
- {\dodoglobal\edef#2{\ifx#2\empty\else#2,\fi#1}}
-
-\unexpanded\def\prependtocommalist#1#2%
- {\dodoglobal\edef#2{#1\ifx#2\empty\else,#2\fi}}
-
-\unexpanded\def\addtocommalist#1#2% {item} \cs
- {\rawdoifelseinset{#1}#2\resetglobal
- {\dodoglobal\edef#2{\ifx#2\empty\else#2,\fi#1}}}
-
-\unexpanded\def\pretocommalist#1#2% {item} \cs
- {\rawdoifelseinset{#1}#2\resetglobal
- {\dodoglobal\edef#2{#1\ifx#2\empty\else,#2\fi}}}
-
-\unexpanded\def\robustdoifelseinset#1#2%
- {\edef\m_syst_string_one{\detokenize\expandafter{\normalexpanded{#1}}}%
- \edef\m_syst_string_two{\detokenize\expandafter{\normalexpanded{#2}}}%
- \rawdoifelseinset\m_syst_string_one\m_syst_string_two}
-
-\let\robustdoifinsetelse\robustdoifelseinset
-
-\unexpanded\def\robustaddtocommalist#1#2% {item} \cs
- {\robustdoifelseinset{#1}#2\resetglobal
- {\dodoglobal\edef#2{\ifx#2\empty\else#2,\fi#1}}}
-
-\unexpanded\def\robustpretocommalist#1#2% {item} \cs
- {\robustdoifelseinset{#1}#2\resetglobal
- {\dodoglobal\edef#2{#1\ifx#2\empty\else,#2\fi}}}
-
-\unexpanded\def\xsplitstring#1#2% \cs {str}
- {\def\syst_helpers_split_string##1,#2,##2,#2,##3\\%
- {\edef\m_syst_string_one{\bcleanedupcommalist##1\empty\empty\relax}%
- \edef\m_syst_string_two{\acleanedupcommalist##2,,\relax}}%
- \expandafter\syst_helpers_split_string\expandafter,#1,,#2,,#2,\\}
-
-\def\bcleanedupcommalist#1#2#3\relax{\if#1,\else#1\fi\if#2,\else#2\fi#3}
-\def\bcleanedupcommalist#1#2\relax{\if#1,\else#1\fi#2}
-\def\acleanedupcommalist#1,,#2\relax{#1}
-
-\unexpanded\def\removefromcommalist#1#2% to be sped up
- {\rawdoifelseinset{#1}#2%
- {\normalexpanded{\xsplitstring\noexpand#2{#1}}%
- \dodoglobal\edef#2%
- {\ifx\m_syst_string_one\empty
- \m_syst_string_two
- \else
- \m_syst_string_one\ifx\m_syst_string_two\empty\else,\m_syst_string_two\fi
- \fi}}
- \resetglobal}
-
-%D \macros
-%D {substituteincommalist}
-%D
-%D Slow but seldom used, so for the moment we stick to this implementation.
-%D
-%D \starttyping
-%D \substituteincommalist{old}{new}{list}
-%D \stoptyping
-
-\def\syst_helpers_substitute_in_comma_list_step#1%
- {\edef\m_syst_string_three{#1}%
- \ifx\m_syst_string_one\m_syst_string_three
- \ifx\m_syst_string_two\empty \else
- \edef\m_syst_string_four{\ifx\m_syst_string_four\empty\else\m_syst_string_four,\fi\m_syst_string_two}%
- \fi
- \else
- \edef\m_syst_string_four{\ifx\m_syst_string_four\empty\else\m_syst_string_four,\fi#1}%
- \fi}
-
-\unexpanded\def\substituteincommalist#1#2#3% old, new, list (slooow)
- {\edef\m_syst_string_one{#1}%
- \edef\m_syst_string_two{#2}%
- \let\m_syst_string_four\empty
- \normalexpanded{\rawprocesscommacommand[#3]}\syst_helpers_substitute_in_comma_list_step
- \let#3\m_syst_string_four}
-
-%D \macros
-%D {replaceincommalist}
-%D
-%D The next macro can be used to replace an indexed element in a commalist:
-%D
-%D \starttyping
-%D \replaceincommalist\MyList{2}
-%D \stoptyping
-%D
-%D Element~2 will be replaced by the current meaning of the macro \type
-%D {\newcommalistelement}. The old meaning is saved in \type {\commalistelement}.
-%D The replacement honors grouped items, like in:
-%D
-%D \starttyping
-%D \def\MyList{a,b,c,d,e,f} \replaceincommalist\MyList{3}
-%D \def\MyList{a,b,c,d,e,f} \replaceincommalist\MyList{3}
-%D \def\MyList{a,{b,c},d,e,f} \replaceincommalist\MyList{3}
-%D \def\MyList{a,b,c,{d,e,f}} \replaceincommalist\MyList{3}
-%D \stoptyping
-%D
-%D This macro was used in the bibtex code (and is probably no longer needed).
-
-\newcount\c_syst_helpers_comma_list_index
-\let \m_syst_helpers_comma_list_target\empty
-
-\let\newcommalistelement\empty
-
-\def\syst_helpers_replace_in_comma_list_step#1%
- {\ifnum\commalistcounter=\c_syst_helpers_comma_list_index\relax
- \ifx\newcommalistelement\empty\else
- \ifx\m_syst_helpers_comma_list_target\empty
- \let\m_syst_helpers_comma_list_target\newcommalistelement
- \else
- \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter
- \m_syst_helpers_comma_list_target\expandafter\expandafter\expandafter
- {\expandafter\m_syst_helpers_comma_list_target\expandafter,\newcommalistelement}%
- \fi
- \fi
- \def\commalistelement{#1}%
- \else
- \ifx\m_syst_helpers_comma_list_target\empty
- \ifx\nexttoken\bgroup % is known -)
- \def\m_syst_helpers_comma_list_target{{#1}}%
- \else
- \def\m_syst_helpers_comma_list_target{#1}%
- \fi
- \else
- \ifx\nexttoken\bgroup % is known -)
- \expandafter\def\expandafter\m_syst_helpers_comma_list_target\expandafter{\m_syst_helpers_comma_list_target,{#1}}%
- \else
- \expandafter\def\expandafter\m_syst_helpers_comma_list_target\expandafter{\m_syst_helpers_comma_list_target,#1}%
- \fi
- \fi
- \fi
- \advance\commalistcounter\plusone}
-
-\unexpanded\def\replaceincommalist#1#2% #1 = commalistelement #2 = position starts at 1
- {\c_syst_helpers_comma_list_index#2\relax
- \let\m_syst_helpers_comma_list_target\empty
- \let\commalistelement\empty
- \commalistcounter\plusone
- \expandafter\processcommalist\expandafter[#1]\syst_helpers_replace_in_comma_list_step
- \dodoglobal\let#1\m_syst_helpers_comma_list_target}
-
-%D \macros
-%D {globalprocesscommalist}
-%D
-%D The commalist processing commands are characterized by the fact that the way they
-%D handle expansion as well as the fact that they can be nested. This makes them
-%D kind of useless for handling comma lists in alignments. In these situations the
-%D next macro can be of use.
-
-\let\m_syst_helpers_comma_list_command_global\empty
-
-\def\syst_helpers_comma_list_command_global_step#1,%
- {\if]#1\else
- \m_syst_helpers_comma_list_command_global{#1}%
- \expandafter\syst_helpers_comma_list_command_global_step
- \fi}
-
-\unexpanded\def\globalprocesscommalist[#1]#2%
- {\glet\m_syst_helpers_comma_list_command_global#2%
- \expandafter\syst_helpers_comma_list_command_global_step#1,],}
-
-%D \macros
-%D {withoutpt,PtToCm,
-%D numberofpoints,dimensiontocount}
-%D
-%D We can convert point into centimeters with:
-%D
-%D \starttyping
-%D \PtToCm{dimension}
-%D \stoptyping
-
-{\catcode`\.=\othercatcode
- \catcode`\p=\othercatcode
- \catcode`\t=\othercatcode
- \gdef\WITHOUTPT#1pt{#1}}
-
-\def\withoutpt#1%
- {\expandafter\WITHOUTPT#1}
-
-%D The capitals are needed because \type {p} and \type {t} have catcode~12, while
-%D macronames only permit tokens with the catcode~11. As a result we cannot use the
-%D \type {.group} primitives. Those who want to know more about this kind of
-%D manipulations, we advice to study the \TEX book in detail. Because this macro
-%D does not do any assignment, we can use it in the following way too.
-
-\def\PtToCm#1%
- {\withoutpt\the\dimexpr0.0351459804\dimexpr#1\relax\relax cm}
-
-%D We also support:
-%D
-%D \starttyping
-%D \numberofpoints {dimension}
-%D \dimensiontocount {dimension} {\count}
-%D \stoptyping
-%D
-%D Both macros return a rounded number.
-
-% \dimensiontocount{10.49pt}\scratchcounter \the\scratchcounter / \numberofpoints{10.49pt}
-% \dimensiontocount{10.51pt}\scratchcounter \the\scratchcounter / \numberofpoints{10.51pt}
-
-\def\dimensiontocount#1#2{#2\numexpr\dimexpr#1\relax/\maxcard\relax}
-\def\numberofpoints #1{\the\numexpr\dimexpr#1\relax/\maxcard\relax}
-
-%D \macros
-%D {swapdimens,swapcounts,swapmacros,
-%D globalswapdimens,globalswapcounts,globalswapmacros}
-%D
-%D Simple but effective are the next two macros. There name exactly states their
-%D purpose.
-
-\newdimen\d_syst_helpers_swapped
-\newcount\c_syst_helpers_swapped
-\let \m_syst_helpers_swapped\relax
-
-\unexpanded\def\swapdimens#1#2{\d_syst_helpers_swapped#1#1#2#2\d_syst_helpers_swapped}
-\unexpanded\def\swapcounts#1#2{\c_syst_helpers_swapped#1#1#2#2\c_syst_helpers_swapped}
-\unexpanded\def\swapmacros#1#2{\let\m_syst_helpers_swapped#1\let#1#2\let#2\m_syst_helpers_swapped}
-
-\unexpanded\def\globalswapdimens#1#2{\d_syst_helpers_swapped#1\global#1#2\global#2\d_syst_helpers_swapped}
-\unexpanded\def\globalswapcounts#1#2{\c_syst_helpers_swapped#1\global#1#2\global#2\c_syst_helpers_swapped}
-\unexpanded\def\globalswapmacros#1#2{\let\m_syst_helpers_swapped#1\glet#1#2\glet#2\m_syst_helpers_swapped}
-
-%D \macros
-%D {pushmacro,popmacro}
-%D
-%D Premature and a bit of beta, we offer:
-%D
-%D \starttyping
-%D \pushmacro\macro
-%D \popmacro\macro
-%D \stoptyping
-%D
-%D Beware: global!
-
-\installsystemnamespace{localpushedmacro}
-\installsystemnamespace{globalpushedmacro}
-
-\let\m_syst_helpers_push_macro\empty
-
-\newcount\c_syst_helpers_pop_count
-
-\def\syst_helpers_push_macro_new_global
- {\expandafter\newcount\csname\??globalpushedmacro\m_syst_helpers_push_macro\endcsname
- \global\advance\csname\??globalpushedmacro\m_syst_helpers_push_macro\endcsname\plusone}
-
-\def\syst_helpers_push_macro_new_local
- {\expandafter\newcount\csname\??localpushedmacro\m_syst_helpers_push_macro\endcsname
- \global\advance\csname\??localpushedmacro\m_syst_helpers_push_macro\endcsname\plusone}
-
-\unexpanded\def\globalpushmacro#1%
- {\xdef\m_syst_helpers_push_macro{\csstring#1}%
- \ifcsname\??globalpushedmacro\m_syst_helpers_push_macro\endcsname
- \global\advance\lastnamedcs\plusone
- \else
- \syst_helpers_push_macro_new_global
- \fi
- \expandafter\glet\csname\the\lastnamedcs\m_syst_helpers_push_macro\endcsname#1}
-
-\unexpanded\def\localpushmacro#1% this one can be used to push a value over an \egroup
- {\xdef\m_syst_helpers_push_macro{\csstring#1}%
- \ifcsname\??localpushedmacro\m_syst_helpers_push_macro\endcsname
- \global\advance\lastnamedcs\plusone
- \else
- \syst_helpers_push_macro_new_local
- \fi
- \expandafter\glet\csname\the\lastnamedcs\m_syst_helpers_push_macro\endcsname#1}
-
-\unexpanded\def\globalpopmacro#1%
- {\xdef\m_syst_helpers_push_macro{\csstring#1}%
- \c_syst_helpers_pop_count\csname\??globalpushedmacro\m_syst_helpers_push_macro\endcsname
- \global\advance\lastnamedcs \minusone
- \expandafter\glet\expandafter#1\csname\the\c_syst_helpers_pop_count\m_syst_helpers_push_macro\endcsname}
-
-\unexpanded\def\localpopmacro#1%
- {\xdef\m_syst_helpers_push_macro{\csstring#1}%
- \c_syst_helpers_pop_count\csname\??localpushedmacro\m_syst_helpers_push_macro\endcsname
- \global\advance\lastnamedcs \minusone
- \expandafter\let\expandafter#1\csname\the\c_syst_helpers_pop_count\m_syst_helpers_push_macro\endcsname}
-
-\let\pushmacro\localpushmacro
-\let\popmacro \localpopmacro
-
-%D \macros
-%D {setlocalhsize,distributedhsize}
-%D
-%D Sometimes we need to work with the \type{ \hsize} that is corrected for
-%D indentation and left and right skips. The corrected value is available in \type
-%D {\localhsize}, which needs to be calculated with \type {\setlocalhsize} first. %D
-%D
-%D \starttyping
-%D \setlocalhsize \hbox to \localhsize{...}
-%D \setlocalhsize[-1em] \hbox to \localhsize{...}
-%D \setlocalhsize[.5ex] \hbox to \localhsize{...}
-%D \stoptyping
-%D
-%D These examples show us that an optional can be used. The value provided is added
-%D to \type {\localhsize}.
-
-\newdimen\localhsize
-
-\unexpanded\def\setlocalhsize % don't change !
- {\doifelsenextoptional
- \syst_helpers_set_local_hsize_yes
- \syst_helpers_set_local_hsize_nop}
-
-\def\syst_helpers_set_local_hsize_nop
- {\localhsize\availablehsize}
-
-\def\syst_helpers_set_local_hsize_yes[#1]%
- {\syst_helpers_set_local_hsize_nop
- \advance\localhsize#1\relax}
-
-\def\availablehsize
- {\dimexpr
- \hsize-\leftskip-\rightskip
- \ifnum\hangafter<\zerocount
- \ifdim\hangindent>\zeropoint-\else+\fi\hangindent
- \fi
- \relax}
-
-\def\distributedhsize#1#2#3%
- {\dimexpr(#1-\numexpr#3-1\relax\dimexpr#2\relax)/#3\relax}
-
-\def\hsizefraction#1#2%
- {\dimexpr#1/#2\relax}
-
-%D \macros
-%D {doifvalue,doifnotvalue,doifelsevalue,
-%D doifnothing,doifsomething,doifelsenothing,
-%D doifvaluenothing,doifvaluesomething,doifelsevaluenothing}
-%D
-%D These \type {\if} commands can be used to access macros (or variables) that are
-%D normally accessed by using \type {\getvalue}. Using these alternatives safes us
-%D three tokens per call. Anyone familiar with the not||values ones, can derive
-%D their meaning from the definitions.
-
-\unexpanded\def\doifvalue#1#2%
- {\iftok{\csname#1\endcsname}{#2}%
- \expandafter\firstofoneargument
- \else
- \expandafter\gobbleoneargument
- \fi}
-
-\unexpanded\def\doifnotvalue#1#2%
- {\iftok{\csname#1\endcsname}{#2}%
- \expandafter\gobbleoneargument
- \else
- \expandafter\firstofoneargument
- \fi}
-
-\unexpanded\def\doifelsevalue#1#2%
- {\iftok{\csname#1\endcsname}{#2}%
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\unexpanded\def\doifnothing#1%
- {\iftok{#1}\emptytoks
- \expandafter\firstofoneargument
- \else
- \expandafter\gobbleoneargument
- \fi}
-
-\unexpanded\def\doifsomething#1%
- {\iftok{#1}\emptytoks
- \expandafter\gobbleoneargument
- \else
- \expandafter\firstofoneargument
- \fi}
-
-\unexpanded\def\doifelsenothing#1%
- {\iftok{#1}\emptytoks
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\unexpanded\def\doifelsesomething#1%
- {\iftok{#1}\emptytoks
- \expandafter\secondoftwoarguments
- \else
- \expandafter\firstoftwoarguments
- \fi}
-
-\unexpanded\def\doifvaluenothing#1%
- {\iftok{\csname#1\endcsname}\emptytoks
- \expandafter\firstofoneargument
- \else
- \expandafter\gobbleoneargument
- \fi}
-
-\unexpanded\def\doifvaluesomething#1%
- {\iftok{\csname#1\endcsname}\emptytoks
- \expandafter\gobbleoneargument
- \else
- \expandafter\firstofoneargument
- \fi}
-
-\unexpanded\def\doifelsevaluenothing#1%
- {\iftok{\csname#1\endcsname}\emptytoks
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\let\doifvalueelse \doifelsevalue
-\let\doifnothingelse \doifelsenothing
-\let\doifsomethingelse \doifelsesomething
-\let\doifvaluenothingelse\doifelsevaluenothing
-
-%D \macros
-%D {doifemptyelsevalue, doifemptyvalue, doifnotemptyvalue}
-%D
-%D Also handy:
-
-\def\doifelseemptyvalue#1%
- {\expandafter\ifx\csname#1\endcsname\empty
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\let\doifemptyvalueelse\doifelseemptyvalue
-
-\def\doifemptyvalue#1%
- {\expandafter\ifx\csname#1\endcsname\empty
- \expandafter\firstofoneargument
- \else
- \expandafter\gobbleoneargument
- \fi}
-
-\def\doifnotemptyvalue#1%
- {\expandafter\ifx\csname#1\endcsname\empty
- \expandafter\gobbleoneargument
- \else
- \expandafter\firstofoneargument
- \fi}
-
-%D \macros
-%D {doifallcommonelse}
-%D
-%D A complete match of two sets can be tested with \type {\doifallcommonelse}, where
-%D the first two arguments are sets.
-
-\def\syst_helpers_do_if_all_common_else#1#2#3#4% slow
- {\def\syst_helpers_do_common_check_all##1%
- {\doifnotinset{##1}{#4}\donefalse
- \ifdone\else\expandafter\quitcommalist\fi}%
- \donetrue
- \processcommalist[#3]\syst_helpers_do_common_check_all
- \ifdone\expandafter#1\else\expandafter#2\fi}
-
-\unexpanded\def\doifelseallcommon{\syst_helpers_do_if_all_common_else\firstoftwoarguments\secondoftwoarguments}
-\unexpanded\def\doifallcommon {\syst_helpers_do_if_all_common_else\firstofonearguments\gobbleoneargument }
-\unexpanded\def\doifnotallcommon {\syst_helpers_do_if_all_common_else\gobbleoneargument \firstofonearguments }
-
-\let\doifallcommonelse\doifelseallcommon
-
-%D \macros
-%D {DOIF,DOIFELSE,DOIFNOT}
-%D
-%D \TEX\ is case sensitive. When comparing arguments, this feature sometimes is less
-%D desirable, for instance when we compare filenames. The next three alternatives
-%D upcase their arguments before comparing them.
-%D
-%D \starttyping
-%D \DOIF {string1} {string2} {...}
-%D \DOIFNOT {string1} {string2} {...}
-%D \DOIFELSE {string1} {string2} {then ...}{else ...}
-%D \stoptyping
-%D
-%D We have to use a two||step implementation, because the
-%D expansion has to take place outside \type{\uppercase}.
-%D
-%D These might end up as \LUA based helpers (i.e. consider these
-%D obsolete:
-
-\unexpanded\def\syst_helpers_do_IF#1#2%
- {\uppercase{\syst_helpers_do_if_in_string_else{$#1$}{$#2$}}%
- \expandafter\firstofoneargument
- \else
- \expandafter\gobbleoneargument
- \fi}
-
-\unexpanded\def\syst_helpers_do_IF_NOT#1#2%
- {\uppercase{\syst_helpers_do_if_in_string_else{$#1$}{$#2$}}%
- \expandafter\gobbleoneargument
- \else
- \expandafter\firstofoneargument
- \fi}
-
-\unexpanded\def\syst_helpers_do_IF_ELSE#1#2%
- {\uppercase{\syst_helpers_do_if_in_string_else{$#1$}{$#2$}}%
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\unexpanded\def\syst_helpers_do_IF_INSTRING_ELSE#1#2%
- {\uppercase{\syst_helpers_do_if_in_string_else{$#1$}{$#2$}}%
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\unexpanded\def\DOIF #1#2{\normalexpanded{\syst_helpers_do_IF {#1}{#2}}}% will become obsolete
-\unexpanded\def\DOIFNOT #1#2{\normalexpanded{\syst_helpers_do_IF_NOT {#1}{#2}}}% will become obsolete
-\unexpanded\def\DOIFELSE #1#2{\normalexpanded{\syst_helpers_do_IF_ELSE {#1}{#2}}}% will become obsolete
-\unexpanded\def\DOIFINSTRINGELSE #1#2{\normalexpanded{\syst_helpers_do_IF_INSTRING_ELSE{#1}{#2}}}% will become obsolete
-
-%D \macros
-%D {dosingleargumentwithset,
-%D dodoubleargumentwithset,dodoubleemptywithset,
-%D dotripleargumentwithset,dotripleemptywithset}
-%D
-%D These maybe too mysterious macros enable us to handle more than one setup at once.
-%D
-%D \starttyping
-%D \dosingleargumentwithset \command[#1]
-%D \dodoubleargumentwithset \command[#1][#2]
-%D \dotripleargumentwithset \command[#1][#2][#3]
-%D \dodoubleemptywithset \command[#1][#2]
-%D \dotripleemptywithset \command[#1][#2][#3]
-%D \stoptyping
-%D
-%D The first macro calls \type {\command[##1]} for each string in the set~\type
-%D {#1}. The second one calls for \typ {\command [##1][#2]} and the third, well one
-%D may guess. These commands support constructions like:
-%D
-%D \starttyping
-%D \def\dodefinesomething[#1][#2]%
-%D {\getparameters[\??xx#1][#2]}
-%D
-%D \unexpanded\def\definesomething%
-%D {\dodoubleargumentwithset\dodefinesomething}
-%D \stoptyping
-%D
-%D Which accepts calls like:
-%D
-%D \starttyping
-%D \definesomething[alfa,beta,...][variable=...,...]
-%D \stoptyping
-
-\let\m_syst_helpers_with_set_command\empty
-\let\syst_helpers_with_set_step \relax
-
-\def\syst_helpers_with_set_double[#1][#2]%
- {\doifsomething{#1}%
- {\def\syst_helpers_with_set_step##1{\m_syst_helpers_with_set_command[##1][#2]}%
- \processcommalist[#1]\syst_helpers_with_set_step}}
-
-\def\syst_helpers_with_set_triple[#1][#2][#3]%
- {\doifsomething{#1}%
- {\def\syst_helpers_with_set_step##1{\m_syst_helpers_with_set_command[##1][#2][#3]}%
- \processcommalist[#1]\syst_helpers_with_set_step}}
-
-\def\dodoubleemptywithset #1{\let\m_syst_helpers_with_set_command#1\dodoubleempty \syst_helpers_with_set_double} % \command
-\def\dodoubleargumentwithset#1{\let\m_syst_helpers_with_set_command#1\dodoubleargument\syst_helpers_with_set_double} % \command
-
-\def\dotripleemptywithset #1{\let\m_syst_helpers_with_set_command#1\dotripleempty \syst_helpers_with_set_triple} % \command
-\def\dotripleargumentwithset#1{\let\m_syst_helpers_with_set_command#1\dotripleargument\syst_helpers_with_set_triple} % \command
-
-%D \macros
-%D {stripcharacters,stripspaces}
-%D
-%D The next command was needed first when we implemented the \CONTEXT\ interactivity
-%D macros. When we use labeled destinations, we often cannot use all the characters
-%D we want. We therefore strip some of the troublemakers, like spaces, from the
-%D labels before we write them to the \DVI||file, which passes them to for instance
-%D a \POSTSCRIPT\ file.
-%D
-%D \starttyping
-%D \stripspaces\from\one\to\two
-%D \stoptyping
-%D
-%D Both the old string \type{\one} and the new one \type{\two}
-%D are expanded. This command is a special case of:
-%D
-%D \starttyping
-%D \stripcharacter\char\from\one\to\two
-%D \stoptyping
-%D
-%D As we can see below, spaces following a control sequence are to enclosed in \type
-%D {{}}.
-
-\let\m_syst_helpers_strip_character\empty
-
-\unexpanded\def\stripcharacter#1\from#2\to#3%
- {\def\syst_helpers_strip_character##1#1##2\end
- {\edef\m_syst_helpers_strip_character{\m_syst_helpers_strip_character##1}%
- \doifnotempty{##2}{\syst_helpers_strip_character##2\end}}%
- \let\m_syst_helpers_strip_character\empty
- \edef\m_syst_string_one{#2}%
- \expandafter\syst_helpers_strip_character\m_syst_string_one#1\end
- \dodoglobal\let#3\m_syst_helpers_strip_character}
-
-\unexpanded\def\stripspaces\from#1\to#2% will become \unspacestring#1\from#2
- {\stripcharacter{ }\from#1\to#2}
-
-%D \macros
-%D {unspacestring}
-%D
-%D The next macro does the same but is more compatible with other macros, like \type
-%D {\convert...}.
-
-\unexpanded\def\unspacestring#1\to#2%
- {\stripcharacter{ }\from#1\to#2}
-
-%D \macros
-%D {executeifdefined}
-%D
-%D \CONTEXT\ uses one auxiliary file for all data concerning tables of contents,
-%D references, two||pass optimizations, sorted lists etc. This file is loaded as
-%D many times as needed. During such a pass we skip the commands thate are of no use
-%D at that moment. Because we don't want to come into trouble with undefined
-%D auxiliary commands, we call the macros in a way similar to \type {\getvalue}. The
-%D next macro take care of such executions and when not defined, gobbles the
-%D unwanted arguments.
-%D
-%D \starttyping
-%D \executeifdefined{name}\gobbleoneargument
-%D \stoptyping
-%D
-%D We can of course gobble more arguments using the appropriate gobbling command.
-
-\def\executeifdefined#1% #2 / never change this one again
- {\ifcsname#1\endcsname
- % \csname#1\expandafter\expandafter\expandafter\endcsname\expandafter\gobbleoneargument
- \expandafter\expandafter\expandafter\lastnamedcs\expandafter\gobbleoneargument
- \else
- \expandafter\firstofoneargument
- \fi}
-
-%D This one also has the advantage that it is fully expandable and that it can be
-%D used after an assignment.
-
-%D \macros
-%D {doifsomespaceelse}
-%D
-%D The next command checks a string on the presence of a space and executed a
-%D command accordingly.
-%D
-%D \starttyping
-%D \doifsomespaceelse {tekst} {then ...} {else ...}
-%D \stoptyping
-%D
-%D We use this command in \CONTEXT\ for determing if an argument must be broken into
-%D words when made interactive. Watch the use of \type {\noexpand}.
-
-%D Is this one still needed?
-
-\def\syst_helpers_if_some_space_else#1 #2#3^^^^0004{\if\noexpand#2@}
-
-\def\doifelsesomespace#1% % #2#3%
- {\syst_helpers_if_some_space_else#1 @ @^^^^0004% #3\else#2\fi}
- \expandafter\secondoftwoarguments
- \else
- \expandafter\firstoftwoarguments
- \fi}
-
-\let\doifsomespaceelse\doifelsesomespace
-
-%D \macros
-%D {processseparatedlist}
-%D
-%D Maybe a bit late, but here is a more general version of the \type
-%D {\processcommalist} command. This time we don't handle nesting but accept
-%D arbitrary seperators.
-%D
-%D \starttyping
-%D \processseparatedlist[list][separator]\command
-%D \stoptyping
-%D
-%D One can think of things like:
-%D
-%D \starttyping
-%D \processseparatedlist[alfa+beta+gamma][+]\message
-%D \stoptyping
-%D
-%D We want to handle all situations, like:
-%D
-%D \startbuffer
-%D \processseparatedlist[{aap noot}] [ ]{\def\xxx} \convertcommand\xxx\to\ascii {\tttf\ascii}
-%D \processseparatedlist[{aap} {noot}][ ]{\def\xxx} \convertcommand\xxx\to\ascii {\tttf\ascii}
-%D \processseparatedlist[aap {noot}] [ ]{\def\xxx} \convertcommand\xxx\to\ascii {\tttf\ascii}
-%D \processseparatedlist[aap noot] [ ]{\def\xxx} \convertcommand\xxx\to\ascii {\tttf\ascii}
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-%D
-%D Therefore we smuggle a \type {\relax} in front of the argument, which we remove
-%D afterwards.
-
-\let\syst_helpers_process_separated_list_step\relax
-
-\def\syst_helpers_process_separated_list#1]#2[#3]#4%
- {\def\syst_helpers_process_separated_list_step##1##2#3%
- {\def\m_syst_string_one{##2}% suggested by VZ
- \if]##1%
- \let\syst_helpers_process_separated_list_step\relax
- \orelse\ifx\blankspace\m_syst_string_one
- #4{##1}%
- \orelse\if]##2%
- \let\syst_helpers_process_separated_list_step\relax
- \else
- #4{##1##2}%
- \fi
- \syst_helpers_process_separated_list_step}%
- \expandafter\syst_helpers_process_separated_list_step\gobbleoneargument#1#3]#3}
-
-\unexpanded\def\processseparatedlist[%
- {\syst_helpers_process_separated_list\relax}
-
-%D \macros
-%D {processlist}
-%D
-%D An even more general list processing macro is the following one:
-%D
-%D \starttyping
-%D \processlist{beginsym}{endsym}{separator}\docommand list
-%D \stoptyping
-%D
-%D This one supports arbitrary open and close symbols as well as user defined
-%D separators.
-%D
-%D \starttyping
-%D \processlist(){=>}\docommand(a=>b=>c=>d)
-%D \stoptyping
-
-\let\syst_helpers_process_any_list \relax
-\let\syst_helpers_process_any_list_indeed\relax
-\let\syst_helpers_process_any_list_step \relax
-
-\unexpanded\def\processlist#1#2#3#4% no blank skipping !
- {\def\syst_helpers_process_any_list_indeed##1#2%
- {\def\syst_helpers_process_any_list_step####1####2#3%
- {\ifx#2####1%
- \let\syst_helpers_process_any_list_step\relax
- \orelse\ifx#2####2%
- \let\syst_helpers_process_any_list_step\relax
- \else
- #4{####1####2}%
- \fi
- \syst_helpers_process_any_list_step}%
- \expandafter\syst_helpers_process_any_list_step\gobbleoneargument##1#3#2#3}%
- \def\syst_helpers_process_any_list#1%
- {\syst_helpers_process_any_list_indeed\relax}%
- \syst_helpers_process_any_list}
-
-%D \macros
-%D {processassignlist}
-%D
-%D Is possible to combine an assignment list with one containing keywords.
-%D Assignments are treated accordingly, keywords are treated by \type {\command}.
-%D
-%D \starttyping
-%D \processassignlist[...=...,...=...,...]\commando
-%D \stoptyping
-%D
-%D This command can be integrated in \type {\getparameters}, but we decided best not
-%D to do so.
-
-\unexpanded\def\processassignlist#1[#2]#3%
- {\def\syst_helpers_process_assign_list_assign[##1=##2=##3]%
- {\doif{##3}\relax{#3{##1}}}%
- \def\syst_helpers_process_assign_list_step##1%
- {\syst_helpers_process_assign_list_assign[##1==\relax]}%
- \processcommalist[#2]\syst_helpers_process_assign_list_step}
-
-%D \macros
-%D {untextargument
-%D untexcommand}
-%D
-%D When manipulating data(bases) and for instance generating index entries, the next
-%D three macros can be of help:
-%D
-%D \starttyping
-%D \untextargument{...}\to\name
-%D \untexcommand {...}\to\name
-%D \stoptyping
-%D
-%D They remove braces and backslashes and give us something to sort.
-
-\let\m_syst_helpers_untexed\empty
-
-\unexpanded\def\untexsomething
- {\begingroup
- \catcode\leftbraceasciicode \ignorecatcode
- \catcode\rightbraceasciicode\ignorecatcode
- \escapechar\minusone
- \syst_helpers_untex_something}
-
-\def\syst_helpers_untex_something#1#2\to#3%
- {\doglobal#1#2\to\m_syst_helpers_untexed
- \endgroup
- \let#3\m_syst_helpers_untexed}
-
-\unexpanded\def\untexargument{\untexsomething\convertargument}
-\unexpanded\def\untexcommand {\untexsomething\convertcommand}
-
-%D \macros
-%D {ScaledPointsToBigPoints,ScaledPointsToWholeBigPoints}
-%D
-%D One characteristic of \POSTSCRIPT\ and \PDF\ is that both used big points (\TEX's
-%D bp). The next macros convert points and scaled points into big points. The magic
-%D factor $72/72.27$ can be found in most \TEX\ related books.
-%D
-%D \starttyping
-%D \ScaledPointsToBigPoints {number} \target
-%D \ScaledPointsToWholeBigPoints {number} \target
-%D \stoptyping
-
-\let\tobigpoints \clf_tobigpoints
-\let\towholebigpoints\clf_towholebigpoints
-
-\unexpanded\def\PointsToBigPoints #1#2{\edef#2{\tobigpoints #1}} % can be avoided
-\unexpanded\def\PointsToWholeBigPoints #1#2{\edef#2{\towholebigpoints#1}} % can be avoided
-\unexpanded\def\ScaledPointsToBigPoints #1#2{\edef#2{\tobigpoints #1\scaledpoint}} % obsolete
-\unexpanded\def\ScaledPointsToWholeBigPoints#1#2{\edef#2{\towholebigpoints#1\scaledpoint}} % obsolete
-
-%D \macros
-%D {PointsToReal}
-%D
-%D Points can be stripped from their suffix by using \type {\withoutpt}. The next
-%D macro enveloppes this macro.
-%D
-%D \starttyping
-%D \PointsToReal {dimension} \target
-%D \stoptyping
-
-\unexpanded\def\PointsToReal#1#2%
- {\edef#2{\withoutpt\the\dimexpr#1}}
-
-%D \macros
-%D {dontleavehmode}
-%D
-%D Sometimes when we enter a paragraph with some command, the first token gets the
-%D whole first line. We can prevent this by saying:
-%D
-%D \starttyping
-%D \dontleavehmode
-%D \stoptyping
-%D
-%D This command is used in for instance the language module \type {lang-ini}. The
-%D first version was:
-%D
-%D \starttyping
-%D \def\dontleavehmode{\ifhmode\else\ifmmode\else$ $\fi\fi}
-%D \stoptyping
-%D
-%D Next, Taco came with a better alternative (using mathsurround):
-%D
-%D \starttyping
-%D \def\dontleavehmode
-%D {\ifhmode\else \ifmmode\else
-%D {\mathsurround\zeropoint\everymath\emptytoks$ $}%
-%D \fi \fi}
-%D \stoptyping
-%D
-%D And finaly we got the following alternative, one that avoids interfering grouping
-%D at the cost of a box.
-%D
-%D \starttyping
-%D \newbox\b_syst_helpers_dlh
-%D
-%D \unexpanded\def\dontleavehmode
-%D {\ifhmode\else \ifmmode\else
-%D \setbox\b_syst_helpers_dlh\hbox{\mathsurround\zeropoint\everymath\emptytoks$ $}\unhbox\b_syst_helpers_dlh
-%D \fi \fi}
-%D \stoptyping
-%D
-%D But, as we run a recent version of \TEX, we can use the new primitive:
-
-\ifdefined\normalquitvmode \let\dontleavehmode\normalquitvmode \fi
-
-%D \macros
-%D {utfupper, utflower, uppercasestring, lowercasestring}
-%D
-%D The names tell what they do:
-%D
-%D \starttyping
-%D \uppercasestring somestring\to\somestring
-%D \lowercasestring somestring\to\somestring
-%D \stoptyping
-%D
-%D The first argument may be a \type{\macro}.
-%D
-%D These macros are sort of obsolete as we never use uppercase this way. But
-%D nevertheless we provide them:
-
-\def\utfupper#1{\clf_upper{#1}} % expandable
-\def\utflower#1{\clf_lower{#1}} % expandable
-
-\unexpanded\def\uppercasestring#1\to#2{\dodoglobal\edef#2{\clf_upper{#1}}}
-\unexpanded\def\lowercasestring#1\to#2{\dodoglobal\edef#2{\clf_lower{#1}}}
-
-%D \macros
-%D {handletokens}
-%D
-%D With the next macro we enter a critical area of macro expansion. What we want is
-%D a macro that looks like:
-%D
-%D \starttyping
-%D \handletokens some tokens\with \somemacro
-%D \stoptyping
-%D
-%D A bonus example:
-%D
-%D \starttyping
-%D \hbox{\handletokens tekst en meer tekst\with\ruledhbox}
-%D
-%D \def\weetikveel#1{\if#1\blankspace\space\else\ruledhbox{#1}\fi}
-%D
-%D \hbox{\handletokens tekst en meer tekst\with\weetikveel}
-%D \stoptyping
-
-%D \macros
-%D {counttoken,counttokens}
-%D
-%D For the few occasions that we want to know the number of specific tokens in a
-%D string, we can use:
-%D
-%D \starttyping
-%D \counttoken token\in string\to \somecount
-%D \counttokens string\to \somecount
-%D \stoptyping
-%D
-%D This macro, that for instance is used in \type {cont-tab}, takes a real counter.
-%D The macro can be preceded by \type {\doglobal}.
-
-\def\syst_helpers_count_token#1% obeys {}
- {\def\m_syst_string_three{#1}%
- \ifx\m_syst_string_two\m_syst_string_three \else
- \ifx\m_syst_string_one\m_syst_string_three
- \advance\privatescratchcounter\plusone
- \fi
- \expandafter\syst_helpers_count_token
- \fi}
-
-\unexpanded\def\counttoken#1\in#2\to#3%
- {\privatescratchcounter\zerocount
- \def\m_syst_string_one{#1}%
- \def\m_syst_string_two{\end}%
- \syst_helpers_count_token#2\end
- \dodoglobal#3\privatescratchcounter}
-
-\unexpanded\def\counttokens#1\to#2%
- {\privatescratchcounter\zerocount
- \def\syst_helpers_count_token##1{\advance\privatescratchcounter\plusone}%
- \handletokens#1\with\syst_helpers_count_token
- \dodoglobal#2\privatescratchcounter}
-
-%D \macros
-%D {splitofftokens}
-%D
-%D Running this one not always gives the expected results. Consider for instance the
-%D macro for which I originally wrote this token handler.
-
-\unexpanded\def\splitofftokens#1\from#2\to#3% slow but hardly used
- {\ifnum#1>\zerocount
- \privatescratchcounter#1\relax
- \def\syst_helpers_split_off_tokens##1%
- {\ifnum\privatescratchcounter>\zerocount
- \advance\privatescratchcounter \minusone
- \edef#3{#3##1}%
- \fi}%
- % \let#3\empty % #3 can be #2, so:
- \expandafter\let\expandafter#3\expandafter\empty
- \expandafter\handletokens#2\with\syst_helpers_split_off_tokens
- \else
- \edef#3{#2}%
- \fi}
-
-%D This macro can be called like:
-%D
-%D \startbuffer[example]
-%D \splitofftokens10\from01234567 890123456789\to\test [\test]
-%D \stopbuffer
-%D
-%D up there. The reason for this is not that logical but follows from \TEX's
-%D However, the characters that we expect to find in \type {\test} just don't show
-%D sometimes mysterious way of expanding. Look at this:
-%D
-%D \startbuffer[next]
-%D \def\next{a} \edef\test{\next} [\test]
-%D \let\next=b \edef\test{\test\next} [\test]
-%D \let\next=c \edef\test{\next} [\test]
-%D \let\next=d \edef\test{\test\next} [\test]
-%D \let\next=e \expandafter\edef\expandafter\test\expandafter{\test\next} [\test]
-%D \stopbuffer
-%D
-%D \typebuffer[next]
-%D
-%D Careful reading shows that inside an \type {\edef} macro's that are \type {\let}
-%D are not expanded!
-%D
-%D \unprotect\getbuffer[next]\protect
-%D
-%D That's why we finally end up with a macro that looks ahead by using an
-%D assignment, this time by using \type {\futurelet}, and grabbing an argument as
-%D well. That way we can handle the sentinal, a blank space and grouped tokens.
-
-\unexpanded\def\syst_helpers_handle_tokens % \nexthandledtoken is part of interface
- {\futurelet\nexthandledtoken\syst_helpers_handle_tokens_indeed}
-
-\def\handletokens#1\with#2%
- {\gdef\syst_helpers_handle_tokens_command{#2}% permits more complex #2's
- \syst_helpers_handle_tokens#1\end}
-
-\def\syst_helpers_handle_tokens_indeed
- {\ifx\nexthandledtoken\blankspace
- \expandafter\syst_helpers_handle_tokens_indeed_one
- \orelse\ifx\nexthandledtoken\end
- \expandafter\gobbletwoarguments % also gobble the \end
- \else
- \expandafter\syst_helpers_handle_tokens_indeed_two
- \fi *}
-
-\def\syst_helpers_handle_tokens_indeed_one * %
- {\syst_helpers_handle_tokens_command{ }\syst_helpers_handle_tokens}
-
-\def\syst_helpers_handle_tokens_indeed_two *#1%
- {\syst_helpers_handle_tokens_command{#1}\syst_helpers_handle_tokens}
-
-%D This macro is tested on:
-%D
-%D \def\xxx#1{[#1]}
-%D
-%D \startlines
-%D \handletokens abc\with\xxx
-%D \handletokens a b c\with\xxx
-%D \handletokens a b c\with\xxx
-%D \handletokens a{bc}d\with\xxx
-%D \handletokens a\space bc \with\xxx
-%D \stoplines
-%D
-%D And our previous example shows up as:
-%D
-%D \getbuffer[example]
-
-%D \macros
-%D {iftrialtypesetting, ifvisible}
-%D
-%D The next boolean is at first sight a strange one. Sometimes one does a trial
-%D typesetting run, for instance to determine dimensions. Some mechanisms, like
-%D object inclusion, can fail on such trials. Temporary setting the next boolean to
-%D true, helps a lot. The second boolena can be used to inhibit processing
-%D completely.
-
-\newif\ifvisible \visibletrue
-
-\newtoks\everysettrialtypesetting
-\newtoks\everyresettrialtypesetting
-
-\unexpanded\def\settrialtypesetting {\the\everysettrialtypesetting } % obeys grouping so
-\unexpanded\def\resettrialtypesetting{\the\everyresettrialtypesetting} % this one is seldom needed
-
-\let\iftrialtypesetting\iffalse % so we have no \trialtypesettingtrue|false in mkiv !
-
-\appendtoks \let\iftrialtypesetting\iftrue \to \everysettrialtypesetting
-\appendtoks \let\iftrialtypesetting\iffalse \to \everyresettrialtypesetting
-
-%D \macros
-%D {twodigitrounding}
-%D
-%D When using \type {\special}s or \type {\pdfliteral}s, it sometimes makes sense to
-%D limit the precission. The next macro rounds a real number to two digits. It takes
-%D one argument and only works in \ETEX.
-
-\def\integerrounding #1{\clf_rounded\zerocount\numexpr#1\relax}
-\def\onedigitrounding #1{\clf_rounded\plusone \numexpr#1\relax}
-\def\twodigitrounding #1{\clf_rounded\plustwo \numexpr#1\relax}
-\def\threedigitrounding#1{\clf_rounded\plusthree\numexpr#1\relax}
-
-%D \macros
-%D {processcontent}
-%D
-%D This macro is first used in the tabulation macros.
-%D
-%D \starttyping
-%D \unexpanded\def\starthans%
-%D {\processcontent{stophans}\test{\message{\test}\wait}}
-%D \stoptyping
-
-\unexpanded\def\processcontent#1%
- {\begingroup\expandafter\syst_helpers_process_content\csname#1\endcsname}
-
-\unexpanded\def\syst_helpers_process_content#1#2#3%
- {\unexpanded\def\syst_helpers_process_content##1#1%
- {\endgroup\def#2{##1}#3}%
- \syst_helpers_process_content}
-
-%D \macros
-%D {dogobblesingleempty, dogobbledoubleempty}
-%D
-%D These two macros savely grab and dispose two arguments.
-
-\def\dogobblesingleempty{\dosingleempty\syst_helpers_gobble_single_empty}
-\def\dogobbledoubleempty{\dodoubleempty\syst_helpers_gobble_double_empty}
-
-\def\syst_helpers_gobble_single_empty [#1]{}
-\def\syst_helpers_gobble_double_empty[#1][#2]{}
-
-\let\gobblesingleempty\dogobblesingleempty % also used
-\let\gobbledoubleempty\dogobbledoubleempty % also used
-
-%D \macros
-%D {setdimensionwithunit, freezedimensionwithunit}
-%D
-%D The next assignments are all valid:
-%D
-%D \starttyping
-%D \setdimensionwithunit\scratchdimen{10} {cm}
-%D \setdimensionwithunit\scratchdimen{10cm}{cm}
-%D \setdimensionwithunit\scratchdimen{10cm}{}
-%D \freezedimensionwithunit\SomeWidth{\textwidth}
-%D \freezedimensionwithunit\SomeDepth{\dp\strutbox}
-%D \stoptyping
-%D
-%D As an alternative for the next macro we can use a global assignment inside a box.
-%D The \type {\empty}'s permits gobbling while preventing spurious \type {\relax}'s.
-
-\unexpanded\def\setdimensionwithunit#1#2#3% number unit dimension / nice trick
- {\afterassignment\gobblefourarguments#1=#2#3pt\relax\empty\empty\empty\empty}
-
-\unexpanded\def\freezedimensionwithunit#1#2%
- {\setdimensionwithunit\privatescratchdimen#1{#2}\edef#1{\the\privatescratchdimen}}
-
-%D \macros
-%D {doifsometokselse, doifsometoks}
-%D
-%D Not that fast I guess, but here's a way to test for token registers being empty.
-
-\unexpanded\def\doifelsesometoks#1%
- {\iftok#1\emptytoks
- \expandafter\secondoftwoarguments
- \else
- \expandafter\firstoftwoarguments
- \fi}
-
-\unexpanded\def\doifsometoks#1%
- {\iftok#1\emptytoks
- \expandafter\gobbleoneargument
- \else
- \expandafter\firstofoneargument
- \fi}
-
-\unexpanded\def\doifemptytoks#1%
- {\iftok#1\emptytoks
- \expandafter\firstofoneargument
- \else
- \expandafter\gobbleoneargument
- \fi}
-
-\let\doifsometokselse\doifelsesometoks
-
-%D \macros
-%D {startstrictinspectnextcharacter}
-%D
-%D This one is for the bibliography module (still?):
-
-\let\syst_helpers_strict_inspect_next_character[
-
-\def\syst_helpers_strict_inspect_next_character% no user macro !
- {\ifx\nexttoken[%
- \expandafter\m_syst_action_yes
- \else
- \expandafter\m_syst_action_nop
- \fi}
-
-\unexpanded\def\strictdoifelsenextoptional#1#2%
- {\def\m_syst_action_yes{#1}%
- \def\m_syst_action_nop{#2}%
- \futurelet\nexttoken\syst_helpers_strict_inspect_next_character}
-
-\let\strictdoifnextoptionalelse\strictdoifelsenextoptional
-
-%D \macros
-%D {gobblespacetokens}
-%D
-%D This macro needs a speed-up!
-
-%\def\gobblespacetokens
-% {\doifnextcharelse\empty\donothing\donothing} % no {}\do\do !
-
-\def\gobblespacetokens
- {\afterassignment\nexttoken\let\nexttoken=}
-
-%D \macros
-%D {verbatimargument}
-%D
-%D As the name says, this macro converts its argument to a (rather safe) string.
-
-\let\verbatimstring\detokenize
-
-%D These are needed in ordinal number conversions:
-
-\def\lastdigit#1%
- {\expandafter\thelastdigit\number#1\relax}
-
-\def\thelastdigit#1#2%
- {\ifx#2\relax#1\else\expandafter\thelastdigit\expandafter#2\fi}
-
-\def\lasttwodigits#1%
- {\expandafter\thelasttwodigits\expandafter0\number#1\relax}
-
-\def\thelasttwodigits#1#2#3% 0 dig ... \relax
- {\ifx#3\relax#1#2\else\expandafter\thelasttwodigits\expandafter#2\expandafter#3\fi}
-
-%D \macros
-%D {serializecommalist}
-%D
-%D Concatenate commalists:
-
-\let\syst_helpers_serialize_comma_list_step\relax
-
-\def\syst_helpers_serialize_comma_list_step#1%
- {\edef\serializedcommalist{\serializedcommalist#1}}
-
-\unexpanded\def\serializecommalist[#1]%
- {\let\serializedcommalist\empty
- \processcommacommand[#1]\syst_helpers_serialize_comma_list_step}
-
-%D \macros
-%D {purenumber}
-%D
-%D Sometimes we need control over when \TEX\ stops reading a number, especially in
-%D full expandable macros where using \type {\relax} would lead to disasters.
-%D
-%D \starttyping
-%D \ifodd\purenumber{...}\space ... \else ... \fi
-%D \stoptyping
-%D
-%D Here we use a space as number delimiter in combination with a space- and
-%D relax-less \type {\purenumber}. This macro works ok with \type {\the}, \type
-%D {\number} as well as \ETEX's \type {\numexpr}.
-
-\def\purenumber#1{\expandafter\firstofoneargument\expandafter{\number#1}}
-
-%D \macros
-%D {filterfromvalue}
-%D
-%D \starttyping
-%D \setvalue{xx}{{A}{B}{C}}
-%D
-%D \filterfromvalue{xx}{3}{3}
-%D \filterfromvalue{xx}{3}{2}
-%D \filterfromvalue{xx}{3}{1}
-%D \stoptyping
-%D
-%D An alternative is to store 'max' in the list, say:
-%D
-%D \starttyping
-%D \setvalue{xx}{3{A}{B}{C}}
-%D
-%D \filterfromvalues{3}{xx}{3}
-%D \filterfromvalues{3}{xx}{2}
-%D \filterfromvalues{3}{xx}{1}
-%D \stoptyping
-%D
-%D I'll implement this when I'm in \quotation {writing dirty macros mood}.
-
-\def\dofilterfromstr#1#2% max n % no need to be fast
- {\expandafter \expandafter \expandafter \csstring
- \ifcase#1\or \ifcase#2\or
- \firstofoneargument \else
- \gobbleoneargument \fi
- \or \ifcase#2\or
- \firstoftwoarguments \or
- \secondoftwoarguments \else
- \gobbletwoarguments \fi
- \or \ifcase#2\or
- \firstofthreearguments \or
- \secondofthreearguments \or
- \thirdofthreearguments \else
- \gobblethreearguments \fi
- \or \ifcase#2\or
- \firstoffourarguments \or
- \secondoffourarguments \or
- \thirdoffourarguments \or
- \fourthoffourarguments \else
- \gobblefourarguments \fi
- \or \ifcase#2\or
- \firstoffivearguments \or
- \secondoffivearguments \or
- \thirdoffivearguments \or
- \fourthoffivearguments \or
- \fifthoffivearguments \else
- \gobblefivearguments \fi
- \fi}
-
-\def\filterfromvalue#1#2#3% value max n
- {\expandafter\doubleexpandafter\csname % we use the fact that an
- \expandafter\ifx\csname#1\endcsname\relax % undefined cs has become \relax
- \csstring\gobbleoneargument % which we then gobble here
- \else
- \dofilterfromstr{#2}{#3}%
- \fi
- \endcsname\csname#1\endcsname}
-
-\def\filterfromnext#1#2% max n {..}{..}{..}{..}
- {\csname\dofilterfromstr{#1}{#2}\endcsname}
-
-%D \macros
-%D {definemeasure}
-%D
-%D \starttyping
-%D \definemeasure[mywidth][\dimexpr(\textwidth-1cm)]
-%D
-%D ... \measure{mywidth} ...
-%D \stoptyping
-
-\installsystemnamespace{measure}
-
-\unexpanded\def\definemeasure
- {\dodoubleargument\syst_helpers_define_measure}
-
-\def\syst_helpers_define_measure[#1][#2]%
- {\expandafter\def\csname\??measure#1\endcsname{#2}}
-
-\unexpanded\def\freezemeasure
- {\dodoubleargument\syst_helpers_freeze_measure}
-
-\def\syst_helpers_freeze_measure[#1][#2]%
- {\expandafter\edef\csname\??measure#1\endcsname{\the\dimexpr#2}}
-
-\unexpanded\def\setmeasure #1#2{\expandafter\def \csname\??measure#1\endcsname{#2}} % quick way
-\unexpanded\def\setgmeasure#1#2{\expandafter\gdef\csname\??measure#1\endcsname{#2}} % quick way
-\unexpanded\def\setemeasure#1#2{\expandafter\edef\csname\??measure#1\endcsname{\the\dimexpr#2}} % quick way
-\unexpanded\def\setxmeasure#1#2{\expandafter\xdef\csname\??measure#1\endcsname{\the\dimexpr#2}} % quick way
-
-\def\measure
- {\the\measured}
-
-\def\measured#1%
- %{\dimexpr\ifcsname\??measure#1\endcsname\csname\??measure#1\endcsname\else\zeropoint\fi\relax}
- {\dimexpr\ifcsname\??measure#1\endcsname\lastnamedcs\else\zeropoint\fi\relax}
-
-% #2 could be omitted, but we want to support spaces
-%
-% \setmeasure {x} {1cm}
-% \setmeasure {xx} {1cm}
-% \setmeasure {xxx}{1cm}
-
-%D \macros
-%D {definequantity}
-%D
-%D These do the same but for numbers.
-
-\installsystemnamespace{quantity}
-
-\unexpanded\def\definequantity
- {\dodoubleargument\syst_helpers_define_quantity}
-
-\def\syst_helpers_define_quantity[#1][#2]%
- {\expandafter\def\csname\??quantity#1\endcsname{#2}}
-
-\unexpanded\def\freezequantity
- {\dodoubleargument\syst_helpers_freeze_quantity}
-
-\def\syst_helpers_freeze_quantity[#1][#2]%
- {\expandafter\edef\csname\??quantity#1\endcsname{\the\numexpr#2}}
-
-\unexpanded\def\setquantity #1#2{\expandafter\def \csname\??quantity#1\endcsname{#2}} % quick way
-\unexpanded\def\setgquantity#1#2{\expandafter\gdef\csname\??quantity#1\endcsname{#2}} % quick way
-\unexpanded\def\setequantity#1#2{\expandafter\edef\csname\??quantity#1\endcsname{\the\numexpr#2}} % quick way
-\unexpanded\def\setxquantity#1#2{\expandafter\xdef\csname\??quantity#1\endcsname{\the\numexpr#2}} % quick way
-
-\def\quantity
- {\the\quantitied}
-
-\def\quantitied#1%
- {\numexpr\ifcsname\??quantity#1\endcsname\lastnamedcs\else\zeropoint\fi\relax}
-
-\def\directquantity#1%
- {\the\numexpr#1\relax}
-
-% let\quantified\quantitied
-
-%D \macros
-%D {dividedsize}
-%D
-%D This one can be used inside a measure (used in m4all):
-%D
-%D \starttyping
-%D \definemeasure[columnwidth][\dividedsize\textwidth{1em}{3}]
-%D \stoptyping
-
-\def\dividedsize#1#2#3% size gap n
- {\dimexpr
- \ifnum\dimexpr#1\relax>\plusone
- (\dimexpr#1\relax-\numexpr#3-\plusone\relax\dimexpr#2\relax)/#3\else#1%
- \fi
- \relax}
-
-%D \macros
-%D {doifdimensionelse}
-%D
-%D This is a dirty one: we simply append a unit and discard it when needed.
-
-\def\doifelsedimension#1%
- {\ifchkdim#1\or
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\let\doifdimensionelse\doifelsedimension
-
-%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
-
-\let\doifelsedimenstring\doifelsedimension
-\let\doifdimenstringelse\doifelsedimenstring
-
-%D \macros
-%D {comparedimension,comparedimensioneps}
-%D
-%D This is a dirty one: we simply append a unit and discard it when needed.
-
-\newdimen \roundingeps \roundingeps=10sp
-\newconstant\compresult
-
-\def\comparedimension#1#2%
- {\compresult
- \ifdim#1<#2%
- \zerocount
- \orelse\ifdim#1<#2%
- \plusone
- \else
- \plustwo
- \fi}
-
-\def\comparedimensioneps#1#2% todo: use eps feature
- {\compresult
- \ifdim\dimexpr#1-#2\relax<\roudingeps
- \zerocount
- \orelse\ifdim\dimexpr#2-#1\relax<\roudingeps
- \zerocount
- \orelse\ifdim#1<#2%
- \plusone
- \else
- \plustwo
- \fi}
-
-% pretty ugly but fast
-
-% \copycsname xxx\endcsname\csname ..\endcsname
-
-\unexpanded\def\copycsname{\expandafter\expandafter\expandafter\let\expandafter\expandafter\csname}
-
-% \letcscsname \crap \csname ..\endcsname
-% \letcsnamecs \csname ..\endcsname\crap
-% \letcsnamecsname\csname ..\endcsname\csname ..\endcsname
-
-\unexpanded\def\letcscsname {\expandafter\let\expandafter}
-\unexpanded\def\letcsnamecs {\expandafter\let}
-\unexpanded\def\letcsnamecsname{\expandafter\expandafter\expandafter\let\expandafter\expandafter}
-
-% another one, add an item to a commalist
-
-\unexpanded\def\addvalue#1#2% cs item
- {\ifcsname#1\endcsname\else\expandafter\let\csname#1\endcsname\empty\fi
- \normalexpanded{\noexpand\addtocommalist{#2}\expandafter\noexpand\csname#1\endcsname}}
-
-\def\unspaced#1%
- {\syst_helpers_unspaced#1\end}
-
-\def\syst_helpers_unspaced#1%
- {\ifx#1\end
- \expandafter\gobbleoneargument
- \orelse\ifx#1\blankspace
- % go on
- \else
- #1%
- \fi
- \syst_helpers_unspaced}
-
-\unexpanded\def\unspaceargument#1\to#2%
- {\privatescratchcounter\catcode\spaceasciicode
- \catcode\spaceasciicode\ignorecatcode
- \scantextokens{\edef#2{#1}}%
- \catcode\spaceasciicode\privatescratchcounter}
-
-\unexpanded\def\unspaceafter#1#2%
- {\unspaceargument#2\to\ascii
- \expandafter#1\expandafter{\ascii}}
-
-% sometimes handy:
-
-\unexpanded\def\doifelsehasspace#1%
- {\edef\m_syst_string_one{#1}%
- \normalexpanded{\syst_helpers_if_has_space_else#1\space}\empty\relax}
-
-\let\doifhasspaceelse\doifelsehasspace
-
-\unexpanded\def\syst_helpers_if_has_space_else#1 #2#3\relax % \space\empty\relax
- {\ifx\m_syst_string_one\space
- \expandafter\firstoftwoarguments
- \orelse\ifx#2\empty
- \expandafter\secondoftwoarguments
- \else
- \expandafter\firstoftwoarguments
- \fi}
-
-% this will replace loadfile once and alike !!! todo
-
-\installsystemnamespace{flag}
-
-\unexpanded\def\setflag #1{\expandafter\dodoglobal\expandafter\let\csname\??flag#1\endcsname\zerocount}
-\unexpanded\def\resetflag#1{\expandafter\dodoglobal\expandafter\let\csname\??flag#1\endcsname\plusone}
-
-\def\flag#1{\csname\??flag#1\endcsname}
-
-\def\doifelseflagged#1%
- {\expandafter\ifx\csname\??flag#1\endcsname\relax
- \expandafter\secondoftwoarguments
- \orelse\ifcase\csname\??flag#1\endcsname
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\let\doifflaggedelse\doifelseflagged
-
-\def\doifnotflagged#1%
- {\expandafter\ifx\csname\??flag#1\endcsname\relax
- \expandafter\firstofoneargument
- \orelse\ifcase\csname\??flag#1\endcsname
- \expandafter\gobbleoneargument
- \else
- \expandafter\firstofoneargument
- \fi}
-
-\unexpanded\def\inheritparameter[#1]#2[#3]#4[#5]% tag tokey fromkey
- {\expandafter\def\csname#1#3\expandafter\endcsname\expandafter{\csname#1#5\endcsname}}
-
-\def\syst_helpers_if_non_zero_positive_else#1#2\end % #3#4%
- {\ifx#1\relax
- \ifcase\privatescratchcounter
- \endgroup
- \doubleexpandafter\secondoftwoarguments
- \else
- \endgroup
- \doubleexpandafter\firstoftwoarguments
- \fi
- \else
- \endgroup
- \expandafter\secondoftwoarguments
- \fi}
-
-% used ?
-
-\def\doifelsenonzeropositive#1%
- {\begingroup\afterassignment\syst_helpers_if_non_zero_positive_else\privatescratchcounter=0#1\relax\empty\end}
-
-\let\doifnonzeropositiveelse\doifelsenonzeropositive
-
-% here ?
-
-\unexpanded\def\dosetrawvalue #1#2#3{\expandafter \def\csname#1#2\endcsname{#3}}
-\unexpanded\def\dosetrawevalue#1#2#3{\expandafter\edef\csname#1#2\endcsname{#3}}
-\unexpanded\def\dosetrawgvalue#1#2#3{\expandafter\gdef\csname#1#2\endcsname{#3}}
-\unexpanded\def\dosetrawxvalue#1#2#3{\expandafter\xdef\csname#1#2\endcsname{#3}}
-
-\unexpanded\def\getrawparameters {\dogetparameters\dosetrawvalue }
-\unexpanded\def\getraweparameters {\dogetparameters\dosetrawevalue}
-\unexpanded\def\getrawgparameters {\dogetparameters\dosetrawgvalue}
-\unexpanded\def\getrawxparameters {\dogetparameters\dosetrawxvalue}
-
-\unexpanded\def\globalgetrawparameters{\dogetparameters\dosetrawgvalue} % obsolete
-
-%D Sort of obsolete:
-
-\newcount\c_syst_helpers_mod
-
-\unexpanded\def\dosetmodulo#1#2#3%
- {\c_syst_helpers_mod#1\divide\c_syst_helpers_mod#2\multiply\c_syst_helpers_mod#2%
- #3#1\advance#3-\c_syst_helpers_mod}
-
-\unexpanded\def\dosetdivision#1#2#3%
- {#3#1\divide#3 #2\relax}
-
-\unexpanded\def\DoMod#1by#2to#3{\dosetmodulo {#1}{#2}{#3}}
-\unexpanded\def\DoDiv#1by#2to#3{\dosetdivision{#1}{#2}{#3}}
-
-\def\syst_helpers_unprotected#1\par
- {#1\protect}
-
-\unexpanded\def\unprotected
- {\unprotect
- \syst_helpers_unprotected}
-
-\let\resettimer \clf_resettimer
-\let\elapsedtime \clf_elapsedtime
-\let\elapsedseconds \elapsedtime
-
-\newcount\c_syst_helpers_test_feature_n
-\newcount\c_syst_helpers_test_feature_m
-
-\def\currentfeaturetest{\number\c_syst_helpers_test_feature_n}
-
-\unexpanded\def\testfeature#1#2%
- {\c_syst_helpers_test_feature_m#1\relax
- \def\syst_helpers_test_feature_yes
- {\advance\c_syst_helpers_test_feature_n\plusone
- \ifnum\c_syst_helpers_test_feature_n>\c_syst_helpers_test_feature_m\else
- #2\expandafter\syst_helpers_test_feature_yes
- \fi}%
- \def\syst_helpers_test_feature_nop
- {\advance\c_syst_helpers_test_feature_n\plusone
- \ifnum\c_syst_helpers_test_feature_n>\c_syst_helpers_test_feature_m\else
- \expandafter\syst_helpers_test_feature_nop
- \fi}%
- \retestfeature}
-
-\unexpanded\def\retestfeature % timer support is new per 10/5/2005
- {\bgroup
- \ifcase\interactionmode\let\wait\relax\fi
- \clf_resettimer
- \c_syst_helpers_test_feature_n\zerocount
- \syst_helpers_test_feature_nop
- \clf_benchmarktimer
- \writestatus\m!system{starting feature test (n=\number\c_syst_helpers_test_feature_m)}\wait
- \c_syst_helpers_test_feature_n\zerocount
- \syst_helpers_test_feature_yes
- \writestatus\m!system{\number\c_syst_helpers_test_feature_m\space feature tests done (\elapsedseconds s)}%
- \wait
- \egroup}
-
-\unexpanded\def\showtimer#1%
- {\writestatus{runtime}{\elapsedseconds\space s / #1}}
-
-\unexpanded\def\testfeatureonce#1#2%
- {\begingroup
- \let\wait\relax
- \testfeature{#1}{#2}%
- \endgroup}
-
-%D \macros
-%D {freezedimenmacro}
-%D
-%D This macro is use as:
-%D
-%D \starttyping
-%D \freezedimenmacro\leftmargindistance
-%D \stoptyping
-
-\unexpanded\def\freezedimenmacro#1%
- {\edef#1{\the\dimexpr#1}}
-
-%D The next macro negates a macro (dimension or number, or actually, whatever. It's
-%D a typical example of \type {\if} usage:
-%D
-%D \starttyping
-%D \if-\whatever \else-\whatever\fi => else => -whatever
-%D \if--\whatever\else-\whatever\fi => then => whatever
-%D \stoptyping
-
-\def\negated#1{\if-#1\else-#1\fi} % does only work in macros or text
-
-\def\gobbleassigndimen#1\\{}
-
-\def\assigndimen#1#2%
- {\afterassignment\gobbleassigndimen#1=#2\zeropoint\\}
-
-\unexpanded\def\appended#1#2#3{\expandafter#1\expandafter#2\expandafter{#2#3}}
-\unexpanded\def\appendvalue #1{\expandafter\appended\expandafter \def\csname#1\endcsname}
-\unexpanded\def\appendgvalue#1{\expandafter\appended\expandafter\gdef\csname#1\endcsname}
-
-\unexpanded\def\prepended#1#2#3%
- {\t_syst_helpers_scratch{#3}%
- \expandafter\expandafter\expandafter#1\expandafter\expandafter\expandafter#2\expandafter\expandafter\expandafter
- {\expandafter\the\expandafter\t_syst_helpers_scratch#2}}
-
-\unexpanded\def\prependvalue #1{\expandafter\prepended\expandafter \def\csname#1\endcsname}
-\unexpanded\def\prependgvalue#1{\expandafter\prepended\expandafter\gdef\csname#1\endcsname}
-
-%D \macros
-%D {dowithrange}
-%D
-%D This one is for Mojca Miklavec, who made me aware of the fact that \type
-%D {page-imp.tex} was not the best place to hide it.
-%D
-%D \startbuffer
-%D \def\DoSomething#1{ [item #1] }
-%D
-%D \processranges[1,4:5]\DoSomething \par
-%D \dowithrange {1,4:5}\DoSomething \par
-%D \stopbuffer
-%D
-%D \typebuffer \blank \getbuffer \blank
-
-\def\syst_helpers_with_range#1%
- {\splitstring#1\at:\to\m_syst_helpers_range_from\and\m_syst_helpers_range_to
- \ifx\m_syst_helpers_range_to\empty\let\m_syst_helpers_range_to\m_syst_helpers_range_from\fi
- \dostepwiserecurse\m_syst_helpers_range_from\m_syst_helpers_range_to\plusone{\m_helpers_range_action{##1}}}%
-
-\unexpanded\def\processranges[#1]#2% #1= n:m,p,q:r
- {\def\m_helpers_range_action{#2}%
- \processcommacommand[#1]\syst_helpers_with_range}
-
-\unexpanded\def\dowithrange#1#2%
- {\def\m_helpers_range_action{#2}%
- \processcommacommand[#1]\syst_helpers_with_range}
-
-% \def\DoSomething#1{ [item #1] }
-% \dowithrange[1,4:5]\DoSomething
-
-%D \macros
-%D {ignoreimplicitspaces}
-%D
-%D \startbuffer
-%D \def\whatever[#1]{\expanded{\definedfont[#1 at 12pt]}\ignorespaces}
-%D {a\whatever[Serif]b a\whatever[Serif] b a\whatever[Serif]\space b}
-%D \def\whatever[#1]{\expanded{\definedfont[#1 at 12pt]}\ignoreimplicitspaces}
-%D {a\whatever[Serif]b a\whatever[Serif] b a\whatever[Serif]\space b}
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-
-\unexpanded\def\ignoreimplicitspaces
- {\doifelsenextchar\relax\relax\relax}
-
-%D \macros
-%D {processwords}
-%D
-%D Not that sophisticated but sometimes users (like in metafun).
-
-\def\syst_helpers_process_word#1 #2\_e_o_w_
- {\doifsomething{#1}{\processword{#1} \syst_helpers_process_word#2 \_e_o_w_}}
-
-\def\processwords#1%
- {\syst_helpers_process_word#1 \_e_o_w_}% no \unskip
-
-\let\processword\relax
-
-%D \macros
-%D {startnointerference}
-%D
-%D \starttyping
-%D \startnointerference
-%D all kind of code
-%D \stopnointerference
-%D \stoptyping
-
-\newbox\b_syst_helpers_no_interference
-
-\unexpanded\def\startnointerference % not even grouped !
- {\setbox\b_syst_helpers_no_interference\vbox
- \bgroup}
-
-\unexpanded\def\stopnointerference
- {\egroup
- \setbox\b_syst_helpers_no_interference\emptybox}
-
-%D A variant for \type {\executeifdefined}:
-
-\def\expandcheckedcsname#1#2% #2 is often a \xxxparameter so let's expand it once
- {\normalexpanded{\noexpand\syst_helpers_expand_checked_csname{#1}{#2}}}
-
-\def\syst_helpers_expand_checked_csname#1#2#3%
- {\csname#1\ifcsname#1#2\endcsname#2\else#3\fi\endcsname}
-
-%D Signal. Some fonts have a char0 rendering so we need to make sure that it is not
-%D set in the font! (This will be overloaded)
-
-\unexpanded\def\signalcharacter{\char\zerocount} % \zwj
-
-%D A few secial variants of commands defined here. Some more will be moved here (e.g.
-%D from table modules.
-
-\def\dodirectdoubleempty#1#2% used in math (lookahead issues)
- {\ifx#2[%
- \expandafter\syst_helpers_direct_double_empty_one_yes
- \else
- \expandafter\syst_helpers_direct_double_empty_one_nop
- \fi#1#2}
-
-\def\syst_helpers_direct_double_empty_one_yes#1[#2]#3%
- {\ifx#3[\else\expandafter\syst_helpers_direct_double_empty_two_nop\fi#1[#2]#3}
-
-\def\syst_helpers_direct_double_empty_one_nop#1{#1[][]}
-\def\syst_helpers_direct_double_empty_two_nop#1[#2]{#1[#2][]}
-
-%D Used in math definitions (in an \type {\edef}):
-
-%D \startbuffer
-%D [\docheckedpair{}]
-%D [\docheckedpair{a}]
-%D [\docheckedpair{a,b}]
-%D [\docheckedpair{a,b,c}]
-%D \stopbuffer
-%D
-%D \typebuffer \startlines \getbuffer \stoplines
-
-\def\docheckedpair#1%
- {\syst_helpers_checked_pair#1,,\_o_e_p_}
-
-\def\syst_helpers_checked_pair#1,#2,#3\_o_e_p_
- {#1,#2}
-
-%D Here are some nasty helpers. They can be used to fill often expanded token
-%D lists efficiently (see tabulate for an example).
-
-\def\constantnumber#1%
- {\ifcase#1\zerocount
- \or \plusone
- \or \plustwo
- \or \plusthree
- \or \plusfour
- \or \plusfive
- \or \plussix
- \or \plusseven
- \or \pluseight
- \or \plusnine
- \or \plusten
- \else \number#1\relax\fi}
-
-\def\constantnumberargument#1%
- {\ifcase#1\zerocount
- \or \plusone
- \or \plustwo
- \or \plusthree
- \or \plusfour
- \or \plusfive
- \or \plussix
- \or \plusseven
- \or \pluseight
- \or \plusnine
- \or \plusten
- \else {\number#1}\fi}
-
-\def\constantdimen#1%
- {\ifdim#1=\zeropoint
- \zeropoint
- \else
- \the#1\relax
- \fi}
-
-\def\constantdimenargument#1%
- {\ifdim#1=\zeropoint
- \zeropoint
- \else
- {\the#1}%
- \fi}
-
-\def\constantemptyargument#1%
- {\ifx#1\empty
- \noexpand\empty
- \else
- {#1}%
- \fi}
-
-%D \macros
-%D {getsubstring}
-%D \startbuffer
-%D
-%D \getsubstring{4}{}{Who Wants This}
-%D \getsubstring{4}{9}{Who Wants This}
-%D \getsubstring{9}{-2}{Who Wants This}
-%D \getsubstring{1}{5}{Who Wants This}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \startlines
-%D \getbuffer
-%D \stoplines
-
-% expandable:
-
-\def\getsubstring#1#2#3{\clf_getsubstring{#3}{#1}{#2}}
-
-%D Other dimensions than pt (used in mb-mp)
-
-\def\converteddimen#1#2{\clf_converteddimen\dimexpr#1\relax{#2}}
-
-%D Maybe (looks ugly):
-%D
-%D \starttyping
-%D \doifcase {foo}
-%D {bar} {BAR}
-%D {foo} {FOO}
-%D {default} {DEFAULT}
-%D
-%D \doifcase {foo}
-%D {bar} {BAR}
-%D {foo} {\doifcase {bar}
-%D {bar} {BAR}
-%D {foo} {FOO}
-%D {default} {DEFAULT}
-%D }
-%D {default} {DEFAULT}
-%D \stoptyping
-
-% \doifcase {\btxfoundname{author}}
-% {author} {\btxflush{author}}
-% {editor} {\texdefinition{btx:apa:editor-or-editors}}
-% {title} {\texdefinition{btx:apa:title-subtitle-type}}
-% {default} {\btxflush{author}}
-
-% \unexpanded\def\doifcase#1%
-% {\edef\m_case_asked{#1}%
-% \syst_aux_case}
-%
-% \def\syst_aux_case#1%
-% {\edef\m_case_temp{#1}%
-% \ifx\m_case_temp\m_case_asked
-% \expandafter\syst_aux_case_yes
-% \orelse\ifx\m_case_temp\s!default
-% \expandafter\firstofoneargument
-% \else
-% \expandafter\syst_aux_case_nop
-% \fi}
-%
-% \def\syst_aux_skip#1#2%
-% {\edef\m_case_temp{#1}%
-% \ifx\m_case_temp\s!default
-% \expandafter\syst_aux_done
-% \else
-% \expandafter\syst_aux_skip
-% \fi}
-%
-% \def\syst_aux_case_yes#1%
-% {\def\syst_aux_done{#1}%
-% \syst_aux_skip}
-%
-% \def\syst_aux_case_nop#1%
-% {\syst_aux_case}
-
-%D \macros
-%D {ntimes}
-%D
-%D some repetition:
-%D
-%D \startbuffer
-%D \ntimes{*}{20}
-%D \stopbuffer
-%D
-%D \typebuffer \blank gives: \getbuffer \blank
-%D
-%D This is not real fast but quite okay:
-
-%def\ntimes#1#2{\ifnum#2>\zerocount#1\ntimes{#1}{\numexpr#2-\plusone\relax}\fi} % 1.72
-\def\ntimes#1#2{\clf_ntimes{#1}\numexpr#2\relax} % 0.33
-
-%D Experiment (sometimes looks nicer in code):
-
-\unexpanded\def\sameargumentscondition#1#2%
- {\edef\m_syst_string_one{#1}%
- \edef\m_syst_string_two{#2}%
- \ifx\m_syst_string_one\m_syst_string_two}
-
-\unexpanded\def\emptyargumentcondition#1%
- {\edef\m_syst_string_one{#1}%
- \ifx\m_syst_string_one\empty}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/syst-con.lua b/Master/texmf-dist/tex/context/base/mkiv/syst-con.lua
index 1af2d9a5d5e..6e998bdfd5e 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/syst-con.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/syst-con.lua
@@ -30,12 +30,18 @@ function converters.octstringtonumber(n) tonumber(n, 8) end
function converters.rawcharacter (n) utfchar(0x110000+n) end
-local lchexnumber = formatters["%x"]
-local uchexnumber = formatters["%X"]
-local lchexnumbers = formatters["%02x"]
-local uchexnumbers = formatters["%02X"]
-local octnumber = formatters["%03o"]
-local nicenumber = formatters["%0.6F"]
+local f_lchexnumber = formatters["%x"]
+local f_uchexnumber = formatters["%X"]
+local f_lchexnumbers = formatters["%02x"]
+local f_uchexnumbers = formatters["%02X"]
+local f_octnumber = formatters["%03o"]
+local nicenumber = formatters["%0.6F"]
+
+local lchexnumber = function(n) if n < 0 then n = 0x100000000 + n end return f_lchexnumber (n) end
+local uchexnumber = function(n) if n < 0 then n = 0x100000000 + n end return f_uchexnumber (n) end
+local lchexnumbers = function(n) if n < 0 then n = 0x100000000 + n end return f_lchexnumbers(n) end
+local uchexnumbers = function(n) if n < 0 then n = 0x100000000 + n end return f_uchexnumbers(n) end
+local octnumber = function(n) if n < 0 then n = 0x100000000 + n end return f_octnumber (n) end
converters.lchexnumber = lchexnumber
converters.uchexnumber = uchexnumber
diff --git a/Master/texmf-dist/tex/context/base/mkiv/syst-con.mkiv b/Master/texmf-dist/tex/context/base/mkiv/syst-con.mkiv
index 56155460a90..ddd65865d22 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/syst-con.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/syst-con.mkiv
@@ -84,14 +84,14 @@
%D \macros{setcalculatedsin,setcalculatedcos,setcalculatedtan}
-\unexpanded\def\setcalculatedsin#1#2{\edef#1{\clf_sind#2}}
-\unexpanded\def\setcalculatedcos#1#2{\edef#1{\clf_cosd#2}}
-\unexpanded\def\setcalculatedtan#1#2{\edef#1{\clf_tand#2}}
+\protected\def\setcalculatedsin#1#2{\edef#1{\clf_sind#2}}
+\protected\def\setcalculatedcos#1#2{\edef#1{\clf_cosd#2}}
+\protected\def\setcalculatedtan#1#2{\edef#1{\clf_tand#2}}
%D \macros{formatted,format}
- \def\formatted#1{\ctxcommand{format(#1)}} % not clf
-\unexpanded\def\format #1{\ctxcommand{format(#1)}} % not clf
+ \def\formatted#1{\ctxcommand{format(#1)}} % not clf
+\protected\def\format #1{\ctxcommand{format(#1)}} % not clf
%D The \type {\modulatednumber} and \type {\realnumber} macros have been removed.
diff --git a/Master/texmf-dist/tex/context/base/mkiv/syst-con.mkxl b/Master/texmf-dist/tex/context/base/mkiv/syst-con.mkxl
deleted file mode 100644
index c3293b221f8..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/syst-con.mkxl
+++ /dev/null
@@ -1,93 +0,0 @@
-%D \module
-%D [ file=syst-con,
-%D version=2006.09.16, % real old stuff ... 2000.12.10
-%D title=\CONTEXT\ System Macros,
-%D subtitle=Conversions,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\registerctxluafile{syst-con}{}
-
-\unprotect
-
-%D \macros{lchexnumber,uchexnumber,lchexnumbers,uchexnumbers}
-%D
-%D In addition to the uppercase hex conversion, as needed in math families, we
-%D occasionally need a lowercase one.
-
-\def\lchexnumber #1{\clf_lchexnumber \numexpr#1\relax}
-\def\uchexnumber #1{\clf_uchexnumber \numexpr#1\relax}
-\def\lchexnumbers#1{\clf_lchexnumbers\numexpr#1\relax}
-\def\uchexnumbers#1{\clf_uchexnumbers\numexpr#1\relax}
-
-\let\hexnumber\uchexnumber
-
-%D \macros{octnumber}
-%D
-%D For \UNICODE\ remapping purposes, we need octal numbers.
-
-\def\octnumber#1{\clf_octnumber\numexpr#1\relax}
-
-%D \macros{hexstringtonumber,octstringtonumber}
-%D
-%D This macro converts a two character hexadecimal number into a decimal number,
-%D thereby taking care of lowercase characters as well.
-
-\def\hexstringtonumber#1{\clf_hexstringtonumber\numexpr#1\relax}
-\def\octstringtonumber#1{\clf_octstringtonumber\numexpr#1\relax}
-
-%D \macros{rawcharacter}
-%D
-%D This macro can be used to produce proper 8 bit characters that we sometimes need
-%D in backends and round||trips.
-
-\def\rawcharacter#1{\clf_rawcharacter\numexpr#1\relax}
-
-%D \macros{twodigits, threedigits}
-%D
-%D These macros provides two or three digits always:
-
-\def\twodigits #1{\ifnum #1<10 0\fi\number#1}
-\def\threedigits#1{\ifnum#1<100 \ifnum#1<10 0\fi0\fi\number#1}
-
-%D \macros{modulonumber}
-%D
-%D In the conversion macros described in \type {core-con} we need a wrap||around
-%D method. The following solution is provided by Taco.
-%D
-%D The \type {modulonumber} macro expands to the mathematical modulo of a positive
-%D integer. It is crucial for it's application that this macro is fully exandable.
-%D
-%D The expression inside the \type {\numexpr} itself is somewhat bizarre because
-%D \ETEX\ uses a rounding division instead of truncation. If \ETEX's division would
-%D have behaved like \TEX's normal\type {\divide}, then the expression could have
-%D been somewhat simpler, like \type {#2-(#2/#1)*#1}. This works just as well, but a
-%D bit more complex.
-%D
-%D \starttyping
-%D \def\modulonumber#1#2{\the\numexpr#2-((((#2+(#1/2))/#1)-1)*#1)\relax}
-%D \stoptyping
-%D
-%D But \unknown\ now we can also do this:
-
-\def\modulonumber#1#2{\the\numexpr#2-(#2:#1)*#1\relax}
-
-%D \macros{setcalculatedsin,setcalculatedcos,setcalculatedtan}
-
-\unexpanded\def\setcalculatedsin#1#2{\edef#1{\clf_sind#2}}
-\unexpanded\def\setcalculatedcos#1#2{\edef#1{\clf_cosd#2}}
-\unexpanded\def\setcalculatedtan#1#2{\edef#1{\clf_tand#2}}
-
-%D \macros{formatted,format}
-
- \def\formatted#1{\ctxcommand{format(#1)}} % not clf
-\unexpanded\def\format #1{\ctxcommand{format(#1)}} % not clf
-
-%D The \type {\modulatednumber} and \type {\realnumber} macros have been removed.
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/syst-fnt.mkiv b/Master/texmf-dist/tex/context/base/mkiv/syst-fnt.mkiv
index cacc5f51740..83b57f5f726 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/syst-fnt.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/syst-fnt.mkiv
@@ -15,28 +15,23 @@
\unprotect
-\def\fontslantperpoint {\fontdimen\plusone }
-\def\fontinterwordspace {\fontdimen\plustwo }
-\def\fontinterwordstretch{\fontdimen\plusthree}
-\def\fontinterwordshrink {\fontdimen\plusfour }
-\def\fontexheight {\fontdimen\plusfive }
-\def\fontemwidth {\fontdimen\plussix }
-\def\fontextraspace {\fontdimen\plusseven}
-
-\def\slantperpoint {\fontdimen\plusone \font}
-\def\interwordspace {\fontdimen\plustwo \font}
-\def\interwordstretch {\fontdimen\plusthree\font}
-\def\interwordshrink {\fontdimen\plusfour \font}
-\def\exheight {\fontdimen\plusfive \font}
-\def\emwidth {\fontdimen\plussix \font}
-\def\extraspace {\fontdimen\plusseven\font}
-
-\def\mathsupdisplay {\fontdimen13 } % to be remapped
-\def\mathsupnormal {\fontdimen14 } % to be remapped
-\def\mathsupcramped {\fontdimen15 } % to be remapped
-\def\mathsubnormal {\fontdimen16 } % to be remapped
-\def\mathsubcombined {\fontdimen17 } % to be remapped
-\def\mathaxisheight {\fontdimen22 } % to be remapped
+\protected\def\fontslantperpoint {\fontdimen\plusone }
+\protected\def\fontinterwordspace {\fontdimen\plustwo }
+\protected\def\fontinterwordstretch{\fontdimen\plusthree}
+\protected\def\fontinterwordshrink {\fontdimen\plusfour }
+\protected\def\fontexheight {\fontdimen\plusfive }
+\protected\def\fontemwidth {\fontdimen\plussix }
+\protected\def\fontextraspace {\fontdimen\plusseven}
+
+\protected\def\slantperpoint {\fontdimen\plusone \font}
+\protected\def\interwordspace {\fontdimen\plustwo \font}
+\protected\def\interwordstretch {\fontdimen\plusthree\font}
+\protected\def\interwordshrink {\fontdimen\plusfour \font}
+\protected\def\exheight {\fontdimen\plusfive \font}
+\protected\def\emwidth {\fontdimen\plussix \font}
+\protected\def\extraspace {\fontdimen\plusseven\font}
+
+\let \mathaxisheight \Umathaxis % takes style
\def\currentspaceskip {\interwordspace\s!plus\interwordstretch\s!minus\interwordshrink\relax}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/syst-ini.mkiv b/Master/texmf-dist/tex/context/base/mkiv/syst-ini.mkiv
index 0dd1fe29cf6..aafbc787e5e 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/syst-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/syst-ini.mkiv
@@ -58,7 +58,9 @@
\chardef\primeasciicode 39 % '
\chardef\leftparentasciicode 40
\chardef\rightparentasciicode 41
+\chardef\commaasciicode 44
\chardef\hyphenasciicode 45
+\chardef\periodasciicode 46
\chardef\forwardslashasciicode 47 % /
\chardef\colonasciicode 58
\chardef\lessthanasciicode 60 % < used as alternative verbatim {
@@ -233,21 +235,21 @@
%D The allocators share a common helper macro.
-\normalprotected\def\newcount {\syst_basics_allocate\c_syst_last_allocated_count \count \countdef \c_syst_max_allocated_register}
-\normalprotected\def\newdimen {\syst_basics_allocate\c_syst_last_allocated_dimen \dimen \dimendef \c_syst_max_allocated_register}
-\normalprotected\def\newskip {\syst_basics_allocate\c_syst_last_allocated_skip \skip \skipdef \c_syst_max_allocated_register}
-\normalprotected\def\newmuskip {\syst_basics_allocate\c_syst_last_allocated_muskip \muskip \muskipdef \c_syst_max_allocated_register}
-\normalprotected\def\newbox {\syst_basics_allocate\c_syst_last_allocated_box \box \mathchardef\c_syst_max_allocated_register}
-\normalprotected\def\newtoks {\syst_basics_allocate\c_syst_last_allocated_toks \toks \toksdef \c_syst_max_allocated_register}
-\normalprotected\def\newread {\syst_basics_allocate\c_syst_last_allocated_read \read \chardef \c_syst_max_allocated_read}
-\normalprotected\def\newwrite {\syst_basics_allocate\c_syst_last_allocated_write \write \chardef \c_syst_max_allocated_write}
-\normalprotected\def\newmarks {\syst_basics_allocate\c_syst_last_allocated_marks \marks \mathchardef\c_syst_max_allocated_register}
-\normalprotected\def\newinsert {\syst_basics_allocate\c_syst_last_allocated_insertion\insert \chardef \c_syst_max_allocated_insert}
+\protected\def\newcount {\syst_basics_allocate\c_syst_last_allocated_count \count \countdef \c_syst_max_allocated_register}
+\protected\def\newdimen {\syst_basics_allocate\c_syst_last_allocated_dimen \dimen \dimendef \c_syst_max_allocated_register}
+\protected\def\newskip {\syst_basics_allocate\c_syst_last_allocated_skip \skip \skipdef \c_syst_max_allocated_register}
+\protected\def\newmuskip {\syst_basics_allocate\c_syst_last_allocated_muskip \muskip \muskipdef \c_syst_max_allocated_register}
+\protected\def\newbox {\syst_basics_allocate\c_syst_last_allocated_box \box \mathchardef\c_syst_max_allocated_register}
+\protected\def\newtoks {\syst_basics_allocate\c_syst_last_allocated_toks \toks \toksdef \c_syst_max_allocated_register}
+\protected\def\newread {\syst_basics_allocate\c_syst_last_allocated_read \read \chardef \c_syst_max_allocated_read}
+\protected\def\newwrite {\syst_basics_allocate\c_syst_last_allocated_write \write \chardef \c_syst_max_allocated_write}
+\protected\def\newmarks {\syst_basics_allocate\c_syst_last_allocated_marks \marks \mathchardef\c_syst_max_allocated_register}
+\protected\def\newinsert {\syst_basics_allocate\c_syst_last_allocated_insertion\insert \chardef \c_syst_max_allocated_insert}
%D We don't need these in \CONTEXT:
-\normalprotected\def\newlanguage{\syst_basics_allocate\c_syst_last_allocated_language \language\chardef \c_syst_max_allocated_language}
-\normalprotected\def\newfamily {\syst_basics_allocate\c_syst_last_allocated_family \fam \chardef \c_syst_max_allocated_family}
+\protected\def\newlanguage{\syst_basics_allocate\c_syst_last_allocated_language \language\chardef \c_syst_max_allocated_language}
+\protected\def\newfamily {\syst_basics_allocate\c_syst_last_allocated_family \fam \chardef \c_syst_max_allocated_family}
\let\newfam\newfamily
@@ -256,10 +258,10 @@
% Watch out, for the moment we disable the check for already being defined
% later we will revert this but first all chardefs must be replaced.
-\normalprotected\def\newconstant #1{\ifdefined#1\let#1\undefined\fi\newcount#1}
-\normalprotected\def\setnewconstant #1{\ifdefined#1\let#1\undefined\fi\newcount#1#1} % just a number
-\normalprotected\def\setconstant {} % dummy, no checking, so it warns
-\normalprotected\def\setconstantvalue#1#2{\csname#1\endcsname\numexpr#2\relax}
+\protected\def\newconstant #1{\ifdefined#1\let#1\undefined\fi\newcount#1}
+\protected\def\setnewconstant #1{\ifdefined#1\let#1\undefined\fi\newcount#1#1} % just a number
+\protected\def\setconstant {} % dummy, no checking, so it warns
+\protected\def\setconstantvalue#1#2{\csname#1\endcsname\numexpr#2\relax}
% maybe setconstant with check
@@ -274,8 +276,8 @@
%D as all engines now provide many registers we removed all traces.
\ifdefined\writestatus \else
- %\normalprotected\def\writestatus#1#2{\immediate\write\statuswrite{#1: #2}}
- \normalprotected\def\writestatus#1#2{\message{#1: #2}}
+ %\protected\def\writestatus#1#2{\immediate\write\statuswrite{#1: #2}}
+ \protected\def\writestatus#1#2{\message{#1: #2}}
\fi
\def\syst_basics_allocate_yes#1#2#3#4#5% last class method max name
@@ -302,8 +304,8 @@
%D Since the number of chars exceed 256 now, we can use \type {\chardef} instead of
%D the more limited \type {\mathchardef}.
-\normalprotected\def\newbox {\syst_basics_allocate\c_syst_last_allocated_box \box \chardef\c_syst_max_allocated_register}
-\normalprotected\def\newmarks{\syst_basics_allocate\c_syst_last_allocated_marks\marks\chardef\c_syst_max_allocated_register}
+\protected\def\newbox {\syst_basics_allocate\c_syst_last_allocated_box \box \chardef\c_syst_max_allocated_register}
+\protected\def\newmarks{\syst_basics_allocate\c_syst_last_allocated_marks\marks\chardef\c_syst_max_allocated_register}
%D Attributes are something very \LUATEX. In \CONTEXT\ you are not supposed to use
%D the attributes directly but always allocate then first. For instance attribute~0
@@ -312,14 +314,14 @@
\let\attributeunsetvalue\c_syst_min_counter_value % used to be \minusone
-\normalprotected\def\newattribute{\syst_basics_allocate\c_syst_last_allocated_attribute\attribute\attributedef\c_syst_max_allocated_register}
+\protected\def\newattribute{\syst_basics_allocate\c_syst_last_allocated_attribute\attribute\attributedef\c_syst_max_allocated_register}
%D Not used by \CONTEXT\ but for instance \PICTEX\ needs it. It's a trick to force
%D strings instead of tokens that take more memory. It's a trick to trick to force
%D strings. This macro is never used in \CONTEXT.
-%normalprotected\def\newhelp#1#2{\newtoks#1#1\expandafter{\csname#2\endcsname}}
-\normalprotected\def\newhelp#1#2{\newtoks#1#1\expandafter{\detokenize{#2}}}
+%protected\def\newhelp#1#2{\newtoks#1#1\expandafter{\csname#2\endcsname}}
+\protected\def\newhelp#1#2{\newtoks#1#1\expandafter{\detokenize{#2}}}
%D \macros
%D {scratchcounter,
@@ -442,6 +444,8 @@
\chardef \pluseight 8
\chardef \plusnine 9
\chardef \plusten 10
+\chardef \pluseleven 11
+\chardef \plustwelve 12
\chardef \plussixteen 16
\chardef \plusfifty 50
\chardef \plushundred 100
@@ -488,7 +492,7 @@
%D
%D We need this one soon:
-\normalprotected\def\dontcomplain
+\protected\def\dontcomplain
{\hbadness\plustenthousand
\vbadness\plustenthousand
\hfuzz \maxdimen
@@ -522,7 +526,7 @@
%D creates \type {\footrue}, \type {\foofalse} to go with \type {\iffoo}.
%D \stopnarrower
-% \normalprotected\def\newif#1%
+% \protected\def\newif#1%
% {\count@\escapechar
% \escapechar\minusone
% \expandafter\expandafter\expandafter\def\new_if #1{true}{\let#1\iftrue }%
@@ -540,7 +544,7 @@
% We use \csstring so there is no need to push/pop escapechar.
% We use different names so that we get a better error message.
%
-% \normalprotected\def\newif#1%
+% \protected\def\newif#1%
% {\let\new_if_saved\newif
% \let\newif\new_if_check
% \expandafter\expandafter\expandafter\def\new_if_cs #1{true}{\let#1\iftrue }%
@@ -548,12 +552,12 @@
% \new_if_cs#1{false}%
% \let\newif\new_if_saved}
%
-% \normalprotected\def\new_if_cs#1#2%
+% \protected\def\new_if_cs#1#2%
% {\csname\expandafter\newif\csstring#1#2\endcsname}
%
% We wrap all into one macro:
-\normalprotected\def\newif#1%
+\protected\def\newif#1%
{\let\new_if_saved\newif
\let\newif\new_if_check
\expandafter\def\csname\expandafter\newif\csstring#1true\endcsname {\let#1\iftrue }%
@@ -574,10 +578,21 @@
%D A few shortcuts:
-\normalprotected\def\udef {\normalprotected\def }
-\normalprotected\def\ugdef{\normalprotected\gdef}
-\normalprotected\def\uedef{\normalprotected\edef}
-\normalprotected\def\uxdef{\normalprotected\xdef}
+\protected\def\udef {\protected\def }
+\protected\def\ugdef{\protected\gdef}
+\protected\def\uedef{\protected\edef}
+\protected\def\uxdef{\protected\xdef}
+
+% For now:
+
+\protected\def\defUmathtopaccent #1#2#3#4{\global\instance\protected\def#1{\Umathaccent "#2 "#3 "#4 }}
+\protected\def\defUmathbotaccent #1#2#3#4{\global\instance\protected\def#1{\Umathbotaccent "#2 "#3 "#4 }}
+\protected\def\defUdelimiterover #1#2#3#4{\global\instance\protected\def#1{\Udelimiterover "#2 "#3 }}
+\protected\def\defUdelimiterunder #1#2#3#4{\global\instance\protected\def#1{\Udelimiterunder "#2 "#3 }}
+\protected\def\defUdelimiter #1#2#3#4{\global\instance\protected\def#1{\Udelimiter "#2 "#2 "#4 }}
+\protected\def\defUradical #1#2#3{\global\instance\protected\def#1{\Uradical "#2 "#3 }}
+\protected\def\defUroot #1#2#3{\global\instance\protected\def#1{\Uroot "#2 "#3 }}
+\protected\def\defUmathchar #1#2#3#4{\global\instance\Umathchardef #1 "#2 "#3 "#4 }
%D For a while we keep the following, as systems like tikz need it. Best
%D not use that one \CONTEXT.
@@ -694,7 +709,7 @@
% no longer \errorstopmode cf. plain tex 3.141592653
-\normalprotected\def\tracingall
+\protected\def\tracingall
{\tracingonline \plusone
\tracingcommands \plusthree
\tracingstats \plustwo
@@ -712,11 +727,11 @@
\tracingnesting \plustwo
\tracingassigns \plustwo}
-\normalprotected\def\loggingall
+\protected\def\loggingall
{\tracingall
\tracingonline \zerocount}
-\normalprotected\def\tracingnone
+\protected\def\tracingnone
{\tracingassigns \zerocount
\tracingnesting \zerocount
\tracingscantokens\zerocount
@@ -759,7 +774,7 @@
\newtoks\everydump
-\def\dump{\the\everydump\normaldump}
+\def\dump{\the\everydump\global\everydump\emptytoks\glet\dump\relax\normaldump}
%D The same applies for the startup actions.
@@ -809,11 +824,11 @@
\let\conditionalfalse\plusone % maybe we will have a dedicated count/chardef
\let\conditionaltrue \zerocount % maybe we will have a dedicated count/chardef
-\normalprotected\def\settrue #1{\let#1\conditionaltrue }
-\normalprotected\def\setfalse#1{\let#1\conditionalfalse}
+\protected\def\settrue #1{\let#1\conditionaltrue }
+\protected\def\setfalse#1{\let#1\conditionalfalse}
-\normalprotected\def\settruevalue #1{\expandafter\let\csname#1\endcsname\conditionaltrue }
-\normalprotected\def\setfalsevalue#1{\expandafter\let\csname#1\endcsname\conditionalfalse}
+\protected\def\settruevalue #1{\expandafter\let\csname#1\endcsname\conditionaltrue }
+\protected\def\setfalsevalue#1{\expandafter\let\csname#1\endcsname\conditionalfalse}
\let\newconditional\setfalse
\let\ifconditional \ifcase
@@ -829,13 +844,13 @@
%D Let's be complete and also introduce some definers. These are not mandate
%D but handy for grepping.
-\normalprotected\def\newmacro #1{\let#1\empty}
-\normalprotected\def\setnewmacro#1{\let#1}
+\protected\def\newmacro #1{\let#1\empty}
+\protected\def\setnewmacro#1{\let#1}
\def\!!zerocount{0}
\def\!!plusone {1}
-\normalprotected\def\newfraction#1{\let#1\!!plusone}
+\protected\def\newfraction#1{\let#1\!!plusone}
%D It would be handy to have a primitive \type {\unless\ifcase} because then we
%D could use nicer values. Anyhow, this conditional code used to be in the \type
@@ -857,19 +872,19 @@
%
% we assume a \cs. not toks0 or so
%
-% \normalprotected\def\appendtotoks #1#{\def\temp{#1}\afterassignment\doappendtotoks \scratchtoks=}
-% \normalprotected\def\prependtotoks#1#{\def\temp{#1}\afterassignment\doprependtotoks\scratchtoks=}
+% \protected\def\appendtotoks #1#{\def\temp{#1}\afterassignment\doappendtotoks \scratchtoks=}
+% \protected\def\prependtotoks#1#{\def\temp{#1}\afterassignment\doprependtotoks\scratchtoks=}
\newtoks\t_syst_toks_temp \let\m_syst_toks_temp\t_syst_toks_temp
-\normalprotected\def\appendtotoks #1{\let\m_syst_toks_temp#1\afterassignment\syst_toks_append_l \t_syst_toks_temp=}
-\normalprotected\def\prependtotoks#1{\let\m_syst_toks_temp#1\afterassignment\syst_toks_prepend_l\t_syst_toks_temp=}
+\protected\def\appendtotoks #1{\let\m_syst_toks_temp#1\afterassignment\syst_toks_append_l \t_syst_toks_temp=}
+\protected\def\prependtotoks#1{\let\m_syst_toks_temp#1\afterassignment\syst_toks_prepend_l\t_syst_toks_temp=}
% \def\syst_toks_append {\m_syst_toks_temp\expandafter\expandafter\expandafter{\expandafter\the\expandafter\m_syst_toks_temp\the\t_syst_toks_temp}}}
% \def\syst_toks_prepend{\m_syst_toks_temp\expandafter\expandafter\expandafter{\expandafter\the\expandafter\t_syst_toks_temp\the\m_syst_toks_temp}}}
-\normalprotected\def\globalappendtotoks #1{\let\m_syst_toks_temp#1\afterassignment\syst_toks_append_g \t_syst_toks_temp=}
-\normalprotected\def\globalprependtotoks#1{\let\m_syst_toks_temp#1\afterassignment\syst_toks_prepend_g\t_syst_toks_temp=}
+\protected\def\globalappendtotoks #1{\let\m_syst_toks_temp#1\afterassignment\syst_toks_append_g \t_syst_toks_temp=}
+\protected\def\globalprependtotoks#1{\let\m_syst_toks_temp#1\afterassignment\syst_toks_prepend_g\t_syst_toks_temp=}
\def\syst_toks_append_l {\normalexpanded{\m_syst_toks_temp{\the\m_syst_toks_temp\the\t_syst_toks_temp}}}
\def\syst_toks_prepend_l{\normalexpanded{\m_syst_toks_temp{\the\t_syst_toks_temp\the\m_syst_toks_temp}}}
@@ -877,14 +892,14 @@
\def\syst_toks_append_g {\global\syst_toks_append_l }
\def\syst_toks_prepend_g{\global\syst_toks_prepend_l}
-\normalprotected\def\addtotoks #1{\let\m_syst_toks_temp#1\afterassignment\syst_toks_add_l\let\next}
-\normalprotected\def\globaladdtotoks#1{\let\m_syst_toks_temp#1\afterassignment\syst_toks_add_g\let\next}
+\protected\def\addtotoks #1{\let\m_syst_toks_temp#1\afterassignment\syst_toks_add_l\let\next}
+\protected\def\globaladdtotoks#1{\let\m_syst_toks_temp#1\afterassignment\syst_toks_add_g\let\next}
\def\syst_toks_add_l{\m_syst_toks_temp\expandafter\bgroup\the\m_syst_toks_temp}
\def\syst_toks_add_g{\global\syst_toks_add_l}
-\normalprotected\def\addtotokscs #1#2{#1{\the#1#2}} % saves a few bytes
-\normalprotected\def\globaladdtotokscs#1#2{\global#1{\the#1#2}} % saves a few bytes
+\protected\def\addtotokscs #1#2{#1{\the#1#2}} % saves a few bytes
+\protected\def\globaladdtotokscs#1#2{\global#1{\the#1#2}} % saves a few bytes
%D \macros
%D {begcsname}
@@ -903,20 +918,20 @@
%
% \newtoks\everyendpar
%
-% \normalprotected\def\endpar{\the\everyendpar\normalpar}
-% \normalprotected\def\par {\endpar}
+% \protected\def\endpar{\the\everyendpar\normalpar}
+% \protected\def\par {\endpar}
%
-% \normalprotected\def\reseteverypar
+% \protected\def\reseteverypar
% {\everypar \emptytoks
% \everyendpar\emptytoks}
-\normalprotected\def\reseteverypar
+\protected\def\reseteverypar
{\everypar\emptytoks}
\let\endgraf\par
\let\endline\cr
-\normalprotected\def\null{\hpack{}}
+\protected\def\null{\hpack{}}
%D The following two might be overloaded later on but some modules need then
%D earlier. These functionality is reflected in the name and will not change.
@@ -995,8 +1010,11 @@
%D Sometimes kerns make more sense than glue but we need to be in the
%D right mode:
-\normalprotected\def\vkern{\ifhmode\par \fi\kern}
-\normalprotected\def\hkern{\ifvmode\dontleavehmode\fi\kern}
+\protected\def\vkern {\ifhmode\par \fi\kern}
+\protected\def\hkern {\ifvmode\dontleavehmode\fi\kern}
+
+\protected\def\vpenalty{\ifhmode\par \fi\penalty}
+\protected\def\hpenalty{\ifvmode\dontleavehmode\fi\penalty}
%D Again a few kind-of-extensions the core. These come from plain \TEX\ but
%D are probably not used in \CONTEXT.
@@ -1132,9 +1150,34 @@
\matheqnogapstep\zerocount % for now
-%D Experiment:
-
-\ifdefined\frozen \else \def\frozen{} \let\normalfrozen\frozen \fi
+%D For as long as we share code between \MKIV\ and \LMTX\ we need these:
+
+\ifdefined\overloadmode \else
+ \newcount\overloadmode
+ %
+ \let\frozen \empty
+ \let\tolerant \empty
+ \let\overloaded\empty
+ \let\aliased \empty
+ \let\permanent \empty
+ \let\immutable \empty
+ \let\mutable \empty
+ \let\instance \empty
+ \let\noaligned \empty
+ \let\enforced \empty
+ %
+ \let\unletfrozen\gobbleoneargument
+ \let\letfrozen \gobbleoneargument
+ \def\letcsname {\expandafter\let \csname}
+ \def\defcsname {\expandafter\def \csname}
+ \def\edefcsname {\expandafter\edef\csname}
+ %
+ \let\pushoverloadmode\relax
+ \let\popoverloadmode\relax
+
+ \let\pushrunstate\relax
+ \let\poprunstate \relax
+\fi
%D Now we define a few helpers that we need in a very early stage. We have no
%D message system yet but redundant definitions are fatal anyway.
@@ -1144,7 +1187,7 @@
\def\v_interfaces_prefix_template_system{\number \c_syst_helpers_n_of_namespaces>>}
%def\v_interfaces_prefix_template_system{\characters\c_syst_helpers_n_of_namespaces>>} % no \characters yet
-\normalprotected\def\installsystemnamespace#1%
+\protected\def\installsystemnamespace#1%
{\ifcsname ??#1\endcsname
\immediate\write\statuswrite{fatal error: duplicate system namespace '#1'}%
\expandafter\normalend
@@ -1174,4 +1217,27 @@
\let\eTeXglueshrinkorder \undefined
\let\eTeXgluestretchorder\undefined
+%D Experiment:
+
+\ifdefined\glyphdimensionsmode \else \newcount\glyphdimensionsmode \fi
+
+\glyphdimensionsmode\plusone
+
+%D For completeness (tokenizer commands have complements), so this one complements
+%D \type {\detokenize}, like \type {\expanded} and \type {\unexpanded}. Not that we
+%D ever needed this one:
+
+\ifdefined \tokenized \else
+ \def\tokenized#1{\scantextokens\expandafter{\normalexpanded{#1}}}
+\fi
+
+\ifdefined \unhpack \else
+ \let\unhpack\unhbox
+ \let\unvpack\unvbox
+\fi
+
+%D Needed:
+
+\let\nexttoken\relax
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/syst-ini.mkxl b/Master/texmf-dist/tex/context/base/mkiv/syst-ini.mkxl
deleted file mode 100644
index 9394807c8da..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/syst-ini.mkxl
+++ /dev/null
@@ -1,1116 +0,0 @@
-%D \module
-%D [ file=syst-ini,
-%D version=2008.11.04, % 2001.11.16, % 1999.03.17, % an oldie: 1995.10.10
-%D title=\CONTEXT\ System Macros,
-%D subtitle=Bootstrapping \TEX,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-%D We used to load plain \TEX\ in a special way, but redefining a couple of
-%D primitives so that for instance font loading was ignored. For those interested,
-%D this loader is found in \type {syst-tex.tex}. Some of the comment's are Don
-%D Knuths and more of it can be found in the plain \TEX\ format.
-%D
-%D Characters can have special states, that can be triggered by setting their
-%D category coded. Some are preset, others are to be set as soon as possible,
-%D otherwise we cannot define any useful macros.
-%D
-%D First we define a bunch of constants. Normally we would \type {\setconstant}
-%D but we're prestine and have no macros defined yet. Abstraction also makes it
-%D possible to avoid the \type {^^} in the input.
-
-\chardef\escapecatcode 0
-\chardef\begingroupcatcode 1
-\chardef\endgroupcatcode 2
-\chardef\mathshiftcatcode 3
-\chardef\alignmentcatcode 4
-\chardef\endoflinecatcode 5
-\chardef\parametercatcode 6
-\chardef\superscriptcatcode 7
-\chardef\subscriptcatcode 8
-\chardef\ignorecatcode 9
-\chardef\spacecatcode 10
-\chardef\lettercatcode 11
-\chardef\othercatcode 12 % finally obsolete: \let\other \othercatcode
-\chardef\activecatcode 13 % finally obsolete: \let\active\activecatcode
-\chardef\commentcatcode 14
-\chardef\invalidcatcode 15
-
-%chardef\zeroasciicode 0
-\chardef\tabasciicode 9
-\chardef\newlineasciicode 10 % don't confuse this one with \endoflineasciicode
-\chardef\formfeedasciicode 12
-\chardef\endoflineasciicode 13 % somewhat messy but this can be the active \par
-\chardef\endoffileasciicode 26
-\chardef\spaceasciicode 32
-\chardef\exclamationmarkasciicode 33 % ! used in namespace protection
-\chardef\doublequoteasciicode 34 % "
-\chardef\hashasciicode 35
-\chardef\dollarasciicode 36
-\chardef\commentasciicode 37
-\chardef\ampersandasciicode 38
-\chardef\singlequoteasciicode 39 % '
-\chardef\primeasciicode 39 % '
-\chardef\leftparentasciicode 40
-\chardef\rightparentasciicode 41
-\chardef\hyphenasciicode 45
-\chardef\forwardslashasciicode 47 % /
-\chardef\colonasciicode 58
-\chardef\lessthanasciicode 60 % < used as alternative verbatim {
-\chardef\morethanasciicode 62 % > used as alternative verbatim }
-\chardef\questionmarkasciicode 63 % ? used in namespace protection
-\chardef\atsignasciicode 64 % @ used in namespace protection
-\chardef\backslashasciicode 92 % `\\
-\chardef\circumflexasciicode 94
-\chardef\underscoreasciicode 95
-\chardef\leftbraceasciicode 123 % `\{
-\chardef\barasciicode 124 % `\|
-\chardef\rightbraceasciicode 125 % `\}
-\chardef\tildeasciicode 126 % `\~
-\chardef\delasciicode 127
-
-%catcode\zeroasciicode \ignorecatcode % `\^^@ ascii null is ignored
-\catcode\tabasciicode \spacecatcode % `\^^I ascii tab is a blank space
-\catcode\formfeedasciicode \activecatcode % `\^^L ascii form-feed (active, set later)
-%catcode\endoflineasciicode \endoflinecatcode % `\^^M ascii return is end-line
-\catcode\endoffileasciicode \ignorecatcode % `\^^Z endoffile (ignored in ConTeXt)
-%catcode\spaceasciicode \spacecatcode % `\ ascii space is blank space
-\catcode\hashasciicode \parametercatcode % `\# hash mark is macro parameter character
-\catcode\dollarasciicode \mathshiftcatcode % `\$ dollar sign is math shift
-%catcode\commentasciicode \commentcatcode % `\% percent sign is comment character
-\catcode\ampersandasciicode \alignmentcatcode % `\& ampersand is alignment tab
-%catcode\backslashasciicode \escapecatcode % `\\ backslash is TeX escape character
-\catcode\circumflexasciicode \superscriptcatcode % `\^ circumflex and uparrow are for superscripts
-\catcode\underscoreasciicode \subscriptcatcode % `\_ underline and downarrow are for subscripts
-\catcode\leftbraceasciicode \begingroupcatcode % `\{ left brace is begin-group character
-\catcode\rightbraceasciicode \endgroupcatcode % `\} right brace is end-group character
-\catcode\tildeasciicode \activecatcode % `\~ tilde is active
-%catcode\delasciicode \invalidcatcode % `\^^? ascii delete is invalid
-
-\chardef\statuswrite 128
-
-%D First we need to initialization the primitives. Because \CONTEXT\ is already a
-%D pretty old macro package, we have a couple of issues with respect to primitives.
-%D The \ETEX\ engine added a few as did \PDFTEX. The \LUATEX\ engine added even
-%D more. This means that there can be a potential clash between primitives and
-%D existing macros. The most noticeable ones are:
-%D
-%D \starttyping
-%D \protected
-%D \expanded
-%D \unexpanded
-%D \stoptyping
-%D
-%D Because we had macros like that before the primitives showed up. The protection
-%D related macros were there before we even knew about extensions to the engine.
-%D When the expansion related ones were introduced, we originally came up with
-%D different names but due to requests we used the current names, somethng that in
-%D retrospect was a bad idea: they should have gotten different names in \LUATEX, if
-%D only because at that time only \CONTEXT\ was using them in rolling releases.
-%D Anyway, we're now stuck with this situation, and it means that one should use the
-%D \type {\normal...} variants in low level code:
-%D
-%D \starttyping
-%D \normalexpanded
-%D \normalprotected
-%D \normalunexpanded
-%D \stoptyping
-%D
-%D In the end not using different names in \LUATEX\ for these kind of backfires. It
-%D makes not much sense to fix this in \LUAMETATEX\ because we're now to long on the
-%D road. It is actually the reason why we have the option in \LUATEX\ to alias all
-%D primitives in one go using a prefix. Actually this trick could be used to recover
-%D a primitive meaning: just enable it with some prefix and \type {\let} the
-%D original to that. But \unknown\ we prevent that trick below.
-%D
-%D The code below differs from \LUATEX: in \LUAMETATEX\ all primitives are already
-%D available; it cannot limit itself to being \TEX\ or \ETEX. It could not do that
-%D anyway because there are differences (no backend, to mention one).
-
-\directlua {
- local primitives = tex.extraprimitives() % "tex","etex","luatex"
- tex.enableprimitives("normal",primitives) % could default to everything
- function tex.enableprimitives() end % so we kind of protect what's there
-}
-
-\def\space{ }
-\def\empty{}
-
-\letcharcode \formfeedasciicode \par % \def ^^L{\par} formfeed
-\letcharcode \tildeasciicode \ % tilde
-\letcharcode \spaceasciicode \space % space
-
-\expandafter\def\csname\Uchar\tabasciicode \endcsname {\ } % \def\^^I{\ } tab
-\expandafter\def\csname\Uchar\formfeedasciicode \endcsname {\par} % \def\^^L{\par} formfeed
-\expandafter\def\csname\Uchar\endoflineasciicode\endcsname {\ } % \def\^^M{\ } return
-
-%D For now:
-
-\def\gobbleoneargument#1{} % will be defined later on anyway
-
-%D First we define a simplified version of the \CONTEXT\ protection mechanism.
-%D Later we will implement a better variant.
-
-\def\unprotect
- {\edef\protect
- {\catcode\atsignasciicode \the\catcode\atsignasciicode \relax
- \catcode\exclamationmarkasciicode\the\catcode\exclamationmarkasciicode\relax
- \catcode\questionmarkasciicode \the\catcode\questionmarkasciicode \relax
- \catcode\underscoreasciicode \the\catcode\underscoreasciicode \relax
- \let\protect\relax}%
- \catcode\atsignasciicode \lettercatcode
- \catcode\exclamationmarkasciicode\lettercatcode
- \catcode\questionmarkasciicode \lettercatcode
- \catcode\underscoreasciicode \lettercatcode}
-
-\let\protect\relax
-
-\unprotect
-
-%D Some pretty important definitions:
-
-\let\bgroup={
-\let\egroup=}
-
-%D \macros
-%D {normalbgroup,normalgroup}
-%D
-%D No comment.
-
-%D Allocation of registers is done slightly different than in plain \TEX. First of
-%D all we use different reserved counters. We also don't implement a family handler
-%D because users are not supposed to implement their own math. We reserve the lowest
-%D 31 registers for scratch purposes. Keep in mind that in the core engine some
-%D registers are reserved: counters 0 upto 9, and counter 255.
-%D
-%D As with plain \TEX\ we recommend that macro designers always use \type {\global}
-%D assignments with respect to registers numbered 1, 3, 5 \unknown\ 31, and always
-%D non||\type {\global} assignments with respect to registers 0, 2, 4, \unknown\ 30.
-%D This will prevent \quote {save stack buildup} that might otherwise occur.
-%D
-%D We reserve some registers for special (management) purposes:
-
-% 0 - 20 : scratch
-% 21 - 127 : internal
-% 128 - 254 : inserts
-% 255 : page
-% 256 - : user
-
-\countdef \c_syst_min_allocated_register = 52 \c_syst_min_allocated_register = 256 % can change
-\countdef \c_syst_max_allocated_register = 53 \c_syst_max_allocated_register = 32767
-\countdef \c_syst_min_allocated_read = 54 \c_syst_min_allocated_read = -1
-\countdef \c_syst_max_allocated_read = 55 \c_syst_max_allocated_read = 16
-\countdef \c_syst_min_allocated_language = 56 \c_syst_min_allocated_language = 0
-\countdef \c_syst_max_allocated_language = 57 \c_syst_max_allocated_language = 255
-\countdef \c_syst_min_allocated_insert = 58 \c_syst_min_allocated_insert = 128
-\countdef \c_syst_max_allocated_insert = 59 \c_syst_max_allocated_insert = 254
-\countdef \c_syst_min_allocated_family = 60 \c_syst_min_allocated_family = 128
-\countdef \c_syst_max_allocated_family = 61 \c_syst_max_allocated_family = 255
-\countdef \c_syst_min_allocated_attribute = 62 \c_syst_min_allocated_attribute = 1024 % 0-1023 : private
-\countdef \c_syst_min_allocated_write = 63 \c_syst_min_allocated_write = 0
-\countdef \c_syst_max_allocated_write = 64 \c_syst_max_allocated_write = 127
-
-\countdef \c_syst_last_allocated_count = 32 \c_syst_last_allocated_count = \c_syst_min_allocated_register
-\countdef \c_syst_last_allocated_dimen = 33 \c_syst_last_allocated_dimen = \c_syst_min_allocated_register
-\countdef \c_syst_last_allocated_skip = 34 \c_syst_last_allocated_skip = \c_syst_min_allocated_register
-\countdef \c_syst_last_allocated_muskip = 35 \c_syst_last_allocated_muskip = \c_syst_min_allocated_register
-\countdef \c_syst_last_allocated_box = 36 \c_syst_last_allocated_box = \c_syst_min_allocated_register
-\countdef \c_syst_last_allocated_toks = 37 \c_syst_last_allocated_toks = \c_syst_min_allocated_register
-\countdef \c_syst_last_allocated_read = 38 \c_syst_last_allocated_read = \c_syst_min_allocated_read
-\countdef \c_syst_last_allocated_write = 39 \c_syst_last_allocated_write = \c_syst_min_allocated_write
-\countdef \c_syst_last_allocated_marks = 40 \c_syst_last_allocated_marks = \c_syst_min_allocated_register
-\countdef \c_syst_last_allocated_language = 41 \c_syst_last_allocated_language = \c_syst_min_allocated_language % not used in context
-\countdef \c_syst_last_allocated_insertion = 42 \c_syst_last_allocated_insertion = \c_syst_min_allocated_insert
-\countdef \c_syst_last_allocated_family = 43 \c_syst_last_allocated_family = \c_syst_min_allocated_family % not used in context
-\countdef \c_syst_last_allocated_attribute = 44 \c_syst_last_allocated_attribute = \c_syst_min_allocated_attribute % not used in context
-
-\countdef \c_syst_min_counter_value = 125 \c_syst_min_counter_value = -"7FFFFFFF % beware, we use index 125 at the lua end
-\countdef \c_syst_max_counter_value = 126 \c_syst_max_counter_value = "7FFFFFFF % beware, we use index 126 at the lua end
-
-\countdef \zerocount = 120 \zerocount = 0
-\countdef \plusone = 121 \plusone = 1
-\countdef \minusone = 122 \minusone = -1
-
-\countdef \normalpagebox = 127 \normalpagebox = 255 % hardcoded in pdftex/xetex
-
-% Only to be used by developers in very special cases!
-
-% \def\lastallocatedcount {\the\c_syst_last_allocated_count}
-% \def\lastallocateddimen {\the\c_syst_last_allocated_dimen}
-% \def\lastallocatedskip {\the\c_syst_last_allocated_skip}
-% \def\lastallocatedmuskip {\the\c_syst_last_allocated_muskip}
-% \def\lastallocatedbox {\the\c_syst_last_allocated_dimen}
-% \def\lastallocatedtoks {\the\c_syst_last_allocated_toks}
-% \def\lastallocatedattribute{\the\c_syst_last_allocated_attribute}
-
-% A few traditional allocations (these might go):
-
-\countdef \count@ 255 % hm, used in \newif .. todo: replace it there
-\dimendef \dimen@ 0
-\dimendef \dimen@i 1 % global only
-\dimendef \dimen@ii 2
-
-%D So, effectively we start allocating from 256 and upwards. The inserts sit in the
-%D range 128 upto 254. Page numbers use the counters 0 upto 9 and the pagebox is
-%D 255. Users can use the scratch registers upto 31 without problem but all others
-%D are reserved.
-
-\let\wlog\gobbleoneargument % Let's get rid of this one.
-
-%D The allocators share a common helper macro.
-
-\normalprotected\def\newcount {\syst_basics_allocate\c_syst_last_allocated_count \count \countdef \c_syst_max_allocated_register}
-\normalprotected\def\newdimen {\syst_basics_allocate\c_syst_last_allocated_dimen \dimen \dimendef \c_syst_max_allocated_register}
-\normalprotected\def\newskip {\syst_basics_allocate\c_syst_last_allocated_skip \skip \skipdef \c_syst_max_allocated_register}
-\normalprotected\def\newmuskip {\syst_basics_allocate\c_syst_last_allocated_muskip \muskip \muskipdef \c_syst_max_allocated_register}
-\normalprotected\def\newbox {\syst_basics_allocate\c_syst_last_allocated_box \box \mathchardef\c_syst_max_allocated_register}
-\normalprotected\def\newtoks {\syst_basics_allocate\c_syst_last_allocated_toks \toks \toksdef \c_syst_max_allocated_register}
-\normalprotected\def\newread {\syst_basics_allocate\c_syst_last_allocated_read \read \chardef \c_syst_max_allocated_read}
-\normalprotected\def\newwrite {\syst_basics_allocate\c_syst_last_allocated_write \write \chardef \c_syst_max_allocated_write}
-\normalprotected\def\newmarks {\syst_basics_allocate\c_syst_last_allocated_marks \marks \mathchardef\c_syst_max_allocated_register}
-\normalprotected\def\newinsert {\syst_basics_allocate\c_syst_last_allocated_insertion\insert \chardef \c_syst_max_allocated_insert}
-
-%D We don't need these in \CONTEXT:
-
-\normalprotected\def\newlanguage{\syst_basics_allocate\c_syst_last_allocated_language \language\chardef \c_syst_max_allocated_language}
-\normalprotected\def\newfamily {\syst_basics_allocate\c_syst_last_allocated_family \fam \chardef \c_syst_max_allocated_family}
-
-\let\newfam\newfamily
-
-\firstvalidlanguage\plusone
-
-% Watch out, for the moment we disable the check for already being defined
-% later we will revert this but first all chardefs must be replaced.
-
-\normalprotected\def\newconstant #1{\ifdefined#1\let#1\undefined\fi\newcount#1}
-\normalprotected\def\setnewconstant #1{\ifdefined#1\let#1\undefined\fi\newcount#1#1} % just a number
-\normalprotected\def\setconstant {} % dummy, no checking, so it warns
-\normalprotected\def\setconstantvalue#1#2{\csname#1\endcsname\numexpr#2\relax}
-
-% maybe setconstant with check
-
-% %D The next definitions are really needed (in \CONTEXT):
-
-\newlinechar\newlineasciicode \edef\outputnewlinechar{\Uchar\newlineasciicode} % {^^J}
-
-%D One reason to start high with allocation is that it permits us to allocate
-%D consecutive ranges more easily, for instance if for \MPLIB\ we want to allocate a
-%D continuous range of boxes. It also permits us to do a proper upward allocation
-%D for inserts. The current code evolved from code that dealt with older engines but
-%D as all engines now provide many registers we removed all traces.
-
-\ifdefined\writestatus \else
- %\normalprotected\def\writestatus#1#2{\immediate\write\statuswrite{#1: #2}}
- \normalprotected\def\writestatus#1#2{\message{#1: #2}}
-\fi
-
-\def\syst_basics_allocate_yes#1#2#3#4#5% last class method max name
- {\ifnum#1<#4\relax
- \global\advance#1\plusone
- \global#3#5=#1\relax
- \else
- \writestatus{warning}{no room for \string#2\space \string#5\space (max: \number#4)}%
- \fi}
-
-\def\syst_basics_allocate_nop#1#2#3#4#5% last class method max name
- {\writestatus{warning}{\string#2 \string#5 is already defined (\string\relax\space it first)}}
-
-\def\syst_basics_allocate#1#2#3#4#5% last class method max name
- {\ifx#5\undefined
- \expandafter\syst_basics_allocate_yes
- \else\ifx#5\relax
- \expandafter\expandafter\expandafter\syst_basics_allocate_yes
- \else
- \expandafter\expandafter\expandafter\syst_basics_allocate_nop
- \fi\fi
- #1#2#3#4#5}
-
-%D Since the number of chars exceed 256 now, we can use \type {\chardef} instead of
-%D the more limited \type {\mathchardef}.
-
-\normalprotected\def\newbox {\syst_basics_allocate\c_syst_last_allocated_box \box \chardef\c_syst_max_allocated_register}
-\normalprotected\def\newmarks{\syst_basics_allocate\c_syst_last_allocated_marks\marks\chardef\c_syst_max_allocated_register}
-
-%D Attributes are something very \LUATEX. In \CONTEXT\ you are not supposed to use
-%D the attributes directly but always allocate then first. For instance attribute~0
-%D is reserved for special purposes (this might change). Attributes in the range
-%D 128-1023 are private and should not be touched.
-
-\let\attributeunsetvalue\c_syst_min_counter_value % used to be \minusone
-
-\normalprotected\def\newattribute{\syst_basics_allocate\c_syst_last_allocated_attribute\attribute\attributedef\c_syst_max_allocated_register}
-
-%D Not used by \CONTEXT\ but for instance \PICTEX\ needs it. It's a trick to force
-%D strings instead of tokens that take more memory. It's a trick to trick to force
-%D strings. This macro is never used in \CONTEXT.
-
-%normalprotected\def\newhelp#1#2{\newtoks#1#1\expandafter{\csname#2\endcsname}}
-\normalprotected\def\newhelp#1#2{\newtoks#1#1\expandafter{\detokenize{#2}}}
-
-%D \macros
-%D {scratchcounter,
-%D scratchdimen,scratchskip,scratchmuskip,
-%D scratchbox,
-%D scratchtoks}
-%D
-%D We now define a few scratch registers, so that successive loads at least have
-%D some available. The private ones are used in cases where we don't want to
-%D intrude on normal scratch ones.
-
-\newcount \scratchcounter \newcount \globalscratchcounter \newcount \privatescratchcounter
-\newdimen \scratchdimen \newdimen \globalscratchdimen \newdimen \privatescratchdimen
-\newskip \scratchskip \newskip \globalscratchskip \newskip \privatescratchskip
-\newmuskip\scratchmuskip \newmuskip\globalscratchmuskip \newmuskip\privatescratchmuskip
-\newtoks \scratchtoks \newtoks \globalscratchtoks \newtoks \privatescratchtoks
-\newbox \scratchbox \newbox \globalscratchbox \newbox \privatescratchbox
-
-\newcount\scratchcounterone \newcount\scratchcountertwo \newcount\scratchcounterthree
-\newdimen \scratchdimenone \newdimen \scratchdimentwo \newdimen \scratchdimenthree
-\newskip \scratchskipone \newskip \scratchskiptwo \newskip \scratchskipthree
-\newmuskip\scratchmuskipone \newmuskip\scratchmuskiptwo \newmuskip\scratchmuskipthree
-\newtoks \scratchtoksone \newtoks \scratchtokstwo \newtoks \scratchtoksthree
-\newbox \scratchboxone \newbox \scratchboxtwo \newbox \scratchboxthree
-
-\newcount\scratchcounterfour \newcount\scratchcounterfive \newcount\scratchcountersix
-\newdimen \scratchdimenfour \newdimen \scratchdimenfive \newdimen \scratchdimensix
-\newskip \scratchskipfour \newskip \scratchskipfive \newskip \scratchskipsix
-\newmuskip\scratchmuskipfour \newmuskip\scratchmuskipfive \newmuskip\scratchmuskipsix
-\newtoks \scratchtoksfour \newtoks \scratchtoksfive \newtoks \scratchtokssix
-\newbox \scratchboxfour \newbox \scratchboxfive \newbox \scratchboxsix
-
-\newcount\globalscratchcounterone
-\newcount\globalscratchcountertwo
-\newcount\globalscratchcounterthree
-
-%D \macros
-%D {tempstring}
-
-\let\tempstring\empty
-
-%D \macros
-%D {scratchwidth, scratchheight, scratchdepth, scratchoffset, scratchdistance}
-%D
-%D A few more scratch dimensions:
-
-\newdimen\scratchwidth
-\newdimen\scratchheight
-\newdimen\scratchdepth
-\newdimen\scratchtotal
-
-\newdimen\scratchoffset
-\newdimen\scratchleftoffset
-\newdimen\scratchrightoffset
-\newdimen\scratchtopoffset
-\newdimen\scratchbottomoffset
-
-\newdimen\scratchdistance
-
-\newdimen\scratchhsize
-\newdimen\scratchvsize
-
-\newdimen\scratchxoffset
-\newdimen\scratchyoffset
-\newdimen\scratchhoffset
-\newdimen\scratchvoffset
-
-\newdimen\scratchxposition
-\newdimen\scratchyposition
-
-\newcount\scratchnx
-\newcount\scratchny
-
-\newcount\scratchmx
-\newcount\scratchmy
-
-\newcount\scratchmin
-\newcount\scratchmax
-
-\newcount\scratchunicode
-
-\newdimen\scratchleftskip
-\newdimen\scratchrightskip
-\newdimen\scratchtopskip
-\newdimen\scratchbottomskip
-
-%D More allocations:
-
-\newskip \zeroskip \zeroskip 0pt plus 0pt minus 0pt
-\newdimen \zeropoint \zeropoint 0pt
-\newdimen \onepoint \onepoint 1pt
-\newdimen \halfapoint \halfapoint 0.5pt
-\newdimen \maxdimen \maxdimen 16383.99999pt % 1073741823sp
-\newcount \maxcount \maxcount 2147483647
-\newdimen \onebasepoint \onebasepoint 1bp
-\newdimen \scaledpoint \scaledpoint 1sp
-\newdimen \thousandpoint \thousandpoint 1000pt
-\newmuskip\zeromuskip \zeromuskip 0mu
-\newmuskip\onemuskip \onemuskip 1mu
-
-\newmuskip\muquad \muquad 18mu
-
-\let\points \onepoint
-\let\halfpoint\halfapoint
-
-\newtoks \emptytoks
-
-%D And even more: (todo: countdefs 60+)
-
-%newcount\minusone \minusone -1
-\newcount\minustwo \minustwo -2
-%chardef \zerocount 0
-%chardef \plusone 1
-\chardef \plustwo 2
-\chardef \plusthree 3
-\chardef \plusfour 4
-\chardef \plusfive 5
-\chardef \plussix 6
-\chardef \plusseven 7
-\chardef \pluseight 8
-\chardef \plusnine 9
-\chardef \plusten 10
-\chardef \plussixteen 16
-\chardef \plusfifty 50
-\chardef \plushundred 100
-\chardef \plusonehundred 100
-\chardef \plustwohundred 200
-\chardef \plusfivehundred 500
-\chardef \pluscxxvii 127
-\chardef \pluscxxviii 128
-\chardef \pluscclv 255
-\chardef \pluscclvi 256
-\chardef \plusthousand 1000
-\chardef \plustenthousand 10000
-\chardef \plustwentythousand 20000
-\chardef \medcard 32768
-\chardef \maxcard 65536 % pdftex has less mathchars
-\chardef \maxcardminusone 65535
-
-%D \macros
-%D {doubleexpandafter,tripleexpandafter,expanded,startexpanded}
-%D
-%D A few handy shortcuts
-
-\let\singleexpandafter \expandafter
-\def\doubleexpandafter{\expandafter\expandafter\expandafter}
-\def\tripleexpandafter{\expandafter\doubleexpandafter\expandafter}
-
-%D We prefer the more readable variant than in plain \TEX. User should only
-%D use \type {\emptybox}:
-
-\newbox\voidbox % public
-
-\let\normalhbox\hbox
-\let\normalvbox\vbox
-
-\def\unvoidbox{\unhbox\voidbox}
-\def\emptybox {\box \voidbox} % used in initializations so no attributes
-\def\emptyvbox{\normalvpack{}} % no copy as we need to set attributes
-\def\emptyhbox{\normalhpack{}} % no copy as we need to set attributes
-
-\let\leavevmode\unvoidbox % we prefer to use \dontleavehmode
-
-%D \macros
-%D {dontcomplain}
-%D
-%D We need this one soon:
-
-\normalprotected\def\dontcomplain
- {\hbadness\plustenthousand
- \vbadness\plustenthousand
- \hfuzz \maxdimen
- \vfuzz \maxdimen}
-
-%D Some expected plain variants follow. We don't reuse registers because we
-%D don't want clashes.
-
-\let \p@ \onepoint
-\let \m@ne \minusone
-\let \z@ \zeropoint
-\let \@ne \plusone
-\let \tw@ \plustwo
-\let \thr@@ \plusthree
-\let \sixt@@n \plussixteen
-\let \@cclv \pluscclv
-\let \@cclvi \pluscclvi
-\let \voidb@x \voidbox
-\newtoks \toks@ % \scratchtoks
-
-%D We define \type {\newif} a la plain \TEX, but will redefine it later. As
-%D Knuth says:
-%D
-%D \startnarrower
-%D And here's a different sort of allocation: for example,
-%D
-%D \starttyping
-%D \newif\iffoo
-%D \stoptyping
-%D
-%D creates \type {\footrue}, \type {\foofalse} to go with \type {\iffoo}.
-%D \stopnarrower
-
-% \normalprotected\def\newif#1%
-% {\count@\escapechar
-% \escapechar\minusone
-% \expandafter\expandafter\expandafter\def\new_if #1{true}{\let#1\iftrue }%
-% \expandafter\expandafter\expandafter\def\new_if#1{false}{\let#1\iffalse}%
-% \new_if#1{false}% the condition starts out false
-% \escapechar\count@}
-%
-% \def\new_if#1#2%
-% {\csname\expandafter\if@\string#1#2\endcsname}
-%
-% \bgroup % `if' is required
-% \uccode`1=`i \uccode`2=`f \uppercase{\gdef\if@12{}}
-% \egroup
-
-% We use \csstring so there is no need to push/pop escapechar.
-% We use different names so that we get a better error message.
-%
-% \normalprotected\def\newif#1%
-% {\let\new_if_saved\newif
-% \let\newif\new_if_check
-% \expandafter\expandafter\expandafter\def\new_if_cs #1{true}{\let#1\iftrue }%
-% \expandafter\expandafter\expandafter\def\new_if_cs#1{false}{\let#1\iffalse}%
-% \new_if_cs#1{false}%
-% \let\newif\new_if_saved}
-%
-% \normalprotected\def\new_if_cs#1#2%
-% {\csname\expandafter\newif\csstring#1#2\endcsname}
-%
-% We wrap all into one macro:
-
-\normalprotected\def\newif#1%
- {\let\new_if_saved\newif
- \let\newif\new_if_check
- \expandafter\def\csname\expandafter\newif\csstring#1true\endcsname {\let#1\iftrue }%
- \expandafter\def\csname\expandafter\newif\csstring#1false\endcsname{\let#1\iffalse}%
- \csname\expandafter\newif\csstring#1false\endcsname
- \let\newif\new_if_saved}
-
-\bgroup
- \normalexpanded{\gdef\noexpand\new_if_check\string i\string f{}}
-\egroup
-
-%D Let's test this one:
-
-\newif\ifdone
-\newif\iffound
-
-\let\htdp\boxtotal
-
-%D A few shortcuts:
-
-\normalprotected\def\udef {\normalprotected\def }
-\normalprotected\def\ugdef{\normalprotected\gdef}
-\normalprotected\def\uedef{\normalprotected\edef}
-\normalprotected\def\uxdef{\normalprotected\xdef}
-
-%D For a while we keep the following, as systems like tikz need it. Best
-%D not use that one \CONTEXT.
-
-\let\active\activecatcode
-
-%D Constants to be used with \type {\currentgrouptype}.
-
-\chardef\bottomlevelgroupcode = 0
-\chardef\simplegroupcode = 1
-\chardef\hboxgroupcode = 2
-\chardef\adjustedhboxgroupcode = 3
-\chardef\vboxgroupcode = 4
-\chardef\vtopgroupcode = 5
-\chardef\aligngroupcode = 6
-\chardef\noaligngroupcode = 7
-\chardef\outputgroupcode = 8
-\chardef\mathgroupcode = 9
-\chardef\discretionarygroupcode = 10
-\chardef\insertgroupcode = 11
-\chardef\vcentergroupcode = 12
-\chardef\mathchoicegroupcode = 13
-\chardef\semisimplegroupcode = 14
-\chardef\mathshiftgroupcode = 15
-\chardef\mathleftgroupcode = 16
-\chardef\vadjustgroupcode = \insertgroupcode
-
-%D Constants to be used with \type {\interactionmode}.
-
-\chardef\batchmodecode \zerocount
-\chardef\nonstopmodecode \plusone
-\chardef\scrollmodecode \plustwo
-\chardef\errorstopmodecode \plusthree
-
-%D Constants to be used with \type {\lastnodetype}. The \type {\lastnodetype}
-%D primitive is \ETEX\ compliant. The valid range is still -1 .. 15 and glyph nodes
-%D have number 0 (used to be char node) and ligature nodes are mapped to 7. That way
-%D macro packages can use the same symbolic names as in traditional \ETEX. Keep in
-%D mind that the internal node numbers are different and that there are more node
-%D types that 15. The mode parameter forces \LUAMETATEX\ to use the real node
-%D numbers.
-
-\internalcodesmode\plusone
-
-%D Constants to be used with \type {\currentiftype}. I wonder if we will ever
-%D use these in \CONTEXT. We have a few more anyway and in \LUAMETATEX\ we
-%D have different numbers. So for now let's just not define them. The
-%D previously mentioned mode parameters enables the real numbers (we have
-%D some more and they are therefore ordered differently).
-
-% \chardef\charifcode = 1
-% \chardef\catifcode = 2
-% \chardef\numifcode = 3
-% \chardef\dimifcode = 4
-% \chardef\oddifcode = 5
-% \chardef\vmodeifcode = 6
-% \chardef\hmodeifcode = 7
-% \chardef\mmodeifcode = 8
-% \chardef\innerifcode = 9
-% \chardef\voidifcode = 10
-% \chardef\hboxifcode = 11
-% \chardef\vboxifcode = 12
-% \chardef\xifcode = 13
-% \chardef\eofifcode = 14
-% \chardef\trueifcode = 15
-% \chardef\falseifcode = 16
-% \chardef\caseifcode = 17
-% \chardef\definedifcode = 18
-% \chardef\csnameifcode = 19
-% \chardef\fontcharifcode = 20
-%
-% % there are some more in luametatex
-
-%D Of course we want even bigger log files, so we copied this from the \ETEX\
-%D source files.
-%D
-%D When watching such logs, beware of nasty side effects of \type {\scantokens},
-%D as in:
-%D
-%D \starttyping
-%D \bgroup
-%D \lccode`a=12\lowercase{\xdef\whatever{a}}\egroup
-%D \def\whatever{test \whatever test}
-%D \scantokens\expandafter{\whatever}
-%D \egroup
-%D \stoptyping
-%D
-%D In \LUATEX\ we have ways around this.
-
-% no longer \errorstopmode cf. plain tex 3.141592653
-
-\normalprotected\def\tracingall
- {\tracingonline \plusone
- \tracingcommands \plusthree
- \tracingstats \plustwo
- \tracingpages \plusone
- \tracingoutput \plusone
- \tracinglostchars \plustwo
- \tracingmacros \plustwo
- \tracingparagraphs\plusone
- \tracingrestores \plusone
- \showboxbreadth \maxdimen
- \showboxdepth \maxdimen
- \tracinggroups \plusone
- \tracingifs \plusone
- \tracingscantokens\plusone
- \tracingnesting \plustwo
- \tracingassigns \plustwo}
-
-\normalprotected\def\loggingall
- {\tracingall
- \tracingonline \zerocount}
-
-\normalprotected\def\tracingnone
- {\tracingassigns \zerocount
- \tracingnesting \zerocount
- \tracingscantokens\zerocount
- \tracingifs \zerocount
- \tracinggroups \zerocount
- \showboxdepth \plusthree
- \showboxbreadth \plusfive
- \tracingrestores \zerocount
- \tracingparagraphs\zerocount
- \tracingmacros \zerocount
- \tracinglostchars \plusone
- \tracingoutput \zerocount
- \tracingpages \zerocount
- \tracingstats \zerocount
- \tracingcommands \zerocount
- \tracingonline \zerocount}
-
-%D When we want to see a box we can as well show all of it.
-
-\showboxdepth \maxdimen
-\showboxbreadth\maxdimen
-
-%D Just for tracing purposes we set:
-
-\tracingstats\plusone
-
-%D Here we also save \type {\input}, more will be saved later.
-
-\ifdefined\normalinput \else \let\normalinput\input \fi
-
-%D We don't like outer commands, and we always want access to the original
-%D \type {\input} primitive.
-
-\let\normalouter\outer \def\outer{} % no longer \relax
-
-%D To circumvent dependencies, we can postpone certain initializations to
-%D dumping time, by appending them to the \type {\everydump} token register.
-
-\ifdefined\normaldump \else \let\normaldump\dump \fi
-
-\newtoks\everydump
-
-\def\dump{\the\everydump\normaldump}
-
-%D The same applies for the startup actions.
-
-\ifdefined\normaleveryjob \else \let\normaleveryjob\everyjob \fi
-
-\let\everyjob\relax \newtoks\everyjob
-
-\normaleveryjob{\the\everyjob}
-
-%D \macros
-%D {newconditional,
-%D settrue, setfalse,
-%D ifconditional,then}
-%D
-%D \TEX's lacks boolean variables, although the \PLAIN\ format implements \type
-%D {\newif}. The main disadvantage of this scheme is that it takes three hash table
-%D entries. A more memory saving alternative is presented here. A conditional is
-%D defined by:
-%D
-%D \starttyping
-%D \newconditional\doublesided
-%D \setfalse
-%D \stoptyping
-%D Setting a conditional is done by \type{\settrue} and
-%D \type{\setfalse}:
-%D
-%D \starttyping
-%D \settrue\doublesided
-%D \setfalse
-%D \stoptyping
-%D while testing is accomplished by:
-%D
-%D \starttyping
-%D \ifconditional\doublesided ... \else ... \fi
-%D \setfalse
-%D \stoptyping
-%D We cannot use the simple scheme:
-%D
-%D \starttyping
-%D \def\settrue #1{\let#1=\iftrue}
-%D \def\setfalse#1{\let#1=\iffalse}
-%D \stoptyping
-%D
-%D Such an implementation gives problems with nested conditionals. The next
-%D implementation is about as fast and just as straightforward:
-
-\let\conditionalfalse\plusone % maybe we will have a dedicated count/chardef
-\let\conditionaltrue \zerocount % maybe we will have a dedicated count/chardef
-
-\normalprotected\def\settrue #1{\let#1\conditionaltrue }
-\normalprotected\def\setfalse#1{\let#1\conditionalfalse}
-
-\normalprotected\def\settruevalue #1{\expandafter\let\csname#1\endcsname\conditionaltrue }
-\normalprotected\def\setfalsevalue#1{\expandafter\let\csname#1\endcsname\conditionalfalse}
-
-\let\newconditional\setfalse
-\let\ifconditional \ifcase
-
-\let\then\relax % so that we can say: \ifnum1>2\then -)
-
-\def\truecondition {\iftrue}
-\def\falsecondition{\iffalse}
-
-% This one has to be unprotected otherwise we get a files-ends-to-soon but it's ok
-% as conditions expand anyway.
-
-\def\quitcondition{\orelse\iffalse}
-
-%D \macros
-%D {newmacro,setnewmacro,newfraction}
-%D
-%D Let's be complete and also introduce some definers. These are not mandate
-%D but handy for grepping.
-
-\normalprotected\def\newmacro #1{\let#1\empty}
-\normalprotected\def\setnewmacro#1{\let#1}
-
-\def\!!zerocount{0}
-\def\!!plusone {1}
-
-\normalprotected\def\newfraction#1{\let#1\!!plusone}
-
-%D It would be handy to have a primitive \type {\unless\ifcase} because then we
-%D could use nicer values. Anyhow, this conditional code used to be in the \type
-%D {syst-aux} module but is now promoted to here.
-
-%D \macros
-%D {ifzeropt}
-%D
-%D The next macro is both cosmetic and byte saving. It is pretty \type
-%D {\if}||safe too. It can be used in cases like:
-%D
-%D \starttyping
-%D \ifzeropt \somedimen ... \else ... \fi
-%D \stoptyping
-
-\let\ifzeropt\ifcase
-
-% these token list helpers might move to syst-aux.mkiv
-%
-% we assume a \cs. not toks0 or so
-%
-% \normalprotected\def\appendtotoks #1#{\def\temp{#1}\afterassignment\doappendtotoks \scratchtoks=}
-% \normalprotected\def\prependtotoks#1#{\def\temp{#1}\afterassignment\doprependtotoks\scratchtoks=}
-
-\newtoks\t_syst_toks_temp \let\m_syst_toks_temp\t_syst_toks_temp
-
-\normalprotected\def\appendtotoks #1{\let\m_syst_toks_temp#1\afterassignment\syst_toks_append_l \t_syst_toks_temp=}
-\normalprotected\def\prependtotoks#1{\let\m_syst_toks_temp#1\afterassignment\syst_toks_prepend_l\t_syst_toks_temp=}
-
-% \def\syst_toks_append {\m_syst_toks_temp\expandafter\expandafter\expandafter{\expandafter\the\expandafter\m_syst_toks_temp\the\t_syst_toks_temp}}}
-% \def\syst_toks_prepend{\m_syst_toks_temp\expandafter\expandafter\expandafter{\expandafter\the\expandafter\t_syst_toks_temp\the\m_syst_toks_temp}}}
-
-\normalprotected\def\globalappendtotoks #1{\let\m_syst_toks_temp#1\afterassignment\syst_toks_append_g \t_syst_toks_temp=}
-\normalprotected\def\globalprependtotoks#1{\let\m_syst_toks_temp#1\afterassignment\syst_toks_prepend_g\t_syst_toks_temp=}
-
-\def\syst_toks_append_l {\normalexpanded{\m_syst_toks_temp{\the\m_syst_toks_temp\the\t_syst_toks_temp}}}
-\def\syst_toks_prepend_l{\normalexpanded{\m_syst_toks_temp{\the\t_syst_toks_temp\the\m_syst_toks_temp}}}
-
-\def\syst_toks_append_g {\global\syst_toks_append_l }
-\def\syst_toks_prepend_g{\global\syst_toks_prepend_l}
-
-\normalprotected\def\addtotoks #1{\let\m_syst_toks_temp#1\afterassignment\syst_toks_add_l\let\next}
-\normalprotected\def\globaladdtotoks#1{\let\m_syst_toks_temp#1\afterassignment\syst_toks_add_g\let\next}
-
-\def\syst_toks_add_l{\m_syst_toks_temp\expandafter\bgroup\the\m_syst_toks_temp}
-\def\syst_toks_add_g{\global\syst_toks_add_l}
-
-\normalprotected\def\addtotokscs #1#2{#1{\the#1#2}} % saves a few bytes
-\normalprotected\def\globaladdtotokscs#1#2{\global#1{\the#1#2}} % saves a few bytes
-
-%D \macros
-%D {begcsname}
-%D
-%D Handy for \ETEX-only usage (avoids making \type {\relax}'s:
-
-% \def\begcsname#1\endcsname{\ifcsname#1\endcsname\csname#1\endcsname\fi}
-
-\let\begcsname\begincsname
-
-%D Now come a few macros that might be needed in successive loading. We redefine the
-%D \type {\par} primitive pretty soon so that we get the equivalents right.
-
-% too tricky: \par is use more often than a par starts so we have too much change
-% that we get assymetrical behaviour
-%
-% \newtoks\everyendpar
-%
-% \normalprotected\def\endpar{\the\everyendpar\normalpar}
-% \normalprotected\def\par {\endpar}
-%
-% \normalprotected\def\reseteverypar
-% {\everypar \emptytoks
-% \everyendpar\emptytoks}
-
-\normalprotected\def\reseteverypar
- {\everypar\emptytoks}
-
-\let\endgraf\par
-\let\endline\cr
-
-\normalprotected\def\null{\hpack{}}
-
-%D The following two might be overloaded later on but some modules need then
-%D earlier. These functionality is reflected in the name and will not change.
-
-% \bgroup
-% \catcode`\^^M=\activecatcode%
-% \gdef\obeylines{\catcode`\^^M\activecatcode \let^^M\par}%
-% \glet^^M\par%
-% \egroup
-%
-% \bgroup
-% \gdef\obeyspaces{\catcode`\ \activecatcode}%
-% \obeyspaces\glet =\space%
-% \egroup
-
-\def\obeylines {\catcode\endoflineasciicode\activecatcode\letcharcode\endoflineasciicode\par}
-\def\obeyspaces{\catcode\spaceasciicode \activecatcode\letcharcode\spaceasciicode \space}
-
-% %D A constant:
-%
-% \let\endoflinetoken=^^M
-
-%D Also needed might be a simple loop structure and we borrow plain \TEX's one
-%D as it is often expected to be present and it is about the fastest you can
-%D get. Beware: this macro does not support nested loops. We use a namespace
-%D prefix \type {@@pln}.
-
-\def\loop#1\repeat{\def\@@plnbody{#1}\@@plniterate} % might go
-
-%D The following makes \type {\loop} \unknown\ \type {\if} \unknown\ \type
-%D {\repeat} skippable (clever trick):
-
-\let\repeat\fi % so both \loop and \repeat are reserved words!
-
-%D The original (no \type {@@pln} there):
-%D
-%D \starttyping
-%D \def\@@plniterate{\@@plnbody\let\next\@@plniterate\else\let\next\relax\fi\next}
-%D \stoptyping
-%D
-%D A more efficient alternative:
-%D
-%D \starttyping
-%D \def\@@plniterate{\@@plnbody\expandafter\@@plniterate\else\expandafter\relax\fi}
-%D \stoptyping
-%D
-%D An even more efficient one:
-
-\def\@@plniterate{\@@plnbody\expandafter\@@plniterate\else\fi}
-
-%D We don't define a real output routine yet but at least get rid of pages:
-
-\output{\shipout\box\normalpagebox}
-
-%D Although we don't add pagenumbers yet we alias the default register used
-%D for counting pages:
-
-\countdef\pageno\zerocount \pageno\plusone % first page is number 1
-
-%D Beside the raw counter \type {\pageno} the \type {\folio} macro provides
-%D the value.
-
-\def\folio{\the\pageno} % kind of expected and therefore reserved
-
-%D The following registers are kind of standard and (for the moment) we define
-%D them here. This might change.
-
-\newskip \bigskipamount \bigskipamount = 12pt plus 4pt minus 4pt
-\newskip \medskipamount \medskipamount = 6pt plus 2pt minus 2pt
-\newskip \smallskipamount \smallskipamount = 3pt plus 1pt minus 1pt
-
-\baselineskip = 12pt
-\lineskip = 1pt
-\lineskiplimit = 0pt
-
-%D Sometimes kerns make more sense than glue but we need to be in the
-%D right mode:
-
-\normalprotected\def\vkern{\ifhmode\par \fi\kern}
-\normalprotected\def\hkern{\ifvmode\dontleavehmode\fi\kern}
-
-%D Again a few kind-of-extensions the core. These come from plain \TEX\ but
-%D are probably not used in \CONTEXT.
-
-\newskip \hideskip \hideskip = -1000pt plus 1fill
-\newskip \centering \centering = 0pt plus 1000pt minus 1000pt
-
-\def\hidewidth % for alignment entries that can stick out
- {\hskip\hideskip}
-
-\def\ialign % initialized \halign
- {\everycr\emptytoks
- \tabskip\zeroskip
- \halign}
-
-\newcount \mscount
-
-\def\spanomit{\span\omit} % bypass error message
-
-\def\multispan#1%
- {\omit
- \mscount#1\relax
- \loop
- \ifnum\mscount>\plusone
- \spanomit \advance\mscount\minusone
- \repeat}
-
-\let\nopdfcompression \relax
-\let\onlypdfobjectcompression\relax
-\let\maximumpdfcompression \relax
-\let\normalpdfcompression \relax
-
-%D Basic status stuff.
-
-\newif\ifproductionrun
-
-%D For those who expect this \unknown
-
-\ifx\fmtname \undefined \def\fmtname {ConTeXt Initial TeX} \fi
-\ifx\fmtversion\undefined \def\fmtversion{3.1415926} \fi
-
-%D A few bonus macros:
-
-\def\modulonumber#1#2{\the\numexpr#2-((((#2+(#1/2))/#1)-1)*#1)\relax}
-\def\dividenumber#1#2{\the\numexpr(#2-(#1/2))/#1\relax}
-
-%D These could be set at the \LUA\ end instead:
-
-\edef\texenginename {\directlua{tex.print(LUATEXENGINE)}}
-\edef\texengineversion {\directlua{tex.print(LUATEXVERSION)}}
-\edef\texenginefunctionality{\directlua{tex.print(LUATEXFUNCTIONALITY)}}
-
-%D We have no reason not to enable this:
-
-\savingvdiscards\plusone
-
-%D We only can set this one via directives (system.synctex) and we only support
-%D the context variant. This will go away completely.
-
-\newcount\synctex \let\normalsynctex\synctex
-
-%D We get rid of the funny \TEX\ offset defaults of one inch by setting them to zero.
-
-\voffset\zeropoint \let\voffset\relax \newdimen\voffset \let\normalvoffset\voffset
-\hoffset\zeropoint \let\hoffset\relax \newdimen\hoffset \let\normalhoffset\hoffset
-
-\matheqnogapstep\zerocount % for now
-
-%D Now we define a few helpers that we need in a very early stage. We have no
-%D message system yet but redundant definitions are fatal anyway.
-
-\newcount\c_syst_helpers_n_of_namespaces \c_syst_helpers_n_of_namespaces\pluseight % 1-8 reserved for catcodes
-
-\def\v_interfaces_prefix_template_system{\number \c_syst_helpers_n_of_namespaces>>}
-%def\v_interfaces_prefix_template_system{\characters\c_syst_helpers_n_of_namespaces>>} % no \characters yet
-
-\normalprotected\def\installsystemnamespace#1%
- {\ifcsname ??#1\endcsname
- \immediate\write\statuswrite{fatal error: duplicate system namespace '#1'}%
- \expandafter\normalend
- \else
- \global\advance\c_syst_helpers_n_of_namespaces\plusone
- \expandafter\edef\csname ??#1\endcsname{\v_interfaces_prefix_template_system}%
- \fi}
-
-%D It makes more sense to have these here:
-
-\let\normalsuperscript \Usuperscript
-\let\normalsubscript \Usubscript
-\let\normalnosuperscript\Unosuperscript
-\let\normalnosubscript \Unosubscript
-\let\normalstartimath \Ustartmath
-\let\normalstopimath \Ustopmath
-\let\normalstartdmath \Ustartdisplaymath
-\let\normalstopdmath \Ustopdisplaymath
-
-%D Also better here:
-
-\def\wildcardsymbol{*}
-
-%D For a while we will keep these useless numbers as for instance tikz checks for them:
-
-\chardef\eTeXversion 2
-\def \eTeXrevision {2}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/syst-lua.lua b/Master/texmf-dist/tex/context/base/mkiv/syst-lua.lua
index 5911d7f0059..085f75eca92 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/syst-lua.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/syst-lua.lua
@@ -6,13 +6,43 @@ if not modules then modules = { } end modules ['syst-lua'] = {
license = "see context related readme files"
}
+local load, type, tonumber = load, type, tonumber
+local concat = table.concat
+local utfchar = utf.char
local find = string.find
local S, C, P, lpegmatch, lpegtsplitat = lpeg.S, lpeg.C, lpeg.P, lpeg.match, lpeg.tsplitat
-commands = commands or { }
-local commands = commands
-local context = context
-local implement = interfaces.implement
+local xmath = xmath or math
+local xcomplex = xcomplex or { }
+
+local cmd = tokens.commands
+
+local scan_next = token.scan_next or token.get_next
+local scan_cmdchr = token.scan_cmdchr_expanded
+
+local get_command = token.get_command
+local get_mode = token.get_mode
+local get_index = token.get_index
+local get_csname = token.get_csname
+local get_macro = token.get_macro
+
+local put_next = token.put_next
+
+local scan_token = token.scan_token or token.get_token
+
+local getdimen = tex.getdimen
+local getglue = tex.getglue
+local getcount = tex.getcount
+local gettoks = tex.gettoks
+local gettex = tex.get
+
+local context = context
+local dimenfactors = number.dimenfactors
+
+commands = commands or { }
+local commands = commands
+local context = context
+local implement = interfaces.implement
local ctx_protected_cs = context.protected.cs -- more efficient
local ctx_firstoftwoarguments = context.firstoftwoarguments
@@ -20,11 +50,9 @@ local ctx_secondoftwoarguments = context.secondoftwoarguments
local ctx_firstofoneargument = context.firstofoneargument
local ctx_gobbleoneargument = context.gobbleoneargument
-local two_strings = interfaces.strings[2]
-
implement { -- will be overloaded later
name = "writestatus",
- arguments = two_strings,
+ arguments = "2 strings",
actions = logs.status,
}
@@ -123,7 +151,7 @@ implement {
implement {
name = "doifelsesame",
- arguments = two_strings,
+ arguments = "2 strings",
actions = function(a,b)
if a == b then
ctx_firstoftwoarguments()
@@ -135,7 +163,7 @@ implement {
implement {
name = "doifsame",
- arguments = two_strings,
+ arguments = "2 strings",
actions = function(a,b)
if a == b then
ctx_firstofoneargument()
@@ -147,7 +175,7 @@ implement {
implement {
name = "doifnotsame",
- arguments = two_strings,
+ arguments = "2 strings",
actions = function(a,b)
if a == b then
ctx_gobbleoneargument()
@@ -164,237 +192,107 @@ implement {
-- stick to the next gimmick. It looks inefficient but performance is actually quite
-- efficient.
-local concat = table.concat
-local utfchar = utf.char
-local load, type, tonumber = load, type, tonumber
-
-local xmath = xmath or math
-local xcomplex = xcomplex or { }
+do
-local cmd = tokens.commands
+ local result = { "return " }
+ local word = { }
+ local r = 1
+ local w = 0
-local get_next = token.get_next
-local get_command = token.get_command
-local get_mode = token.get_mode
-local get_index = token.get_index
-local get_csname = token.get_csname
-local get_macro = token.get_macro
+ local report = logs.reporter("system","expression")
-local put_next = token.put_next
-
-local scan_token = token.scan_token
-
-local getdimen = tex.getdimen
-local getglue = tex.getglue
-local getcount = tex.getcount
-local gettoks = tex.gettoks
-local gettex = tex.get
-
-local context = context
-local dimenfactors = number.dimenfactors
-
-local result = { "return " }
-local word = { }
-local r = 1
-local w = 0
-
-local report = logs.reporter("system","expression")
-
-local function unexpected(c)
- report("unexpected token %a",c)
-end
+ local function unexpected(c)
+ report("unexpected token %a",c)
+ end
-local function expression()
- local w = 0
- local r = 1
- while true do
- local t = get_next()
- local n = get_command(t)
- local c = cmd[n]
- -- todo, helper: returns number
- if c == "letter" then
- w = w + 1 ; word[w] = utfchar(get_mode(t))
- else
- if w > 0 then
- local s = concat(word,"",1,w)
- local d = dimenfactors[s]
- if d then
- r = r + 1 ; result[r] = "*"
- r = r + 1 ; result[r] = 1/d
- else
- if xmath[s] then
- r = r + 1 ; result[r] = "xmath."
- elseif xcomplex[s] then
- r = r + 1 ; result[r] = "xcomplex."
+ local function expression()
+ local w = 0
+ local r = 1
+ while true do
+ local t = scan_next()
+ local n = get_command(t)
+ local c = cmd[n]
+ -- todo, helper: returns number
+ if c == "letter" then
+ w = w + 1 ; word[w] = utfchar(get_mode(t))
+ else
+ if w > 0 then
+ local s = concat(word,"",1,w)
+ local d = dimenfactors[s]
+ if d then
+ r = r + 1 ; result[r] = "*"
+ r = r + 1 ; result[r] = 1/d
+ else
+ if xmath[s] then
+ r = r + 1 ; result[r] = "xmath."
+ elseif xcomplex[s] then
+ r = r + 1 ; result[r] = "xcomplex."
+ end
+ r = r + 1 ; result[r] = s
end
- r = r + 1 ; result[r] = s
+ w = 0
end
- w = 0
- end
- if c == "other_char" then
- r = r + 1 ; result[r] = utfchar(get_mode(t))
- elseif c == "spacer" then
- -- r = r + 1 ; result[r] = " "
- elseif c == "relax" then
- break
- elseif c == "assign_int" then
- r = r + 1 ; result[r] = getcount(get_index(t))
- elseif c == "assign_dimen" then
- r = r + 1 ; result[r] = getdimen(get_index(t))
- elseif c == "assign_glue" then
- r = r + 1 ; result[r] = getglue(get_index(t))
- elseif c == "assign_toks" then
- r = r + 1 ; result[r] = gettoks(get_index(t))
- elseif c == "char_given" or c == "math_given" or c == "xmath_given" then
- r = r + 1 ; result[r] = get_mode(t)
- elseif c == "last_item" then
- local n = get_csname(t)
- if n then
- local s = gettex(n)
- if s then
- r = r + 1 ; result[r] = s
+ if c == "other_char" then
+ r = r + 1 ; result[r] = utfchar(get_mode(t))
+ elseif c == "spacer" then
+ -- r = r + 1 ; result[r] = " "
+ elseif c == "relax" then
+ break
+ elseif c == "assign_int" then
+ r = r + 1 ; result[r] = getcount(get_index(t))
+ elseif c == "assign_dimen" then
+ r = r + 1 ; result[r] = getdimen(get_index(t))
+ elseif c == "assign_glue" then
+ r = r + 1 ; result[r] = getglue(get_index(t))
+ elseif c == "assign_toks" then
+ r = r + 1 ; result[r] = gettoks(get_index(t))
+ elseif c == "char_given" or c == "math_given" or c == "xmath_given" then
+ r = r + 1 ; result[r] = get_mode(t)
+ elseif c == "last_item" then
+ local n = get_csname(t)
+ if n then
+ local s = gettex(n)
+ if s then
+ r = r + 1 ; result[r] = s
+ else
+ unexpected(c)
+ end
else
unexpected(c)
end
- else
- unexpected(c)
- end
- elseif c == "call" then
- local n = get_csname(t)
- if n then
- local s = get_macro(n)
- if s then
- r = r + 1 ; result[r] = s
+ elseif c == "call" then
+ local n = get_csname(t)
+ if n then
+ local s = get_macro(n)
+ if s then
+ r = r + 1 ; result[r] = s
+ else
+ unexpected(c)
+ end
else
unexpected(c)
end
+ elseif c == "the" or c == "convert" or c == "lua_expandable_call" then
+ put_next(t)
+ scan_token() -- expands
else
unexpected(c)
end
- elseif c == "the" or c == "convert" or c == "lua_expandable_call" then
- put_next(t)
- scan_token() -- expands
- else
- unexpected(c)
end
end
+ local code = concat(result,"",1,r)
+ local func = load(code)
+ if type(func) == "function" then
+ context(func())
+ else
+ report("invalid lua %a",code)
+ end
end
- local code = concat(result,"",1,r)
- local func = load(code)
- if type(func) == "function" then
- context(func())
- else
- report("invalid lua %a",code)
- end
-end
--- local letter_code <const> = cmd.letter
--- local other_char_code <const> = cmd.other_char
--- local spacer_code <const> = cmd.spacer
--- local other_char_code <const> = cmd.other_char
--- local relax_code <const> = cmd.relax
--- local assign_int_code <const> = cmd.assign_int
--- local assign_dimen_code <const> = cmd.assign_dimen
--- local assign_glue_code <const> = cmd.assign_glue
--- local assign_toks_code <const> = cmd.assign_toks
--- local char_given_code <const> = cmd.char_given
--- local math_given_code <const> = cmd.math_given
--- local xmath_given_code <const> = cmd.xmath_given
--- local last_item_code <const> = cmd.last_item
--- local call_code <const> = cmd.call
--- local the_code <const> = cmd.the
--- local convert_code <const> = cmd.convert
--- local lua_expandable_call_code <const> = cmd.lua_expandable_call
---
--- local function unexpected(c)
--- report("unexpected token %a",c)
--- end
---
--- local function expression()
--- local w = 0
--- local r = 1
--- while true do
--- local t = get_next()
--- local n = get_command(t)
--- if n == letter_code then
--- w = w + 1 ; word[w] = utfchar(get_mode(t))
--- else
--- if w > 0 then
--- -- we could use a metatable for all math, complex and factors
--- local s = concat(word,"",1,w)
--- local d = dimenfactors[s]
--- if d then
--- r = r + 1 ; result[r] = "*"
--- r = r + 1 ; result[r] = 1/d
--- else
--- if xmath[s] then
--- r = r + 1 ; result[r] = "xmath."
--- elseif xcomplex[s] then
--- r = r + 1 ; result[r] = "xcomplex."
--- end
--- r = r + 1 ; result[r] = s
--- end
--- w = 0
--- end
--- if n == other_char_code then
--- r = r + 1 ; result[r] = utfchar(get_mode(t))
--- elseif n == spacer_code then
--- -- r = r + 1 ; result[r] = " "
--- elseif n == relax_code then
--- break
--- elseif n == assign_int_code then
--- r = r + 1 ; result[r] = getcount(get_index(t))
--- elseif n == assign_dimen_code then
--- r = r + 1 ; result[r] = getdimen(get_index(t))
--- elseif n == assign_glue_code then
--- r = r + 1 ; result[r] = getglue(get_index(t))
--- elseif n == assign_toks_code then
--- r = r + 1 ; result[r] = gettoks(get_index(t))
--- elseif n == char_given_code or n == math_given_code or n == xmath_given_code then
--- r = r + 1 ; result[r] = get_mode(t)
--- elseif n == last_item_code then
--- local n = get_csname(t)
--- if n then
--- local s = gettex(n)
--- if s then
--- r = r + 1 ; result[r] = s
--- else
--- unexpected(c)
--- end
--- else
--- unexpected(c)
--- end
--- elseif n == call_code then
--- local n = get_csname(t)
--- if n then
--- local s = get_macro(n)
--- if s then
--- r = r + 1 ; result[r] = s
--- else
--- unexpected(c)
--- end
--- else
--- unexpected(c)
--- end
--- elseif n == the_code or n == convert_code or n == lua_expandable_call_code then
--- put_next(t)
--- scan_token() -- expands
--- else
--- unexpected(c)
--- end
--- end
--- end
--- local code = concat(result,"",1,r)
--- local func = load(code)
--- if type(func) == "function" then
--- context(func())
--- else
--- report("invalid lua %a",code)
--- end
--- end
+ implement {
+ public = true,
+ name = "expression",
+ actions = expression,
+ }
-implement {
- public = true,
- name = "expression",
- actions = expression,
-}
+end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/syst-lua.mkiv b/Master/texmf-dist/tex/context/base/mkiv/syst-lua.mkiv
index d275acd7dd1..f0902eaf58b 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/syst-lua.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/syst-lua.mkiv
@@ -57,8 +57,8 @@
\def\expdoifelsecommon#1#2{\clf_doifelsecommon{#1}{#2}}
\def\expdoifelseinset #1#2{\clf_doifelseinset {#1}{#2}}
-\def\expdoifcommonelse\expdoifelsecommon
-\def\expdoifinsetelse \expdoifelseinset
+\let\expdoifcommonelse\expdoifelsecommon
+\let\expdoifinsetelse \expdoifelseinset
%D We define these here, just in case. This permits \typefile {self} otherwise
%D nested b|/|e sep problems.
@@ -68,7 +68,7 @@
\edef\!!bs{[\luastringsep[}
\edef\!!es{]\luastringsep]}
-\unexpanded\def\writestatus#1#2{\clf_writestatus{#1}{#2}}
+\protected\def\writestatus#1#2{\clf_writestatus{#1}{#2}}
%D We can omit the tex.ctxcatcodes here as nowadays we seldom change the regime at
%D the \TEX\ end:
diff --git a/Master/texmf-dist/tex/context/base/mkiv/syst-lua.mkxl b/Master/texmf-dist/tex/context/base/mkiv/syst-lua.mkxl
deleted file mode 100644
index cf20c3341f8..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/syst-lua.mkxl
+++ /dev/null
@@ -1,100 +0,0 @@
-%D \module
-%D [ file=syst-lua,
-%D version=2008.01.25,
-%D title=\CONTEXT\ System Macros,
-%D subtitle=Helper macros based on \LUA,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\registerctxluafile{syst-lua}{}
-
-\unprotect
-
-\def\expdoifelse#1#2{\clf_doifelsesame{#1}{#2}}
-\def\expdoif #1#2{\clf_doifsame {#1}{#2}}
-\def\expdoifnot #1#2{\clf_doifnotsame {#1}{#2}}
-
-%D Here is variant using a brainwave of the 12\high{+} hour \quotation {Long Road
-%D Out of Eden}\footnote {Eden being Backo\TeX\ 2018, where the virtues of the \type
-%D {\expanded} primitive were mentioned in talks.} trip. For now I don't really see
-%D other useful applications.
-
-\def\expandeddoifelse#1#2{\iftok{#1}{#2}\expandafter\firstoftwoarguments\else\expandafter\secondoftwoarguments\fi}
-\def\expandeddoif #1#2{\iftok{#1}{#2}\expandafter\firstofoneargument \else\expandafter\gobbleoneargument \fi}
-\def\expandeddoifnot #1#2{\iftok{#1}{#2}\expandafter\gobbleoneargument \else\expandafter\firstofoneargument \fi}
-
-% \testfeatureonce{100000}{\doifelse{hello world}{here i am}{}} % 0.3
-% \testfeatureonce{100000}{\expandabledoifelse{hello world}{here i am}{}} % 1.5
-
-\def\expdoifelsecommon#1#2{\clf_doifelsecommon{#1}{#2}}
-\def\expdoifelseinset #1#2{\clf_doifelseinset {#1}{#2}}
-
-\def\expdoifcommonelse\expdoifelsecommon
-\def\expdoifinsetelse \expdoifelseinset
-
-%D We define these here, just in case. This permits \typefile {self} otherwise
-%D nested b|/|e sep problems.
-
-\def\luastringsep{===}
-
-\edef\!!bs{[\luastringsep[}
-\edef\!!es{]\luastringsep]}
-
-\unexpanded\def\writestatus#1#2{\clf_writestatus{#1}{#2}}
-
-%D We can omit the tex.ctxcatcodes here as nowadays we seldom change the regime at
-%D the \TEX\ end:
-
-%def\luaexpr#1{\ctxlua{context (tostring(#1))}} % more efficient:
-\def\luaexpr#1{\ctxlua{tex.print(tostring(#1))}} % no use is shortcutting has to be compiled
-
-%D But as we only use write 16 we could as well do all in \LUA\ and ignore the rest.
-%D Okay, we still can do writes here but only when not blocked.
-
-\let\syst_write_execute\clf_execute % always {...}
-
-%D There is a probably rather useless \type {\expression} command that can mix \LUA\ numeric
-%D expressions with \TEX\ commands (for as far that makes sense) that works like this:
-%D
-%D \starttyping
-%D \mathchardef\foooo 1234
-%D \def \mymacro {123.45}
-%D \scratchdimen 123pt
-%D \scratchskip 123pt
-%D \scratchtoks {34}
-%D
-%D \testfeatureonce{10000}{\edef\foo{\expression
-%D round(
-%D 12.3 * \scratchdimen
-%D - (12.3 * \scratchskip) / 2
-%D + 2 ^ 3
-%D * (
-%D - sqrt(12)
-%D - 10pt
-%D - \foooo
-%D + \luatexversion
-%D - \mymacro
-%D + \scratchtoks
-%D + \the\scratchcounter
-%D + \number\scratchcounter
-%D )
-%D )
-%D \relax}}
-%D
-%D \expression string.format("\letterpercent f",\elapsedtime/50000) \relax
-%D \stoptyping
-%D
-%D The final \type {\relax} is mandate because we also accept spaces. Of course we
-%D could have avoided it by using outer parenthesis but this is cleaner anyway.
-%D
-%D The \LMTX\ version supports te \type {xmath} and \type {xcomplex} functions and
-%D therefore one can have expressions that don't work in \MKIV.
-
-% maybe: \let\texexpr\expression
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/syst-mac.lua b/Master/texmf-dist/tex/context/base/mkiv/syst-mac.lua
new file mode 100644
index 00000000000..b7c36817c50
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkiv/syst-mac.lua
@@ -0,0 +1,9 @@
+if not modules then modules = { } end modules ['syst-mac'] = {
+ version = 1.001,
+ comment = "companion to syst-aux.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- empty
diff --git a/Master/texmf-dist/tex/context/base/mkiv/syst-mes.mkiv b/Master/texmf-dist/tex/context/base/mkiv/syst-mes.mkiv
index 4ed2697f15a..ff7ab1ce39f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/syst-mes.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/syst-mes.mkiv
@@ -11,8 +11,8 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\normalprotected\def\writestring {\immediate\write\statuswrite}
-\normalprotected\def\writeline {\writestring{}}
- \let\message \normalmessage
+\protected\def\writestring{\immediate\write\statuswrite}
+\protected\def\writeline {\writestring{}}
+% \let\message \normalmessage
\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/syst-pln.mkiv b/Master/texmf-dist/tex/context/base/mkiv/syst-pln.mkiv
index 2481131209f..38ec9c4c1c5 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/syst-pln.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/syst-pln.mkiv
@@ -13,10 +13,9 @@
\unprotect
-%D This module set a couple of variables to the plain \TEX\
-%D values. Later they might be overloaded. There is not much
-%D difference between \MKII\ and \MKIV\ but at some point they
-%D might diverge.
+%D This module set a couple of variables to the plain \TEX\ values. Later they might
+%D be overloaded. There is not much difference between \MKII\ and \MKIV\ but at some
+%D point they might diverge.
%D Build||in numeric variables.
diff --git a/Master/texmf-dist/tex/context/base/mkiv/tabl-ltb.mkiv b/Master/texmf-dist/tex/context/base/mkiv/tabl-ltb.mkiv
index de90d658528..0650cf9ce72 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/tabl-ltb.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/tabl-ltb.mkiv
@@ -503,7 +503,7 @@
\fi
\global\d_tabl_lines_width\wd\b_tabl_lines_cell
\tabl_lines_start_part
- \if!!doneb \else \ifcase\c_tabl_lines_repeat \else
+ \if!!donea \else \ifcase\c_tabl_lines_repeat \else
% check for left/right page
\ifcase\c_tabl_lines_page\donetrue\or\donetrue\or\donefalse\fi\ifdone
% insert repeater
diff --git a/Master/texmf-dist/tex/context/base/mkiv/tabl-mis.mkiv b/Master/texmf-dist/tex/context/base/mkiv/tabl-mis.mkiv
index b2af1993eac..d9022b06d7a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/tabl-mis.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/tabl-mis.mkiv
@@ -130,7 +130,7 @@
\let\typo_paragraphs_setup_saved\setupparagraphs
-\unexpanded\def\setupparagraphs
+\unexpanded\overloaded\def\setupparagraphs
{\dotripleempty\typo_paragraphs_setup}
\def\typo_paragraphs_setup[#1][#2][#3]% we are downward compatible with [each] and [1,3]
@@ -193,7 +193,7 @@
\fi
\parindent\zeropoint
\c_typo_paragraphs_n\zerocount
- \let\\=\typo_paragraphs_next % downward compatible
+ \enforced\let\\\typo_paragraphs_next % downward compatible
\edef\p_offset{\paragraphsparameter\c!offset}%
\doifelsedimension\p_offset
{\scratchoffset\p_offset}%
diff --git a/Master/texmf-dist/tex/context/base/mkiv/tabl-ntb.mkiv b/Master/texmf-dist/tex/context/base/mkiv/tabl-ntb.mkiv
index 8ff02330a9a..45f746f3a08 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/tabl-ntb.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/tabl-ntb.mkiv
@@ -243,12 +243,18 @@
\tabl_ntb_next_level % go to level 1
+%D This is for the special cases where for instance a table is in a header or footer
+%D line and we have a split table in progress. (See mail to list from Taco.)
+
\installcorenamespace{naturaltable} % was tbl
\installcorenamespace{naturaltablelocal} % was tbltbl
\installdirectcommandhandler \??naturaltable {naturaltable} % \??naturaltable
\installsimpleframedcommandhandler \??naturaltablelocal {naturaltablelocal} \??naturaltablelocal
+\unexpanded\def\bTABLEnested{\tabl_ntb_next_level\bTABLE}
+\unexpanded\def\eTABLEnested{\eTABLE\tabl_ntb_prev_level}
+
\installcorenamespace{naturaltabletal}
\installcorenamespace{naturaltablegal}
\installcorenamespace{naturaltablenob}
@@ -1505,7 +1511,7 @@
\advance\scratchcounter\plusone}%
\fi
% cell
- \setbox\scratchbox\hbox attr \taggedattribute \attribute\taggedattribute \bgroup
+ \setbox\scratchbox\hbox attr \taggedattribute \c_attr_tagged \bgroup
\dotagTABLEsignal % maybe we need to add some packaging in this case
\tabl_ntb_get_txt{#1}{#2}%
\egroup
diff --git a/Master/texmf-dist/tex/context/base/mkiv/tabl-ntb.mkxl b/Master/texmf-dist/tex/context/base/mkiv/tabl-ntb.mkxl
deleted file mode 100644
index 6b84411b2a9..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/tabl-ntb.mkxl
+++ /dev/null
@@ -1,2202 +0,0 @@
-%D \module
-%D [ file=tabl-ntb,
-%D version=2000.04.18,
-%D title=\CONTEXT\ Table Macros,
-%D subtitle=Natural Tables,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-%D This module has a more modern variant in xtables but as we follow a bit different
-%D approach with settings there, this mechanism will stay. In fact each of them has
-%D its advantages. This module could be sped up a bit and made more efficient by
-%D delegating some housekeeping to \LUA\ but it's not worth the effort. The code
-%D could me made more readable but again, there is no real purpose in it. If needed
-%D I can squeeze out a few more percentages runtime.
-
-% columndistance 'optimized' ... needs checking
-%
-% we don't need the alignment mechanism .. we can just pack the row in a box
-
-\writestatus{loading}{ConTeXt Table Macros / Natural Tables}
-
-% sometimes this helps (with nc going wild): \setupTABLE[maxwidth=100cm]
-%
-% bug: width 3cm is not honored and column becomes too wide as given width is added
-% to distributed width
-%
-% \bTABLE
-% \bTR
-% \bTD test \eTD
-% \bTD \framed[height=3cm]{test} \eTD
-% \bTD[width=3cm] \dorecurse{30}{a } \eTD
-% \bTD \input ward \eTD
-% \eTR
-% \bTR
-% \bTD test \eTD
-% \bTD \framed[height=3cm]{test} \eTD
-% \bTD \dorecurse{30}{a } \eTD
-% \bTD \input ward \eTD
-% \eTR
-% \eTABLE
-
-% \unexpanded\def\startrow {\bTR}
-% \unexpanded\def\stoprow {\eTR}
-% \unexpanded\def\startcell#1\stopcell{\bTD#1\eTD}
-% \let\stopcell \relax
-% \let\startcelltable \bTABLE
-% \let\stopcelltable \eTABLE
-
-% \starttext
-% \startcelltable
-% \startrow \startcell a \stopcell \stoprow
-% \startrow \startcell a \stopcell \stoprow
-% \startrow \startcell a \stopcell \stoprow
-% \startrow \startcell a \stopcell \stoprow
-% \stopcelltable
-% \stoptext
-
-%D As always, this is the n\high{th} version. Much time went in trying to speed up
-%D the many cell calculations, some optimizations were rejected in order not to
-%D complicate this module too much (and in order to prevail extensibility). In the
-%D meantime we've sacrified some speed for readability.
-
-\unprotect
-
-%D The next alternative also takes care of preceding and following white space.
-%D
-%D \startbuffer
-%D \bTABLE[left={(},right={)},top=\startnarrower,bottom=\stopnarrower]
-%D \bTR \bTD something \eTD \eTR
-%D \eTABLE
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-
-\ifdefined\dotagTABLEcell \else \let\dotagTABLEcell \relax \fi % todo: namespace
-\ifdefined\dotagTABLEsignal \else \let\dotagTABLEsignal\relax \fi % todo: namespace
-
-\let\tabl_ntb_next_level\relax
-
-\newtoks\t_tabl_ntb_cell_start
-\newtoks\t_tabl_ntb_cell_stop
-
-\appendtoks
- \naturaltablelocalparameter\c!left
- \delayedbegstrut
-\to \t_tabl_ntb_cell_start
-
-\appendtoks
- \delayedendstrut
- \naturaltablelocalparameter\c!right
-\to \t_tabl_ntb_cell_stop
-
-\appendtoks
- \flushpostponednodedata
- % maybe: \the\neverypar
-\to \t_tabl_ntb_cell_start
-
-\unexpanded\def\tabl_ntb_cell_start
- {% \inhibitblank
- \dotagTABLEcell
- %\tabl_ntb_next_level
- \font_styles_math_reset
- \usenaturaltablelocalstyleandcolor\c!style\c!color
- \everypar\t_tabl_ntb_cell_start
- \font_styles_math_start}
-
-\unexpanded\def\tabl_ntb_cell_stop
- {\font_styles_math_stop
- \ifhmode
- \the\t_tabl_ntb_cell_stop
- \par % added 13/4/2006
- \orelse\ifdim\prevdepth<\zeropoint % =-1000pt ?
- % not sure yet:\naturaltablelocalparameter\c!right
- \vskip-\strutdp
- \else
- \removebottomthings
- \fi}
-
-% maybe:
-%
-% \unexpanded\def\tabl_ntb_cell_stop
-% {\ifhmode
-% \the\t_tabl_ntb_cell_stop
-% \par % added 13/4/2006
-% \else
-% % not sure yet:\naturaltablelocalparameter\c!right
-% \par
-% \ifhmode
-% % \removeunwantedspaces
-% \else\ifdim\prevdepth<\zeropoint % =-1000pt ?
-% \vskip-\strutdp
-% \else
-% \removebottomthings
-% \fi\fi
-% \fi}
-
-\newcount\c_tabl_ntb_row
-\newcount\c_tabl_ntb_col
-\newcount\c_tabl_ntb_spn
-
-\newcount\c_tabl_ntb_nx
-\newcount\c_tabl_ntb_ny
-
-\setnewconstant\c_tabl_ntb_cell \plusone
-\setnewconstant\c_tabl_ntb_none \plustwo
-
-\newcount\c_tabl_ntb_current_row
-\newcount\c_tabl_ntb_current_col
-\newcount\c_tabl_ntb_current_row_one
-\newcount\c_tabl_ntb_current_col_one
-\newcount\c_tabl_ntb_current_row_two
-\newcount\c_tabl_ntb_current_col_two
-\newcount\c_tabl_ntb_current_row_three
-\newcount\c_tabl_ntb_current_col_three
-\newcount\c_tabl_ntb_current_row_four
-\newcount\c_tabl_ntb_current_col_four
-
-\newcount\c_tabl_ntb_running_col
-\newcount\c_tabl_ntb_maximum_row
-\newcount\c_tabl_ntb_maximum_col
-\newcount\c_tabl_ntb_maximum_row_span
-\newcount\c_tabl_ntb_maximum_col_span
-
-\newcount\c_tabl_ntb_encountered_col
-\newcount\c_tabl_ntb_encountered_max
-
-\newtoks\t_tabl_ntb
-\newtoks\t_tabl_ntb_row
-
-\newconstant\c_tabl_tbl_pass
-
-\newtoks\t_tabl_ntb_head
-\newtoks\t_tabl_ntb_next
-\newtoks\t_tabl_ntb_body
-\newtoks\t_tabl_ntb_foot
-
-\newcount\c_tabl_ntb_n_of_head_lines
-\newcount\c_tabl_ntb_n_of_next_lines
-\newcount\c_tabl_ntb_n_of_hdnx_lines
-
-\newdimen\d_tabl_ntb_height
-\newdimen\d_tabl_ntb_width
-
-\newdimen\d_tabl_ntb_leftmargindistance
-\newdimen\d_tabl_ntb_rightmargindistance
-\newdimen\d_tabl_ntb_columndistance
-\newdimen\d_tabl_ntb_maxwidth
-
-\newtoks\everyTABLEpass % public
-
-\newcount\tablecellrows % public (needs checking)
-\newcount\tablecellcolumns % public (needs checking)
-
-\newbox\b_tabl_ntb_final
-
-%D For tagging and export:
-
-\newconstant \c_tabl_ntb_head
-\newconstant \c_tabl_ntb_body
-\newconstant \c_tabl_ntb_foot
-\newconditional \c_tabl_ntb_okay
-
-%D We have already prepared the previous macros for nesting, so we only have to pop
-%D in the right ones:
-
-\newcount\c_tabl_level
-
-\installglobalmacrostack\m_tabl_ntb_saved_row
-\installglobalmacrostack\m_tabl_ntb_saved_col
-
-\unexpanded\def\tabl_ntb_table_push
- {\ifnum\m_tabl_tbl_level>\plusone
- \tabl_ntb_parameters_reset
- % we need a proper count push/pop
- \xdef\m_tabl_ntb_saved_row{\the\c_tabl_ntb_row}\push_macro_m_tabl_ntb_saved_row
- \xdef\m_tabl_ntb_saved_col{\the\c_tabl_ntb_col}\push_macro_m_tabl_ntb_saved_col
- \else
- \global\intabletrue
- \fi}
-
-\unexpanded\def\tabl_ntb_table_pop
- {\ifnum\m_tabl_tbl_level>\plusone
- \pop_macro_m_tabl_ntb_saved_row\global\c_tabl_ntb_row\m_tabl_ntb_saved_row
- \pop_macro_m_tabl_ntb_saved_col\global\c_tabl_ntb_col\m_tabl_ntb_saved_col
- \else
- \global\intablefalse
- \fi}
-
-\unexpanded\def\tabl_ntb_next_level
- {\advance\c_tabl_level\plusone
- \edef\m_tabl_tbl_level{\the\c_tabl_level}}
-
-\unexpanded\def\tabl_ntb_prev_level
- {\advance\c_tabl_level\minusone
- \edef\m_tabl_tbl_level{\the\c_tabl_level}}
-
-\tabl_ntb_next_level % go to level 1
-
-\installcorenamespace{naturaltable} % was tbl
-\installcorenamespace{naturaltablelocal} % was tbltbl
-
-\installdirectcommandhandler \??naturaltable {naturaltable} % \??naturaltable
-\installsimpleframedcommandhandler \??naturaltablelocal {naturaltablelocal} \??naturaltablelocal
-
-\installcorenamespace{naturaltabletal}
-\installcorenamespace{naturaltablegal}
-\installcorenamespace{naturaltablenob}
-\installcorenamespace{naturaltabletag}
-\installcorenamespace{naturaltablecol}
-\installcorenamespace{naturaltablerow}
-\installcorenamespace{naturaltablewd}
-\installcorenamespace{naturaltableht}
-\installcorenamespace{naturaltabledp}
-\installcorenamespace{naturaltablewid}
-\installcorenamespace{naturaltablehei}
-\installcorenamespace{naturaltabledis}
-\installcorenamespace{naturaltableaut}
-\installcorenamespace{naturaltablebck}
-%installcorenamespace{naturaltablefwd} % forcedwidth
-\installcorenamespace{naturaltabletxt}
-\installcorenamespace{naturaltablespn}
-\installcorenamespace{naturaltableref}
-\installcorenamespace{naturaltableset}
-\installcorenamespace{naturaltablecell}
-\installcorenamespace{naturaltablesqueeze}
-\installcorenamespace{naturaltabletok}
-
-\letvalue{\??naturaltablesqueeze }\donefalse
-\letvalue{\??naturaltablesqueeze\v!fit }\donetrue
-\letvalue{\??naturaltablesqueeze\v!fixed}\donetrue
-\letvalue{\??naturaltablesqueeze\v!broad}\donetrue
-\letvalue{\??naturaltablesqueeze\v!local}\donetrue
-
-\def\tabl_ntb_let_gal{\expandafter\glet\csname\??naturaltablegal\m_tabl_tbl_level\endcsname}
-\def\tabl_ntb_get_gal{\csname\??naturaltablegal\m_tabl_tbl_level\endcsname}
-
-\def\tabl_ntb_let_tal#1{\expandafter\glet\csname\??naturaltabletal\m_tabl_tbl_level:\number#1\endcsname}
-\def\tabl_ntb_get_tal#1{\csname\??naturaltabletal\m_tabl_tbl_level:\number#1\endcsname}
-
-\def\tabl_ntb_set_nob#1{\expandafter\let\csname\??naturaltablenob\m_tabl_tbl_level:\number#1\endcsname\plusone}
-\def\tabl_ntb_get_nob#1{\ifcsname\??naturaltablenob\m_tabl_tbl_level:\number#1\endcsname\plusone\else\zerocount\fi}
-
-%def\tabl_ntb_set_tag#1#2{\expandafter\edef\csname\??naturaltabletag\m_tabl_tbl_level:\number#1:\number#2\endcsname}
-\def\tabl_ntb_set_col#1#2{\expandafter\edef\csname\??naturaltablecol\m_tabl_tbl_level:\number#1:\number#2\endcsname}
-\def\tabl_ntb_set_row#1#2{\expandafter\edef\csname\??naturaltablerow\m_tabl_tbl_level:\number#1:\number#2\endcsname}
-
-\def\tabl_ntb_let_tag#1#2{\expandafter\let\csname\??naturaltabletag\m_tabl_tbl_level:\number#1:\number#2\endcsname}
-\def\tabl_ntb_let_col#1#2{\expandafter\let\csname\??naturaltablecol\m_tabl_tbl_level:\number#1:\number#2\endcsname}
-\def\tabl_ntb_let_row#1#2{\expandafter\let\csname\??naturaltablerow\m_tabl_tbl_level:\number#1:\number#2\endcsname}
-
-%def\tabl_ntb_set_wd#1#2{\expandafter\xdef\csname\??naturaltablewd\m_tabl_tbl_level:\number#1:\number#2\endcsname} % global !
-\def\tabl_ntb_set_ht#1#2{\expandafter\xdef\csname\??naturaltableht\m_tabl_tbl_level:\number#1:\number#2\endcsname} % global !
-
-%def\tabl_ntb_let_wd#1#2{\expandafter\glet\csname\??naturaltablewd\m_tabl_tbl_level:\number#1:\number#2\endcsname} % global !
-\def\tabl_ntb_let_ht#1#2{\expandafter\glet\csname\??naturaltableht\m_tabl_tbl_level:\number#1:\number#2\endcsname} % global !
-
-\def\tabl_ntb_get_tag#1#2{\csname\??naturaltabletag\m_tabl_tbl_level:\number#1:\number#2\endcsname}
-\def\tabl_ntb_get_col#1#2{\csname\??naturaltablecol\m_tabl_tbl_level:\number#1:\number#2\endcsname}
-\def\tabl_ntb_get_row#1#2{\csname\??naturaltablerow\m_tabl_tbl_level:\number#1:\number#2\endcsname}
-
-%def\tabl_ntb_get_wd#1#2{\csname\??naturaltablewd\m_tabl_tbl_level:\number#1:\number#2\endcsname}
-\def\tabl_ntb_get_ht#1#2{\csname\??naturaltableht\m_tabl_tbl_level:\number#1:\number#2\endcsname}
-
-\def\tabl_ntb_set_wid#1{\expandafter\xdef\csname\??naturaltablewid\m_tabl_tbl_level:\number#1\endcsname} % {#2} global !
-\def\tabl_ntb_set_hei#1{\expandafter\xdef\csname\??naturaltablehei\m_tabl_tbl_level:\number#1\endcsname} % {#2} global !
-\def\tabl_ntb_set_dis#1{\expandafter\xdef\csname\??naturaltabledis\m_tabl_tbl_level:\number#1\endcsname} % {#2} global !
-\def\tabl_ntb_set_aut#1{\expandafter\xdef\csname\??naturaltableaut\m_tabl_tbl_level:\number#1\endcsname} % {#2} global !
-
-\def\tabl_ntb_let_wid#1{\expandafter\glet\csname\??naturaltablewid\m_tabl_tbl_level:\number#1\endcsname} % {#2} global !
-\def\tabl_ntb_let_hei#1{\expandafter\glet\csname\??naturaltablehei\m_tabl_tbl_level:\number#1\endcsname} % {#2} global !
-\def\tabl_ntb_let_dis#1{\expandafter\glet\csname\??naturaltabledis\m_tabl_tbl_level:\number#1\endcsname} % {#2} global !
-\def\tabl_ntb_let_aut#1{\expandafter\glet\csname\??naturaltableaut\m_tabl_tbl_level:\number#1\endcsname} % {#2} global !
-
-\def\tabl_ntb_get_wid#1{\ifcsname\??naturaltablewid\m_tabl_tbl_level:\number#1\endcsname\lastnamedcs\else\zeropoint\fi}
-\def\tabl_ntb_get_hei#1{\ifcsname\??naturaltablehei\m_tabl_tbl_level:\number#1\endcsname\lastnamedcs\else\zeropoint\fi}
-\def\tabl_ntb_get_dis#1{\ifcsname\??naturaltabledis\m_tabl_tbl_level:\number#1\endcsname\lastnamedcs\else\zeropoint\fi}
-\def\tabl_ntb_get_aut#1{\csname \??naturaltableaut\m_tabl_tbl_level:\number#1\endcsname}
-
-\def\tabl_ntb_let_bck#1#2{\global\expandafter\chardef\csname\??naturaltablebck\m_tabl_tbl_level:\number#1:\number#2\endcsname}
-
-\def\tabl_ntb_get_bck#1#2{\csname\??naturaltablebck\m_tabl_tbl_level:\number#1:\number#2\endcsname}
-
-\def\tabl_ntb_tag_pattern#1#2{\??naturaltabletag\m_tabl_tbl_level:\number#1:\number#2}
-\def\tabl_ntb_row_pattern#1#2{\??naturaltablerow\m_tabl_tbl_level:\number#1:\number#2}
-\def\tabl_ntb_col_pattern#1#2{\??naturaltablecol\m_tabl_tbl_level:\number#1:\number#2}
-
-\def\tabl_ntb_tag_doif #1#2{\ifcsname\??naturaltabletag\m_tabl_tbl_level:\number#1:\number#2\endcsname\expandafter\firstofoneargument \else\expandafter\gobbleoneargument \fi}
-\def\tabl_ntb_tag_doifnot #1#2{\ifcsname\??naturaltabletag\m_tabl_tbl_level:\number#1:\number#2\endcsname\expandafter\gobbleoneargument \else\expandafter\firstofoneargument \fi}
-\def\tabl_ntb_tag_doifelse#1#2{\ifcsname\??naturaltabletag\m_tabl_tbl_level:\number#1:\number#2\endcsname\expandafter\firstoftwoarguments\else\expandafter\secondoftwoarguments\fi}
-\def\tabl_ntb_row_doif #1#2{\ifcsname\??naturaltablerow\m_tabl_tbl_level:\number#1:\number#2\endcsname\expandafter\firstofoneargument \else\expandafter\gobbleoneargument \fi}
-\def\tabl_ntb_col_doif #1#2{\ifcsname\??naturaltablecol\m_tabl_tbl_level:\number#1:\number#2\endcsname\expandafter\firstofoneargument \else\expandafter\gobbleoneargument \fi}
-\def\tabl_ntb_col_doifnot #1#2{\ifcsname\??naturaltablecol\m_tabl_tbl_level:\number#1:\number#2\endcsname\expandafter\gobbleoneargument \else\expandafter\firstofoneargument \fi}
-
-%D If we ever run into memory issues we can do:
-%
-% \def\tabl_ntb_let_tag#1#2#3%
-% {\ifx#3\c_tabl_ntb_none\else
-% \expandafter\let\csname\??naturaltabletag\m_tabl_tbl_level:\number#1:\number#2\endcsname#3%
-% \fi}
-%
-% \def\tabl_ntb_get_tag#1#2%
-% {\ifcsname\??naturaltabletag\m_tabl_tbl_level:\number#1:\number#2\endcsname
-% \lastnamedcs
-% \else
-% \c_tabl_ntb_none
-% \fi}
-
-% not used
-%
-% \def\tabl_ntb_tag_state#1#2{\ifcsname\??naturaltabletag\m_tabl_tbl_level:\number#1:\number#2\endcsname\zerocount\else\plusone\fi}
-% \def\tabl_ntb_row_state#1#2{\ifcsname\??naturaltablerow\m_tabl_tbl_level:\number#1:\number#2\endcsname\zerocount\else\plusone\fi}
-% \def\tabl_ntb_col_state#1#2{\ifcsname\??naturaltablecol\m_tabl_tbl_level:\number#1:\number#2\endcsname\zerocount\else\plusone\fi}
-
-%def\tabl_ntb_set_spn #1{\expandafter\let\csname\??naturaltablespn\m_tabl_tbl_level:\number#1\endcsname \!!plusone}
-%def\tabl_ntb_spn_doifelse#1{\doifelse {\csname\??naturaltablespn\m_tabl_tbl_level:\number#1\endcsname}\!!plusone}
-
-%def\tabl_ntb_set_spn #1{\setvalue {\??naturaltablespn\m_tabl_tbl_level:\number#1}{1}}
-%def\tabl_ntb_spn_doifelse#1{\doifelsevalue{\??naturaltablespn\m_tabl_tbl_level:\number#1}{1}}
-
-\def\tabl_ntb_let_ref #1#2{\expandafter\glet\csname\??naturaltableref\m_tabl_tbl_level:\number#1:\number#2\endcsname}
-\def\tabl_ntb_set_ref #1#2{\expandafter\xdef\csname\??naturaltableref\m_tabl_tbl_level:\number#1:\number#2\endcsname}
-%def\tabl_ntb_get_ref #1#2{\ifcsname\??naturaltableref\m_tabl_tbl_level:\number#1:\number#2\endcsname\csname\??naturaltableref\m_tabl_tbl_level:\number#1:\number#2\endcsname\fi}
-\def\tabl_ntb_get_ref #1#2{\begincsname\??naturaltableref\m_tabl_tbl_level:\number#1:\number#2\endcsname}
-
-\def\tabl_ntb_set_spn #1{\expandafter\let\csname\??naturaltablespn\m_tabl_tbl_level:\number#1\endcsname \!!plusone}
-\def\tabl_ntb_spn_doifelse#1{\ifcase0\csname\??naturaltablespn\m_tabl_tbl_level:\number#1\endcsname\relax % could be inlined
- \expandafter\secondoftwoarguments % unset
- \else
- \expandafter\firstoftwoarguments % a span
- \fi}
-
-% keep for a while:
-%
-% \unexpanded\def\tabl_ntb_set_txt_process#1#2#3#4#5#6% nasty: we restore the level
-% {\expandafter\def\csname\??naturaltabletxt\m_tabl_tbl_level:\number#1:\number#2\expandafter\endcsname\expandafter
-% {\expandafter\def\expandafter\m_tabl_tbl_level\expandafter{\m_tabl_tbl_level}\tabl_ntb_cell_process{#3}{#4}[#5]{#6}}}
-
-\unexpanded\def\tabl_ntb_set_txt_process#1#2#3#4#5#6%
- {\expandafter\def\csname\??naturaltabletxt\m_tabl_tbl_level:\number#1:\number#2\endcsname
- {\tabl_ntb_cell_process{#3}{#4}[#5]{\tabl_ntb_next_level#6\tabl_ntb_prev_level}}}
-
-\def\tabl_ntb_get_txt#1#2%
- {\csname\??naturaltabletxt\m_tabl_tbl_level:\number#1:\number#2\endcsname}
-
-% to be changed:
-
-\newif\ifsqueezeTBLspan \squeezeTBLspantrue % spans one column cell over multi column par cells
-\newif\ifautosqueezeTBLspan \autosqueezeTBLspantrue % unless explicit widths are given
-\newif\ifautoTBLspread \autoTBLspreadfalse
-\newif\ifautoTBLhsize \autoTBLhsizetrue
-\newif\ifautoTBLrowspan \autoTBLrowspantrue
-\newif\ifautoTBLemptycell \autoTBLemptycelltrue
-\newif\ifautoTBLcheckwidth \autoTBLcheckwidthtrue
-\newif\ifappendTBLsetups \appendTBLsetupstrue
-\newif\ifenableTBLbreak \enableTBLbreakfalse
-\newif\ifmultipleTBLheads \multipleTBLheadsfalse
-\newif\iftightTBLrowspan \tightTBLrowspantrue
-\newif\iftightTBLcolspan \tightTBLcolspanfalse
-
-\newconditional \c_tabl_ntb_trace_widths
-
-\installtextracker
- {tables.natural.widths}
- {\settrue \c_tabl_ntb_trace_widths}
- {\setfalse\c_tabl_ntb_trace_widths}
-
-% so far
-
-\unexpanded\def\tabl_ntb_cell_process#1#2[#3]{}
-
-\unexpanded\def\bTC#1\eTC{\bTD#1\eTD} \let\eTC\relax
-\unexpanded\def\bTX#1\eTX{\bTD#1\eTD} \let\eTX\relax
-\unexpanded\def\bTY#1\eTY{\bTR#1\eTR} \let\eTY\relax
-
-\unexpanded\def\setupTABLE
- {\dotripleempty\tabl_ntb_setup}
-
-\let\tabl_ntb_parameters_get\setupcurrentnaturaltablelocal
-
-\def\tabl_ntb_setup
- {\ifthirdargument
- \expandafter\tabl_ntb_setup_three
- \orelse\ifsecondargument
- \doubleexpandafter\tabl_ntb_setup_two
- \else
- \doubleexpandafter\tabl_ntb_setup_one
- \fi}
-
-\def\tabl_ntb_setup_one[#1][#2][#3]%
- {\setupcurrentnaturaltablelocal[#1]}
-
-\def\tabl_ntb_setup_xy[#1][#2][#3]%
- {\def\tabl_ntb_setup_step##1{\tabl_ntb_parameters_set[#1##1][#3]}%
- \processcommalist[#2]\tabl_ntb_setup_step}
-
-\def\tabl_ntb_setup_un[#1][#2][#3]%
- {\def\tabl_ntb_setup_step##1%
- {\def\tabl_ntb_setup_step_step####1{\tabl_ntb_parameters_set[\c!x##1\c!y####1][#3]}%
- \processcommalist[#2]\tabl_ntb_setup_step_step}%
- \processcommalist[#1]\tabl_ntb_setup_step}
-
-\def\tabl_ntb_setup_each[#1][#2][#3]% ignores #3
- {\tabl_ntb_parameters_set[#1\v!each][#2]}
-
-\def\tabl_ntb_setup_ux[#1][#2][#3]% ignores #3
- {\def\tabl_ntb_setup_step##1{\tabl_ntb_parameters_set[\c!x##1][#2]}%
- \processcommalist[#1]\tabl_ntb_setup_step}
-
-\installcorenamespace{naturaltablesetupthree}
-\installcorenamespace{naturaltablesetuptwo}
-
-%def\tabl_ntb_setup_three[#1]{\csname\??naturaltablesetupthree\ifcsname\??naturaltablesetupthree#1\endcsname#1\else\s!unknown\fi\endcsname[#1]}
-%def\tabl_ntb_setup_two [#1]{\csname\??naturaltablesetuptwo \ifcsname\??naturaltablesetuptwo #1\endcsname#1\else\s!unknown\fi\endcsname[#1]}
-
-\def\tabl_ntb_setup_three[#1]{\ifcsname\??naturaltablesetupthree#1\endcsname\expandafter\lastnamedcs\else\expandafter\tabl_ntb_setup_un\fi[#1]}
-\def\tabl_ntb_setup_two [#1]{\ifcsname\??naturaltablesetuptwo #1\endcsname\expandafter\lastnamedcs\else\expandafter\tabl_ntb_setup_ux\fi[#1]}
-
-\setvalue{\??naturaltablesetupthree \v!row}[#1]{\tabl_ntb_setup_xy [\c!y]}
-\setvalue{\??naturaltablesetupthree \v!column}[#1]{\tabl_ntb_setup_xy [\c!x]}
-\setvalue{\??naturaltablesetupthree \v!start}[#1]{\tabl_ntb_setup_xy [\v!start]}
-\setvalue{\??naturaltablesetupthree \v!header}[#1]{\tabl_ntb_setup_xy [\v!header]}
-
-\setvalue{\??naturaltablesetuptwo \v!row}[#1]{\tabl_ntb_setup_each[\c!y]}
-\setvalue{\??naturaltablesetuptwo \v!column}[#1]{\tabl_ntb_setup_each[\c!x]}
-\setvalue{\??naturaltablesetuptwo \v!start}[#1]{\tabl_ntb_setup_each[\v!start]}
-\setvalue{\??naturaltablesetuptwo \v!header}[#1]{\tabl_ntb_setup_each[\v!header]}
-
-\letvalue{\??naturaltablesetupthree\s!unknown}\tabl_ntb_setup_un
-\letvalue{\??naturaltablesetuptwo \s!unknown}\tabl_ntb_setup_ux
-
-\letcsnamecsname\csname\??naturaltablesetupthree r\endcsname\csname\??naturaltablesetupthree \v!row\endcsname
-\letcsnamecsname\csname\??naturaltablesetupthree c\endcsname\csname\??naturaltablesetupthree\v!column\endcsname
-\letcsnamecsname\csname\??naturaltablesetupthree y\endcsname\csname\??naturaltablesetupthree \v!row\endcsname
-\letcsnamecsname\csname\??naturaltablesetupthree x\endcsname\csname\??naturaltablesetupthree\v!column\endcsname
-
-\letcsnamecsname\csname\??naturaltablesetuptwo r\endcsname\csname\??naturaltablesetuptwo \v!row\endcsname
-\letcsnamecsname\csname\??naturaltablesetuptwo c\endcsname\csname\??naturaltablesetuptwo \v!column\endcsname
-\letcsnamecsname\csname\??naturaltablesetuptwo y\endcsname\csname\??naturaltablesetuptwo \v!row\endcsname
-\letcsnamecsname\csname\??naturaltablesetuptwo x\endcsname\csname\??naturaltablesetuptwo \v!column\endcsname
-
-\def\tabl_ntb_parameters_set[#1][#2]%
- {\ifappendTBLsetups
- \ifcsname\??naturaltableset\m_tabl_tbl_level:#1\endcsname
- \def\tabl_ntb_parameters_get[##1]%
- {\setvalue{\??naturaltableset\m_tabl_tbl_level:#1}{\tabl_ntb_parameters_get[##1,#2]}}%
- \csname\??naturaltableset\m_tabl_tbl_level:#1\endcsname
- \let\tabl_ntb_parameters_get\setupcurrentnaturaltablelocal
- \else
- \setvalue{\??naturaltableset\m_tabl_tbl_level:#1}{\tabl_ntb_parameters_get[#2]}%
- \fi
- \else
- \setvalue{\??naturaltableset\m_tabl_tbl_level:#1}{\tabl_ntb_parameters_get[#2]}%
- \fi}
-
-% % \setupTABLE [y] [first][background=color,backgroundcolor=blue,frame=off,bottomframe=on,topframe=on,framecolor=white]
-% \setupTABLE [first][first][backgroundcorner=2,corner=10,frame=on]
-% \setupTABLE [last] [first][backgroundcorner=4,corner=12,frame=on]
-%
-% \setupTABLE [row] [each] [background=color,backgroundcolor=blue,frame=on,framecolor=white]
-% \setupTABLE [first][2] [corner=8]
-% \setupTABLE [last] [2] [corner=5]
-% \setupTABLE [first][last] [corner=7]
-% \setupTABLE [last] [last] [corner=6]
-%
-% \startTEXpage
-% \bTABLE[frame=off,align=middle]
-% \bTR \bTD one \eTD \bTD two \eTD \bTD three \eTD \eTR
-% \bTR \bTD first \eTD \bTD second \eTD \bTD third \eTD \eTR
-% \bTR \bTD alpha \eTD \bTD beta \eTD \bTD gamma \eTD \eTR
-% \eTABLE
-% \stopTEXpage
-%
-% \setupTABLE [first] [two][corner=2] % special case
-% \setupTABLE [last] [two][corner=4] % special case
-%
-% % % \setupTABLE [one] [first] ... special case of span
-%
-% \startTEXpage
-% \bTABLE[frame=off,align=middle]
-% \bTR \bTD one \eTD \bTD two \eTD \bTD three \eTD \eTR
-% \bTR \bTD first \eTD \bTD second \eTD \bTD third \eTD \eTR
-% \eTABLE
-% \stopTEXpage
-
-%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
-
-\let\tabl_ntb_setup_section\relax
-
-\unexpanded\def\tabl_ntb_setup_cell#1#2% cell over col over row
- {\tabl_ntb_setup_section % already forgotten
- \edef\m_tabl_ntb_positive_row{\number#1}%
- \edef\m_tabl_ntb_positive_col{\number#2}%
- \edef\m_tabl_ntb_negative_row{\the\numexpr-\c_tabl_ntb_maximum_row+#1+\minusone\relax}%
- \edef\m_tabl_ntb_negative_col{\the\numexpr-\c_tabl_ntb_maximum_col+#2+\minusone\relax}%
- % saves tokens (no speed gain)
- \edef\m_tabl_ntb_prefix{\??naturaltableset\m_tabl_tbl_level:}%
- % each each
- \begincsname\m_tabl_ntb_prefix\c!x\v!each\c!y\v!each\endcsname
- \begincsname\m_tabl_ntb_prefix\c!y\v!each\endcsname
- \begincsname\m_tabl_ntb_prefix\c!x\v!each\endcsname
- % odd even
- \begincsname\m_tabl_ntb_prefix\c!y\v!oddeven\m_tabl_ntb_positive_row\endcsname
- \begincsname\m_tabl_ntb_prefix\c!x\v!oddeven\m_tabl_ntb_positive_col\endcsname
- \begincsname\m_tabl_ntb_prefix\c!x\v!oddeven\m_tabl_ntb_positive_col\c!y\v!oddeven\m_tabl_ntb_positive_row\endcsname
- % row/col number combinations
- \begincsname\m_tabl_ntb_prefix\c!y\m_tabl_ntb_positive_row\endcsname
- \begincsname\m_tabl_ntb_prefix\c!y\m_tabl_ntb_negative_row\endcsname
- \naturaltablelocalparameter\c!extras
- \letnaturaltablelocalparameter\c!extras\relax % new, see x-fo
- \begincsname\m_tabl_ntb_prefix\c!x\m_tabl_ntb_positive_col\endcsname
- \begincsname\m_tabl_ntb_prefix\c!x\m_tabl_ntb_negative_col\endcsname
- \naturaltablelocalparameter\c!extras
- \letnaturaltablelocalparameter\c!extras\relax % new, see x-fo
- % first/last combinations
- \ifnum\m_tabl_ntb_positive_row=\plusone
- \begincsname\m_tabl_ntb_prefix\c!y\v!first\endcsname
- \begincsname\m_tabl_ntb_prefix\c!x\m_tabl_ntb_positive_col\c!y\v!first\endcsname
- \fi
- \ifnum\m_tabl_ntb_positive_col=\plusone
- \begincsname\m_tabl_ntb_prefix\c!x\v!first\endcsname
- \begincsname\m_tabl_ntb_prefix\c!x\v!first\c!y\m_tabl_ntb_positive_row\endcsname
- \fi
- \ifnum\m_tabl_ntb_positive_row=\c_tabl_ntb_maximum_row\relax
- \begincsname\m_tabl_ntb_prefix\c!y\v!last\endcsname
- \begincsname\m_tabl_ntb_prefix\c!x\m_tabl_ntb_positive_col\c!y\v!last\endcsname
- \fi
- \ifnum\m_tabl_ntb_positive_col=\c_tabl_ntb_maximum_col\relax
- \begincsname\m_tabl_ntb_prefix\c!x\v!last\endcsname
- \begincsname\m_tabl_ntb_prefix\c!x\v!last\c!y\m_tabl_ntb_positive_row\endcsname
- \fi
- \ifnum\m_tabl_ntb_positive_row=\c_tabl_ntb_maximum_row\relax \ifnum\m_tabl_ntb_positive_col=\c_tabl_ntb_maximum_col\relax
- \begincsname\m_tabl_ntb_prefix\c!x\v!last\c!y\v!last\endcsname
- \fi\fi
- \ifnum\m_tabl_ntb_positive_row=\plusone \ifnum\m_tabl_ntb_positive_col=\plusone
- \begincsname\m_tabl_ntb_prefix\c!x\v!first\c!y\v!first\endcsname
- \fi\fi
- \ifnum\m_tabl_ntb_positive_row=\plusone \ifnum\m_tabl_ntb_positive_col=\c_tabl_ntb_maximum_col\relax
- \begincsname\m_tabl_ntb_prefix\c!x\v!last\c!y\v!first\endcsname
- \fi\fi
- \ifnum\m_tabl_ntb_positive_row=\c_tabl_ntb_maximum_row\relax \ifnum\m_tabl_ntb_positive_col=\plusone
- \begincsname\m_tabl_ntb_prefix\c!x\v!first\c!y\v!last\endcsname
- \fi\fi
- % special case: two rows and last row : two&first and two&last (round corners)
- \ifnum\c_tabl_ntb_maximum_row=\plustwo\relax
- \ifnum\m_tabl_ntb_positive_row=\c_tabl_ntb_maximum_row\relax \ifnum\m_tabl_ntb_positive_col=\plusone
- \begincsname\m_tabl_ntb_prefix\c!x\v!first\c!y\v!two\endcsname
- \fi\fi
- \ifnum\m_tabl_ntb_positive_row=\c_tabl_ntb_maximum_row\relax \ifnum\m_tabl_ntb_positive_col=\c_tabl_ntb_maximum_col\relax
- \begincsname\m_tabl_ntb_prefix\c!x\v!last\c!y\v!two\endcsname
- \fi\fi
- \fi
- \ifnum\tabl_ntb_get_col\m_tabl_ntb_positive_row\m_tabl_ntb_positive_col=\c_tabl_ntb_maximum_col\relax % top span over whole width
- \ifnum\m_tabl_ntb_positive_row=\plusone
- \begincsname\m_tabl_ntb_prefix\c!x\v!one\c!y\v!first\endcsname
- \fi
- \ifnum\m_tabl_ntb_positive_row=\c_tabl_ntb_maximum_row\relax
- \begincsname\m_tabl_ntb_prefix\c!x\v!one\c!y\v!last\endcsname
- \fi
- \fi
- % header things
- \ifnum#1>\c_tabl_ntb_n_of_hdnx_lines\else
- \begincsname\m_tabl_ntb_prefix\v!header\v!each\endcsname
- \begincsname\m_tabl_ntb_prefix\v!header\m_tabl_ntb_positive_col\endcsname
- \fi
- % explicit cells
- \begincsname\m_tabl_ntb_prefix\c!x\m_tabl_ntb_positive_col\c!y\m_tabl_ntb_positive_row\endcsname
- \begincsname\m_tabl_ntb_prefix\c!x\m_tabl_ntb_negative_col\c!y\m_tabl_ntb_negative_row\endcsname
- % local
- \begincsname\m_tabl_ntb_prefix\c!y++\m_tabl_ntb_positive_row\endcsname
- % done
- \relax}
-
-% we cannot use +n (checking on number/last/first would slow down too much)
-%
-% \setupTABLE[r] [2][color=red]
-% \setupTABLE[r] [-2][color=red]
-% \setupTABLE[c] [2][color=green]
-% \setupTABLE[c] [-2][color=green]
-% \setupTABLE[4] [4][color=blue]
-% \setupTABLE[-4][-4][color=blue]
-%
-% \bTABLE
-% \dorecurse{10}{\bTR \dorecurse{6}{\bTD xxx \eTD} \eTR}
-% \eTABLE
-
-\let\m_tabl_ntb_before_split\empty
-\let\m_tabl_ntb_after_split \empty
-\let\m_tabl_ntb_same_page \empty
-
-% split + page:
-%
-% \bTABLE[split=yes]
-% \bTR \bTD left \eTD\bTD right \eTD\eTR
-% \bTR[after=\page] \bTD left \eTD\bTD right \eTD\eTR
-% \bTR \bTD left \eTD\bTD right \eTD\eTR
-% \eTABLE
-
-\unexpanded\def\tabl_ntb_tr
- {\c_tabl_ntb_running_col\zerocount
- \c_tabl_ntb_encountered_col\zerocount
- \advance\c_tabl_ntb_maximum_row\plusone
- \iffirstargument
- \expandafter\tabl_ntb_tr_yes
- \else
- \expandafter\gobbleoneoptional
- \fi}
-
-\def\tabl_ntb_tr_yes[#1]%
- {\setvalue{\??naturaltableset\m_tabl_tbl_level:\c!y++\the\c_tabl_ntb_maximum_row}{\setupcurrentnaturaltablelocal[#1]}}
-
-\def\m_tabl_ntb_default_nr{\naturaltableparameter\c!nr}
-\def\m_tabl_ntb_default_nc{\naturaltableparameter\c!nc}
-
-\unexpanded\def\tabl_ntb_td
- {\advance\c_tabl_ntb_encountered_col\plusone
- \iffirstargument
- \expandafter\tabl_ntb_td_yes
- \else
- \expandafter\tabl_ntb_td_nop
- \fi}
-
-\def\tabl_ntb_td_yes[#1]#2\eTD
- {\letnaturaltableparameter\c!ny \m_tabl_ntb_default_nr
- \letnaturaltableparameter\c!nx \m_tabl_ntb_default_nc
- \letnaturaltableparameter\c!nc \plusone
- \letnaturaltableparameter\c!nr \plusone
- \letnaturaltableparameter\c!n \c_tabl_ntb_running_col
- \letnaturaltableparameter\c!m \empty
- \letnaturaltableparameter\c!action\empty % not that important
- \setupcurrentnaturaltable[#1]%
- %
- \c_tabl_ntb_nx\naturaltableparameter\c!nx\relax
- \c_tabl_ntb_ny\naturaltableparameter\c!ny\relax
- % goto first cell n/m=cellnumber
- \edef\m_tabl_ntb_n{\naturaltableparameter\c!n}%
- \edef\m_tabl_ntb_m{\naturaltableparameter\c!m}%
- %
- \ifx\m_tabl_ntb_n\empty
- \global\advance\c_tabl_ntb_spn\c_tabl_ntb_nx\relax
- \orelse\ifnum\m_tabl_ntb_n=\c_tabl_ntb_running_col\else
- \tabl_ntb_td_pass_n{#1}%
- \fi
- \ifx\m_tabl_ntb_m\empty \else
- \ifnum\m_tabl_ntb_m=\c_tabl_ntb_running_col\else
- \tabl_ntb_td_pass_m{#1}%
- \fi
- \fi
- \doloop % skip over columns that result from earlier span
- {\advance\c_tabl_ntb_running_col\plusone
- \ifcsname\tabl_ntb_tag_pattern\c_tabl_ntb_maximum_row\c_tabl_ntb_running_col\endcsname \else
- \exitloop
- \fi}%
- % fill r*c cells and set span
- \c_tabl_ntb_nx\naturaltableparameter\c!nx\relax
- \c_tabl_ntb_ny\naturaltableparameter\c!ny\relax
- \ifnum\c_tabl_ntb_nx=\plusone
- \ifnum\c_tabl_ntb_ny=\plusone
- \ifnum\c_tabl_ntb_running_col>\c_tabl_ntb_maximum_col\relax
- \c_tabl_ntb_maximum_col\c_tabl_ntb_running_col
- \fi
- \else
- \tabl_ntb_cell_preset
- \fi
- \else
- \tabl_ntb_cell_preset
- \fi
- % set values
- \tabl_ntb_let_tag\c_tabl_ntb_maximum_row\c_tabl_ntb_running_col\c_tabl_ntb_cell
- \tabl_ntb_set_col\c_tabl_ntb_maximum_row\c_tabl_ntb_running_col{\the\c_tabl_ntb_nx}%
- \tabl_ntb_set_row\c_tabl_ntb_maximum_row\c_tabl_ntb_running_col{\the\c_tabl_ntb_ny}%
- % the action key will change!
- \tabl_ntb_set_ref\c_tabl_ntb_maximum_row\c_tabl_ntb_running_col{\naturaltableparameter\c!action}%
- % save text
- \normalexpanded
- {\tabl_ntb_set_txt_process\c_tabl_ntb_maximum_row\c_tabl_ntb_running_col{\the\c_tabl_ntb_maximum_row}{\the\c_tabl_ntb_running_col}}%
- {#1}{#2}%
- \ifnum\c_tabl_ntb_encountered_col>\c_tabl_ntb_encountered_max
- \c_tabl_ntb_encountered_max\c_tabl_ntb_encountered_col
- \fi}
-
-\def\tabl_ntb_td_nop[#1]#2\eTD
- {\global\advance\c_tabl_ntb_spn\plusone\relax
- \doloop
- {\advance\c_tabl_ntb_running_col\plusone
- \ifcsname\tabl_ntb_tag_pattern\c_tabl_ntb_maximum_row\c_tabl_ntb_running_col\endcsname \else
- \exitloop
- \fi}%
- \c_tabl_ntb_nx\plusone
- \c_tabl_ntb_ny\plusone
- \ifnum\c_tabl_ntb_running_col>\c_tabl_ntb_maximum_col\relax
- \c_tabl_ntb_maximum_col\c_tabl_ntb_running_col
- \fi
- \tabl_ntb_let_tag\c_tabl_ntb_maximum_row\c_tabl_ntb_running_col\c_tabl_ntb_cell
- \tabl_ntb_set_col\c_tabl_ntb_maximum_row\c_tabl_ntb_running_col{\the\c_tabl_ntb_nx}%
- \tabl_ntb_set_row\c_tabl_ntb_maximum_row\c_tabl_ntb_running_col{\the\c_tabl_ntb_ny}%
- \tabl_ntb_let_ref\c_tabl_ntb_maximum_row\c_tabl_ntb_running_col\empty
- \normalexpanded
- {\tabl_ntb_set_txt_process\c_tabl_ntb_maximum_row\c_tabl_ntb_running_col{\the\c_tabl_ntb_maximum_row}{\the\c_tabl_ntb_running_col}}%
- {#1}{#2}%
- \ifnum\c_tabl_ntb_encountered_col>\c_tabl_ntb_encountered_max
- \c_tabl_ntb_encountered_max\c_tabl_ntb_encountered_col
- \fi}
-
-\def\tabl_ntb_td_pass_n#1%
- {\scratchcounter\numexpr\m_tabl_ntb_n-\c_tabl_ntb_running_col+\minusone-\c_tabl_ntb_spn\relax
- \ifnum\scratchcounter>\zerocount
- \normalexpanded{\tabl_ntb_td[\c!nx=\the\scratchcounter,\c!n=,\c!m=,*sq=\v!no]}\eTD
- \fi
- \letnaturaltableparameter\c!ny\m_tabl_ntb_default_nr
- \letnaturaltableparameter\c!nx\m_tabl_ntb_default_nc
- \letnaturaltableparameter\c!nc\plusone
- \letnaturaltableparameter\c!nr\plusone
- \setupcurrentnaturaltable[#1]%
- \letnaturaltableparameter\c!n \empty
- \letnaturaltableparameter\c!m \empty}
-
-\def\tabl_ntb_td_pass_m#1%
- {\scratchcounter\numexpr\m_tabl_ntb_m-\c_tabl_ntb_running_col+\minusone-\c_tabl_ntb_spn\relax
- \dorecurse\scratchcounter{\normalexpanded{\tabl_ntb_td[\c!n=,\c!m=]}\eTD}%
- % can be sped up
- \letnaturaltableparameter\c!ny\m_tabl_ntb_default_nr
- \letnaturaltableparameter\c!nx\m_tabl_ntb_default_nc
- \letnaturaltableparameter\c!nc\plusone
- \letnaturaltableparameter\c!nr\plusone
- \setupcurrentnaturaltable[#1]%
- \letnaturaltableparameter\c!n \empty
- \letnaturaltableparameter\c!m \empty}
-
-\def\tabl_ntb_cell_preset
- {\c_tabl_ntb_current_row\c_tabl_ntb_maximum_row
- \c_tabl_ntb_current_col\c_tabl_ntb_running_col
- \dorecurse\c_tabl_ntb_ny\tabl_ntb_cell_preset_rows
- % check max column
- \advance\c_tabl_ntb_current_col\minusone
- \ifnum\c_tabl_ntb_current_col>\c_tabl_ntb_maximum_col\relax
- \c_tabl_ntb_maximum_col\c_tabl_ntb_current_col
- \fi}
-
-\def\tabl_ntb_cell_preset_rows
- {\c_tabl_ntb_current_col\c_tabl_ntb_running_col
- \tabl_ntb_set_col\c_tabl_ntb_current_row\c_tabl_ntb_current_col{\the\c_tabl_ntb_nx}%
- \ifnum\c_tabl_ntb_nx>\c_tabl_ntb_maximum_row_span\relax
- \c_tabl_ntb_maximum_row_span\c_tabl_ntb_nx
- \fi
- \dorecurse\c_tabl_ntb_nx\tabl_ntb_cell_preset_cells
- \advance\c_tabl_ntb_current_row\plusone}
-
-\def\tabl_ntb_cell_preset_cells
- {\tabl_ntb_let_tag\c_tabl_ntb_current_row\c_tabl_ntb_current_col\c_tabl_ntb_none
- \advance\c_tabl_ntb_current_col\plusone}
-
-%D The usage of n and m:
-%D
-%D \startbuffer
-%D \bTABLE[width=3em]
-%D \bTR\bTD d1 \eTD\bTD[n=2] d2 \eTD\bTD[n=5] d5 \eTD\bTD[n=7] d7 \eTD\eTR
-%D \bTR\bTD f1 \eTD\bTD[n=4] f4 \eTD\bTD[n=5] f5 \eTD\bTD[n=7] f7 \eTD\eTR
-%D \eTABLE
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-%D
-%D \startbuffer
-%D \bTABLE[width=3em]
-%D \bTR\bTD d1 \eTD\bTD[m=2] d2 \eTD\bTD[m=5] d5 \eTD\bTD[m=7] d7 \eTD\eTR
-%D \bTR\bTD f1 \eTD\bTD[m=4] f4 \eTD\bTD[m=5] f5 \eTD\bTD[m=7] f7 \eTD\eTR
-%D \eTABLE
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-%D
-%D \startbuffer
-%D \bTABLE[frame=on]
-%D \bTR \bTH[nc=3] One \eTH \bTH[m=4] Four \eTH\eTR
-%D \bTR \bTD a \eTD\bTD b \eTD\bTD c \eTD\bTD d \eTD\eTR
-%D \eTABLE
-%D
-%D \bTABLE[frame=on]
-%D \bTR \bTH[nr=2] One \eTH \bTH[m=3] Three \eTH\eTR
-%D \bTR \bTD[m=3] a \eTD\bTD b \eTD\bTD c \eTD\bTD d \eTD\eTR
-%D \bTR \bTD[m=3] a \eTD\bTD b \eTD\bTD c \eTD\bTD d \eTD\eTR
-%D \eTABLE
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-
-\def\tabl_ntb_th[#1]#2\eTH
- {\tabl_ntb_td[#1,\c!color=\naturaltablelocalparameter\c!headcolor,\c!style=\naturaltablelocalparameter\c!headstyle,\c!aligncharacter=\v!no]#2\eTD}
-
-\def\tabl_ntb_tn[#1]#2\eTN
- {\tabl_ntb_td[#1]\digits#2\relax\eTD}
-
-%D Vit Zyka needed the option to create a distance between columns, so I added
-%D support for individual column distances.
-%D
-%D \startbuffer
-%D % \setupTABLE[c][each][distance=2em]
-%D \setupTABLE[c][1][distance=2em]
-%D \setupTABLE[c][2][distance=3em]
-%D
-%D \bTABLE
-%D \bTR \bTD test \eTD \bTD test \eTD \bTD test \eTD \eTR
-%D \bTR \bTD[nx=2] test \eTD \bTD test \eTD \eTR
-%D \bTR \bTD test \eTD \bTD[nx=2] test \eTD \eTR
-%D \eTABLE
-%D
-%D \bTABLE[option=stretch]
-%D \bTR \bTD test \eTD \bTD test \eTD \bTD test \eTD \eTR
-%D \bTR \bTD[nx=2] test \eTD \bTD test \eTD \eTR
-%D \bTR \bTD test \eTD \bTD[nx=2] test \eTD \eTR
-%D \eTABLE
-%D \stopbuffer
-%D
-%D \typebuffer \startlinecorrection \getbuffer \stoplinecorrection
-%D
-%D and he provided patches for the global left and right margin distances as well as
-%D the columndistance (although i changed the names -). Here is his testcase:
-%D
-%D \startbuffer
-%D \framed[offset=overlay]\bgroup
-%D \setupTABLE[column][2][align=left]%
-%D \setupTABLE[column][3][align=right]%
-%D \bTABLE[columndistance=2cm,leftmargindistance=.3cm,rightmargindistance=.5cm]
-%D \bTR \bTH[nc=3] Table head\eTH \eTR
-%D \bTR \bTD[nc=2] AB\eTD \bTD C\eTD \eTR
-%D \bTR \bTD[nc=2,align=left] AB\eTD \bTD C\eTD \eTR
-%D \bTR \bTD[nc=2,align=middle] AB\eTD \bTD C\eTD \eTR
-%D \bTR \bTD A\eTD \bTD B\eTD \bTD C\eTD \eTR
-%D \bTR \bTD Aa\eTD \bTD Bb\eTD \bTD Cccc\eTD \eTR
-%D \bTR \bTD[nc=3,align=middle] ABC\eTD \eTR
-%D \eTABLE
-%D \egroup
-%D \stopbuffer
-%D
-%D \typebuffer \startlinecorrection \getbuffer \stoplinecorrection
-
-% to be done: head <raw> foot, dus state var
-
-\unexpanded\def\bTABLEhead{\dosingleempty\tabl_ntb_head} \let\eTABLEhead\relax
-\unexpanded\def\bTABLEnext{\dosingleempty\tabl_ntb_next} \let\eTABLEnext\relax
-\unexpanded\def\bTABLEbody{\dosingleempty\tabl_ntb_body} \let\eTABLEbody\relax
-\unexpanded\def\bTABLEfoot{\dosingleempty\tabl_ntb_foot} \let\eTABLEfoot\relax
-
-\def\tabl_ntb_head[#1]#2\eTABLEhead{\appendtoks\tabl_ntb_section[#1]{#2}\to\t_tabl_ntb_head}
-\def\tabl_ntb_next[#1]#2\eTABLEnext{\appendtoks\tabl_ntb_section[#1]{#2}\to\t_tabl_ntb_next}
-\def\tabl_ntb_body[#1]#2\eTABLEbody{\appendtoks\tabl_ntb_section[#1]{#2}\to\t_tabl_ntb_body}
-\def\tabl_ntb_foot[#1]#2\eTABLEfoot{\appendtoks\tabl_ntb_section[#1]{#2}\to\t_tabl_ntb_foot}
-
-\def\tabl_ntb_section[#1]#2% also used in tabl-nte
- {\unexpanded\def\tabl_ntb_setup_section{\setupcurrentnaturaltablelocal[#1]}%
- #2%
- \let\tabl_ntb_setup_section\relax}
-
-\def\tabl_ntb_preset_parameters% each odd|even level / can be sped up but only once per table
- {\begincsname\??naturaltableset\m_tabl_tbl_level:\v!start\v!each\endcsname
- \begincsname\??naturaltableset\m_tabl_tbl_level:\v!start\v!oddeven\m_tabl_tbl_level\endcsname
- \begincsname\??naturaltableset\m_tabl_tbl_level:\v!start\m_tabl_tbl_level\endcsname}
-
-\unexpanded\def\bTABLE
- {\dosingleempty\tabl_ntb_table}
-
-\def\tabl_ntb_table[#1]%
- {\tabl_ntb_table_push
- % box not here
- \bgroup
- \pushpostponednodedata
- \t_tabl_ntb_head\emptytoks
- \t_tabl_ntb_next\emptytoks
- \t_tabl_ntb_body\emptytoks
- \t_tabl_ntb_foot\emptytoks
- \ifhmode\kern\zeropoint\fi % blocks \removeunwantedspaces: check this on icare handelingsschema
- \resetcharacteralign % new
- \setupcurrentnaturaltablelocal[\c!align={\v!right,\v!broad,\v!high},#1]%
- %
- \d_tabl_ntb_leftmargindistance \naturaltablelocalparameter\c!leftmargindistance\relax
- \d_tabl_ntb_rightmargindistance\naturaltablelocalparameter\c!rightmargindistance\relax
- \d_tabl_ntb_columndistance \naturaltablelocalparameter\c!columndistance\relax
- \d_tabl_ntb_maxwidth \naturaltablelocalparameter\c!maxwidth\relax
- %
- \usesetupsparameter\naturaltablelocalparameter
- \doifelse{\naturaltablelocalparameter\c!textwidth}\v!local
- {\hsize\availablehsize}
- {\hsize\naturaltablelocalparameter\c!textwidth}%
- \enableTBLbreakfalse
- \multipleTBLheadsfalse
- \autoTBLspreadfalse
- \tightTBLcolspanfalse
- \processaction
- [\naturaltablelocalparameter\c!split]
- [ \v!yes=>\enableTBLbreaktrue,
- \v!repeat=>\enableTBLbreaktrue\multipleTBLheadstrue,
- \v!auto=>\ifinsidesplitfloat\enableTBLbreaktrue\fi]
- \processaction
- [\naturaltablelocalparameter\c!header]
- [\v!repeat=>\multipleTBLheadstrue]%
- \tabl_ntb_preset_parameters
- \processallactionsinset
- [\naturaltablelocalparameter\c!option]
- [\v!stretch=>\autoTBLspreadtrue,%
- \v!tight=>\tightTBLcolspantrue]%
- \linewidth\naturaltablelocalparameter\c!rulethickness % needs to be frozen
- \dontcomplain
- \c_tabl_ntb_running_col \zerocount
- \c_tabl_ntb_maximum_col \zerocount
- \c_tabl_ntb_maximum_row \zerocount
- \c_tabl_ntb_maximum_row_span\plusone
- \let\currentTABLErow \tabl_ntb_current_row
- \let\currentTABLEcolumn\tabl_ntb_current_column
- \let\nofTABLErows \tabl_ntb_n_of_rows
- \let\nofTABLEcolumns \tabl_ntb_n_of_columns
- \let\bTR\dobTR
- \let\bTD\dobTD
- \let\bTH\dobTH
- \let\bTN\dobTN}
-
-\def\tabl_ntb_current_row {\m_tabl_ntb_positive_row}
-\def\tabl_ntb_current_column{\m_tabl_ntb_positive_col}
-\def\tabl_ntb_n_of_rows {\number\c_tabl_ntb_maximum_row}
-\def\tabl_ntb_n_of_columns {\number\c_tabl_ntb_maximum_col}
-
-\let\currentTABLErow \!!zerocount
-\let\currentTABLEcolumn\!!zerocount
-\let\nofTABLErows \!!zerocount
-\let\nofTABLEcolumns \!!zerocount
-
-% there is no gain in a \doifelsenextoptionalcs variant
-
-\unexpanded\def\dobTR{\dosingleempty\tabl_ntb_tr} % also used in tabl-nte
-\unexpanded\def\dobTD{\dosingleempty\tabl_ntb_td} % also used in tabl-nte
-\unexpanded\def\dobTH{\dosingleempty\tabl_ntb_th} % also used in tabl-nte
-\unexpanded\def\dobTN{\dosingleempty\tabl_ntb_tn} % also used in tabl-nte
-
-% permits \expanded{\bTD ... \eTD}
-
-\let\bTR\relax \unexpanded\def\eTR{\ignorespaces} % handy in case we use a macro to generate rows
-\let\bTD\relax \unexpanded\def\eTD{\ignorespaces}
-\let\bTH\relax \unexpanded\def\eTH{\ignorespaces}
-\let\bTN\relax \unexpanded\def\eTN{\ignorespaces}
-
-\unexpanded\def\eTABLE % beware, we need to get rid of spurious spaces when in hmode
- {% tricky and dirty order -)
- \setfalse\c_tabl_ntb_okay
- % head
- \doifelsesometoks\t_tabl_ntb_head % slow, better a flag
- {\c_tabl_ntb_head\numexpr\c_tabl_ntb_maximum_row+\plusone\relax
- \the\t_tabl_ntb_head
- \c_tabl_ntb_n_of_head_lines\c_tabl_ntb_maximum_row\relax
- \doifelsesometoks\t_tabl_ntb_next
- {\the\t_tabl_ntb_next
- \c_tabl_ntb_n_of_next_lines\numexpr\c_tabl_ntb_maximum_row-\c_tabl_ntb_n_of_head_lines\relax}%
- {\c_tabl_ntb_n_of_next_lines\zerocount}% was 1
- \c_tabl_ntb_n_of_hdnx_lines\c_tabl_ntb_maximum_row}
- {\c_tabl_ntb_head\zerocount
- \c_tabl_ntb_n_of_head_lines\zerocount % was 1
- \c_tabl_ntb_n_of_next_lines\zerocount
- \c_tabl_ntb_n_of_hdnx_lines\zerocount}%
- % body
- \c_tabl_ntb_body\numexpr\c_tabl_ntb_maximum_row+\plusone\relax
- \the\t_tabl_ntb_body
- % foot
- \doifelsesometoks\t_tabl_ntb_foot
- {\c_tabl_ntb_foot\numexpr\c_tabl_ntb_maximum_row+\plusone\relax
- \the\t_tabl_ntb_foot}%
- {\c_tabl_ntb_foot\zerocount}%
- % done
- \removeunwantedspaces % only if hmode
- % finish cells
- \tabl_ntb_loop_one
- % to be sure
- \tabl_ntb_loop_two
- % check and do
- \ifcase\c_tabl_ntb_maximum_col\else
- \startTBLprocessing
- \tabl_ntb_table_start
- \dorecurse\c_tabl_ntb_maximum_row
- {\tabl_ntb_row_start
- \c_tabl_ntb_current_row\recurselevel\relax
- \dorecurse\c_tabl_ntb_maximum_col
- {\c_tabl_ntb_current_col\recurselevel\relax
- \normalexpanded{\tabl_ntb_cell{\the\c_tabl_ntb_current_row}{\the\c_tabl_ntb_current_col}}}%
- \tabl_ntb_row_stop}%
- \removeunwantedspaces % only if hmode
- \tabl_ntb_table_stop
- \stopTBLprocessing
- % wrong ! ! ! better to have an auto-offset-overlay
- % \ifnum\m_tabl_tbl_level>1
- % \vskip-\strutdp
- % \fi
- \fi
- % tracing
- % \iftrue
- % \blank \tttf
- % \dorecurse\c_tabl_ntb_maximum_row
- % {\c_tabl_ntb_current_row\recurselevel\relax
- % \dorecurse\c_tabl_ntb_maximum_col
- % {\c_tabl_ntb_current_col\recurselevel\relax
- % [r=\the\c_tabl_ntb_current_row,c=\the\c_tabl_ntb_current_col,h=\the\dimexpr\tabl_ntb_get_ht\c_tabl_ntb_current_row\c_tabl_ntb_current_col,w=\the\dimexpr\tabl_ntb_get_wd\c_tabl_ntb_current_row\c_tabl_ntb_current_col]}%
- % \par}%
- % \blank
- % \fi
- \poppostponednodedata
- \egroup
- \tabl_ntb_table_pop}
-
-\def\tabl_ntb_loop_one
- {\dorecurse\c_tabl_ntb_maximum_row{\tabl_ntb_loop_one_rows}}
-
-\def\tabl_ntb_loop_one_rows
- {\c_tabl_ntb_current_row\recurselevel\relax
- \dorecurse\c_tabl_ntb_maximum_col\tabl_ntb_loop_one_cells}
-
-\def\tabl_ntb_loop_one_cells
- {\c_tabl_ntb_current_col\recurselevel\relax
- \ifcsname\tabl_ntb_tag_pattern\c_tabl_ntb_current_row\c_tabl_ntb_current_col\endcsname \else
- \tabl_ntb_loop_one_cells_indeed
- \fi}
-
-\def\tabl_ntb_loop_one_cells_indeed
- {\c_tabl_ntb_current_col_two\c_tabl_ntb_current_col
- \c_tabl_ntb_current_row_two\c_tabl_ntb_current_row
- \c_tabl_ntb_current_row_one\c_tabl_ntb_current_row
- \doloop
- {\c_tabl_ntb_current_col_one\c_tabl_ntb_current_col
- \doloop
- {\ifcsname\tabl_ntb_tag_pattern\c_tabl_ntb_current_row_one\c_tabl_ntb_current_col_one\endcsname
- \exitloop
- \else
- \advance\c_tabl_ntb_current_col_one\plusone
- \ifnum\c_tabl_ntb_current_col_one>\c_tabl_ntb_maximum_col\relax
- \exitloop
- \fi
- \fi}%
- \ifcsname\tabl_ntb_tag_pattern\c_tabl_ntb_current_row_one\c_tabl_ntb_current_col_one\endcsname
- \exitloop
- \else
- \c_tabl_ntb_current_row_two\c_tabl_ntb_current_row_one
- \c_tabl_ntb_current_col_two\c_tabl_ntb_current_col_one
- \advance\c_tabl_ntb_current_row_one\plusone
- \ifnum\c_tabl_ntb_current_row_one>\c_tabl_ntb_maximum_row
- \exitloop
- \fi
- \fi}%
- \ifnum\c_tabl_ntb_current_row_two>\c_tabl_ntb_maximum_row\c_tabl_ntb_current_row_two\c_tabl_ntb_maximum_row\fi
- \ifnum\c_tabl_ntb_current_col_two>\c_tabl_ntb_maximum_col\c_tabl_ntb_current_col_two\c_tabl_ntb_maximum_col\fi
- \c_tabl_ntb_current_row_two\numexpr\c_tabl_ntb_current_row_two-\c_tabl_ntb_current_row+\plusone\relax
- \c_tabl_ntb_current_col_two\numexpr\c_tabl_ntb_current_col_two-\c_tabl_ntb_current_col+\plusone\relax
- \c_tabl_ntb_current_row_one\c_tabl_ntb_current_row
- \dorecurse\c_tabl_ntb_current_row_two
- {\c_tabl_ntb_current_col_one\c_tabl_ntb_current_col
- \tabl_ntb_set_col\c_tabl_ntb_current_row_one\c_tabl_ntb_current_col_one{\the\c_tabl_ntb_current_col_two}%
- \dorecurse\c_tabl_ntb_current_col_two
- {\tabl_ntb_let_tag\c_tabl_ntb_current_row_one\c_tabl_ntb_current_col_one\c_tabl_ntb_none
- \advance\c_tabl_ntb_current_col_one\plusone}%
- \advance\c_tabl_ntb_current_row_one\plusone}%
- \tabl_ntb_let_tag\c_tabl_ntb_current_row\c_tabl_ntb_current_col\c_tabl_ntb_cell
- \tabl_ntb_set_col\c_tabl_ntb_current_row\c_tabl_ntb_current_col{\the\c_tabl_ntb_current_col_two}%
- \tabl_ntb_set_row\c_tabl_ntb_current_row\c_tabl_ntb_current_col{\the\c_tabl_ntb_current_row_two}%
- \ifautoTBLemptycell
- \normalexpanded
- {\tabl_ntb_set_txt_process\c_tabl_ntb_current_row\c_tabl_ntb_current_col{\the\c_tabl_ntb_current_row}{\the\c_tabl_ntb_current_col}}%
- {\c!option=\v!tight}{\strut\kern\scaledpoint}% the kern forces the tight
- \fi}
-
-\def\tabl_ntb_loop_two
- {\dorecurse\c_tabl_ntb_maximum_row\tabl_ntb_loop_two_rows}
-
-\def\tabl_ntb_loop_two_rows
- {\c_tabl_ntb_current_row\recurselevel\relax
- \dorecurse\c_tabl_ntb_maximum_col\tabl_ntb_loop_two_cells}
-
-\def\tabl_ntb_loop_two_cells
- {\c_tabl_ntb_current_col\recurselevel\relax
- \ifcsname\tabl_ntb_row_pattern\c_tabl_ntb_current_row\c_tabl_ntb_current_col\endcsname
- \scratchcounter\numexpr\c_tabl_ntb_maximum_row-\c_tabl_ntb_current_row+\plusone\relax
- \ifnum\tabl_ntb_get_row\c_tabl_ntb_current_row\c_tabl_ntb_current_col>\scratchcounter
- \tabl_ntb_set_row\c_tabl_ntb_current_row\c_tabl_ntb_current_col{\the\scratchcounter}%
- \fi
- \fi
- \tabl_ntb_let_ht\c_tabl_ntb_current_row\c_tabl_ntb_current_col\zeropoint
- %tabl_ntb_let_wd\c_tabl_ntb_current_row\c_tabl_ntb_current_col\zeropoint
- \ifcsname\tabl_ntb_col_pattern\c_tabl_ntb_current_row\c_tabl_ntb_current_col\endcsname \else
- \tabl_ntb_let_col\c_tabl_ntb_current_row\c_tabl_ntb_current_col\zerocount
- \fi
- \ifcsname\tabl_ntb_tag_pattern\c_tabl_ntb_current_row\c_tabl_ntb_current_col\endcsname \else
- \tabl_ntb_let_tag\c_tabl_ntb_current_row\c_tabl_ntb_current_col\c_tabl_ntb_none
- \fi}
-
-\let\startTBLprocessing\relax % public
-\let\stopTBLprocessing \relax % public
-
-\newcount\c_tabl_prelocated_rows % \prelocateTBLrows{1000} may speed up large tables
-
-% \def\tabl_ntb_row_start{\t_tabl_ntb_row\emptytoks}
-% \def\tabl_ntb_row_stop {\normalexpanded{\t_tabl_ntb{\the\t_tabl_ntb\noexpand\tabl_ntb_row_align_start\the\t_tabl_ntb_row\tabl_ntb_row_align_stop}}}
-
-\def\tabl_ntb_row_start
- {\t_tabl_ntb_row\emptytoks}
-
-\def\tabl_ntb_row_stop
- {\ifenableTBLbreak
- \tabl_ntb_row_stop_split
- \else
- \tabl_ntb_row_stop_boxed
- \fi}
-
-\def\tabl_ntb_row_stop_boxed
- {% \noindent % no, else double leftskip in narrower
- \etoksapp\t_tabl_ntb
- {% no need for init
- \tabl_ntb_row_align_start
- \the\t_tabl_ntb_row
- \tabl_ntb_row_align_stop}}
-
-\def\tabl_ntb_row_stop_split
- {\ifcsname\??naturaltableset\m_tabl_tbl_level:\c!y++\the\c_tabl_ntb_current_row\endcsname
- \tabl_ntb_row_stop_split_yes
- \else
- \tabl_ntb_row_stop_split_nop
- \fi}
-
-\def\tabl_ntb_row_stop_split_nop
- {\etoksapp\t_tabl_ntb
- {\tabl_ntb_row_align_reset
- \tabl_ntb_row_align_start
- \the\t_tabl_ntb_row
- \tabl_ntb_row_align_stop}}
-
-\def\tabl_ntb_row_stop_split_yes
- {\begingroup
- \csname\??naturaltableset\m_tabl_tbl_level:\c!y++\the\c_tabl_ntb_current_row\endcsname
- \xdef\m_tabl_ntb_before_split{\naturaltablelocalparameter\c!before}% to be checked
- \xdef\m_tabl_ntb_after_split {\naturaltablelocalparameter\c!after}% to be checked
- \xdef\m_tabl_ntb_same_page {\naturaltablelocalparameter\c!samepage}%
- \endgroup
- \etoksapp\t_tabl_ntb
- {\tabl_ntb_row_align_set{\m_tabl_ntb_before_split}{\m_tabl_ntb_after_split}{\m_tabl_ntb_same_page}%
- \tabl_ntb_row_align_start
- \the\t_tabl_ntb_row
- \tabl_ntb_row_align_stop}}
-
-\unexpanded\def\tabl_ntb_row_align_set#1#2#3%
- {\xdef\m_tabl_ntb_before_split{#1}%
- \xdef\m_tabl_ntb_after_split {#2}%
- \xdef\m_tabl_ntb_same_page {#3}}
-
-\unexpanded\def\tabl_ntb_row_align_reset
- {\glet\m_tabl_ntb_before_split\empty
- \glet\m_tabl_ntb_after_split \empty
- \glet\m_tabl_ntb_same_page \empty}
-
-\def\tabl_ntb_prelocate_error
- {\writestatus\m!TABLE{fatal error: use \string\prelocateTBLrows\space to increase table memory (now: \the\c_tabl_prelocated_rows)}}
-
-% \prelocateTBLrows{1000} % may speed up large tables
-
-\def\prelocateTBLrows#1% we start at zero so we have one to much, better play safe anyway
- {\dostepwiserecurse\c_tabl_prelocated_rows{#1}\plusone
- {\expandafter\newtoks\csname\??naturaltabletok\recurselevel\endcsname}%
- \def\tabl_ntb_row_start
- {\ifnum\c_tabl_ntb_row<\c_tabl_prelocated_rows\relax
- \tabl_ntb_prelocate_okay
- \else
- \tabl_ntb_prelocate_error
- \fi}%
- \def\tabl_ntb_row_stop
- {\etoksapp\t_tabl_ntb
- {\tabl_ntb_row_align_start
- \the\csname\??naturaltabletok\the\c_tabl_ntb_row\endcsname
- \tabl_ntb_row_align_stop}}%
- \global\c_tabl_prelocated_rows#1\relax}
-
-\def\tabl_ntb_prelocate_okay
- {\expandafter\let\expandafter\t_tabl_ntb_row\csname\??naturaltabletok\the\c_tabl_ntb_row\endcsname\t_tabl_ntb_row\emptytoks}
-
-%D We use aligments to handle the empty (skipped) columns, so that we don't have to
-%D (re|)|calculate these.
-
-\let\m_tabl_ntb_saved_row\!!zerocount
-\let\m_tabl_ntb_saved_col\!!zerocount
-
-\def\tabl_ntb_start_tagged
- {\scratchcounter\numexpr\c_tabl_ntb_row+\plusone\relax
- \ifnum\scratchcounter=\c_tabl_ntb_head
- \ifconditional\c_tabl_ntb_okay
- \dostoptagged
- \else
- \settrue\c_tabl_ntb_okay
- \fi
- \dostarttagged\t!tablehead\empty
- \orelse\ifnum\scratchcounter=\c_tabl_ntb_body
- \ifconditional\c_tabl_ntb_okay
- \dostoptagged
- \else
- \settrue\c_tabl_ntb_okay
- \fi
- \dostarttagged\t!tablebody\empty
- \orelse\ifnum\scratchcounter=\c_tabl_ntb_foot
- \ifconditional\c_tabl_ntb_okay
- \dostoptagged
- \else
- \settrue\c_tabl_ntb_okay
- \fi
- \dostarttagged\t!tablefoot\empty
- \fi
- \dostarttagged\t!tablerow\empty}
-
-\def\tabl_ntb_stop_tagged
- {\dostoptagged
- \ifconditional\c_tabl_ntb_okay
- \scratchcounter\numexpr\c_tabl_ntb_row+\plustwo\relax
- \ifnum\scratchcounter=\c_tabl_ntb_body
- \dostoptagged
- \setfalse\c_tabl_ntb_okay
- \orelse\ifnum\scratchcounter=\c_tabl_ntb_foot
- \dostoptagged
- \setfalse\c_tabl_ntb_okay
- \orelse\ifnum\scratchcounter>\c_tabl_ntb_maximum_row
- \dostoptagged
- \setfalse\c_tabl_ntb_okay
- \fi
- \fi}
-
-\unexpanded\def\tabl_ntb_row_align_start
- {\global\advance\c_tabl_ntb_row\plusone
- \global\c_tabl_ntb_col\plusone
- \global\c_tabl_ntb_spn\zerocount
- \tabl_ntb_row_align_start_inject
- \ifconditional\c_strc_tags_enabled
- \tabl_ntb_start_tagged
- \fi
- \hbox\bgroup
- \kern\dimexpr\d_tabl_ntb_leftmargindistance\relax}
-
-\unexpanded\def\tabl_ntb_row_align_stop
- {\kern\dimexpr\d_tabl_ntb_rightmargindistance-\d_tabl_ntb_columndistance\relax
- \egroup
- \ifconditional\c_strc_tags_enabled
- \tabl_ntb_stop_tagged
- \fi
- \tabl_ntb_row_align_stop_inject}
-
-\unexpanded\def\tabl_ntb_before_page
- {\ifx\m_tabl_ntb_same_page\v!before
- % \blank[\v!samepage,\v!strong]%
- \unpenalty
- \nobreak
- \orelse\ifx\m_tabl_ntb_same_page\v!both
- % \blank[\v!samepage,\v!strong]%
- \unpenalty
- \nobreak
- \fi}
-
-\unexpanded\def\tabl_ntb_after_page
- {\ifnum\c_tabl_ntb_row>\c_tabl_ntb_n_of_head_lines
- \ifnum\tabl_ntb_get_nob\c_tabl_ntb_row=\zerocount
- \unpenalty
- \ifx\m_tabl_ntb_same_page\v!after
- % \blank[\v!samepage,\v!strong]%
- \nobreak
- \orelse\ifx\m_tabl_ntb_same_page\v!both
- % \blank[\v!samepage,\v!strong]%
- \nobreak
- \else
- % \blank[\v!preference,\v!weak]%
- \allowbreak
- \fi
- \fi
- \else
- % \blank[\v!preference,\v!weak]%
- \allowbreak % else no proper head split off
- \fi}
-
-\unexpanded\def\tabl_ntb_inbetween
- {\scratchcounter\numexpr\c_tabl_ntb_row+\plusone\relax
- \ifnum\scratchcounter>\c_tabl_ntb_n_of_hdnx_lines\relax
- \ifnum\scratchcounter<\c_tabl_ntb_maximum_row\relax
- \edef\p_spaceinbetween{\naturaltablelocalparameter\c!spaceinbetween}%
- \ifx\p_spaceinbetween\empty\else
- \blank[\p_spaceinbetween]%
- \fi
- \fi
- \fi}
-
-\unexpanded\def\tabl_ntb_row_align_start_inject
- {\bgroup % protect local vars
- \m_tabl_ntb_before_split
- \egroup
- \ifenableTBLbreak
- \tabl_ntb_before_page
- \fi}
-
-\unexpanded\def\tabl_ntb_row_align_stop_inject
- {\par
- \nointerlineskip
- \ifenableTBLbreak
- \tabl_ntb_after_page
- \fi
- \bgroup % protect local vars
- \m_tabl_ntb_after_split
- \egroup
- \bgroup % protect local vars
- \tabl_ntb_inbetween
- \egroup}
-
-\def\tabl_ntb_flush_content
- {\the\everyTABLEpass
- \global\c_tabl_ntb_spn\zerocount
- \global\c_tabl_ntb_col\zerocount
- \global\c_tabl_ntb_row\zerocount
- \global\advance\c_tabl_ntb_row\minusone
- \dostarttaggedchained\t!table\empty\??naturaltable
- %\registerparoptions % (*) triggers max hsize
- \the\t_tabl_ntb
- \dostoptagged}
-
-\unexpanded\def\tabl_ntb_span#1%
- {\hskip\tabl_ntb_get_dis\c_tabl_ntb_col
- \dorecurse{#1}
- {\hskip\tabl_ntb_get_wid\c_tabl_ntb_col\relax
- \global\advance\c_tabl_ntb_col\plusone}}
-
-\unexpanded\def\tabl_ntb_skip#1%
- {\global\advance\c_tabl_ntb_col#1\relax}
-
-\unexpanded\def\tabl_ntb_plus
- {\global\advance\c_tabl_ntb_col\plusone
- \kern\d_tabl_ntb_columndistance}
-
-\setvalue{\??naturaltablecell\the\c_tabl_ntb_none}#1#2%
- {\scratchcounter\tabl_ntb_get_col{#1}{#2}\relax
- \ifnum\scratchcounter>\zerocount
- \etoksapp\t_tabl_ntb_row
- {\tabl_ntb_span{\the\scratchcounter}}%
- \fi}
-
-\setvalue{\??naturaltablecell\the\c_tabl_ntb_cell}#1#2%
- {\toksapp\t_tabl_ntb_row{\tabl_ntb_pass #1 #2 }% space delimited -> less tokens
- \scratchcounter\tabl_ntb_get_col{#1}{#2}\relax
- \ifnum\scratchcounter>\zerocount
- \etoksapp\t_tabl_ntb_row
- {\ifnum\scratchcounter=\plusone
- \tabl_ntb_plus
- \else
- \tabl_ntb_skip{\the\scratchcounter}%
- \fi}%
- \fi}
-
-\unexpanded\def\tabl_ntb_cell#1#2%
- {\csname\??naturaltablecell\the\tabl_ntb_get_tag{#1}{#2}\endcsname{#1}{#2}}
-
-\unexpanded\def\tabl_ntb_table_start
- {\global\c_tabl_ntb_spn\zerocount
- \global\c_tabl_ntb_row\zerocount
- \global\c_tabl_ntb_col\zerocount
- \c_tabl_tbl_pass\zerocount
- \t_tabl_ntb\emptytoks}
-
-\def\tabl_ntb_pass_one#1 #2 %
- {\tabl_ntb_get_txt{#1}{#2}}%
-
-\def\tabl_ntb_pass_two#1 #2 % meer in cellD
- {\d_tabl_ntb_width\zeropoint
- \scratchcounter\c_tabl_ntb_col
- \!!counta\tabl_ntb_get_col{#1}{#2}\relax
- \ifcase\!!counta\or
- \advance\d_tabl_ntb_width\dimexpr
- \tabl_ntb_get_wid\scratchcounter
- \relax
- \advance\scratchcounter\plusone
- \else
- \dorecurse\!!counta
- {\advance\d_tabl_ntb_width\dimexpr
- \tabl_ntb_get_wid\scratchcounter
- \ifnum\recurselevel<\!!counta
- +\d_tabl_ntb_columndistance
- +\tabl_ntb_get_dis\scratchcounter
- \fi
- \relax
- \advance\scratchcounter\plusone}%
- \fi
- \setbox\scratchbox\hbox{\tabl_ntb_get_txt{#1}{#2}}%
- \tabl_ntb_set_ht{#1}{#2}{\the\ht\scratchbox}%
- %tabl_ntb_set_wd{#1}{#2}{\the\wd\scratchbox}%
- \ifdim\ht\scratchbox>\tabl_ntb_get_hei{#1}\relax
- \tabl_ntb_set_hei{#1}{\the\ht\scratchbox}%
- \fi}%
-
-\def\tabl_ntb_pass_three#1 #2 %
- {% height
- \dostarttagged\t!tablecell\empty
- \!!counta \tabl_ntb_get_col{#1}{#2}\relax
- \!!countb \tabl_ntb_get_row{#1}{#2}\relax
- \!!heighta\tabl_ntb_get_ht {#1}{#2}\relax
- \tablecellcolumns\!!counta % used later so don't adapt these
- \tablecellrows \!!countb % used later so don't adapt these
- \d_tabl_ntb_height\zeropoint
- \ifnum\!!counta=\c_tabl_ntb_maximum_col\relax
- % case: nc=maxcolumns
- \else
- \scratchcounter#1\relax
- \dorecurse\!!countb
- {\advance\d_tabl_ntb_height\tabl_ntb_get_hei\scratchcounter
- \advance\scratchcounter\plusone}%
- \ifdim\d_tabl_ntb_height<\!!heighta\relax
- \d_tabl_ntb_height\!!heighta
- \fi
- \fi
- % width
- \d_tabl_ntb_width\zeropoint
- \scratchcounter\c_tabl_ntb_col
- \ifcase\!!counta\or
- \advance\d_tabl_ntb_width\dimexpr
- \tabl_ntb_get_wid\scratchcounter
- \relax
- \advance\scratchcounter\plusone
- \else
- \dorecurse\!!counta
- {\advance\d_tabl_ntb_width\dimexpr
- \tabl_ntb_get_wid\scratchcounter
- \ifnum\recurselevel<\!!counta
- +\d_tabl_ntb_columndistance
- +\tabl_ntb_get_dis\scratchcounter
- \fi
- \relax
- \advance\scratchcounter\plusone}%
- \fi
- % cell
- \setbox\scratchbox\hbox attr \taggedattribute \attribute\taggedattribute \bgroup
- \dotagTABLEsignal % maybe we need to add some packaging in this case
- \tabl_ntb_get_txt{#1}{#2}%
- \egroup
- \ifnum\!!counta=\c_tabl_ntb_maximum_col\relax
- % case: nc=maxcolumns
- \else
- \scratchdimen\tabl_ntb_get_hei{#1}%
- \setbox\scratchbox\hpack
- {\lower\ht\scratchbox\hpack{\raise\scratchdimen\box\scratchbox}}%
- \ht\scratchbox\scratchdimen
- \fi
- \dp\scratchbox\zeropoint
- \edef\!!stringa{\tabl_ntb_get_ref{#1}{#2}}%
- \ifx\!!stringa\empty
- \box\scratchbox
- \else
- \normalexpanded{\noexpand\directgotobox{\box\scratchbox}[\!!stringa]}% to be checked
- \fi
- \dostoptagged} % right spot
-
-% \def\tabl_ntb_cell_finalize
-% {\doifnotinset\localwidth{\v!fit,\v!broad}% user set
-% {\scratchdimen\tabl_ntb_get_aut\c_tabl_ntb_col\relax
-% \ifdim\localwidth>\scratchdimen
-% \tabl_ntb_set_aut\c_tabl_ntb_col{\the\dimexpr\localwidth}%
-% \fi}}
-
-\def\tabl_ntb_cell_finalize
- {\ifx\localwidth\v!fit
- % nothing
- \orelse\ifx\localwidth\v!broad
- % nothing
- \orelse\ifx\localwidth\empty
- % nothing (safeguard)
- \else
- \tabl_ntb_cell_finalize_indeed
- \fi}
-
-\def\tabl_ntb_cell_finalize_indeed
- {\scratchdimen\tabl_ntb_get_aut\c_tabl_ntb_col\relax
- \ifdim\localwidth>\scratchdimen
- \tabl_ntb_set_aut\c_tabl_ntb_col{\the\dimexpr\localwidth}%
- \fi}
-
-\let\tabl_ntb_preroll\relax
-
-\def\tabl_ntb_table_get_max_width
- {\scratchdimen\wd\scratchbox\relax}
-
-% enable dper 2018-02-22
-
-\def\tabl_ntb_table_get_max_width_step
- {\advance\scratchdimen\tabl_ntb_get_wid\fastloopindex
- \advance\scratchdimen\tabl_ntb_get_dis\fastloopindex}
-
-\def\tabl_ntb_table_get_max_width
- {\scratchdimen\zeropoint
- \dofastloopcs\c_tabl_ntb_maximum_col\tabl_ntb_table_get_max_width_step
- \ifdim\scratchdimen<\wd\scratchbox\relax
- \scratchdimen\wd\scratchbox\relax
- \fi}
-
-\def\tabl_ntb_table_stop
- {\forgetall % new, here see narrower-004.tex
- %\setbox\scratchbox\hbox
- % {\letnaturaltablelocalparameter\c!frame\v!off
- % \letnaturaltablelocalparameter\c!background\empty
- % \letnaturaltablelocalparameter\c!align\v!no
- % \inheritednaturaltablelocalframed{\strut}}%
- %\edef\minimalcellheight{\the\ht\scratchbox}% not used
- \dorecurse\c_tabl_ntb_maximum_col
- {\tabl_ntb_let_aut\recurselevel\zeropoint
- % new
- \c_tabl_ntb_current_col_one\recurselevel\relax
- \dorecurse\c_tabl_ntb_maximum_row
- {%tabl_ntb_let_wd\recurselevel\c_tabl_ntb_current_col_one\zeropoint
- \tabl_ntb_let_ht\recurselevel\c_tabl_ntb_current_col_one\zeropoint}%
- % till here
- \tabl_ntb_let_tal\recurselevel\zerocount
- \tabl_ntb_let_wid\recurselevel\zeropoint
- \tabl_ntb_let_dis\recurselevel\zeropoint}%
- \dorecurse\c_tabl_ntb_maximum_row
- {\tabl_ntb_let_hei\recurselevel\maxdimen}%
- \tabl_ntb_let_gal\zerocount
- \tabl_ntb_preroll\relax
- \c_tabl_tbl_pass\plusone
- \let\tabl_ntb_pass\tabl_ntb_pass_one
- \let\tabl_ntb_cell_process\tabl_ntb_cell_process_a
- \setbox\scratchbox\vbox{\settrialtypesetting \tabl_ntb_flush_content}%
- \ifcase\tabl_ntb_get_gal\or
- % \c_tabl_tbl_pass\plusone
- % \let\tabl_ntb_pass\tabl_ntb_pass_one
- \let\tabl_ntb_cell_process\tabl_ntb_cell_process_a_extra
- \setbox\scratchbox\vbox{\settrialtypesetting \tabl_ntb_flush_content}%
- \fi
- \tabl_ntb_let_dis\c_tabl_ntb_maximum_col\zeropoint
- %
- \tabl_ntb_table_get_max_width % \scratchdimen\scratchbox
- %
- \ifautoTBLspread
- % experimental, stretch non fixed cells to \hsize
- \tabl_ntb_check_widths_one % trial run
- \tabl_ntb_check_widths_two % real run
- \tabl_ntb_stretch_widths
- \let\tabl_ntb_cell_process\tabl_ntb_cell_process_b
- \setbox\scratchbox\vbox{\settrialtypesetting \tabl_ntb_flush_content}%
- % \orelse\ifdim\wd\scratchbox>\hsize
- \orelse\ifdim\scratchdimen>\hsize
- \ifautoTBLhsize
- \tabl_ntb_check_widths_one % trial run
- \tabl_ntb_check_widths_two % real run
- \let\tabl_ntb_cell_process\tabl_ntb_cell_process_b
- \setbox\scratchbox\vbox{\settrialtypesetting \tabl_ntb_flush_content}%
- \fi
- \orelse\ifautoTBLrowspan
- \ifnum\c_tabl_ntb_maximum_row_span>\plusone % max ?
- % added jan 2002 because nx=* did no longer work
- \ifnum\c_tabl_ntb_encountered_max<\c_tabl_ntb_maximum_col
- % added jun 2014 because someone had less columns than nx .. sigh / see *nx*
- \writestatus\m!TABLE{missing\space\number\numexpr\c_tabl_ntb_maximum_col-\c_tabl_ntb_encountered_max\relax\space column(s), guessing widths}%
- \fi
- \edef\savedhsize{\the\hsize}%
- % \hsize\wd\scratchbox\relax % new per 17/04/2006
- \hsize\scratchdimen\relax % new per 17/04/2006
- \tabl_ntb_check_widths_one % trial run
- \tabl_ntb_check_widths_two % real run
- \hsize\savedhsize
- \let\tabl_ntb_cell_process\tabl_ntb_cell_process_c
- \setbox\scratchbox\vbox{\settrialtypesetting \tabl_ntb_flush_content}%
- \fi
- \fi
- \let\tabl_ntb_cell_process\tabl_ntb_cell_process_d
- \c_tabl_tbl_pass\plustwo
- \let\tabl_ntb_pass\tabl_ntb_pass_two
- \setbox\scratchbox\vbox{\settrialtypesetting \tabl_ntb_flush_content}%
- \tabl_ntb_check_heights_one
- \tabl_ntb_check_heights_two
- \let\tabl_ntb_cell_process\tabl_ntb_cell_process_e
- \c_tabl_tbl_pass\plusthree
- \let\tabl_ntb_pass\tabl_ntb_pass_three
- \ifnum\m_tabl_tbl_level>\plusone
- \tabl_tbl_split_nop
- \orelse\ifenableTBLbreak
- \tabl_tbl_split_yes
- \else
- \tabl_tbl_split_nop
- \fi}
-
-\def\tabl_ntb_stretch_widths % more variants, e.g. a max to \dimend
- {\ifcase\c_tabl_ntb_maximum_col\else % else division by zero
- \!!dimend\zeropoint
- \!!dimene\dimexpr
- \hsize
- -\d_tabl_ntb_leftmargindistance
- -\d_tabl_ntb_rightmargindistance
- +\d_tabl_ntb_columndistance
- \relax
- \dorecurse\c_tabl_ntb_maximum_col
- {\advance\!!dimend\dimexpr
- \tabl_ntb_get_wid\recurselevel
- \relax
- \advance\!!dimene\dimexpr
- -\tabl_ntb_get_dis\recurselevel
- -\d_tabl_ntb_columndistance
- \relax}%
- \relax
- % distribute width (stretch)
- \ifdim\!!dimend<\!!dimene
- \advance\!!dimend-\!!dimene
- \divide\!!dimend\c_tabl_ntb_maximum_col
- \dorecurse\c_tabl_ntb_maximum_col
- {\tabl_ntb_set_wid\recurselevel{\the\dimexpr\tabl_ntb_get_wid\recurselevel-\!!dimend\relax}}%
- \fi
- \fi}
-
-\def\tabl_tbl_split_nop
- {\setbox\b_tabl_ntb_final\vbox{\tabl_ntb_flush_content}%
- \postprocessTABLEbox\b_tabl_ntb_final
- \beforeTABLEbox
- % packaging prevents max hsized box
- % \hbox{\registerparoptions\box\b_tabl_ntb_final}% (*) better here
- % better :
- \ifinsidefloat
- % no \dontleavehmode else too wide, otherwise we get a \hsized box
- \else
- \registerparoptions % (*) better here (also does a \dontleavehmode)
- \ifhmode\else\dontleavehmode\fi
- \fi
- \box\b_tabl_ntb_final
- \afterTABLEbox}
-
-\def\tabl_tbl_split_yes
- {\ifinsidesplitfloat
- \donetrue
- \orelse\ifinsidefloat
- \donefalse
- \else
- \donetrue
- \fi
- \ifdone
- \expandafter\tabl_ntb_split_box
- \else
- \expandafter\tabl_tbl_split_nop
- \fi}
-
-\newbox\TABLEsplitbox % public, don't change
-
-\let\extratblsplitheight\zeropoint % additional space taken by before/afterTABLEsplitbox
-
-\def\tabl_ntb_split_box
- {\resettsplit
- \def\tsplitminimumfreelines{2}%
- \def\tsplitminimumfreespace{\dimexpr\extratblsplitheight+\naturaltablelocalparameter\c!splitoffset\relax}%
- \def\tsplitbeforeresult {\beforeTABLEsplitbox}%
- \def\tsplitafterresult {\afterTABLEsplitbox}%
- \def\tsplitafter {\m_tabl_ntb_after_split}%
- \def\tsplitbefore {\m_tabl_ntb_before_split}% supported ?
- \setbox\tsplitcontent\vbox{\tabl_ntb_flush_content}%
- \ifmultipleTBLheads
- \dorecurse\c_tabl_ntb_n_of_head_lines
- {\setbox\scratchbox\vsplit\tsplitcontent to \lineheight
- \setbox\tsplithead\vbox{\unvcopy\tsplithead\unvcopy\scratchbox}}% \vpack ?
- \dorecurse\c_tabl_ntb_n_of_next_lines
- {\setbox\scratchbox\vsplit\tsplitcontent to \lineheight
- \setbox\tsplitnext\vbox{\unvcopy\tsplitnext\unvcopy\scratchbox}}% \vpack ?
- \fi
- \edef\p_spaceinbetween{\naturaltablelocalparameter\c!spaceinbetween}%
- \ifx\p_spaceinbetween\empty\else
- \blank[\p_spaceinbetween]%
- \fi
- \def\postprocesstsplit{\postprocessTABLEsplitbox{\box\tsplitresult}}%
- \handletsplit}
-
-% ! ! ! ! TODO: naast \postprocessTABLEsplitbox ook evt \postprocessTABLEbox voor niet split
-
-\let\postprocessTABLEsplitbox\gobbleoneargument
-\let\postprocessTABLEbox \gobbleoneargument
-
-\let\beforeTABLEsplitbox\relax
-\let\afterTABLEsplitbox \relax
-\let\beforeTABLEbox \relax
-\let\afterTABLEbox \relax
-
-\def\tabl_ntb_check_widths_one{\tabl_ntb_check_widths_indeed\zerocount} % 0 = trial run
-\def\tabl_ntb_check_widths_two{\tabl_ntb_check_widths_indeed\plusone } % 1 = real run
-
-\def\tabl_ntb_check_widths_indeed#1%
- {\ifconditional\c_tabl_ntb_trace_widths\tabl_ntb_show_widths B#1\fi
- \!!counta\zerocount
- \!!dimena\dimexpr
- \hsize
- -\d_tabl_ntb_leftmargindistance
- -\d_tabl_ntb_rightmargindistance
- -\d_tabl_ntb_columndistance
- \relax
- \dorecurse\c_tabl_ntb_maximum_col
- {\scratchdimen\tabl_ntb_get_aut\recurselevel\relax
- \advance\!!dimena\dimexpr
- -\tabl_ntb_get_dis\recurselevel
- -\d_tabl_ntb_columndistance
- \relax
- \ifdim\scratchdimen>\zeropoint\relax
- \advance\!!dimena -\scratchdimen
- \else
- \scratchdimen\tabl_ntb_get_wid\recurselevel\relax
- \ifdim\scratchdimen>\d_tabl_ntb_maxwidth\relax
- \ifcase#1\else\tabl_ntb_let_wid\recurselevel\zeropoint\fi
- \advance\!!counta \plusone
- \orelse\ifdim\scratchdimen>\zeropoint\relax
- \advance\!!dimena -\scratchdimen
- \else
- % eigenlijk moet dit alleen als de kolom wordt overspannen door een
- % vorige, maw extra dubbele loop en status var
- \ifnum\c_tabl_ntb_encountered_max=\c_tabl_ntb_maximum_col % *nx* bah
- \advance\!!counta \plusone % setting maxwidth to a large value also works
- \fi
- \fi
- \fi}%
- \ifconditional\c_tabl_ntb_trace_widths\tabl_ntb_show_widths M#1\fi
- \ifcase\!!counta \else \divide\!!dimena \!!counta \fi
- \dorecurse\c_tabl_ntb_maximum_col
- {\scratchdimen\tabl_ntb_get_wid\recurselevel\relax
- \ifcase#1\relax
- \ifdim\scratchdimen<\!!dimena % take natural width
- \tabl_ntb_set_aut\recurselevel{\the\scratchdimen}%
- \fi
- \else
- \ifzeropt\scratchdimen % auto set width
- \tabl_ntb_set_wid\recurselevel{\the\!!dimena}%
- \fi
- \fi}%
- \ifconditional\c_tabl_ntb_trace_widths\tabl_ntb_show_widths E#1\fi}
-
-% todo: use scratchcounters, not !! ones
-
-\def\tabl_ntb_check_heights_one_indeed
- {\!!countb\tabl_ntb_get_row\c_tabl_ntb_current_row_three\c_tabl_ntb_current_col_three\relax
- % check row span
- \ifnum\!!countb>\plusone
- % current height in row
- \dimen0=\tabl_ntb_get_ht\c_tabl_ntb_current_row_three\c_tabl_ntb_current_col_three
- % find nearest height in row
- \dimen2=\zeropoint
- \dorecurse\c_tabl_ntb_maximum_col
- {\ifnum\recurselevel=\c_tabl_ntb_current_col_three\else
- \ifcsname\tabl_ntb_row_pattern\c_tabl_ntb_current_row_three\recurselevel\endcsname
- \!!countc=\tabl_ntb_get_row\c_tabl_ntb_current_row_three\recurselevel\relax
- \ifnum\!!countc=\plusone
- \dimen4=\tabl_ntb_get_ht\c_tabl_ntb_current_row_three\recurselevel\relax
- \ifdim\dimen2<\dimen4
- \dimen2=\dimen4
- \fi
- \fi
- \fi
- \fi}%
- \c_tabl_ntb_current_row_four\c_tabl_ntb_current_row_three
- % calculate cummulative height
- \dimen4=\dimen2
- \!!countc\c_tabl_ntb_current_row_three
- \advance\!!countc\minusone
- \dorecurse\!!countb
- {\ifnum\c_tabl_ntb_current_row_four=\c_tabl_ntb_current_row_three\else
- \advance\dimen4 \tabl_ntb_get_hei\c_tabl_ntb_current_row_four
- \fi
- \ifnum\recurselevel=\!!countb\else
- \tabl_ntb_set_nob\!!countc
- \advance\!!countc\plusone
- \fi
- \advance\c_tabl_ntb_current_row_four\plusone}%
- % distribute overshoot equally
- \ifdim\dimen2>\zeropoint % new: test on natural-003
- \ifdim\dimen4<\dimen0
- \advance\dimen0 -\dimen4
- \divide\dimen0 \!!countb
- \c_tabl_ntb_current_row_four\c_tabl_ntb_current_row_three
- \tabl_ntb_set_hei\c_tabl_ntb_current_row_three{\the\dimen2}%
- \dorecurse\!!countb
- {\dorecurse\c_tabl_ntb_maximum_col
- {\ifnum\recurselevel=\c_tabl_ntb_current_col_three\else
- \scratchdimen\dimexpr\tabl_ntb_get_ht\c_tabl_ntb_current_row_four\recurselevel+\dimen0\relax
- \tabl_ntb_set_ht\c_tabl_ntb_current_row_four\recurselevel{\the\scratchdimen}%
- \ifdim\tabl_ntb_get_hei\c_tabl_ntb_current_row_four<\scratchdimen
- \tabl_ntb_set_hei\c_tabl_ntb_current_row_four{\the\scratchdimen}%
- \fi
- \fi}%
- \advance\c_tabl_ntb_current_row_four\plusone}%
- \orelse\ifdim\dimen4>\dimen0
- \iftightTBLrowspan
- \tabl_ntb_set_hei\c_tabl_ntb_current_row_three{\the\dimen2}%
- \fi
- \fi
- \fi
- \fi}
-
-\def\tabl_ntb_check_heights_one
- {\dorecurse\c_tabl_ntb_maximum_row
- {\c_tabl_ntb_current_row_three\recurselevel\relax
- \dorecurse\c_tabl_ntb_maximum_col
- {\c_tabl_ntb_current_col_three\recurselevel\relax
- \ifcsname\tabl_ntb_row_pattern\c_tabl_ntb_current_row_three\c_tabl_ntb_current_col_three\endcsname
- \tabl_ntb_check_heights_one_indeed
- \fi}}}
-
-\def\tabl_ntb_check_heights_two
- {}
-
-\def\tabl_ntb_show_widths#1#2%
- {\begingroup
- \scratchdimen\zeropoint
- \dorecurse\c_tabl_ntb_maximum_col
- {\advance\scratchdimen\tabl_ntb_get_wid\recurselevel\relax}%
- \writestatus\m!TABLE{#1 \ifcase#2trial\else real\fi: hsize: \the\hsize, total: \the\scratchdimen}%
- \dorecurse\c_tabl_ntb_maximum_col
- {\writestatus\m!TABLE{\space\space\recurselevel: \the\dimexpr\tabl_ntb_get_wid\recurselevel}}%
- \endgroup}
-
-\def\tabl_ntb_char_align % called often
- {\edef\p_characteralign{\naturaltablelocalparameter\c!aligncharacter}%
- \ifx\p_characteralign\v!yes
- \ifcase\c_tabl_tbl_pass\or
- \tabl_ntb_let_tal\currentTABLEcolumn\plusone
- \tabl_ntb_let_gal\plusone
- \fi
- \expandafter\tabl_ntb_char_align_indeed
- \else
- \expandafter\gobbletwoarguments
- \fi}
-
-\def\tabl_ntb_char_align_indeed#1#2% row column
- {\ifcase\c_tabl_tbl_pass \or
- \setcharacteralign{#2}{\naturaltablelocalparameter\c!alignmentcharacter}% we could store the character in tal
- \fi
- \typo_charalign_adapt_font
- \signalcharacteralign{#2}{#1}}
-
-\unexpanded\def\tabl_ntb_cell_process_a_extra#1#2%
- {\ifcase\tabl_ntb_get_tal{#2}\relax
- \expandafter\tabl_ntb_cell_process_x
- \else
- \expandafter\tabl_ntb_cell_process_a
- \fi{#1}{#2}}
-
-\unexpanded\def\tabl_ntb_cell_process_x#1#2[#3]#4%
- {}
-
-% problem: when span doesn't break we can have a span that is the sum of cells but
-% still to small .. chicken egg problem ... for that we should also have a smallest
-% width run
-%
-% nilling the background makes a run upto 25% faster
-
-\def\tabl_ntb_cell_process_a_check_span_one
- {\ifautosqueezeTBLspan
- \edef\p_width{\naturaltablelocalparameter\c!width}%
- \ifcsname\??naturaltablesqueeze\p_width\endcsname\lastnamedcs\else\donefalse\fi
- \else
- \donetrue
- \fi
- \ifdone % brr, 0
- \ifnum\scratchcounter>\plusone
- \tabl_ntb_set_spn\c_tabl_ntb_col
- \fi
- \fi}
-
-\let\tabl_ntb_cell_process_a_check_span_two_yes\relax
-
-\def\tabl_ntb_cell_process_a_check_span_two_nop
- {\ifdim\tabl_ntb_get_wid\c_tabl_ntb_col<\wd\scratchbox
- \tabl_ntb_set_wid\c_tabl_ntb_col{\the\wd\scratchbox}%
- \fi}
-
-\unexpanded\def\tabl_ntb_cell_process_a#1#2[#3]#4% grouping added ! ! !
- {\bgroup
- \letnaturaltablelocalparameter\c!option\empty
- \tabl_ntb_setup_cell{#1}{#2}%
- \setupcurrentnaturaltablelocal[#3]%
- \letnaturaltablelocalparameter\c!background\empty
- \letnaturaltablelocalparameter\c!frame\v!off
- \scratchcounter\tabl_ntb_get_col{#1}{#2}\relax
- \setbox\scratchbox\hbox
- {\scratchdimen\naturaltablelocalparameter\c!distance\relax
- \ifdim\scratchdimen>\tabl_ntb_get_dis{#2}\relax
- \tabl_ntb_set_dis{#2}{\the\scratchdimen}%
- \fi
- \anch_backgrounds_text_level_start
- \inheritednaturaltablelocalframed{\tabl_ntb_cell_start\tabl_ntb_char_align{#1}{#2}#4\tabl_ntb_cell_stop\tabl_ntb_cell_finalize}%
- \anch_backgrounds_text_level_stop
- \ifcase\c_anch_backgrounds_text_count\else
- \tabl_ntb_let_bck{#1}{#2}\c_anch_backgrounds_text_state
- \fi
- }%
- \scratchdimen\tabl_ntb_get_wid\c_tabl_ntb_col\relax
- \ifdim\wd\scratchbox>\scratchdimen
- \ifsqueezeTBLspan
- \tabl_ntb_cell_process_a_check_span_one
- \fi
- \tabl_ntb_spn_doifelse\c_tabl_ntb_col
- \tabl_ntb_cell_process_a_check_span_two_yes
- \tabl_ntb_cell_process_a_check_span_two_nop
- \fi
- \scratchcounter\numexpr\c_tabl_ntb_row+\plusone\relax
- \scratchdimen\tabl_ntb_get_hei\scratchcounter\relax
- \ifdim\ht\scratchbox<\scratchdimen
- \tabl_ntb_set_hei\scratchcounter{\the\ht\scratchbox}% auto set
- \fi
- \tabl_ntb_set_ht{#1}{#2}{\the\ht\scratchbox}%
- %tabl_ntb_set_wd{#1}{#2}{\the\wd\scratchbox}%
- \ifautoTBLcheckwidth
- \ifdim\wd\scratchbox<.75\hsize % fuzzy guess
- \ifdim\ht\scratchbox>2\openlineheight % honor width since this
- \scratchdimen\tabl_ntb_get_aut\c_tabl_ntb_col\relax % can be a figure or so
- \ifzeropt\scratchdimen
- % side effect: when width is set to 0pt,
- % we can force a span that fits the sum of spans widths
- \tabl_ntb_set_aut\c_tabl_ntb_col{\the\scratchdimen}%
- \orelse\ifdim\wd\scratchbox>\scratchdimen
- % unless span
- \tabl_ntb_set_aut\c_tabl_ntb_col{\the\wd\scratchbox}%
- % to be translated
- \writestatus\m!TABLE{no auto width in (\number#1,\number#2)\space\the\wd\scratchbox/\the\hsize}%
- \fi
- \fi
- \fi
- \fi
- \setbox\scratchboxone\emptyhbox
- \wd\scratchboxone\wd\scratchbox
- \ht\scratchboxone\ht\scratchbox
- \dp\scratchboxone\dp\scratchbox
- \box\scratchboxone
- \egroup}
-
-\unexpanded\def\tabl_ntb_cell_process_b_c#1#2#3[#4]#5%
- {\setbox\scratchbox\hbox
- {\tabl_ntb_setup_cell{#2}{#3}%
- \setupcurrentnaturaltablelocal[#4,#1]%
- \letnaturaltablelocalparameter\c!background\empty
- \letnaturaltablelocalparameter\c!frame\v!off
- \inheritednaturaltablelocalframed{\tabl_ntb_cell_start#5\tabl_ntb_cell_stop}}%
- \setbox2\emptyhbox % todo: \scratchboxtwo
- \wd2\wd\scratchbox
- \ht2\ht\scratchbox
- \dp2\dp\scratchbox
- \ifautoTBLrowspan
- \scratchcounter\numexpr\c_tabl_ntb_row+\plusone\relax
- \ifcsname\tabl_ntb_row_pattern\scratchcounter\c_tabl_ntb_col\endcsname
- \scratchdimen\tabl_ntb_get_hei\scratchcounter\relax
- \ifnum\tabl_ntb_get_row\scratchcounter\c_tabl_ntb_col>\plusone
- \ifdim\ht\scratchbox>\scratchdimen
- \ht2\dimexpr-\scratchdimen-\ht\scratchbox\relax
- \fi
- \fi
- \fi
- \fi
- \box2 }
-
-\unexpanded\def\tabl_ntb_cell_process_b#1#2[#3]#4%
- {\scratchdimen\tabl_ntb_get_aut\c_tabl_ntb_col\relax
- \ifdim\scratchdimen>\zeropoint\relax
- \else
- \scratchdimen\tabl_ntb_get_wid\c_tabl_ntb_col\relax
- \ifdim\scratchdimen>\zeropoint\relax
- \ifnum\tabl_ntb_get_col{#1}{#2}=\c_tabl_ntb_maximum_col\relax
- \scratchdimen\hsize
- \fi
- \fi
- \fi
- \normalexpanded{\tabl_ntb_cell_process_b_c{\ifdim\scratchdimen>\zeropoint \c!width=\the\scratchdimen\fi}}%
- {#1}{#2}[#3]{\tabl_ntb_char_align{#1}{#2}#4}}
-
-\unexpanded\def\tabl_ntb_cell_process_c
- {\tabl_ntb_cell_process_b_c{}}
-
-\unexpanded\def\tabl_ntb_cell_process_d#1#2[#3]#4%
- {\tabl_ntb_setup_cell{#1}{#2}%
- \bgroup
- \setupcurrentnaturaltablelocal[#3]%
- \letnaturaltablelocalparameter\c!background\empty
- \letnaturaltablelocalparameter\c!frame\v!off
- \setnaturaltablelocalparameter\c!width{\d_tabl_ntb_width}%
- \inheritednaturaltablelocalframed{\tabl_ntb_cell_start\tabl_ntb_char_align{#1}{#2}#4\tabl_ntb_cell_stop}%
- \egroup}
-
-\unexpanded\def\tabl_ntb_cell_process_e#1#2[#3]#4%
- {\tabl_ntb_setup_cell{#1}{#2}%
- \setupcurrentnaturaltablelocal[#3]% to get the color right, the way we
- \color % handle color here prevents interference due to whatsit nodes
- [\naturaltablelocalparameter\c!color] % as well as permits local colors to take precedence
- {\letnaturaltablelocalparameter\c!color\empty
- \setnaturaltablelocalparameter\c!width{\d_tabl_ntb_width}%
- \ifzeropt\d_tabl_ntb_height % case: nc=maxcolumns
- \else
- \setnaturaltablelocalparameter\c!height{\d_tabl_ntb_height}%
- \fi
- \ifcase\c_anch_backgrounds_text_count\else
- \edef\p_region{\naturaltablelocalparameter\c!region}%
- \ifx\p_region\empty\ifnum\tabl_ntb_get_bck{#1}{#2}>\zerocount
- \letnaturaltablelocalparameter\c!region\v!yes
- \fi\fi
- \fi
- \inheritednaturaltablelocalframed{\tabl_ntb_cell_start\tabl_ntb_char_align{#1}{#2}#4\tabl_ntb_cell_stop}}%
- \hskip\tabl_ntb_get_dis{#2}}
-
-\newtoks\everyresetTABLEyes
-\newtoks\everyresetTABLEnop
-
-\appendtoks
- \setupTABLE [%
- %
- % framed defaults
- %
- \c!width=\v!fit,%
- \c!height=\v!fit,%
- \c!lines=,%
- \c!offset=.25\exheight,%
- \c!empty=\v!no,%
- \c!frame=\v!on,%
- \c!topframe=,%
- \c!bottomframe=,%
- \c!leftframe=,%
- \c!rightframe=,%
- \c!radius=.5\bodyfontsize,%
- \c!rulethickness=\linewidth,%
- \c!corner=\v!rectangular,%
- \c!depth=\zeropoint,%
- \c!foregroundcolor=,%
- \c!foregroundstyle=,%
- \c!background=,%
- \c!backgroundcolor=,%
- \c!backgroundoffset=\v!frame,%
- \c!framecolor=,%
- \c!frameoffset=.5\linewidth,%
- % \c!backgroundcorner=\framedparameter\c!corner,%
- % \c!backgrounddepth=\framedparameter\c!depth,%
- % \c!backgroundradius=\framedparameter\c!radius,%
- % \c!framecorner=\framedparameter\c!corner,%
- % \c!framedepth=\framedparameter\c!depth,%
- % \c!frameradius=\framedparameter\c!radius,%
- \c!component=,%
- \c!region=,%
- \c!align=,%
- \c!bottom=\vss,%
- \c!top=,%
- \c!strut=\v!yes,%
- \c!autostrut=\v!no,%
- \c!location=\v!normal,%
- \c!orientation=,%
- \c!autowidth=\v!yes,%
- \c!setups=,%
- \c!loffset=\zeropoint,%
- \c!roffset=\zeropoint,%
- \c!toffset=\zeropoint,%
- \c!boffset=\zeropoint,%
- %
- % table specific
- %
- \c!aligncharacter=\v!no,%
- \c!alignmentcharacter={,},%
- \c!color=,%
- \c!columndistance=\zeropoint,% each column (whole table)
- \c!distance=\zeropoint,% individual column
- \c!headcolor=,%
- \c!header=,%
- \c!headstyle=\v!bold,%
- \c!left=,%
- \c!leftmargindistance=\zeropoint,% whole table
- \c!maxwidth=8\emwidth,%
- \c!option=,% \v!stretch
- \c!right=,%
- \c!rightmargindistance=\zeropoint,% whole table
- \c!spaceinbetween=,%
- \c!split=\v!auto,%
- \c!splitoffset=\zeropoint,%
- \c!style=,%
- \c!textwidth=\v!local,% was \hsize
- ]%
-\to \everyresetTABLEyes
-
-\appendtoks
- \setupTABLE [%
- \c!width=\v!fit,%
- \c!height=\v!fit%
- ]%
-\to \everyresetTABLEnop
-
-\the\everyresetTABLEyes
-
-% \bgroup
-% \setupTABLE[column][1][aligncharacter=yes, alignmentcharacter={,}]
-% \bTABLE
-% \bTR \bTD 1,2 \eTD \bTD 2 \eTD \eTR
-% \bTR \bTD 11,2 \eTD \bTD
-% {\setupTABLE[column][1][aligncharacter=yes, alignmentcharacter={,}]
-% \bTABLE
-% \bTR \bTD 1,2 \eTD \bTD 2 \eTD \eTR
-% \bTR \bTD 11,22 \eTD \bTD 2 \eTD \eTR
-% \bTR \bTD 11,2 \eTD \bTD 2 \eTD \eTR \eTABLE} \eTD \eTR
-% \bTR \bTD 11,22 \eTD \bTD 2 \eTD \eTR
-% \eTABLE
-% \egroup
-
-\newconditional\resetTABLEmode \settrue\resetTABLEmode
-
-\def\tabl_ntb_parameters_reset % we can use setters instead
- {\ifnum\m_tabl_tbl_level>\plusone % in ieder geval
- \ifconditional\resetTABLEmode
- \the\everyresetTABLEyes
- \else
- \the\everyresetTABLEnop
- \fi
- \fi}
-
-% new (for Olivier Turlier)
-%
-% \defineTABLEsetup [xx] [foregroundcolor=red]
-%
-% \bTABLE
-% \bTR \bTD oeps \eTD \bTD oeps \eTD \eTR
-% \bTR \bTDs[xx] oeps \eTDs \bTD oeps \eTD \eTR
-% \bTRs[xx] \bTD oeps \eTD \bTD oeps \eTD \eTRs
-% \eTABLE
-
-\installcorenamespace{naturaltablesetup}
-
-\unexpanded\def\defineTABLEsetup
- {\dodoubleargument\tabl_ntb_define_setup}
-
-\def\tabl_ntb_define_setup[#1][#2]%
- {\setvalue{\??naturaltablesetup#1}{#2}}
-
-\let\eTDs\relax
-\let\eTRs\relax
-
-\unexpanded\def\bTDs[#1]#2\eTDs
- {\normalexpanded{\bTD[\begincsname\??naturaltablesetup#1\endcsname]}#2\eTD}
-
-\unexpanded\def\bTRs[#1]#2\eTRs
- {\normalexpanded{\bTR[\begincsname\??naturaltablesetup#1\endcsname]}#2\eTR}
-
-\protect \endinput
-
-% todo: mode: first|next (of niets)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/tabl-nte.mkiv b/Master/texmf-dist/tex/context/base/mkiv/tabl-nte.mkiv
index af74a2abe9b..2a8c4c7dd89 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/tabl-nte.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/tabl-nte.mkiv
@@ -81,10 +81,10 @@
\setfalse\c_tabl_nte_in_nc}
\unexpanded\def\tabl_nte_start_nc
- {\futurelet\next\tabl_nte_start_nc_indeed}
+ {\futurelet\nexttoken\tabl_nte_start_nc_indeed}
\def\tabl_nte_start_nc_indeed
- {\ifx\next\tabl_nte_start_nr \else
+ {\ifx\nexttoken\tabl_nte_start_nr \else
\expandafter\tabl_nte_start_nc_finish
\fi}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/tabl-tab.mkiv b/Master/texmf-dist/tex/context/base/mkiv/tabl-tab.mkiv
index 3799964c9f8..e646a1a184f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/tabl-tab.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/tabl-tab.mkiv
@@ -1739,7 +1739,7 @@
%D elsewhere. Here we only check for inconsistent spacing. Due to the way \TEX\
%D handles alignments, we cannot automate spacing for colored rows and columns.
-\setnewconstant\tablerowzero\zerocount
+\tablerowzero\zerocount
\appendtoks
\let\SR\tabl_table_SR
diff --git a/Master/texmf-dist/tex/context/base/mkiv/tabl-tbl.lua b/Master/texmf-dist/tex/context/base/mkiv/tabl-tbl.lua
index 13d899de647..aa4d5051f97 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/tabl-tbl.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/tabl-tbl.lua
@@ -18,13 +18,16 @@ local commands = commands
local texsetcount = tex.setcount
-local separator = P("|")
-local nested = lpeg.patterns.nested
-local pattern = Ct((separator * (C(nested) + Cc("")) * C((1-separator)^0))^0)
+local separator = P("|") -- keep { }
+----- nested = C(lpeg.patterns.nested) -- remove { }
+local nested = lpeg.patterns.argument
+local pattern = Ct((separator * (nested + Cc("")) * C((1-separator)^0))^0)
local ctx_settabulatelastentry = context.settabulatelastentry
local ctx_settabulateentry = context.settabulateentry
+-- the lmtx raw processor handles {} like the normal one so we need to prune
+
local function presettabulate(preamble)
preamble = gsub(preamble,"~","d") -- let's get rid of ~ mess here
if find(preamble,"*",1,true) then
diff --git a/Master/texmf-dist/tex/context/base/mkiv/tabl-tbl.mkiv b/Master/texmf-dist/tex/context/base/mkiv/tabl-tbl.mkiv
index 434b260950c..2ed104adf38 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/tabl-tbl.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/tabl-tbl.mkiv
@@ -224,6 +224,9 @@
\newconstant \c_tabl_tabulate_localcolorspan
\newconstant \c_tabl_tabulate_modus
+%newconditional \c_tabl_pre_is_set
+\newconditional \c_tabl_post_is_set
+
\let\tabulatesplitlinemode\c_tabl_tabulate_splitlinemode % temp hack, we need an interface
\let \m_tabl_tabulate_separator_factor \empty % fraction
@@ -424,9 +427,9 @@
\fi\fi}
% \unexpanded % we can expand this one
-\def\tabl_tabulate_inject_post_skip#1%
+\def\tabl_tabulate_inject_post_skip#1#2%
{\ifdim#1>\zeropoint
- \kern#1\relax % was \hskip
+ \kern\ifnum\c_tabl_tabulate_columns=\c_tabl_tabulate_nofcolumns#2\else#1\fi\relax
\else\ifnum\c_tabl_tabulate_columns=\c_tabl_tabulate_nofcolumns
\ifconditional\c_tabl_tabulate_autorulespacing
\ifcase\c_tabl_tabulate_has_rule_spec_last\else
@@ -516,7 +519,9 @@
\egroup
\aligntab
\noexpand\dostoptagged
- \tabl_tabulate_inject_post_skip{\the\dimexpr\s_tabl_tabulate_post}% get rid of plus
+ \tabl_tabulate_inject_post_skip
+ {\the\ifconditional\c_tabl_post_is_set\s_tabl_tabulate_post\else\s_tabl_tabulate_last\fi}%
+ {\the\s_tabl_tabulate_post}%
\alignmark\alignmark
}%
\toksapp\t_tabl_tabulate_dummy{\NC}%
@@ -527,7 +532,9 @@
\s_tabl_tabulate_post\zeropoint
\fi
%\let\gettabulateexit\dogettabulateexit % still needed ?
- \d_tabl_tabulate_width\zeropoint}
+ \d_tabl_tabulate_width\zeropoint
+ %setfalse\c_tabl_pre_is_set
+ \setfalse\c_tabl_post_is_set}
\unexpanded\def\installtabulatepreambleoption#1#2%
{\setvalue{\??tabulatepreamble\string#1}{#2}}%
@@ -622,17 +629,21 @@
\tabl_tabulate_set_preamble}
\def\tabl_tabulate_set_preskip#1%
- {\doifelsenumber{#1}%
+ {%settrue\c_tabl_pre_is_set
+ \doifelsenumber{#1}%
{\s_tabl_tabulate_pre#1\d_tabl_tabulate_unit\tabl_tabulate_set_preamble }%
{\s_tabl_tabulate_pre.5\d_tabl_tabulate_unit\tabl_tabulate_set_preamble#1}}
\def\tabl_tabulate_set_posskip#1%
- {\doifelsenumber{#1}%
+ {\settrue\c_tabl_post_is_set
+ \doifelsenumber{#1}%
{\s_tabl_tabulate_post#1\d_tabl_tabulate_unit\tabl_tabulate_set_preamble }%
{\s_tabl_tabulate_post.5\d_tabl_tabulate_unit\tabl_tabulate_set_preamble#1}}
\def\tabl_tabulate_set_preposskip#1%
- {\doifelsenumber{#1}%
+ {%settrue\c_tabl_pre_is_set
+ \settrue\c_tabl_post_is_set
+ \doifelsenumber{#1}%
{\s_tabl_tabulate_pre#1\d_tabl_tabulate_unit\s_tabl_tabulate_post\s_tabl_tabulate_pre\tabl_tabulate_set_preamble }%
{\s_tabl_tabulate_pre.5\d_tabl_tabulate_unit\s_tabl_tabulate_post\s_tabl_tabulate_pre\tabl_tabulate_set_preamble#1}}
@@ -803,6 +814,8 @@
\c_tabl_tabulate_modus\zerocount
\setfalse\c_tabl_tabulate_pwidth_set
\setfalse\c_tabl_tabulate_reshape
+ %setfalse\c_tabl_pre_is_set
+ \setfalse\c_tabl_post_is_set
\t_tabl_tabulate_before\emptytoks
\t_tabl_tabulate_after\emptytoks
\t_tabl_tabulate_bmath\emptytoks
@@ -2112,7 +2125,7 @@
\stoptabulatenoalign}
\def\spac_vspacing_no_topskip % use grouped
- {\attribute\skipcategoryattribute\plusten}
+ {\c_attr_skipcategory\plusten}
\unexpanded\def\tabl_tabulate_ML_second_indeed
{\tabl_tabulate_break_no
@@ -2264,7 +2277,7 @@
\s_tabl_tabulate_first.5\d_tabl_tabulate_unit
\s_tabl_tabulate_last\s_tabl_tabulate_first
\s_tabl_tabulate_pre\zeropoint
- \s_tabl_tabulate_post\s_tabl_tabulate_first % was: \zeropoint
+ \s_tabl_tabulate_post\zeropoint
\global\c_tabl_tabulate_columns\zerocount
\global\c_tabl_tabulate_nofauto\zerocount
\global\c_tabl_tabulate_noflines\zerocount
diff --git a/Master/texmf-dist/tex/context/base/mkiv/tabl-tbl.mkxl b/Master/texmf-dist/tex/context/base/mkiv/tabl-tbl.mkxl
deleted file mode 100644
index dc8ae0214c4..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/tabl-tbl.mkxl
+++ /dev/null
@@ -1,3022 +0,0 @@
-%D \module
-%D [ file=core-tbl,
-%D version=1998.11.03,
-%D title=\CONTEXT\ Table Macros,
-%D subtitle=Text Flow Tabulation,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Table Macros / Tabulation}
-
-\unprotect
-
-\registerctxluafile{tabl-tbl}{} % experiment
-
-%D I can probably reimplement this using a \LUATEX\ combination but it does not pay
-%D of in development time. If I need something else I will write it from scratch
-%D anyway. This module looks a bit complex which is a consequence of it dealing with
-%D paragraphs being split over pages and that there are several passes over the data
-%D set. We can probably do some cleanup (combine/split).
-%D
-%D Caching the preamble does not save much (compared to other bits and pieces of
-%D \CONTEXT). There are not that many ways to deal with preambles and this is just
-%D one of them. The keys are somewhat similar to those of the \TABLE\ package.
-
-% |p2|p3| 2:3 -> spanning (maybe)
-%
-% In-text tabbing environment
-%
-% \starttabulate[| separated template] % eg [|l|p|] or [|l|p|p|]
-% \NC ... \NC ... \NC\NR
-% \stoptabulate
-%
-% with: two pass auto width calculation when no p-width
-% specified, even with multiple p's, see examples.
-%
-% TaBlE compatible specifications:
-%
-% l align column/paragraph left
-% r align column/paragraph right
-% c align column/paragraph center
-% p p(dimen) of automatisch als alleen p
-% w column width
-% f font#1
-% A {alignmentoptions}
-% B bold
-% I italic
-% S slanted
-% T type
-% R roman
-% m math
-% M display math
-% h hook (inner level or par lines)
-% b before (may be command#1)
-% a after
-% i i<n> skip left of column
-% j i<n> skip right of column
-% k i<n> skip around column
-% d digits (~)
-%
-% C [LMRT] {color} % T is text color
-%
-% | {color,n}
-%
-% s setups
-%
-% g g{char} align at char
-% . align at .
-% , align at ,
-%
-% Still to be done
-%
-% N math numbers (best hook into existing digits mechanism)
-% n numbers (best hook into existing digits mechanism)
-% Q math numbers (best hook into existing digits mechanism)
-% q numbers (best hook into existing digits mechanism)
-% ~ \hskip.5em
-% | check
-%
-% nesting
-%
-% 10 evt auto stack; dan wel andere signal dan void nodig
-%
-% present but not yet 100% ok
-%
-% \TL [width,color] bottom hrule
-% \FL [width,color] first hrule
-% \ML [width,color] mid hrule (with auto split)
-% \LL [width,color] bottom hrule
-% \BL [width,color] last hrule
-%
-% \HL [width,color] top rule
-% \VL [width,color]
-%
-% \CC \CL \CM \CR color
-%
-% \EQ \RQ \HQ equal (raw, hook)
-% \NC \RC \HC normal (raw, hook)
-%
-% \NR checked break
-% \NB no break
-%
-% \HR : rule with lineheight
-%
-% \autotabulaterule : with lineheight, not first/last
-% \autotabulateline : spaced, not first/last
-% \tabulaterule : with lineheight
-% \tabulateline : spaced
-%
-% tricky: align scans ahead, over # and expands ones before
-% while doing
-%
-% new:
-%
-% \starttabulate[|cg{.}|cg{,}|cg{,}|]
-% \NC period \NC comma \NC comma \NC\NR
-% \NG 100.000,00 \NG 100.000,00 \NG 100,00 \NC\NR
-% \NG 10.000,00 \NG 10.000,00 \NG 1000,00 \NC\NR
-% \NG 100,00 \NG 100,00 \NG 10,00 \NC\NR
-% \NG 10 \NG 10 \NG 0,00 \NC\NR
-% \stoptabulate
-%
-% \starttabulate[|c.|c,|c,|]
-% \NC period \NC comma \NC comma \NC\NR
-% \NG 100.000,00 \NG 100.000,00 \NG 100,00 \NC\NR
-% \NG 10.000,00 \NG 10.000,00 \NG 1000,00 \NC\NR
-% \NG 100,00 \NG 100,00 \NG 10,00 \NC\NR
-% \NG 10 \NG 10 \NG 0,00 \NC\NR
-% \stoptabulate
-
-% nice demo (for BG)
-%
-% \starttabulate[|r|b{$\star$}|ra{\percent}|b{=}|r|]
-% \NC 500 \NC \NC 60 \NC \NC 300 \NC \NR
-% \NC 500 \NC \NC 55 \NC \NC 275 \NC \NR
-% \NC 500 \NC \NC 50 \NC \NC 250 \NC \NR
-% \NC 500 \NC \NC 45 \NC \NC 225 \NC \NR
-% \NC 500 \NC \NC 40 \NC \NC 200 \NC \NR
-% \NC 500 \NC \NC 35 \NC \NC 175 \NC \NR
-% \NC 500 \NC \NC 30 \NC \NC 150 \NC \NR
-% \NC 500 \NC \NC 25 \NC \NC 125 \NC \NR
-% \NC 500 \NC \NC 20 \NC \NC 100 \NC \NR
-% \stoptabulate
-
-\newtoks \t_tabl_tabulate_preamble
-\newtoks \t_tabl_tabulate_before
-\newtoks \t_tabl_tabulate_after
-\newtoks \t_tabl_tabulate_bmath
-\newtoks \t_tabl_tabulate_emath
-\newtoks \t_tabl_tabulate_font
-\newtoks \t_tabl_tabulate_settings
-\newtoks \t_tabl_tabulate_dummy
-\newtoks \t_tabl_tabulate_every_row
-\newtoks \t_tabl_tabulate_every_after_row
-\newtoks \t_tabl_tabulate_every_real_row
-
-\newtoks \t_tabl_tabulate_initializers_first
-\newtoks \t_tabl_tabulate_initializers_second
-
-\newcount \c_tabl_tabulate_nofauto
-\newcount \c_tabl_tabulate_columns
-\newcount \c_tabl_tabulate_column
-\newcount \c_tabl_tabulate_plines_min
-\newcount \c_tabl_tabulate_plines_max
-\newcount \c_tabl_tabulate_max_colorcolumn
-\newcount \c_tabl_tabulate_max_vrulecolumn
-\newcount \c_tabl_tabulate_repeathead
-\newcount \c_tabl_tabulate_noflines
-\newcount \c_tabl_tabulate_totalnoflines
-\newcount \c_tabl_tabulate_minusnoflines
-\newcount \c_tabl_tabulate_align
-\newcount \c_tabl_tabulate_nofrealrows
-\newcount \c_tabl_tabulate_autocolor
-
-\newcount \c_tabl_tabulate_nofcolumns % set at the lua end by parser
-\newcount \c_tabl_tabulate_has_rule_spec_first % set at the lua end by parser (for the moment a count)
-\newcount \c_tabl_tabulate_has_rule_spec_last % set at the lua end by parser (for the moment a count)
-
-\newconditional \c_tabl_tabulate_nopbreak
-\newconditional \c_tabl_tabulate_firstflushed
-\newconditional \c_tabl_tabulate_equal
-\newconditional \c_tabl_tabulate_split \settrue\c_tabl_tabulate_split
-\newconditional \c_tabl_tabulate_automode
-\newconditional \c_tabl_tabulate_handlepbreak \settrue\c_tabl_tabulate_handlepbreak
-\newconditional \c_tabl_tabulate_autorulespacing \settrue\c_tabl_tabulate_autorulespacing
-\newconditional \c_tabl_tabulate_someamble
-\newconditional \c_tabl_tabulate_tolerant_break
-\newconditional \c_tabl_tabulate_splitoff_whitespace
-\newconditional \c_tabl_tabulate_pwidth_set
-\newconditional \c_tabl_tabulate_reshape
-
-\newdimen \d_tabl_tabulate_width_p
-\newdimen \d_tabl_tabulate_width_w
-\newdimen \d_tabl_tabulate_width
-\newdimen \d_tabl_tabulate_unit
-\newdimen \d_tabl_tabulate_height_p_max
-\newdimen \d_tabl_tabulate_vrulethickness_default
-\newdimen \d_tabl_tabulate_hrulethickness_default
-\newdimen \d_tabl_tabulate_vrulethickness
-\newdimen \d_tabl_tabulate_hrulethickness % not used
-\newdimen \d_tabl_tabulate_vrulethickness_local
-\newdimen \d_tabl_tabulate_hrulethickness_local
-\newdimen \d_tabl_tabulate_indent
-\newdimen \d_tabl_tabulate_splitoff_betweenskip
-\newdimen \d_tabl_tabulate_margin
-
-\newskip \s_tabl_tabulate_pre
-\newskip \s_tabl_tabulate_post
-\newskip \s_tabl_tabulate_first
-\newskip \s_tabl_tabulate_last
-\newskip \s_tabl_tabulate_separator
-
-\newbox \b_tabl_tabulate
-
-\newconstant \c_tabl_tabulate_pass
-\newconstant \c_tabl_tabulate_type
-\newconstant \c_tabl_tabulate_kind % 1=strong 2=equals
-\newconstant \c_tabl_tabulate_splitlinemode \c_tabl_tabulate_splitlinemode\plusone
-\newconstant \c_tabl_tabulate_colorspan
-\newconstant \c_tabl_tabulate_localcolorspan
-\newconstant \c_tabl_tabulate_modus
-
-\let\tabulatesplitlinemode\c_tabl_tabulate_splitlinemode % temp hack, we need an interface
-
-\let \m_tabl_tabulate_separator_factor \empty % fraction
-
-\newtoks \everytabulatepar % where used ?
-\newtoks \everytabulate % public ?
-
-\unexpanded\def\tolerantTABLEbreaktrue {\settrue \c_tabl_tabulate_tolerant_break} % used in styles !
-\unexpanded\def\handletabulatepbreakfalse{\setfalse\c_tabl_tabulate_handlepbreak } % depricated
-
-\def\noftabulaterows{\number\c_tabl_tabulate_noflines} % handy for testing if a table is empty
-
-\installcorenamespace{tabulatebox}
-\installcorenamespace{tabulatesetup}
-\installcorenamespace{tabulatehook}
-\installcorenamespace{tabulatesplit}
-\installcorenamespace{tabulateseparator}
-\installcorenamespace{tabulatecolor}
-\installcorenamespace{tabulateheader}
-\installcorenamespace{tabulatealigning}
-\installcorenamespace{tabulatepreamble}
-\installcorenamespace{tabulatevrule}
-
-\installcorenamespace{tabulatehead}
-\installcorenamespace{tabulatefoot}
-\installcorenamespace{tabulatenext}
-
-\prependtoks
- \global\c_tabl_tabulate_nofrealrows\zerocount
-\to \t_tabl_tabulate_initializers_first
-
-\prependtoks
- \global\c_tabl_tabulate_nofrealrows\zerocount
-\to \t_tabl_tabulate_initializers_second
-
-\prependtoks
- \global\advance\c_tabl_tabulate_nofrealrows\plusone
-\to \t_tabl_tabulate_every_real_row
-
-\def\b_tabl_tabulate_current#1%
- {\csname\??tabulatebox\number#1\endcsname} % beware, a synonym
-
-\def\tabl_tabulate_initialize_boxes#1%
- {\scratchcounter#1\relax
- \tabl_tabulate_initialize_boxes_step}
-
-\def\tabl_tabulate_initialize_boxes_step
- {\ifnum\scratchcounter>\zerocount
- \tabl_tabulate_initialize_box\scratchcounter
- \advance\scratchcounter\minusone
- \expandafter\tabl_tabulate_initialize_boxes_step
- \fi}
-
-\def\tabl_tabulate_initialize_box#1% also used elsewhere
- {\ifcsname\??tabulatebox\number#1\endcsname
- \tabl_tabulate_initialize_box_yes
- \else
- \tabl_tabulate_initialize_box_nop#1%
- \fi}
-
-\def\tabl_tabulate_initialize_box_yes {\global \setbox\lastnamedcs\emptybox}
-\def\tabl_tabulate_initialize_box_nop#1{\expandafter\newbox\csname\??tabulatebox\number#1\endcsname}
-
-\tabl_tabulate_initialize_boxes{16} % not really needed
-
-\let\initializetablebox \tabl_tabulate_initialize_box % used elsewhere, will change
-\let\initializetableboxes\tabl_tabulate_initialize_boxes % used elsewhere, will change
-\let\tablebox \b_tabl_tabulate_current
-
-% 0 = NC column next EQ equal column
-% 1 = RC column raw RQ equal column raw
-% 2 = HC column hook HQ equal column hook
-
-% handy helper
-
-\def\tabulatenoalign % public ?
- {\noalign
- \bgroup
- \let\noalign\relax
- \let\tabulatenoalign\relax
- \let\next=}
-
-\def\starttabulatenoalign % public ?
- {\tabulatenoalign\bgroup}
-
-\let\stoptabulatenoalign\egroup
-
-% [|lg{.}|] => \NG 12.34 \NC
-
-\def\tabl_tabulate_nobreak_inject_tracer
- {\red % maybe use the fast color switcher here
- \hrule\s!height.5\linewidth\s!depth.5\linewidth
- \par
- \kern-\linewidth
- \tabl_tabulate_break_no}
-
-\installtextracker
- {tables.tabulate.breaks}
- {\let\tabl_tabulate_break_no_tracer\tabl_tabulate_nobreak_inject_tracer}
- {\let\tabl_tabulate_break_no_tracer\donothing}
-
-\let\tabl_tabulate_break_no_tracer\donothing
-
-\def\tabl_tabulate_nobreak_inject_indeed
- {\tabl_tabulate_break_no
- \tabl_tabulate_break_no_tracer}
-
-\def\tabl_tabulate_nobreak_inject
- {\tabulatenoalign{\tabl_tabulate_nobreak_inject_indeed}}
-
-\unexpanded\def\tabl_tabulate_hook_check
- {\ifnum\c_tabl_tabulate_type<\plustwo
- \glet\tabl_tabulate_hook\tabl_tabulate_hook_nop
- \else
- \glet\tabl_tabulate_hook\tabl_tabulate_hook_yes
- \fi}
-
-\unexpanded\def\tabl_tabulate_setups_check
- {\begincsname\??tabulatesetup\the\c_tabl_tabulate_column\endcsname}
-
-\unexpanded\def\tabl_tabulate_entry_before{\ignorespaces\tabl_tabulate_hook}
-\unexpanded\def\tabl_tabulate_entry_after {\unskip\unskip\ifmmode\else\endgraf\fi}
-
-\unexpanded\def\tabl_tabulate_shaped_par_begin
- {\dowithnextboxcs\tabl_tabulate_shaped_par_finish\vbox\bgroup}
-
-\def\tabl_tabulate_shaped_par_finish
- {\clf_doreshapeframedbox\nextbox\relax
- \ifvmode\unvbox\else\box\fi\nextbox}
-
-\let\tabl_tabulate_shaped_par_end\egroup
-
-\ifdefined\dotagtabulatecell \else \let\dotagtabulatecell \relax \fi
-\ifdefined\dotagtabulatesignal \else \let\dotagtabulatesignal\relax \fi
-
-\unexpanded\def\tabl_tabulate_check_local_color_first#1#2%
- {\relax}
-
-\unexpanded\def\tabl_tabulate_check_local_color_second#1#2%
- {\relax
- \ifx\m_tabl_tabulate_color_local\empty
- \xdef\m_tabl_tabulate_color{#1}%
- \else
- \glet\m_tabl_tabulate_color\m_tabl_tabulate_color_local
- \glet\m_tabl_tabulate_color_local\empty
- \fi
- \ifcase\c_tabl_tabulate_localcolorspan
- \global\c_tabl_tabulate_colorspan#2\relax
- \else
- \global\c_tabl_tabulate_colorspan\c_tabl_tabulate_localcolorspan
- \global\c_tabl_tabulate_localcolorspan\zerocount
- \fi}
-
-\unexpanded\def\tabl_tabulate_check_local_vrule_thickness#1%
- {\relax
- \ifcase\d_tabl_tabulate_vrulethickness_local
- \global\d_tabl_tabulate_vrulethickness#1\relax
- \else
- \global\d_tabl_tabulate_vrulethickness\d_tabl_tabulate_vrulethickness_local
- \global\d_tabl_tabulate_vrulethickness_local\zeropoint
- \fi}
-
-\unexpanded\def\tabl_tabulate_check_local_vrule_color_first#1%
- {\relax}
-
-\unexpanded\def\tabl_tabulate_check_local_vrule_color_second#1%
- {\relax
- \ifx\m_tabl_tabulate_vrule_color_local\empty
- \xdef\m_tabl_tabulate_vrule_color{#1}%
- \else
- \glet\m_tabl_tabulate_vrule_color\m_tabl_tabulate_vrule_color_local
- \glet\m_tabl_tabulate_vrule_color_local\empty
- \fi}
-
-\let\tabl_tabulate_check_local_color \gobbletwoarguments
-\let\tabl_tabulate_check_local_vrule_color\gobbleoneargument
-
-\appendtoks
- \let\tabl_tabulate_check_local_color \tabl_tabulate_check_local_color_first
- \let\tabl_tabulate_check_local_vrule_color\tabl_tabulate_check_local_vrule_color_first
-\to \t_tabl_tabulate_initializers_first
-
-\appendtoks
- \let\tabl_tabulate_check_local_color \tabl_tabulate_check_local_color_second
- \let\tabl_tabulate_check_local_vrule_color\tabl_tabulate_check_local_vrule_color_second
-\to \t_tabl_tabulate_initializers_second
-
-% \unexpanded % we can expand this one
-\def\tabl_tabulate_inject_pre_skip#1%
- {\ifdim#1>\zeropoint
- \kern#1\relax % was \hskip
- \orelse\ifnum\c_tabl_tabulate_column=\zerocount
- \ifconditional\c_tabl_tabulate_autorulespacing
- \ifcase\c_tabl_tabulate_has_rule_spec_first\else
- \kern\s_tabl_tabulate_first\relax % was \hskip
- \fi
- \fi
- \fi}
-
-% \unexpanded % we can expand this one
-\def\tabl_tabulate_inject_post_skip#1%
- {\ifdim#1>\zeropoint
- \kern#1\relax % was \hskip
- \orelse\ifnum\c_tabl_tabulate_columns=\c_tabl_tabulate_nofcolumns
- \ifconditional\c_tabl_tabulate_autorulespacing
- \ifcase\c_tabl_tabulate_has_rule_spec_last\else
- \kern\s_tabl_tabulate_last\relax % was \hskip
- \fi
- \fi
- \fi}
-
-\let\tabl_tabulate_hook_b\donothing
-\let\tabl_tabulate_hook_e\donothing
-
-\let\tabl_tabulate_hook_g\donothing
-
-\def\tabl_tabulate_set_preamble_step#1#2% only makes sense for many tabulates
- {\etoksapp\t_tabl_tabulate_preamble{%
- \tabl_tabulate_check_local_vrule_thickness\constantdimenargument\d_tabl_tabulate_vrulethickness
- \tabl_tabulate_check_local_vrule_color\constantemptyargument\m_tabl_tabulate_vrule_color
- \tabl_tabulate_check_local_color\constantemptyargument\m_tabl_tabulate_color\constantnumberargument\c_tabl_tabulate_colorspan
- \tabl_tabulate_color_side_right
- \aligntab
- \tabl_tabulate_column_vrule_inject
- \tabl_tabulate_color_side_left
- \tabl_tabulate_inject_pre_skip{\the\dimexpr\s_tabl_tabulate_pre}% get rid of plus
- \alignmark\alignmark
- \aligntab
- \tabl_tabulate_color_side_both
- \global\c_tabl_tabulate_colorspan\zerocount
- \global\c_tabl_tabulate_column\constantnumber\c_tabl_tabulate_columns
- \tabl_tabulate_hook_g
- \tabl_tabulate_setups_check % unexpandable
- \tabl_tabulate_hook_check % unexpandable
- \ifzeropt\d_tabl_tabulate_width
- \ifcase\c_tabl_tabulate_modus\else
- \settrue\c_tabl_tabulate_automode
- \fi
- \else
- \ifcase\c_tabl_tabulate_modus
- \hbox to
- \else
- \hsize
- \fi
- \the\d_tabl_tabulate_width
- \fi
- \bgroup
- \tabl_tabulate_bbskip
- \bgroup % we cannot combine the if because a cell may have only one ##
- \tabl_tabulate_hook_b
- \c_tabl_tabulate_align\constantnumber\c_tabl_tabulate_align % needed in tag passing
- \ifx\m_tabl_tabulate_alignment\empty \else
- \spac_align_use_now{\m_tabl_tabulate_alignment}%
- \fi
- \noexpand\dostarttagged\noexpand\t!tabulatecell\noexpand\empty
- \noexpand\dotagtabulatecell
- \noexpand#1%
- \ifconditional\c_tabl_tabulate_reshape
- \tabl_tabulate_shaped_par_begin
- \fi
- \dotagtabulatesignal % empty cells .. todo (can be removed as soon as build)
- \noexpand\ifnum\noexpand\c_tabl_tabulate_type=\plusone\noexpand\else
- \the\t_tabl_tabulate_bmath % maybe later? can interfere with char 0
- \the\t_tabl_tabulate_font
- \the\t_tabl_tabulate_settings
- \the\t_tabl_tabulate_before
- \ifx\m_tabl_tabulate_text_color\empty
- \expandafter\gobbleoneargument
- \else
- \expandafter\dofastcoloractivation
- \fi\m_tabl_tabulate_text_color
- \noexpand\fi
- % grouping needs to be outside macros (or expandable), nice test
- % example \NC \string \aligntab \NC which will fail otherwise (mk)
- \bgroup
- \tabl_tabulate_entry_before
- \alignmark\alignmark
- \tabl_tabulate_entry_after
- \egroup
- \noexpand\ifnum\noexpand\c_tabl_tabulate_type=\plusone\noexpand\else
- \the\t_tabl_tabulate_after
- \the\t_tabl_tabulate_emath
- \noexpand\fi
- \ifconditional\c_tabl_tabulate_reshape
- \tabl_tabulate_shaped_par_end
- \fi
- \noexpand#2%
- \tabl_tabulate_hook_e
- \egroup
- \egroup
- \aligntab
- \noexpand\dostoptagged
- \tabl_tabulate_inject_post_skip{\the\dimexpr\s_tabl_tabulate_post}% get rid of plus
- \alignmark\alignmark
- }%
- \toksapp\t_tabl_tabulate_dummy{\NC}%
- \s_tabl_tabulate_pre.5\d_tabl_tabulate_unit\relax
- \ifnum\c_tabl_tabulate_columns<\numexpr\c_tabl_tabulate_nofcolumns-\plusone\relax
- \s_tabl_tabulate_post\s_tabl_tabulate_pre
- \else
- \s_tabl_tabulate_post\zeropoint
- \fi
- %\let\gettabulateexit\dogettabulateexit % still needed ?
- \d_tabl_tabulate_width\zeropoint}
-
-\unexpanded\def\installtabulatepreambleoption#1#2%
- {\setvalue{\??tabulatepreamble\string#1}{#2}}%
-
-\installtabulatepreambleoption{x}{\c_tabl_tabulate_align\zerocount
- \tabl_tabulate_set_preamble} % internal
-\installtabulatepreambleoption{l}{\c_tabl_tabulate_align\plusone
- \tabl_tabulate_set_preamble}
-\installtabulatepreambleoption{r}{\c_tabl_tabulate_align\plustwo
- \tabl_tabulate_set_preamble}
-\installtabulatepreambleoption{c}{\c_tabl_tabulate_align\plusthree
- \tabl_tabulate_set_preamble}
-\installtabulatepreambleoption{p}{\tabl_tabulate_set_paragraph}
-\installtabulatepreambleoption{s}{\tabl_tabulate_set_setups}
-\installtabulatepreambleoption{w}{\tabl_tabulate_set_width}
-\installtabulatepreambleoption{f}{\tabl_tabulate_set_font}
-\installtabulatepreambleoption{B}{\t_tabl_tabulate_font{\bf}%
- \tabl_tabulate_set_preamble}
-\installtabulatepreambleoption{I}{\t_tabl_tabulate_font{\it}%
- \tabl_tabulate_set_preamble}
-\installtabulatepreambleoption{S}{\t_tabl_tabulate_font{\sl}%
- \tabl_tabulate_set_preamble}
-\installtabulatepreambleoption{T}{\t_tabl_tabulate_font{\tt}%
- \tabl_tabulate_set_preamble}
-\installtabulatepreambleoption{R}{\t_tabl_tabulate_font{\rm}%
- \tabl_tabulate_set_preamble}
-\installtabulatepreambleoption{m}{\t_tabl_tabulate_bmath{\normalstartimath}%
- \t_tabl_tabulate_emath{\normalstopimath}%
- \tabl_tabulate_set_preamble}
-\installtabulatepreambleoption{M}{\t_tabl_tabulate_bmath{\normalstartimath\displaystyle}%
- \t_tabl_tabulate_emath{\normalstopimath}%
- \tabl_tabulate_set_preamble}
-\installtabulatepreambleoption{h}{\tabl_tabulate_set_hook}
-\installtabulatepreambleoption{b}{\tabl_tabulate_set_before}
-\installtabulatepreambleoption{a}{\tabl_tabulate_set_after}
-\installtabulatepreambleoption{i}{\tabl_tabulate_set_preskip}
-\installtabulatepreambleoption{j}{\tabl_tabulate_set_posskip}
-\installtabulatepreambleoption{k}{\tabl_tabulate_set_preposskip}
-\installtabulatepreambleoption{e}{\toksapp\t_tabl_tabulate_settings{\global\settrue\c_tabl_tabulate_equal}%
- \tabl_tabulate_set_preamble}
-\installtabulatepreambleoption{g}{\tabl_tabulate_set_align}
-\installtabulatepreambleoption{.}{\tabl_tabulate_set_align.}
-\installtabulatepreambleoption{,}{\tabl_tabulate_set_align,}
-\installtabulatepreambleoption{C}{\tabl_tabulate_set_color_span}
-\installtabulatepreambleoption{d}{\toksapp\t_tabl_tabulate_settings{\fixedspaces}%
- \tabl_tabulate_set_preamble}
-\installtabulatepreambleoption{ }{\tabl_tabulate_set_preamble}
-\installtabulatepreambleoption{A}{\tabl_tabulate_set_alignment}
-
-%D We no longer deal with \type {~} here but map it onto \type {d} instead. Of
-%D course we could prefix a key with \type {\meaning} instead, which works ok (and
-%D is needed in order to pseudo expand \type {\next}, but is ugly at the same time.
-%D The type {d} stands for digitspace.
-
-%D \starttyping
-%D \installtabulatepreambleoption{~}{...} % see 'd'
-%D \stoptyping
-%D
-%D Also, as there is always a key, we no longer do some after assigment or future
-%D let but just pick up the key.
-
-% \installtabulatepreambleoption \s!unknown %
-% {\writestatus{tabulate}{unknown preamble key [\normalmeaning\next]}%
-% \tabl_tabulate_set_preamble}
-%
-% \def\tabl_tabulate_set_preamble
-% {\afterassignment\dosettabulatepreamble\let\next=}
-%
-% \def\dosettabulatepreamble
-% {\ifx\next\relax \else
-% \csname\??tabulatepreamble
-% \ifcsname\??tabulatepreamble\next\endcsname\next\else\s!unknown\fi
-% \expandafter\endcsname
-% \fi}
-
-\installtabulatepreambleoption\relax
- {} % finished
-
-\def\tabl_tabulate_set_preamble#1%
- {\ifcsname\??tabulatepreamble\string#1\endcsname
- %\expandafter\tabl_tabulate_set_preamble_yes
- \expandafter\expandafter\expandafter\lastnamedcs\expandafter\gobbleoneargument
- \else
- \expandafter\tabl_tabulate_set_preamble_nop
- \fi{#1}}
-
-\def\tabl_tabulate_set_preamble_yes#1%
- {\csname\??tabulatepreamble\string#1\expandafter\endcsname}
-
-\def\tabl_tabulate_set_preamble_nop#1%
- {\writestatus{tabulate}{unknown preamble key: #1}%
- \tabl_tabulate_set_preamble}
-
-\def\tabl_tabulate_set_preskip#1%
- {\doifelsenumber{#1}%
- {\s_tabl_tabulate_pre#1\d_tabl_tabulate_unit\tabl_tabulate_set_preamble }%
- {\s_tabl_tabulate_pre.5\d_tabl_tabulate_unit\tabl_tabulate_set_preamble#1}}
-
-\def\tabl_tabulate_set_posskip#1%
- {\doifelsenumber{#1}%
- {\s_tabl_tabulate_post#1\d_tabl_tabulate_unit\tabl_tabulate_set_preamble }%
- {\s_tabl_tabulate_post.5\d_tabl_tabulate_unit\tabl_tabulate_set_preamble#1}}
-
-\def\tabl_tabulate_set_preposskip#1%
- {\doifelsenumber{#1}%
- {\s_tabl_tabulate_pre#1\d_tabl_tabulate_unit\s_tabl_tabulate_post\s_tabl_tabulate_pre\tabl_tabulate_set_preamble }%
- {\s_tabl_tabulate_pre.5\d_tabl_tabulate_unit\s_tabl_tabulate_post\s_tabl_tabulate_pre\tabl_tabulate_set_preamble#1}}
-
-\def\tabl_tabulate_set_setups#1%
- {\setvalue{\??tabulatesetup\the\c_tabl_tabulate_columns}{\setups[#1]}%
- \tabl_tabulate_set_preamble}
-
-\def\tabl_tabulate_set_hook#1%
- {\setvalue{\??tabulatehook\the\c_tabl_tabulate_columns}{#1}%
- \tabl_tabulate_set_preamble}
-
-% begin of character align plugin
-
-\newconditional\c_tabl_auto_align_mode % reset later
-
-\def\tabl_tabulate_hook_g % partly expanded
- {\ifconditional\c_tabl_auto_align_mode
- \signalcharacteralign\c_tabl_tabulate_column{\c_tabl_tabulate_noflines+\plusone}%
- \typo_charalign_adapt_font
- \fi}
-
-\def\tabl_tabulate_set_align#1%
- {\global\settrue\c_tabl_auto_align_mode
- \setcharacteralign\c_tabl_tabulate_columns{#1}%
- \tabl_tabulate_set_preamble}
-
-% end of character align plugin
-
-\def\tabl_tabulate_set_before#1%
- {\t_tabl_tabulate_before{#1}%
- \tabl_tabulate_set_preamble}
-
-\def\tabl_tabulate_set_after#1%
- {\t_tabl_tabulate_after{#1}%
- \tabl_tabulate_set_preamble}
-
-\def\tabl_tabulate_set_font#1%
- {\t_tabl_tabulate_font{#1}%
- \tabl_tabulate_set_preamble}
-
-\def\tabl_tabulate_pickup_width
- {\doifelsenextparenthesis\tabl_tabulate_set_width_indeed\tabl_tabulate_set_preamble}
-
-\def\tabl_tabulate_set_width
- {\setfalse\c_tabl_tabulate_pwidth_set
- \c_tabl_tabulate_modus\zerocount
- \tabl_tabulate_pickup_width}
-
-\def\tabl_tabulate_set_alignment#1%
- {\edef\m_tabl_tabulate_alignment{#1}%
- \spac_align_use_later\m_tabl_tabulate_alignment
- \tabl_tabulate_set_preamble}
-
-\def\tabl_tabulate_set_paragraph
- {\doifelsenextparenthesis
- {\c_tabl_tabulate_modus\plusone
- \settrue\c_tabl_tabulate_pwidth_set
- \tabl_tabulate_pickup_width}
- {\c_tabl_tabulate_modus\plustwo
- \setfalse\c_tabl_tabulate_pwidth_set
- \tabl_tabulate_set_preamble}}
-
-% \startbuffer
-% \toplinebox{\framed[width=3cm,height=2cm]{tufte}}
-% \stopbuffer
-% \starttabulate[|p(fixed)|p|]
-% \dorecurse{100}{\NC \getbuffer \NC test \par test \par \NC \NR}
-% \stoptabulate
-% \starttabulate[|p(fit)|p|]
-% \dorecurse{100}{\NC \getbuffer \NC test \par test \par \NC \NR}
-% \stoptabulate
-
-\def\tabl_tabulate_set_width_indeed(#1)%
- {\processallactionsinset % can be made faster
- [#1]%
- [ \v!fit=>\c_tabl_tabulate_modus\plusthree,
- \v!fixed=>\c_tabl_tabulate_modus\plusthree
- \settrue\c_tabl_tabulate_nopbreak,
- \v!auto=>\c_tabl_tabulate_modus\plusthree
- \settrue\c_tabl_tabulate_reshape,
- \s!unknown=>\d_tabl_tabulate_width#1\relax]%
- \ifconditional\c_tabl_tabulate_pwidth_set
- \global\advance\d_tabl_tabulate_width_p\d_tabl_tabulate_width % accumulated parwidth
- \fi
- \tabl_tabulate_set_preamble}
-
-% faster but seldom used
-%
-% \installcorenamespace{tabulatewidth}
-%
-% \setvalue{\??tabulatewidth\v!fit }{\c_tabl_tabulate_modus\plusthree}
-% \setvalue{\??tabulatewidth\v!fixed}{\c_tabl_tabulate_modus\plusthree\settrue\c_tabl_tabulate_nopbreak}
-% \setvalue{\??tabulatewidth\v!auto }{\c_tabl_tabulate_modus\plusthree\settrue\c_tabl_tabulate_reshape}
-%
-% \def\tabl_tabulate_set_width_step#1%
-% {\ifcsname\??tabulatewidth#1\endcsname
-% \lastnamedcs
-% \else
-% \d_tabl_tabulate_width#1\relax
-% \fi}
-%
-% \def\tabl_tabulate_set_width_indeed(#1)%
-% {\rawprocesscommacommand[#1]\tabl_tabulate_set_width_step
-% \ifconditional\c_tabl_tabulate_pwidth_set
-% \global\advance\d_tabl_tabulate_width_p\d_tabl_tabulate_width % accumulated parwidth
-% \fi
-% \tabl_tabulate_set_preamble}
-%
-\def\tabl_tabulate_set_raggedright {\ifnum\c_tabl_tabulate_type=\plusone \else\raggedright \fi}
-\def\tabl_tabulate_set_raggedcenter{\ifnum\c_tabl_tabulate_type=\plusone \else\raggedcenter\fi}
-\def\tabl_tabulate_set_raggedleft {\ifnum\c_tabl_tabulate_type=\plusone \else\raggedleft \fi}
-\def\tabl_tabulate_set_notragged {\ifnum\c_tabl_tabulate_type=\plusone \else\notragged \fi}
-\def\tabl_tabulate_set_hss {\ifnum\c_tabl_tabulate_type=\plusone \else\hss \fi} % never change this to a fill
-
-\def\tabl_tabulate_bskip_raggedright {\tabl_tabulate_bskip\tabl_tabulate_set_raggedright }
-\def\tabl_tabulate_bskip_raggedleft {\tabl_tabulate_bskip\tabl_tabulate_set_raggedleft }
-\def\tabl_tabulate_bskip_raggedcenter{\tabl_tabulate_bskip\tabl_tabulate_set_raggedcenter}
-
-\def\tabl_tabulate_set_width_normal
- {\ifcase\c_tabl_tabulate_align\relax
- \tabl_tabulate_set_preamble_step\empty \tabl_tabulate_set_hss \or
- \tabl_tabulate_set_preamble_step\empty \tabl_tabulate_set_hss \or
- \tabl_tabulate_set_preamble_step\tabl_tabulate_set_hss\empty \or
- \tabl_tabulate_set_preamble_step\tabl_tabulate_set_hss\tabl_tabulate_set_hss \fi}
-
-\def\tabl_tabulate_set_width_fixed
- {\ifcase\c_tabl_tabulate_align\relax
- \tabl_tabulate_set_preamble_step\tabl_tabulate_bskip \tabl_tabulate_eskip \or
- \tabl_tabulate_set_preamble_step\tabl_tabulate_bskip_raggedright \tabl_tabulate_eskip \or
- \tabl_tabulate_set_preamble_step\tabl_tabulate_bskip_raggedleft \tabl_tabulate_eskip \or
- \tabl_tabulate_set_preamble_step\tabl_tabulate_bskip_raggedcenter\tabl_tabulate_eskip \fi}
-
-\def\tabl_tabulate_set_width_auto
- {\global\advance\c_tabl_tabulate_nofauto\plusone
- \ifcase\c_tabl_tabulate_align\relax
- \tabl_tabulate_set_preamble_step\tabl_tabulate_bskip \tabl_tabulate_eskip \or
- \tabl_tabulate_set_preamble_step\tabl_tabulate_bskip_raggedright \tabl_tabulate_eskip \or
- \tabl_tabulate_set_preamble_step\tabl_tabulate_bskip_raggedleft \tabl_tabulate_eskip \or
- \tabl_tabulate_set_preamble_step\tabl_tabulate_bskip_raggedcenter\tabl_tabulate_eskip \fi}
-
-\def\tabl_tabulate_set_width_simple
- {\tabl_tabulate_set_preamble_step\tabl_tabulate_xbskip\tabl_tabulate_xeskip}
-
-% \def\tabl_tabulate_set_color_span#1#2%
-% {\xdef\m_tabl_tabulate_color{#2}%
-% \global\c_tabl_tabulate_colorspan\if#1L\plusone\else\if#1M\plustwo\else\if#1R\plusthree\else\zerocount\fi\fi\fi\relax
-% \tabl_tabulate_set_preamble}
-
-\installcorenamespace{tabulatecolorspec}
-
-\setvalue{\??tabulatecolorspec C}#1{\xdef\m_tabl_tabulate_color {#1}\global\c_tabl_tabulate_colorspan\zerocount}
-\setvalue{\??tabulatecolorspec L}#1{\xdef\m_tabl_tabulate_color {#1}\global\c_tabl_tabulate_colorspan\plusone }
-\setvalue{\??tabulatecolorspec M}#1{\xdef\m_tabl_tabulate_color {#1}\global\c_tabl_tabulate_colorspan\plustwo }
-\setvalue{\??tabulatecolorspec R}#1{\xdef\m_tabl_tabulate_color {#1}\global\c_tabl_tabulate_colorspan\plusthree}
-\setvalue{\??tabulatecolorspec T}#1{\xdef\m_tabl_tabulate_text_color{#1}}
-
-\def\tabl_tabulate_set_color_span#1#2%
- {\csname\??tabulatecolorspec#1\endcsname{#2}%
- \tabl_tabulate_set_preamble}
-
-\def\tabl_tabulate_set_vrule_command#1%
- {\doifelsenumber{#1}
- {\global\d_tabl_tabulate_vrulethickness#1\d_tabl_tabulate_vrulethickness_default}
- {\xdef\m_tabl_tabulate_vrule_color{#1}}}
-
-\def\tabl_tabulate_set_entry#1#2% rulespec template
- {\c_tabl_tabulate_align\v_tabl_tabulate_align
- \c_tabl_tabulate_modus\zerocount
- \setfalse\c_tabl_tabulate_pwidth_set
- \setfalse\c_tabl_tabulate_reshape
- \t_tabl_tabulate_before\emptytoks
- \t_tabl_tabulate_after\emptytoks
- \t_tabl_tabulate_bmath\emptytoks
- \t_tabl_tabulate_emath\emptytoks
- \t_tabl_tabulate_font\emptytoks
- \t_tabl_tabulate_settings\emptytoks
- \glet\m_tabl_tabulate_alignment\empty
- \glet\m_tabl_tabulate_color\empty
- \glet\m_tabl_tabulate_text_color\empty
- \glet\m_tabl_tabulate_vrule_color\empty
- \global\c_tabl_tabulate_colorspan\zerocount
- \global\setfalse\c_tabl_auto_align_mode
- \global\advance\c_tabl_tabulate_columns\plusone
- \expandafter\let\csname\??tabulatesetup\the\c_tabl_tabulate_columns\endcsname\donothing % here ?
- \edef\currenttabulationtrulespec{#1}%
- \ifx\currenttabulationtrulespec\empty
- \global\d_tabl_tabulate_vrulethickness\zeropoint
- \else
- \global\d_tabl_tabulate_vrulethickness\d_tabl_tabulate_vrulethickness_default
- \rawprocesscommalist[#1]\tabl_tabulate_set_vrule_command
- \fi
- \tabl_tabulate_set_preamble#2\relax\relax % permits i without n
- \ifcase\c_tabl_tabulate_modus\relax
- \tabl_tabulate_set_width_normal
- \or % fixed width
- \tabl_tabulate_set_width_fixed
- \or % auto width
- \tabl_tabulate_set_width_auto
- \or % simple
- \tabl_tabulate_set_width_simple
- \fi}
-
-\def\tabl_tabulate_set_last_entry#1% rulespec
- {\glet\m_tabl_tabulate_color\empty
- \glet\m_tabl_tabulate_vrule_color\empty
- \edef\currenttabulationtrulespec{#1}%
- \ifx\currenttabulationtrulespec\empty
- \global\d_tabl_tabulate_vrulethickness\zeropoint
- \else
- \global\d_tabl_tabulate_vrulethickness\d_tabl_tabulate_vrulethickness_default
- \rawprocesscommalist[#1]\tabl_tabulate_set_vrule_command
- \fi
- \etoksapp\t_tabl_tabulate_preamble{%
- \tabl_tabulate_check_local_vrule_thickness\constantdimenargument\d_tabl_tabulate_vrulethickness
- \tabl_tabulate_check_local_vrule_color\constantemptyargument\m_tabl_tabulate_vrule_color
- \tabl_tabulate_column_vrule_inject}}
-
-\let\settabulateentry \tabl_tabulate_set_entry % used at the lua end
-\let\settabulatelastentry\tabl_tabulate_set_last_entry % used at the lua end
-
-\def\tabl_tabulate_normalize_splitline
- {\ifcase\c_tabl_tabulate_splitlinemode
- % nothing
- \or
- \ht\b_tabl_tabulate\strutht
- \dp\b_tabl_tabulate\strutdp
- \or
- \ifdim\ht\b_tabl_tabulate<\strutht
- \ht\b_tabl_tabulate\strutht
- \fi
- \ifdim\dp\b_tabl_tabulate<\strutdp
- \dp\b_tabl_tabulate\strutdp
- \fi
- \fi}
-
-\def\tabl_tabulate_whitespace
- {\ifdim\d_tabl_tabulate_splitoff_betweenskip>\zeropoint
- \vskip\d_tabl_tabulate_splitoff_betweenskip
- \global\d_tabl_tabulate_splitoff_betweenskip\zeropoint
- \fi}
-
-\def\tabl_tabulate_check_whitespace
- {\setbox\scratchbox\vpack
- {\splitdiscards
- \unskip
- \ifdim\lastskip>\d_tabl_tabulate_splitoff_betweenskip
- \global\d_tabl_tabulate_splitoff_betweenskip\lastskip
- \fi}}
-
-\installtexdirective
- {tabulate.linenumbers}
- {\def\tabl_tabulate_check_linenumbers{\page_postprocessors_linenumbers_deepbox\b_tabl_tabulate}}
- {\let\tabl_tabulate_check_linenumbers\relax}
-
-\let\tabl_tabulate_check_linenumbers\relax
-
-\def\tabl_tabulate_splitoff_box
- {\dontcomplain
- \global\setbox\b_tabl_tabulate\vsplit\b_tabl_tabulate_current\c_tabl_tabulate_column to \lineheight % % % global ? % % %
- \setbox\b_tabl_tabulate\vbox
- {\unvbox\b_tabl_tabulate}%
- \ifconditional\c_tabl_tabulate_splitoff_whitespace
- \tabl_tabulate_check_whitespace
- \fi
- \tabl_tabulate_color_repeat % needs to end up in a cell
- \setbox\b_tabl_tabulate\hpack to \wd\b_tabl_tabulate
- {\hss\tabl_tabulate_hook_yes{\box\b_tabl_tabulate}\hss}%
- \tabl_tabulate_normalize_splitline
- \tabl_tabulate_check_linenumbers
- \box\b_tabl_tabulate}
-
-\unexpanded\def\tabl_tabulate_hook_nop
- {}
-
-\let\tabl_tabulate_hook\tabl_tabulate_hook_nop
-
-\def\tabl_tabulate_hook_yes{\begincsname\??tabulatehook\the\c_tabl_tabulate_column\endcsname}
-
-\def\tabl_tabulate_pheight_reset
- {\global\c_tabl_tabulate_plines_min\plusone
- \ifdim\d_tabl_tabulate_height_p_max>\zeropoint
- \getnoflines\d_tabl_tabulate_height_p_max
- \global\c_tabl_tabulate_plines_max\noflines
- \else
- \global\c_tabl_tabulate_plines_max\zerocount
- \fi
- \global\d_tabl_tabulate_height_p_max\zeropoint}
-
-\def\tabl_tabulate_pheight_set
- {\scratchdimen\ht\b_tabl_tabulate_current\c_tabl_tabulate_column\relax
- \ifdim\scratchdimen>\d_tabl_tabulate_height_p_max
- \global\d_tabl_tabulate_height_p_max\scratchdimen
- \fi}
-
-\def\tabl_tabulate_pbreak_inject
- {\ifconditional\c_tabl_tabulate_handlepbreak
- \ifconditional\c_tabl_tabulate_nopbreak
- \tabl_tabulate_nobreak_inject
- \orelse\ifnum\c_tabl_tabulate_plines_max>\plusone
- \ifnum\c_tabl_tabulate_plines_min=\plusone
- \tabl_tabulate_nobreak_inject
- \fi
- \global\advance\c_tabl_tabulate_plines_min\plusone
- \ifnum\c_tabl_tabulate_plines_min=\c_tabl_tabulate_plines_max\relax
- \tabl_tabulate_nobreak_inject
- \fi
- \fi
- \fi}
-
-\def\tabl_tabulate_pbreak_check
- {\starttabulatenoalign
- \tabl_tabulate_pbreak_inject
- \ifconditional\c_tabl_tabulate_splitoff_whitespace
- \tabl_tabulate_whitespace
- \fi
- \stoptabulatenoalign}
-
-%D \startbuffer
-%D \starttabulate[|c|p|p|]
-%D \NC \bf Alpha \NC \bf Beta \NC \bf Gamma \NC\NR
-%D \NC 1 \NC right indeed \NC definitely wrong \NC\NR
-%D \NC 2 \NC \thinrules[n=3] \NC \thinrules[n=3] \NC\NR
-%D \NC 3 \NC oh yes \NC simply no \NC\NR
-%D \NC 4 \NC very true \NC as false as can be \NC\NR
-%D \NC 5 \NC \thinrules[n=5] \NC \thinrules[n=5] \NC\NR
-%D \NC 6 \NC \thinrules[n=3] \NC \thinrules[n=4] \NC\NR
-%D \stoptabulate
-%D \stopbuffer
-%D
-%D \typebuffer {\tracetabulatetrue\getbuffer}
-%D
-%D \startbuffer
-%D \starttabulate[|c|p|p|]
-%D \NC \bf Alpha \NC \bf Beta \NC \bf Gamma \NC\NR
-%D \NC 1 \NC right indeed \NC definitely wrong \NC\NR
-%D \NC 2 \NC oh yes \NC simply no \NC\NR
-%D \NC 3 \NC very true \NC as false as can be \NC\NR
-%D \NC 4 \NC the whole truth \NC but the truth \NC\NR
-%D \stoptabulate
-%D \stopbuffer
-%D
-%D \typebuffer {\tracetabulatetrue\getbuffer}
-
-%D Because we want to be compatible we use an indirect way to implement the
-%D definers. The next examples demonstrate the difference:
-%D
-%D \starttyping
-%D \definetabulate[test][|l|c|r|]
-%D \definetabulate[test][two][|r|c|l|]
-%D
-%D \definetabulation[more][format={|l|c|r|}]
-%D \definetabulation[more:two][format={|r|c|l|}]
-%D
-%D \starttest
-%D \NC t \NC t \NC t \NC \NR
-%D \NC te \NC te \NC te \NC \NR
-%D \NC tes \NC tes \NC tes \NC \NR
-%D \NC test \NC test \NC test \NC \NR
-%D \stoptest
-%D
-%D \starttest[two]
-%D \NC t \NC t \NC t \NC \NR
-%D \NC te \NC te \NC te \NC \NR
-%D \NC tes \NC tes \NC tes \NC \NR
-%D \NC test \NC test \NC test \NC \NR
-%D \stoptest
-%D \startmore
-%D \NC t \NC t \NC t \NC \NR
-%D \NC te \NC te \NC te \NC \NR
-%D \NC tes \NC tes \NC tes \NC \NR
-%D \NC test \NC test \NC test \NC \NR
-%D \stopmore
-%D
-%D \startmore[two]
-%D \NC t \NC t \NC t \NC \NR
-%D \NC te \NC te \NC te \NC \NR
-%D \NC tes \NC tes \NC tes \NC \NR
-%D \NC test \NC test \NC test \NC \NR
-%D \stopmore
-%D \stoptyping
-
-\installcorenamespace {tabulation}
-
-\installcommandhandler \??tabulation {tabulation} \??tabulation
-
-\setuptabulation
- [\c!unit=1em,
- EQ={:},
- \c!format={|l|p|},
- \c!frame=\v!off,
- %\c!bodyfont=,
- \c!rule=\v!normal,
- %\c!rulecolor=,
- \c!rulethickness=\linewidth,
- %\c!inner=,
- \c!before=\blank,
- \c!after=\blank,
- \c!distance={\v!depth,\v!medium},
- \c!align=\v!normal,
- \c!margin=\!!zeropoint,
- \c!split=\v!auto,
- \c!header=\v!yes,
- %\c!title=,
- \c!indenting=\v!no]
-
-\unexpanded\def\definetabulate
- {\dotripleempty\tabl_tabulate_define}
-
-\def\tabl_tabulate_define[#1][#2][#3]%
- {\ifthirdargument
- % [tag] [sub] [template]
- \ifcsname\namedtabulationhash{#1}\s!check\endcsname \else
- \definetabulation[#1][\c!format={#3},\s!check=]%
- \fi
- \definetabulation[#1:#2][#1][\c!format={#3},\s!check=]%
- \orelse\ifsecondargument
- % [tag] [template]
- \definetabulation[#1][\c!format={#2},\s!check=]%
- \else
- % [tag]
- \definetabulation[#1][\c!format={|l|p|},\s!check=]%
- \fi}
-
-\unexpanded\def\setuptabulate
- {\dotripleempty\tabl_tabulate_setup}
-
-\def\tabl_tabulate_setup[#1][#2][#3]%
- {\ifthirdargument
- % [tag] [sub] [settings]
- \setuptabulation[#1:#2][#3]%
- \orelse\ifsecondargument
- % [tag] [settings]
- \setuptabulation[#1][#2]%
- \else
- % [tag]
- \setuptabulation[#1]%
- \fi}
-
-\appendtoks
- \setuevalue{\e!start\currenttabulation}{\tabl_start_defined[\currenttabulation]}%
- \letvalue{\e!stop\currenttabulation}\relax
- \letvalue{\??tabulatehead\currenttabulation}\empty
- \letvalue{\??tabulatefoot\currenttabulation}\empty
-\to \everydefinetabulation
-
-\let\tabulateparameter\tabulationparameter % will stay for a while
-\def\currenttabulate {\currenttabulation} % will stay for a while
-
-% Here begins the implementation.
-
-\let\tabl_tabulate_insert_head\empty
-\let\tabl_tabulate_insert_body\empty
-\let\tabl_tabulate_insert_foot\empty
-
-\def\tabl_tabulate_insert_head_content
- {\tabulatenoalign{\global\settrue\c_tabl_tabulate_someamble}%
- \begincsname\??tabulatehead\currenttabulation\endcsname
- \tabulatenoalign{\global\setfalse\c_tabl_tabulate_someamble}}%
-
-\def\tabl_tabulate_insert_foot_content
- {\tabulatenoalign{\global\settrue\c_tabl_tabulate_someamble}%
- \begincsname\??tabulatefoot\currenttabulation\endcsname
- \tabulatenoalign{\global\setfalse\c_tabl_tabulate_someamble}}%
-
-\def\tabl_tabulate_check_full_content % - needed, else confusion with \c!header
- {\ifcsname\??tabulatehead\currenttabulation\endcsname
- %\expandafter\ifx\csname\??tabulatehead\currenttabulation\endcsname\empty
- \expandafter\ifx\lastnamedcs\empty
- \let\tabl_tabulate_insert_head\empty
- \else
- \let\tabl_tabulate_insert_head\tabl_tabulate_insert_head_content
- \fi
- \else
- \let\tabl_tabulate_insert_head\empty
- \fi
- \ifcsname\??tabulatefoot\currenttabulation\endcsname
- \expandafter\ifx\csname\??tabulatefoot\currenttabulation\endcsname\empty
- %\expandafter\ifx\lastnamedcs\empty
- \let\tabl_tabulate_insert_foot\empty
- \else
- \let\tabl_tabulate_insert_foot\tabl_tabulate_insert_foot_content
- \fi
- \else
- \let\tabl_tabulate_insert_foot\empty
- \fi}
-
-\def\tabl_tabulate_insert_content
- {\tabl_tabulate_insert_head
- \ifcase\c_tabl_tabulate_repeathead \else
- \tabulatenoalign{\penalty\zerocount}% added 7/5/2014 WS mail
- \fi
- \tabl_tabulate_insert_body
- \tabl_tabulate_insert_foot
- \tabl_tabulate_remove_funny_line}
-
-\def\tabl_tabulate_remove_funny_line
- {\ifhmode
- \strut\crcr
- \tabulatenoalign{\kern-\lineheight}%
- \fi}
-
-% todo: make footer synonym to tail
-
-\setuvalue{\e!start\v!tabulatehead}{\doifelsenextoptionalcs\tabl_tabulate_start_head_yes\tabl_tabulate_start_head_nop}
-\setuvalue{\e!start\v!tabulatetail}{\doifelsenextoptionalcs\tabl_tabulate_start_foot_yes\tabl_tabulate_start_foot_nop}
-
-\let\m_tabl_tabulate_data\empty
-
-\def\tabl_tabulate_start_head_yes[#1]%
- {\processcontent{\e!stop\v!tabulatehead}\m_tabl_tabulate_data{\letvalue{\??tabulatehead#1}\m_tabl_tabulate_data}}
-
-\def\tabl_tabulate_start_foot_yes[#1]%
- {\processcontent{\e!stop\v!tabulatetail}\m_tabl_tabulate_data{\letvalue{\??tabulatefoot#1}\m_tabl_tabulate_data}}
-
-\def\tabl_tabulate_start_head_nop{\tabl_tabulate_start_head_yes[\v!tabulate]}
-\def\tabl_tabulate_start_foot_nop{\tabl_tabulate_start_foot_yes[\v!tabulate]}
-
-\unexpanded\def\tabl_start_defined[#1]%
- {\bgroup
- \edef\currenttabulationparent{#1}%
- \let\currenttabulation\currenttabulationparent
- \edef\p_format{\tabulationparameter\c!format}%
- \ifx\p_format\v!none
- % this is special case: we need to define the generic english
- % \starttabulate in other interfaces as well
- \expandafter\dodoubleempty \expandafter\tabl_start_regular
- \else
- \expandafter\dodoubleargument\expandafter\tabl_start_defined_indeed
- \fi}
-
-\def\tabl_start_defined_indeed
- {\iffirstargument
- \ifsecondargument
- \doubleexpandafter\tabl_start_defined_two
- \else
- \doubleexpandafter\tabl_start_defined_one
- \fi
- \else
- \singleexpandafter\tabl_start_defined_zero
- \fi}
-
-\def\tabl_start_defined_one[#1][#2]%
- {\ifcondition\validassignment{#1}%
- \setuptabulation[\currenttabulation][#1]%
- \else
- \edef\currenttabulation{\currenttabulation:#1}%
- \fi
- \tabl_tabulate_start_building}
-
-\def\tabl_start_defined_two[#1][#2]%
- {\edef\currenttabulation{\currenttabulation:#1}%
- \setuptabulation[\currenttabulation][#2]%
- \tabl_tabulate_start_building}
-
-\def\tabl_start_defined_zero[#1][#2]%
- {\tabl_tabulate_start_building}
-
-% \definetabulate[\v!tabulate][|l|p|] % we need to get rid of this one
-
-\unexpanded\setuvalue{\e!start\v!tabulate}%
- {\bgroup % whole thing
- \let\currenttabulationparent\empty
- \dodoubleempty\tabl_start_regular}
-
-\def\tabl_start_regular
- {\let\currenttabulation\currenttabulationparent
- \ifsecondargument
- \expandafter\tabl_start_regular_two
- \else
- \expandafter\tabl_start_regular_one
- \fi}
-
-\def\tabl_default_format{|l|p|}
-
-\def\tabl_start_regular_one[#1][#2]%
- {\ifcondition\validassignment{#1}%
- \lettabulationparameter\c!format\tabl_default_format
- \setupcurrenttabulation[#1]%
- \else
- \def\p_format{#1}%
- \ifx\p_format\empty
- \def\p_format{|l|p|}%
- \fi
- \lettabulationparameter\c!format\p_format
- \fi
- \tabl_tabulate_start_building}
-
-\def\tabl_start_regular_two[#1][#2]%
- {\def\p_format{#1}%
- \ifx\p_format\empty
- \let\p_format\tabl_default_format
- \fi
- \lettabulationparameter\c!format\p_format
- \setupcurrenttabulation[#2]%
- \tabl_tabulate_start_building}
-
-\letvalue{\e!stop\v!tabulate }\relax
-\letvalue{\e!stop\v!tabulatehead}\relax
-\letvalue{\e!stop\v!tabulatetail}\relax
-
-\unexpanded\def\tabl_tabulate_start_ignore
- {\em Nested tabulate is not (yet) supported.\relax
- \expandafter\gobbleuntil\csname\ifconditional\c_tabl_generic stoptabulate\else\e!stop\v!tabulate\fi\endcsname}
-
-\appendtoks
- \letvalue{\e!start\v!tabulate}\tabl_tabulate_start_ignore % only the main one
-\to \everytabulate
-
-\setvalue{\??tabulatesplit\v!yes }{\settrue\c_tabl_tabulate_split}
-\setvalue{\??tabulatesplit\v!repeat}{\settrue\c_tabl_tabulate_split}
-\setvalue{\??tabulatesplit\v!no }{\setfalse\c_tabl_tabulate_split}
-\setvalue{\??tabulatesplit\v!auto }{\ifinsidefloat\ifinsidesplitfloat\else\setfalse\c_tabl_tabulate_split\fi\fi}
-
-% todo: spacing around tabulate when bodyfont is set
-
-% \let\tabl_tabulate_inside_before \relax
-% \let\tabl_tabulate_inside_after \relax
-% \let\tabl_tabulate_inside_inbetween\relax
-%
-% \def\tabl_tabulate_outside_before
-% {\whitespace
-% \tabulationparameter\c!before}
-%
-% \def\tabl_tabulate_outside_after
-% {\tabulationparameter\c!after}
-
-% \showboxes
-%
-% \startcombination
-% {\insidefloattrue \starttabulate[|||] \NC test \NC test \NC \NR \stoptabulate} {}
-% {\insidefloattrue \starttabulate[|||] \NC test \NC test \NC \NR \stoptabulate} {}
-% \stopcombination
-%
-% \startcombination
-% {\vbox{\starttabulate[|||] \NC test \NC test \NC \NR \stoptabulate}} {}
-% {\vbox{\starttabulate[|||] \NC test \NC test \NC \NR \stoptabulate}} {}
-% \stopcombination
-%
-% \startcombination
-% {\starttabulate[|||] \NC test \NC test \NC \NR \stoptabulate} {}
-% {\starttabulate[|||] \NC test \NC test \NC \NR \stoptabulate} {}
-% \stopcombination
-
-\let\tabl_tabulate_inside_after \relax
-\let\tabl_tabulate_outside_after \relax
-\let\tabl_tabulate_inside_inbetween \relax
-\let\tabl_tabulate_outside_inbetween\relax
-
-\unexpanded\def\tabl_tabulate_inside_before
- {\ifhmode\par\fi
- \ifhmode
- \ifinsidesplitfloat
- \let\tabl_tabulate_inside_after\relax
- \else
- \vbox\bgroup
- \let\tabl_tabulate_inside_after\egroup
- \fi
- \else
- \let\tabl_tabulate_inside_after\relax
- \fi}
-
-\unexpanded\def\tabl_tabulate_outside_before
- {\ifhmode\par\fi
- \ifhmode
- \vbox\bgroup
- \let\tabl_tabulate_outside_after \egroup
- \let\tabl_tabulate_outside_inbetween\relax
- \orelse\ifinner
- \let\tabl_tabulate_outside_after \relax
- \let\tabl_tabulate_outside_inbetween\relax
- \else
- \whitespace
- \tabulationparameter\c!before
- \relax
- \let\tabl_tabulate_outside_after \tabl_tabulate_outside_after_indeed
- \let\tabl_tabulate_outside_inbetween\tabl_tabulate_outside_inbetween_indeed
- \fi}
-
-\def\tabl_tabulate_outside_after_indeed
- {\tabulationparameter\c!after}
-
-\def\tabl_tabulate_outside_inbetween_indeed
- {\doifempty{\tabulationparameter\c!after}
- {\vskip\strutdp
- \verticalstrut
- \vskip-\struttotal}}
-
-\def\tabl_tabulate_inside_inbetween % needs checking
- {\doifempty{\tabulationparameter\c!after}
- {\vskip\strutdp
- \verticalstrut
- \vskip-\struttotal}}
-
-\unexpanded\def\tabl_tabulate_start_building
- {\ifinsidefloat
- \tabl_tabulate_inside_before
- \else
- \tabl_tabulate_outside_before
- \fi
- \bgroup % settings
- %
- \t_tabl_tabulate_preamble\emptytoks
- \t_tabl_tabulate_dummy \emptytoks
- %
- \resetcharacteralign
- %
- \edef\p_distance {\tabulationparameter\c!distance}%
- \edef\p_align {\tabulationparameter\c!align}%
- \edef\p_line {\tabulationparameter\c!rule}%
- \edef\p_rulecolor {\tabulationparameter\c!rulecolor}%
- \edef\p_rulethickness{\tabulationparameter\c!rulethickness}%
- \edef\p_bodyfont {\tabulationparameter\c!bodyfont}
- \edef\p_indenting {\tabulationparameter\c!indenting}%
- \edef\p_keeptogether {\tabulationparameter\c!keeptogether}%
- \edef\p_blank {\tabulationparameter\c!blank}%
- %
- \ifx\p_keeptogether\v!no
- \settrue \c_tabl_tabulate_tolerant_break
- %\setfalse\c_tabl_tabulate_handlepbreak
- \else
- \setfalse\c_tabl_tabulate_tolerant_break
- %\settrue \c_tabl_tabulate_handlepbreak
- \fi
- %
- \settrue\c_tabl_tabulate_split
- \begincsname\??tabulatesplit\tabulationparameter\c!split\endcsname
- %
- \let\m_tabl_tabulate_blank_default\p_blank
- %
- \d_tabl_tabulate_unit\tabulationparameter\c!unit
- \d_tabl_tabulate_margin\tabulationparameter\c!margin
- \let\m_tabl_tabulate_vrule_color_default\p_rulecolor
- \let\m_tabl_tabulate_hrule_color_default\p_rulecolor
- \d_tabl_tabulate_vrulethickness_default\p_rulethickness
- \d_tabl_tabulate_hrulethickness_default\p_rulethickness
- \ifx\p_bodyfont\empty\else
- \switchtobodyfont[\p_bodyfont]%
- \fi
- \postponenotes % new, to be tested / will be configurable
- \widowpenalty\zerocount % otherwise lines are not broken
- \clubpenalty \zerocount % but overlap in funny ways
- \the\everytabulate
- \tabulationparameter\c!inner
- \d_tabl_tabulate_indent\dimexpr\leftskip+\hangindent\ifx\p_indenting\v!yes+\parindent\fi\relax
- \global\c_tabl_tabulate_column\zerocount
- \processcontent
- {\ifconditional\c_tabl_generic stoptabulate\else\e!stop\ifx\currenttabulationparent\empty\v!tabulate\else\currenttabulationparent\fi\fi}
- \tabl_tabulate_insert_body
- \tabl_tabulate_process}
-
-\def\tabulateEQ
- {\ifconditional\c_tabl_tabulate_firstflushed\else
- \dostarttaggedchained\t!ignore\empty\empty
- \dostarttagged\t!ignore\empty
- \tabulationparameter{EQ}%
- \dostoptagged
- \dostoptagged
- \fi
- \global\setfalse\c_tabl_tabulate_equal}
-
-% The next ones will be token registers
-
-\let\tabulatenormalpos\relax % hooks, todo
-\let\tabulateequalpos \relax % hooks, todo
-
-% color columns
-
-\let\m_tabl_tabulate_color_previous \empty
-\let\m_tabl_tabulate_color \empty
-\let\m_tabl_tabulate_text_color \empty
-\let\m_tabl_tabulate_color_local \empty
-\let\m_tabl_tabulate_vrule_color \empty
-\let\m_tabl_tabulate_vrule_color_local \empty
-\let\m_tabl_tabulate_vrule_color_default\empty % used local
-\let\m_tabl_tabulate_hrule_color_default\empty % used local
-\let\m_tabl_tabulate_blank_default \empty
-
-\appendtoks
- \glet\m_tabl_tabulate_color_previous \empty
- \glet\m_tabl_tabulate_color \empty
- \glet\m_tabl_tabulate_text_color \empty
- \glet\m_tabl_tabulate_color_local \empty
- \glet\m_tabl_tabulate_vrule_color \empty
- \glet\m_tabl_tabulate_vrule_color_local \empty
- \global \d_tabl_tabulate_vrulethickness_local\zeropoint
-\to \t_tabl_tabulate_every_row
-
-\unexpanded\def\tabl_tabulate_color_side_right_second
- {\ifx\m_tabl_tabulate_color_previous\empty \else
- \tabl_tabulate_color_set\m_tabl_tabulate_color_previous
- \glet\m_tabl_tabulate_color_previous\empty
- \fi}
-
-\unexpanded\def\tabl_tabulate_color_side_left_second
- {\ifx\m_tabl_tabulate_color\empty \else
- \ifcase\c_tabl_tabulate_colorspan
- \or
- \tabl_tabulate_color_set\m_tabl_tabulate_color
- \or
- \tabl_tabulate_color_set\m_tabl_tabulate_color
- \fi
- \fi}
-
-\unexpanded\def\tabl_tabulate_color_side_both_second
- {\ifx\m_tabl_tabulate_color\empty \else
- \tabl_tabulate_color_set\m_tabl_tabulate_color
- \ifcase\c_tabl_tabulate_colorspan
- %\glet\m_tabl_tabulate_color_previous\empty
- \or
- \glet\m_tabl_tabulate_color_previous\empty
- \or
- \glet\m_tabl_tabulate_color_previous\m_tabl_tabulate_color
- \or
- \glet\m_tabl_tabulate_color_previous\m_tabl_tabulate_color
- \fi
- \fi}
-
-\let\tabl_tabulate_color_side_right \relax
-\let\tabl_tabulate_color_side_left \relax
-\let\tabl_tabulate_color_side_both \relax
-
-\appendtoks
- \let\tabl_tabulate_color_side_right\tabl_tabulate_color_side_right_second
- \let\tabl_tabulate_color_side_left \tabl_tabulate_color_side_left_second
- \let\tabl_tabulate_color_side_both \tabl_tabulate_color_side_both_second
-\to \t_tabl_tabulate_initializers_second
-
-\def\tabl_tabulate_set_color_column#1% overloaded
- {\unskip
- \doifelsefastoptionalcheck{\tabl_tabulate_set_color_column_yes#1}{\tabl_tabulate_set_color_column_nop#1}}
-
-\def\tabl_tabulate_set_color_column_nop
- {\tabl_tabulate_column_normal\zerocount}
-
-\def\tabl_tabulate_set_color_column_yes#1[#2]%
- {\xdef\m_tabl_tabulate_color_local{#2}%
- \tabl_tabulate_column_normal\zerocount#1}
-
-% normal columns:
-
-\def\tabl_tabulate_column_normal#1#2%
- {\unskip
- \aligntab
- \ifconditional\c_tabl_tabulate_equal\tabulateequalpos\else\tabulatenormalpos\fi
- \ifnum\c_tabl_tabulate_column>\c_tabl_tabulate_max_vrulecolumn\else
- \tabl_tabulate_column_vrule_setup
- \fi
- \aligntab
- \global\c_tabl_tabulate_kind#1%
- \global\c_tabl_tabulate_type#2%
- \aligntab}
-
-% equal columns
-
-\def\tabl_tabulate_column_equal#1#2%
- {\unskip
- \aligntab
- \tabulateequalpos
- \aligntab
- \global\c_tabl_tabulate_kind#1%
- \global\c_tabl_tabulate_type#2%
- \aligntab}
-
-% ruled columns
-
-\def\tabl_tabulate_column_vruled_preset
- {\glet\m_tabl_tabulate_vrule_color_local\m_tabl_tabulate_vrule_color_default
- \global\d_tabl_tabulate_vrulethickness_local\d_tabl_tabulate_vrulethickness_default}
-
-\def\tabl_tabulate_column_vruled#1#2%
- {\unskip % 0-n
- %\ifnum\c_tabl_tabulate_column=\plusone
- % \global\c_tabl_tabulate_has_rule_spec_first\plusone
- %\orelse\ifnum\c_tabl_tabulate_column=\c_tabl_tabulate_nofcolumns
- % \global\c_tabl_tabulate_has_rule_spec_last\plusone
- %\fi
- \ifnum\c_tabl_tabulate_column>\c_tabl_tabulate_max_vrulecolumn
- \global\c_tabl_tabulate_max_vrulecolumn\c_tabl_tabulate_column
- \fi
- \doifelsefastoptionalcheck{\tabl_tabulate_column_vruled_yes#1#2}{\tabl_tabulate_column_vruled_nop#1#2}}
-
-\def\tabl_tabulate_column_vrule_setup
- {\begincsname\??tabulatevrule\the\c_tabl_tabulate_column\endcsname}
-
-\def\tabl_tabulate_column_vruled_nop
- {\expandafter\glet\csname\??tabulatevrule\the\c_tabl_tabulate_column\endcsname\tabl_tabulate_column_vruled_preset
- \tabl_tabulate_column_normal}
-
-\def\tabl_tabulate_column_vruled_step#1%
- {\doifelsenumber{#1}
- {\global\d_tabl_tabulate_vrulethickness_local#1\d_tabl_tabulate_vrulethickness_default}
- {\xdef\m_tabl_tabulate_vrule_color_local{#1}}}
-
-\def\tabl_tabulate_column_vruled_yes#1#2[#3]%
- {\expandafter\gdef\csname\??tabulatevrule\the\c_tabl_tabulate_column\endcsname
- {\tabl_tabulate_column_vruled_preset
- \rawprocesscommalist[#3]\tabl_tabulate_column_vruled_step}%
- \tabl_tabulate_column_normal#1#2}
-
-\def\tabl_tabulate_vrule_reset
- {\ifcase\c_tabl_tabulate_max_vrulecolumn\else
- \tabl_tabulate_vrule_reset_indeed
- \fi}
-
-\def\tabl_tabulate_vrule_reset_indeed
- {\dofastloopcs\c_tabl_tabulate_max_vrulecolumn\tabl_tabulate_vrule_reset_step
- \global\c_tabl_tabulate_max_vrulecolumn\zerocount}
-
-\def\tabl_tabulate_vrule_reset_step % undefined or relax
- {\expandafter\glet\csname\??tabulatevrule\the\fastloopindex\endcsname\undefined}
-
-\appendtoks
- \tabl_tabulate_vrule_reset
-\to \t_tabl_tabulate_every_after_row
-
-% sometimes more efficient:
-%
-% \def\tabl_tabulate_column_vruled_yes#1#2[#3]%
-% {\rawprocesscommalist[#3]\tabl_tabulate_column_vruled_step
-% \expandafter\xdef\csname\??tabulatevrule\the\c_tabl_tabulate_column\endcsname
-% {\global\d_tabl_tabulate_vrulethickness_local\the\d_tabl_tabulate_vrulethickness_default
-% \noexpand\xdef\noexpand\m_tabl_tabulate_vrule_color_local{\m_tabl_tabulate_vrule_color_local}}%
-% \tabl_tabulate_column_normal#1#2}
-
-\def\tabl_tabulate_column_vruled_normal
- {\vrule\s!width\d_tabl_tabulate_vrulethickness\relax}
-
-\def\tabl_tabulate_column_vruled_colored
- {\dousecolorparameter\m_tabl_tabulate_vrule_color
- \vrule\s!width\d_tabl_tabulate_vrulethickness\relax}
-
-\unexpanded\def\tabl_tabulate_column_vrule_inject_first
- {\ifcase\d_tabl_tabulate_vrulethickness\else
- \tabl_tabulate_column_vruled_normal % could be a skip instead
- \fi
- \global\d_tabl_tabulate_vrulethickness\zeropoint} % nils second one
-
-\unexpanded\def\tabl_tabulate_column_vrule_inject_second
- {\ifcase\d_tabl_tabulate_vrulethickness\else
- \ifx\m_tabl_tabulate_vrule_color\empty
- \tabl_tabulate_column_vruled_normal
- \else
- \tabl_tabulate_column_vruled_colored
- \fi
- \fi
- \global\d_tabl_tabulate_vrulethickness\zeropoint} % nils second one
-
-\let\tabl_tabulate_column_vrule_inject\relax
-
-\appendtoks
- \let\tabl_tabulate_column_vrule_inject\tabl_tabulate_column_vrule_inject_first
-\to \t_tabl_tabulate_initializers_first
-
-\appendtoks
- \let\tabl_tabulate_column_vrule_inject\tabl_tabulate_column_vrule_inject_second
-\to \t_tabl_tabulate_initializers_second
-
-% auto columns
-
-\def\tabl_tabulate_column_inject_auto
- {\tabl_tabulate_column_normal\zerocount\zerocount
- \ifnum\c_tabl_tabulate_column>\c_tabl_tabulate_columns\relax
- \expandafter\NR
- \else
- \expandafter\ignorespaces % interferes with the more tricky hooks
- \fi}
-
-\unexpanded\def\setquicktabulate#1% see \startlegend \startgiven (for the moment still public)
- {\let#1\tabl_tabulate_column_inject_auto
- \let\\\tabl_tabulate_column_inject_auto} % brrr, will go
-
-\setvalue{\??tabulateseparator\v!blank }{\s_tabl_tabulate_separator\bigskipamount}
-\setvalue{\??tabulateseparator\v!depth }{\s_tabl_tabulate_separator\strutdp}
-\setvalue{\??tabulateseparator\v!small }{\def\m_tabl_tabulate_separator_factor{.25}}
-\setvalue{\??tabulateseparator\v!medium}{\def\m_tabl_tabulate_separator_factor{.5}}
-\setvalue{\??tabulateseparator\v!big }{}
-\setvalue{\??tabulateseparator\v!none }{\s_tabl_tabulate_separator\zeropoint\let\m_tabl_tabulate_separator_factor\zerocount}
-\setvalue{\??tabulateseparator\v!grid }{\s_tabl_tabulate_separator\zeropoint\let\m_tabl_tabulate_separator_factor\zerocount}
-
-\def\tabl_tabulate_column_rule_separator_step#1%
- {\ifcsname\??tabulateseparator#1\endcsname
- \lastnamedcs
- \else
- \s_tabl_tabulate_separator#1\relax
- \fi}
-
-\def\tabl_tabulate_column_rule_separator_inject % can be sped up (will do when used frequently)
- {\bgroup
- \s_tabl_tabulate_separator\strutdp
- \ifx\p_distance\empty\else
- \let\m_tabl_tabulate_separator_factor\plusone
- \processcommacommand[\p_distance]\tabl_tabulate_column_rule_separator_step
- \s_tabl_tabulate_separator\m_tabl_tabulate_separator_factor\s_tabl_tabulate_separator
- \fi
- % someamble: footer or header: unfortunately a skip can trigger a page break (weird
- % as we have lots of nobreaks)
- % \ifconditional\c_tabl_tabulate_someamble\kern\else\vskip\fi\s_tabl_tabulate_separator % new
- % \directvspacing{\the\s_tabl_tabulate_separator}% new
- \directvskip\s_tabl_tabulate_separator
- \egroup}
-
-\def\tabl_tabulate_hrule_spec_ignore#1%
- {%\glet\currenttabulationlocalhrulecolor\empty
- %\global\d_tabl_tabulate_hrulethickness_local\d_tabl_tabulate_hrulethickness_default
- \doifelsefastoptionalcheck#1#1}
-
-\def\tabl_tabulate_hrule_spec_pickup#1%
- {\glet\currenttabulationlocalhrulecolor\m_tabl_tabulate_hrule_color_default
- \global\d_tabl_tabulate_hrulethickness_local\d_tabl_tabulate_hrulethickness_default
- \doifelsefastoptionalcheck{\tabl_tabulate_hrule_preset#1}#1}
-
-\def\tabl_tabulate_hrule_preset_step#1%
- {\doifelsenumber{#1}
- {\global\d_tabl_tabulate_hrulethickness_local#1\d_tabl_tabulate_hrulethickness_default}
- {\xdef\currenttabulationlocalhrulecolor{#1}}}
-
-\def\tabl_tabulate_hrule_preset#1[#2]%
- {\rawprocesscommalist[#2]\tabl_tabulate_hrule_preset_step
- #1}
-
-\def\tabl_tabulate_hrule_inject_normal
- {\autorule
- \s!height.5\d_tabl_tabulate_hrulethickness_local
- \s!depth .5\d_tabl_tabulate_hrulethickness_local
- \s!left \d_tabl_tabulate_indent
- \relax}
-
-\def\tabl_tabulate_hrule_inject_colored
- {\dousecolorparameter\currenttabulationlocalhrulecolor
- \tabl_tabulate_hrule_inject_normal}
-
-\unexpanded\def\tabl_tabulate_hrule_inject_first
- {\ifcase\d_tabl_tabulate_hrulethickness_local\else
- \tabl_tabulate_hrule_inject_normal
- \fi}
-
-\unexpanded\def\tabl_tabulate_hrule_inject_second
- {\ifcase\d_tabl_tabulate_hrulethickness_local\else
- \ifx\currenttabulationlocalhrulecolor\empty
- \tabl_tabulate_hrule_inject_normal
- \else
- \tabl_tabulate_hrule_inject_colored
- \fi
- \fi}
-
-\let\tabl_tabulate_hrule_inject\relax
-
-\appendtoks
- \let\tabl_tabulate_hrule_inject\tabl_tabulate_hrule_inject_first
-\to \t_tabl_tabulate_initializers_first
-
-\appendtoks
- \let\tabl_tabulate_hrule_inject\tabl_tabulate_hrule_inject_second
-\to \t_tabl_tabulate_initializers_second
-
-%D Color:
-
-% \starttabulate[||p||]
-% \NC test \NC test \NC test \NC \NR
-% \NC test \CC[green] \input tufte \CC[yellow] test \NC \NR
-% \NC test \NC test \NC test \NC \NR
-% \NC test \NC test \NC test \NC \NR
-% \NC test \NC test \NC test \NC \NR
-% \NC test \NC test \NC test \NC \NR
-% \CC[blue] test \CC[red] test \NC test \NC \NR
-% \NC test \NC test \NC test \NC \NR
-% \NC test \NC test \NC test \NC \NR
-% \NC test \NC test \NC test \NC \NR
-% \NC test \NC test \CC[gray] test \NC \NR
-% \NC test \NC test \NC test \NC \NR
-% \NC test \NC test \NC test \NC \NR
-% \CC[blue] test \NC test \NC test \NC \NR
-% \NC test \NC test \NC test \NC \NR
-% \NC test \NC test \CC[magenta] test \NC \NR
-% \NC test \NC test \NC test \NC \NR
-% \NC test \CC[cyan] \dorecurse{10}{\input ward }\NC test \NC \NR
-% \NC test \NC test \NC test \NC \NR
-% \NC test \CC[yellow] test \NC test \NC \NR
-% \stoptabulate
-
-\unexpanded\def\tabl_tabulate_color_set#1% we could store the attributes at the cost of a lua call
- {\begingroup
- \clf_enablebackgroundalign % was \node_backgrounds_align_initialize
- \glet\tabl_tabulate_color_repeat\tabl_tabulate_color_repeat_second
- \global\settrue\c_tabl_tabulate_has_colors
- \ifnum\c_tabl_tabulate_column>\c_tabl_tabulate_max_colorcolumn
- \global\c_tabl_tabulate_max_colorcolumn\c_tabl_tabulate_column
- \fi
- \expandafter\xdef\csname\??tabulatecolor\the\c_tabl_tabulate_column\endcsname{#1}%
- \hpack \thealignbackgroundcolorattr{#1}{}% pack ?
- \endgroup}
-
-\def\tabl_tabulate_color_repeat_second % for split off lines
- {\begingroup
- \scratchcounter\numexpr\c_tabl_tabulate_column-\plusone\relax % ugly !
- \ifcsname\??tabulatecolor\the\scratchcounter\endcsname
- % \hbox \thealignbackgroundcolorattr{\csname\??tabulatecolor\the\scratchcounter\endcsname}{}% pack ?
- \hpack \expandafter\thealignbackgroundcolorattr\expandafter{\lastnamedcs}{}% pack ?
- \fi
- \endgroup}
-
-\let\tabl_tabulate_color_repeat\relax
-
-\appendtoks
- \let\tabl_tabulate_color_repeat\relax
-\to \everytabulate
-
-\def\tabl_tabulate_color_reset
- {\ifcase\c_tabl_tabulate_max_colorcolumn\else
- \tabl_tabulate_color_reset_indeed
- \fi}
-
-% \def\tabl_tabulate_color_reset_indeed
-% {\dorecurse\c_tabl_tabulate_max_colorcolumn{\letgvalue{\??tabulatecolor\recurselevel}\undefined}} % slow
-
-\def\tabl_tabulate_color_reset_indeed
- {\dofastloopcs\c_tabl_tabulate_max_colorcolumn\tabl_tabulate_color_reset_step}
-
-\def\tabl_tabulate_color_reset_step % undefined or empty?
- {\expandafter\glet\csname\??tabulatecolor\number\fastloopindex\endcsname\undefined}
-
-\appendtoks
- \tabl_tabulate_color_reset
-\to \t_tabl_tabulate_every_after_row
-
-% \def\tabl_tabulate_register_par_options_indeed
-% {\iftrialtypesetting \else
-% \registerparoptions
-% \ifinsidefloat
-% % that is, an unbreakable one
-% \glet\tabl_tabulate_register_par_options\empty
-% \else
-% % unsafe in crossing pages, at each b...
-% % \glet\tabl_tabulate_register_par_options\empty
-% \fi
-% \fi}
-%
-% \appendtoks
-% \glet\tabl_tabulate_register_par_options\tabl_tabulate_register_par_options_indeed
-% \to \everytabulate
-
-\def\tabl_tabulate_register_par_options_first % maybe track here if needed
- {}
-
-\def\tabl_tabulate_register_par_options_second
- {\registerparoptions
- \ifinsidefloat
- % that is, an unbreakable one
- \glet\tabl_tabulate_register_par_options\empty
- \else
- % unsafe in crossing pages, at each b...
- % \glet\tabl_tabulate_register_par_options\empty
- \fi}
-
-\let\tabl_tabulate_register_par_options\relax
-
-\appendtoks
- \let\tabl_tabulate_register_par_options\tabl_tabulate_register_par_options_first
-\to \t_tabl_tabulate_initializers_first
-
-\appendtoks
- \let\tabl_tabulate_register_par_options\tabl_tabulate_register_par_options_second
-\to \t_tabl_tabulate_initializers_second
-
-\appendtoks
- \tabl_tabulate_register_par_options
-\to \t_tabl_tabulate_every_row
-
-\def\tabl_tabulate_flush_indent_indeed
- {\hbox to \d_tabl_tabulate_indent % pack ?
- {% we now have a local hsize, and since we want to
- % register positional info (i.e. real hsizes) we
- % need to reconstitute the original hsize
- \advance\hsize\d_tabl_tabulate_indent
- % this is indeed rather messy and took a few hours
- % to dis/uncover
- \the\t_tabl_tabulate_every_row
- \hss}}
-
-\def\tabl_tabulate_flush_indent
- {\ifnum\c_tabl_tabulate_column=\zerocount
- \tabl_tabulate_flush_indent_indeed
- \fi}
-
-\def\tabl_tabulate_digits{\digits}
-
-%D Beware, we cannot use \type {\unexpanded} on \type {\HL} cum suis, since \TEX's
-%D hard coded noalign lookahead fails on it! I mistakenly added this for a while.
-
-\setvalue{\??tabulatealigning\v!normal}{0}
-\setvalue{\??tabulatealigning\v!right }{1}
-\setvalue{\??tabulatealigning\v!left }{2}
-\setvalue{\??tabulatealigning\v!middle}{3}
-
-\setvalue{\??tabulateheader\v!repeat}{\plusone}
-\setvalue{\??tabulateheader\v!text }{\plustwo}
-
-\unexpanded\def\tabl_tabulate_bskip_first {\setbox\b_tabl_tabulate\vbox\bgroup\glet\tabl_tabulate_hook\tabl_tabulate_hook_nop}
-\unexpanded\def\tabl_tabulate_eskip_first {\par\egroup\glet\tabl_tabulate_hook\tabl_tabulate_hook_yes}
-\unexpanded\def\tabl_tabulate_xbskip_first{\hpack\bgroup\vbox\bgroup\glet\tabl_tabulate_hook\tabl_tabulate_hook_nop}
-\unexpanded\def\tabl_tabulate_xeskip_first{\par\egroup\egroup\glet\tabl_tabulate_hook\tabl_tabulate_hook_yes}
-
-\let\tabl_tabulate_bbskip\relax
-\let\tabl_tabulate_eeskip\relax
-\let\tabl_tabulate_bskip \relax
-\let\tabl_tabulate_eskip \relax
-\let\tabl_tabulate_xbskip\relax
-\let\tabl_tabulate_xeskip\relax
-
-\appendtoks
- \let\tabl_tabulate_bbskip\relax
- %\let\tabl_tabulate_eeskip\relax % adapted by bskip
- \let\tabl_tabulate_bskip \tabl_tabulate_bskip_first
- \let\tabl_tabulate_eskip \tabl_tabulate_eskip_first
- \let\tabl_tabulate_xbskip\tabl_tabulate_xbskip_first
- \let\tabl_tabulate_xeskip\tabl_tabulate_xeskip_first
-\to \t_tabl_tabulate_initializers_first
-
-\def\tabl_tabulate_baselinecorrection % keep an eye on this one
- {\def\dobaselinecorrection{\vskip\dimexpr-\prevdepth+\strutdp+\strutdp\relax}% todo: mkiv
- \baselinecorrection}
-
-% some hack to prevent an allowbreak ... actually we could set up a system then
-% that is dealt with atthe lua end in the skip handler: turn penalties with attributes
-% values into other penalties that get removed
-
-\installcorenamespace{tabulatenobreak}
-
-\def\tabl_tabulate_break_allow{\directvpenalty\zerocount}
-\def\tabl_tabulate_break_maybe{\directvpenalty\zerocount}
-\def\tabl_tabulate_break_no {\directvpenalty\plustenthousand} % ,order:2}}
-
-\let\tabl_tabulate_break_state_set \relax
-\let\tabl_tabulate_break_state_reset \relax
-\let\tabl_tabulate_break_state_allowbreak\tabl_tabulate_break_maybe
-
-% so far
-
-\unexpanded\def\tabl_tabulate_VL_first{\tabl_tabulate_column_vruled\zerocount\zerocount}
-\unexpanded\def\tabl_tabulate_NC_first{\tabl_tabulate_column_normal\zerocount\zerocount}
-\unexpanded\def\tabl_tabulate_RC_first{\tabl_tabulate_column_normal\zerocount\plusone}
-\unexpanded\def\tabl_tabulate_HC_first{\tabl_tabulate_column_normal\zerocount\plustwo}
-\unexpanded\def\tabl_tabulate_EQ_first{\tabl_tabulate_column_equal \plustwo \zerocount}
-\unexpanded\def\tabl_tabulate_RQ_first{\tabl_tabulate_column_equal \zerocount\plusone}
-\unexpanded\def\tabl_tabulate_HQ_first{\tabl_tabulate_column_equal \zerocount\plustwo}
-
-\unexpanded\def\tabl_tabulate_NG_first{\tabl_tabulate_column_normal\zerocount\zerocount}
-\unexpanded\def\tabl_tabulate_NN_first{\tabl_tabulate_column_normal\zerocount\zerocount\tabl_tabulate_digits} % new, undocumented, test first
-\unexpanded\def\tabl_tabulate_ND_first{\tabl_tabulate_column_normal\zerocount\zerocount\tabl_tabulate_digits} % same, for old times sake
-
-\unexpanded\def\tabl_tabulate_NR_first {\tabl_tabulate_NR_common\conditionaltrue \tabl_tabulate_check_penalties} % next row
-\unexpanded\def\tabl_tabulate_NB_first {\tabl_tabulate_NR_common\conditionaltrue \tabl_tabulate_nobreak_inject } % next row no break
-
-\unexpanded\def\tabl_tabulate_NR_second{\tabl_tabulate_NR_common\conditionalfalse\tabl_tabulate_check_penalties} % next row
-\unexpanded\def\tabl_tabulate_NB_second{\tabl_tabulate_NR_common\conditionalfalse\tabl_tabulate_nobreak_inject } % next row no break
-
-\unexpanded\def\tabl_tabulate_CC_first{\global\c_tabl_tabulate_localcolorspan\zerocount\tabl_tabulate_set_color_column\zerocount}
-\unexpanded\def\tabl_tabulate_CL_first{\global\c_tabl_tabulate_localcolorspan\plusone \tabl_tabulate_set_color_column\zerocount}
-\unexpanded\def\tabl_tabulate_CM_first{\global\c_tabl_tabulate_localcolorspan\plustwo \tabl_tabulate_set_color_column\zerocount}
-\unexpanded\def\tabl_tabulate_CR_first{\global\c_tabl_tabulate_localcolorspan\plusthree\tabl_tabulate_set_color_column\zerocount}
-
-%D Sort of special:
-%D
-%D \startbuffer
-%D \startitemize[n]
-%D \starttabulate[|||||]
-%D \NC p \NC \itemtag \NC q \NC r \NC \NR
-%D \NC p \NC \itemtag \NC q \NC r \NC \NR
-%D \NC p \NC \itemtag \NC q \NC r \NC \NR
-%D \NC p \NC \itemtag \NC q \NC r \NC \NR
-%D \stoptabulate
-%D \stopitemize
-%D
-%D \startitemize[n]
-%D \starttabulate[|||||]
-%D \NI b \NC c \NC d \NC \NR
-%D \NC a \NI c \NC d \NC \NR
-%D \NC a \NC b \NI d \NC \NR
-%D \NC a \NC b \NC c \NI \NR
-%D \stoptabulate
-%D \stopitemize
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-
-\unexpanded\def\tabl_tabulate_NI_first{\doifelsefastoptionalcheck\tabl_tbl_NI_yes\tabl_tbl_NI_nop}
-
-\def\tabl_tbl_NI_yes[#1]{\NC \itemtag[#1]\NC}
-\def\tabl_tbl_NI_nop {\NC \itemtag \NC}
-
-%D The following shortcut is handy for tables where one needs bold headers:
-
-\unexpanded\def\tabl_tabulate_BC_first
- {\tabl_tabulate_column_normal\plusone\zerocount
- \let\fontstyle\globalfontstyle
- \bf}
-
-\appendtoks
- \let\VL\tabl_tabulate_VL_first
- \let\NC\tabl_tabulate_NC_first
- \let\BC\tabl_tabulate_BC_first
- \let\RC\tabl_tabulate_RC_first
- \let\HC\tabl_tabulate_HC_first
- \let\EQ\tabl_tabulate_EQ_first
- \let\RQ\tabl_tabulate_RQ_first
- \let\HQ\tabl_tabulate_HQ_first
- \let\NG\tabl_tabulate_NG_first
- \let\NN\tabl_tabulate_NN_first
- \let\ND\tabl_tabulate_ND_first
- \let\NR\tabl_tabulate_NR_first
- \let\NB\tabl_tabulate_NB_first
- \let\CC\tabl_tabulate_CC_first
- \let\CL\tabl_tabulate_CL_first
- \let\CM\tabl_tabulate_CM_first
- \let\CR\tabl_tabulate_CR_first
- \let\NI\tabl_tabulate_NI_first
-\to \t_tabl_tabulate_initializers_first
-
-\appendtoks
- \let\NR\tabl_tabulate_NR_second
- \let\NB\tabl_tabulate_NB_second
-\to \t_tabl_tabulate_initializers_second
-
-\appendtoks
- \let\SR\NR
- \let\FR\NR
- \let\MR\NR
- \let\LR\NR
- \let\AR\NR
-\to \t_tabl_tabulate_initializers_first
-
-\unexpanded\def\tabl_tabulate_NR_common#1#2%
- {\global\advance\c_tabl_tabulate_noflines\plusone
- \global\setfalse\c_tabl_tabulate_firstflushed
- \global\setfalse\c_tabl_tabulate_equal
- \global\c_tabl_tabulate_column\zerocount
- \ifconditional#1\relax
- \tabl_tabulate_break_state_reset
- \fi
- \tabl_tabulate_pheight_reset
- \unskip\unskip\crcr\tabl_tabulate_flush_collected
- % can we omit the next one in the first run? probably
- \starttabulatenoalign
- \the\t_tabl_tabulate_every_after_row
- #2%
- \stoptabulatenoalign}
-
-\def\tabl_tabulate_check_penalties
- {\ifconditional\c_tabl_tabulate_tolerant_break\else
- \ifnum\c_tabl_tabulate_totalnoflines=\plusone
- % \tabl_tabulate_break_allow
- \else
- \ifconditional\c_tabl_tabulate_someamble \ifcase\c_tabl_tabulate_repeathead \else
- \tabl_tabulate_break_allow
- \fi \fi
- \ifnum\c_tabl_tabulate_noflines=\plusone
- \tabl_tabulate_nobreak_inject
- \orelse\ifnum\c_tabl_tabulate_noflines=\c_tabl_tabulate_minusnoflines
- \ifnum\c_tabl_tabulate_plines_max<\plustwo
- \tabl_tabulate_nobreak_inject
- \else
- \tabl_tabulate_break_allow % needed with pbreak prevention
- \fi
- \else
- \tabl_tabulate_break_state_allowbreak
- \fi
- \fi
- \fi
- \global\setfalse\c_tabl_tabulate_firstflushed}
-
-\unexpanded\def\tabl_tabulate_bbskip_second_split_yes
- {\ifvoid\b_tabl_tabulate_current\c_tabl_tabulate_column
- \ifx\tabl_tabulate_flush_collected_indeed\empty\else
- \setbox0\hbox
- \fi
- \fi}
-
-\unexpanded\def\tabl_tabulate_eskip_second
- {\par\egroup
- \tabl_tabulate_pheight_set
- \glet\tabl_tabulate_hook\tabl_tabulate_hook_yes
- \tabl_tabulate_splitoff_box}
-
-\unexpanded\def\tabl_tabulate_bskip_second_split_yes
- {\ifvoid\b_tabl_tabulate_current\c_tabl_tabulate_column
- % first line
- \global\setbox\b_tabl_tabulate_current\c_tabl_tabulate_column\vbox
- \bgroup
- \glet\tabl_tabulate_hook\tabl_tabulate_hook_nop
- \ifconditional\c_tabl_tabulate_automode\hsize\d_tabl_tabulate_width\fi
- % \begstrut % interferes with pre-\pars
- % evt: \appendtoks\begstrut\to\everypar
- \ignorespaces
- \let\tabl_tabulate_eskip\tabl_tabulate_eskip_second
- \else
- % successive lines
- \let\tabl_tabulate_eskip\empty
- \dontcomplain
- \glet\tabl_tabulate_hook\tabl_tabulate_hook_yes
- \expandafter\tabl_tabulate_splitoff_box
- \fi}
-
-\unexpanded\def\tabl_tabulate_xbskip_second{\tabl_tabulate_bskip}
-\unexpanded\def\tabl_tabulate_xeskip_second{\tabl_tabulate_eskip}
-
-\unexpanded\def\tabl_tabulate_flush_second_indeed
- {\glet\tabl_tabulate_flush_collected_indeed\empty
- \global\c_tabl_tabulate_column\zerocount
- \tabl_tabulate_pbreak_check
- \dofastloopcs\c_tabl_tabulate_columns\tabl_tabulate_flush_second_step
- \global\settrue\c_tabl_tabulate_firstflushed}
-
-\unexpanded\def\tabl_tabulate_flush_second_step
- {\ifvoid\b_tabl_tabulate_current\fastloopindex\else
- \gdef\tabl_tabulate_flush_collected_indeed{\the\t_tabl_tabulate_dummy}%
- \fi}
-
-\def\tabl_tabulate_flush_second
- {\tabulatenoalign{\tabl_tabulate_flush_second_indeed}%
- \tabl_tabulate_flush_collected_indeed}
-
-\unexpanded\def\tabl_tabulate_bskip_second_split_nop
- {\vtop\bgroup
- \ifconditional\c_tabl_tabulate_automode\hsize\d_tabl_tabulate_width\fi
- % \begstrut % interferes with pre-\pars
- % evt: \appendtoks\begstrut\to\everypar
- \ignorespaces}
-
-\unexpanded\def\tabl_tabulate_eskip_second_split_nop % vertical strut added august 2003
- {\par\verticalstrut
- \vskip-\struttotal
- \egroup}
-
-% \let\tabl_tabulate_eskip \relax % adapted by bskip
-% \let\tabl_tabulate_eeskip\relax % adapted by bskip
-
-\appendtoks
- \let\tabl_tabulate_xbskip\tabl_tabulate_xbskip_second
- \let\tabl_tabulate_xeskip\tabl_tabulate_xeskip_second
- \ifconditional\c_tabl_tabulate_split
- \let\tabl_tabulate_bskip \tabl_tabulate_bskip_second_split_yes
- \let\tabl_tabulate_bbskip\tabl_tabulate_bbskip_second_split_yes
- \else
- \let\tabl_tabulate_bskip \tabl_tabulate_bskip_second_split_nop
- \let\tabl_tabulate_eskip \tabl_tabulate_eskip_second_split_nop
- \fi
-\to \t_tabl_tabulate_initializers_second
-
-% see ***
-%
-% \enabletrackers[nodes.page_vspacing]
-% \starttext
-% \starttabulate[||] \dorecurse{100}{\NC Eins \NC \NR \HL} \stoptabulate
-% \stoptext
-
-\def\tabl_tabulate_XX_none
- {\starttabulatenoalign
- \tabl_tabulate_break_state_set
- \tabl_tabulate_hrule_spec_ignore
- \stoptabulatenoalign}
-
-\def\tabl_tabulate_FL_second{\starttabulatenoalign\tabl_tabulate_hrule_spec_pickup\tabl_tabulate_FL_second_indeed}
-\def\tabl_tabulate_ML_second{\starttabulatenoalign\tabl_tabulate_hrule_spec_pickup\tabl_tabulate_ML_second_indeed}
-\def\tabl_tabulate_LL_second{\starttabulatenoalign\tabl_tabulate_hrule_spec_pickup\tabl_tabulate_LL_second_indeed}
-\def\tabl_tabulate_TL_second{\starttabulatenoalign\tabl_tabulate_hrule_spec_pickup\tabl_tabulate_TL_second_indeed}
-\def\tabl_tabulate_BL_second{\starttabulatenoalign\tabl_tabulate_hrule_spec_pickup\tabl_tabulate_BL_second_indeed}
-
-\unexpanded\def\tabl_tabulate_FL_second_indeed
- {\ifinsidefloat\else
- \doifempty{\tabulationparameter\c!before}\tabl_tabulate_baselinecorrection % no expansion
- \fi
- \tabl_tabulate_hrule_inject
- \tabl_tabulate_nobreak_inject
- \tabl_tabulate_column_rule_separator_inject
- \prevdepth\strutdp
- \tabl_tabulate_nobreak_inject
- \stoptabulatenoalign}
-
-\def\spac_vspacing_no_topskip % use grouped
- {\attribute\skipcategoryattribute\plusten}
-
-\unexpanded\def\tabl_tabulate_ML_second_indeed
- {\tabl_tabulate_break_no
- \tabl_tabulate_column_rule_separator_inject
- \tabl_tabulate_break_no
- \tabl_tabulate_hrule_inject
- \vskip-\p_rulethickness\relax
- \begingroup
- \spac_vspacing_no_topskip
- \tabl_tabulate_hrule_inject
- \endgroup
- \tabl_tabulate_break_no
- \tabl_tabulate_column_rule_separator_inject
- \stoptabulatenoalign}
-
-\unexpanded\def\tabl_tabulate_LL_second_indeed
- {\tabl_tabulate_nobreak_inject
- \tabl_tabulate_column_rule_separator_inject
- \tabl_tabulate_nobreak_inject
- \tabl_tabulate_hrule_inject
- \ifinsidefloat
- \tabl_tabulate_inside_inbetween
- \else
- \tabl_tabulate_outside_inbetween
- \fi
- \stoptabulatenoalign}
-
-\unexpanded\def\tabl_tabulate_TL_second_indeed
- {\tabl_tabulate_nobreak_inject
- \tabl_tabulate_column_rule_separator_inject
- \tabl_tabulate_nobreak_inject
- \tabl_tabulate_hrule_inject
- \tabl_tabulate_nobreak_inject
- \tabl_tabulate_column_rule_separator_inject
- %\prevdepth\strutdp % todo, might differ between TL and BL
- \tabl_tabulate_nobreak_inject
- \stoptabulatenoalign}
-
-\let\tabl_tabulate_BL_second_indeed\tabl_tabulate_TL_second_indeed
-
-\def\tabl_tabulate_HL_second
- {\csname
- \ifnum\c_tabl_tabulate_noflines=\zerocount F\orelse
- \ifnum\c_tabl_tabulate_noflines=\c_tabl_tabulate_totalnoflines L\else
- M\fi
- L\endcsname}
-
-\appendtoks
- \let\FL\tabl_tabulate_XX_none
- \let\ML\tabl_tabulate_XX_none
- \let\LL\tabl_tabulate_XX_none
- \let\TL\tabl_tabulate_XX_none
- \let\BL\tabl_tabulate_XX_none
- \let\HL\tabl_tabulate_XX_none
- \let\HR\tabl_tabulate_XX_none
-\to \t_tabl_tabulate_initializers_first
-
-\appendtoks
- \let\FL\tabl_tabulate_FL_second
- \let\ML\tabl_tabulate_ML_second
- \let\LL\tabl_tabulate_LL_second
- \let\TL\tabl_tabulate_TL_second
- \let\BL\tabl_tabulate_BL_second
- \let\HL\tabl_tabulate_HL_second
- \let\HR\tabl_tabulate_HL_second
-\to \t_tabl_tabulate_initializers_second
-
-% \def\tabulatedoHRfive % horizontal rule line (break untested)
-% {\starttabulatenoalign
-% \glet\dotabulateautoline\dotabulatelinerule
-% %\ifcase#1\or % todo: check what this does
-% \ifnum\noftabulatelines=\zerocount
-% \glet\dotabulateautoline\donothing
-% \else\ifnum\noftabulatelines=\totalnoftabulatelines
-% \glet\dotabulateautoline\donothing
-% \fi\fi
-% %\fi
-% \dotabulatenobreak
-% \stoptabulatenoalign
-% \dotabulateautoline
-% \starttabulatenoalign
-% \tabl_tabulate_break_no
-% \ifx\dotabulateautoline\dotabulatelinerule\kern-\lineheight\fi
-% \ifnum\noftabulatelines=\totalnoftabulatelines
-% \expandafter\dotabulatenobreak
-% \else
-% \expandafter\tabl_tabulate_break_allow
-% \fi
-% \stoptabulatenoalign
-% \dotabulateautoline
-% \starttabulatenoalign
-% \dotabulatenobreak
-% \stoptabulatenoalign}
-
-% \dorecurse{10}{
-% \starttabulate[|l|]
-% \FL
-% \NC first line, bound to next rule \NC \NR
-% \TL
-% \NC bound to previous rule \NC \NR
-% \NC some line \NC \NR
-% \NC some line \NC \NR
-% \NC some line \NC \NR
-% \NC bound to next rule \NC \NR
-% \ML
-% \NC bound to previous rule \NC \NR
-% \NC bound to next rule \NC \NR
-% \BL
-% \NC last line, bound to previous rule \NC \NR
-% \LL
-% \stoptabulate
-% }
-
-% This needs checking:
-
-\def\tabulaterule {\HR} % a rule with lineheight
-\def\tabulateline {\HL} % just a spaced rule
-\def\tabulateautorule{\HR}%
-\def\tabulateautoline{\HL} % no longer different (to be looked into)
-
-%D When support for vertical rules we needed a way to pick up the specification for
-%D the final rule and a \type {|{}} interface was chosen. As a result parsing had to
-%D become more complex and I was not in the mood for messing up the code too much.
-%D Therefore from now on the preamble is split by \LUA. There are definitely more
-%D places where we can use \LUA\ code (for instance in alignment of numbers. The
-%D repeat parser is replace at the \LUA\ end as well.
-
-\let\tabl_tabulate_flush_collected \empty
-\let\tabl_tabulate_flush_collected_indeed\empty
-
-\let\v_tabl_tabulate_align\!!zerocount
-
-\def\tabl_tabulate_check_side_float % new per 29-07-2016
- {\ifdefined\page_sides_check_floats_indeed
- \page_sides_check_floats_indeed
- \ifdim\hangindent>\zeropoint
- \advance\d_tabl_tabulate_indent\hangindent
- \fi
- \fi}
-
-\def\tabl_tabulate_set_local_hsize
- {\setlocalhsize
- \hsize\localhsize}
-
-\def\tabl_tabulate_process
- {\c_tabl_tabulate_pass\plusone
- \tabl_tabulate_check_full_content
- \edef\v_tabl_tabulate_align{\ifcsname\??tabulatealigning\p_align\endcsname\lastnamedcs\else0\fi}%
- \s_tabl_tabulate_first.5\d_tabl_tabulate_unit
- \s_tabl_tabulate_last\s_tabl_tabulate_first
- \s_tabl_tabulate_pre\zeropoint
- \s_tabl_tabulate_post\s_tabl_tabulate_first % was: \zeropoint
- \global\c_tabl_tabulate_columns\zerocount
- \global\c_tabl_tabulate_nofauto\zerocount
- \global\c_tabl_tabulate_noflines\zerocount
- \c_tabl_tabulate_totalnoflines\zerocount
- \c_tabl_tabulate_minusnoflines\zerocount
- \global\d_tabl_tabulate_width_p\zeropoint
- \global\d_tabl_tabulate_width_w\zeropoint
- \global\setfalse\c_tabl_tabulate_equal
- \tabl_tabulate_pheight_reset
- \tabskip\zeropoint
- \ifinsidesplitfloat
- \donetrue
- \orelse\ifinsidefloat
- \donefalse
- \else
- \donetrue
- \fi
- \global\c_tabl_tabulate_repeathead
- \ifdone
- \ifcsname\??tabulateheader\tabulationparameter\c!header\endcsname
- \lastnamedcs
- \else
- \zerocount
- \fi
- \else
- \zerocount
- \fi
- %
- \the\t_tabl_tabulate_initializers_first % collect more here
- %
- \glet\tabl_tabulate_flush_collected\empty
- \ifdim\d_tabl_tabulate_margin>\zeropoint
- \t_tabl_tabulate_preamble
- {\aligntab
- \tabl_tabulate_flush_indent
-% \global\advance\c_tabl_tabulate_noflines\plusone
- \strut
- \alignmark\alignmark
- \tabskip\d_tabl_tabulate_margin
- \strut
- \aligntab
- \alignmark\alignmark
- \tabskip\zeropoint}%
- \else
- \t_tabl_tabulate_preamble
- {\aligntab
- \tabl_tabulate_flush_indent
-% \global\advance\c_tabl_tabulate_noflines\plusone
- \strut
- \alignmark\alignmark
- \aligntab
- \alignmark\alignmark
- \tabskip\zeropoint}%
- \fi
- \d_tabl_tabulate_width\zeropoint
- % these counters are set at the lua end
- \c_tabl_tabulate_nofcolumns \zerocount
- \c_tabl_tabulate_has_rule_spec_first\zerocount
- \c_tabl_tabulate_has_rule_spec_last \zerocount
- \clf_presettabulate{\detokenizedtabulationparameter\c!format}%
- %
- % \edef\totaltabulatecolumns{\the\numexpr3*\c_tabl_tabulate_columns+\plusfour}%
- \d_tabl_tabulate_width\zeropoint
- \tabl_tabulate_initialize_boxes\c_tabl_tabulate_columns
- \toksapp\t_tabl_tabulate_preamble{%
- \aligntab\alignmark\alignmark
- \global\advance\c_tabl_tabulate_column\plusone % maybe just set it already
- }%
- \toksapp\t_tabl_tabulate_dummy{%
- \NC\unskip\unskip\crcr\tabl_tabulate_flush_collected % no count
- }%
- \global\c_tabl_tabulate_column\zerocount
- \tabl_tabulate_pheight_reset
- \glet\tabl_tabulate_hook\tabl_tabulate_hook_yes
- \ifx\p_indenting\v!no
- \forgetparindent
- \fi
- \ifinsidefloat
- \d_tabl_tabulate_indent\zeropoint
- \else
- \tabl_tabulate_check_side_float
- \tabl_tabulate_set_local_hsize
- \fi
- \dontcomplain
- \forgetall % hm, interference with preceding \forgetparindent probably bug, to be solved
- \everypar\everytabulatepar
- \setbox\scratchbox\vbox % outside \if because of line counting
- {\notesenabledfalse
- \d_tabl_tabulate_indent\zeropoint
- \settrialtypesetting % very important
- \anch_backgrounds_text_level_start
- \expandafter\halign\expandafter{\the\t_tabl_tabulate_preamble\crcr\tabl_tabulate_insert_content\crcr}}%
- \anch_backgrounds_text_level_stop
- \ifcase\c_anch_backgrounds_text_state\else
- \global\settrue\tablehaspositions
- \fi
- \ifnum\c_tabl_tabulate_nofauto>\zerocount
- % so, even if the natural size is larger, in the final run, we force the calculated width
- \d_tabl_tabulate_width\dimexpr\hsize-\wd\scratchbox-\d_tabl_tabulate_width_p-\d_tabl_tabulate_width_w\relax
- \ifnum\c_tabl_tabulate_nofauto>\zerocount
- \divide\d_tabl_tabulate_width \c_tabl_tabulate_nofauto\relax
- \fi
- \fi
- \setbox\scratchbox\emptybox % free memory
- \ifconditional\c_tabl_tabulate_split
- \splittopskip\strutht
- \glet\tabl_tabulate_flush_collected_indeed\empty
- \glet\tabl_tabulate_flush_collected\tabl_tabulate_flush_second
- \fi
- \c_tabl_tabulate_totalnoflines\c_tabl_tabulate_noflines
- \c_tabl_tabulate_minusnoflines\numexpr\c_tabl_tabulate_noflines+\minusone\relax
- \global\c_tabl_tabulate_noflines\zerocount
- %
- \c_tabl_tabulate_pass\plustwo % final pass
- \the\t_tabl_tabulate_initializers_second % collect more here
- %
- \ifx\p_line\v!line
- \let\HL\HR
- \let\tabulateautoline\tabulateautorule
- \let\tabulateline\tabulaterule
- \fi
- %
- \ifcase\c_tabl_tabulate_repeathead
- \ifinsidesplitfloat
- \global\setbox\b_tabl_tabulate\vbox \bgroup
- \else
- \startframedcontent[\tabulationparameter\c!frame]%
- \fi
- \else
- \global\setbox\b_tabl_tabulate\vbox \bgroup
- \fi
- %
- \dostarttaggedchained\t!tabulate\empty\??tabulation
- \dostarttagged\t!tabulaterow\empty
- \setfalse\inhibitmargindata % new per 2012.06.13 ... really needed
- % \everycr\expandafter{\the\everycr\noalign{\the\t_tabl_tabulate_every_real_row}\dostoptagged\dostarttagged\t!tabulaterow\empty}%
- \toksapp\everycr{\noalign{\the\t_tabl_tabulate_every_real_row}\dostoptagged\dostarttagged\t!tabulaterow\empty}%
- \expandafter\halign\expandafter{\the\t_tabl_tabulate_preamble\crcr\tabl_tabulate_insert_content\crcr}%
- \dostoptagged
- \dostoptagged
- \ifhmode\par\prevdepth\strutdp\fi % nog eens beter, temporary hack
- \ifx\p_distance\v!grid
- \vskip-\strutdp % experimental tm-prikkels
- \fi
- %
- \ifcase\c_tabl_tabulate_repeathead
- \ifinsidesplitfloat
- \egroup % box
- \egroup % settings
- \tabl_split_box\b_tabl_tabulate
- \else
- \stopframedcontent
- \egroup
- \fi
- \else
- \egroup % box
- \egroup % settings
- \tabl_split_box\b_tabl_tabulate
- \fi
- %
- \ifinsidefloat
- \tabl_tabulate_inside_after
- \else
- \tabl_tabulate_outside_after
- \fi
- \egroup} % whole thing
-
-% \egroup
-
-% \setuptabulate[split=yes,header=text,title=Vervolg van Tabel]
-%
-% % \starttabulatehead
-% % \NC test \NC hans\NC \NR
-% % \stoptabulatehead
-%
-% \starttabulate
-% \NC test \NC \input tufte \relax \NC \NR
-% \NC test \NC \input knuth \relax \NC \NR
-% \NC test \NC \input knuth \relax \NC \NR
-% \NC test \NC \input tufte \relax \NC \NR
-% \NC test \NC \input tufte \relax \NC \NR
-% \NC test \NC \input tufte \relax \NC \NR
-% \stoptabulate
-
-\def\tabl_split_box#1% #1 <> 0/2 / derived from the one in core-ntb.tex
- {\ifinsidesplitfloat
- \tabl_split_box_indeed#1%
- \orelse\ifinsidefloat
- \unvbox#1%
- \else
- \tabl_split_box_indeed#1%
- \fi}
-
-\def\tabl_split_box_indeed#1%
- {\resettsplit
- \def\tsplitminimumfreelines{2}%
- \def\tsplitminimumfreespace{0pt}%
- \setbox\tsplitcontent\box#1%
- \ifcase\c_tabl_tabulate_repeathead\or
- \setbox\tsplithead\vsplit\tsplitcontent to \lineheight
- \setbox\tsplithead\vbox{\unvbox\tsplithead}%
- \or
- \setbox\tsplithead\vbox{\hbox{\strut\tabulationparameter\c!title}}%
- \fi
- \handletsplit}
-
-%D \starttyping
-%D \setuptabulate[split=no,rule=line]
-%D
-%D \starttabulate
-%D \NC tufte \NC \input tufte \NC \NR \tabulateautorule
-%D \NC tufte \NC \input tufte \NC \NR \tabulateautorule
-%D \NC tufte \NC \input tufte \NC \NR \tabulateautorule
-%D \NC tufte \NC \input tufte \NC \NR \tabulateautorule
-%D \NC tufte \NC \input tufte \NC \NR \tabulateautorule
-%D \NC tufte \NC \input tufte \NC \NR \tabulateautorule
-%D \stoptabulate
-%D \stoptyping
-
-%D Spacing:
-%
-% \starttabulate
-% \NC text \NC text \NC \NR
-% \TB[small]
-% \NC text \NC text \NC \NR
-% \TB[4*big]
-% \NC text \NC text \NC \NR
-% \stoptabulate
-
-\def\tabl_tabulate_TB
- {\starttabulatenoalign
- \dosingleempty\tabl_tabulate_TB_indeed}
-
-\def\tabl_tabulate_TB_indeed[#1]%
- {\iffirstargument
- \blank[#1]
- \orelse\ifx\m_tabl_tabulate_blank_default\empty
- \blank
- \else
- \blank[\m_tabl_tabulate_blank_default]%
- \fi
- \stoptabulatenoalign}
-
-% to be tested:
-%
-% \def\tabl_tabulate_TB
-% {\starttabulatenoalign
-% \doiffastoptionalcheckelse\tabl_tabulate_TB_yes\tabl_tabulate_TB_nop}
-%
-% \def\tabl_tabulate_TB_yes[#1]%
-% {\blank[#1]
-% \stoptabulatenoalign}
-%
-% \def\tabl_tabulate_TB_nop[#1]%
-% {\blank
-% \stoptabulatenoalign}
-
-\appendtoks
- \let\TB\tabl_tabulate_TB
-\to \everytabulate
-
-% %D Between alignment lines certain rules apply, and even a simple test can mess
-% %D up a table, which is why we have a special test facilityL
-% %D
-% %D \startbuffer
-% %D \starttabulate[|l|p|]
-% %D \NC 1test \NC test \NC \NR
-% %D \tableifelse{\doifelse{a}{a}}{\NC Xtest \NC test \NC \NR}{}%
-% %D \stoptabulate
-% %D \stopbuffer
-% %D
-% %D \typebuffer \getbuffer
-%
-% \def\tableifelse#1% should be tabulatenoalign then
-% {\tablenoalign
-% {#1%
-% {\aftergroup \firstoftwoarguments}%
-% {\aftergroup\secondoftwoarguments}}}
-%
-% \def\tableiftextelse#1{\tableifelse{\doiftextelse{#1}}}
-
-%D Some new trickery:
-%D
-%D \startbuffer
-%D \settrue\c_tabl_tabulate_splitoff_whitespace
-%D
-%D \starttabulate[|p(2cm)|p(2cm)|p(2cm)|]
-%D \NC test 1a \NC test 2a \NC test 3a
-%D \par
-%D test 3b \NC \NR
-%D \NC test 1a \NC test 2a \NC test 3a
-%D \blank[line]
-%D test 3b \NC \NR
-%D \NC test 1a \NC test 2a \NC test 3a
-%D \blank[halfline]
-%D test 3b
-%D \blank[halfline]
-%D test 3c \NC \NR
-%D \NC \blank \NC \blank \NC \blank \NC \NR
-%D \NC test 1a \NC test 2a \NC test 3a
-%D \blank[halfline]
-%D test 3b
-%D \blank[halfline]
-%D test 3c \NC \NR
-%D \NC \blank \NC \blank \NC \NC \NR
-%D \NC test 1a
-%D \par
-%D test 1b
-%D \par
-%D test 1b \NC test 2a
-%D \par
-%D test 2b
-%D \par
-%D test 2b \NC test 3a \NC \NR
-%D \NC test 1a
-%D \blank
-%D test 1b
-%D \par
-%D test 1b \NC test 2a
-%D \par
-%D test 2b
-%D \blank
-%D test 2b \NC test 3a \NC \NR
-%D \stoptabulate
-%D \stopbuffer
-%D
-%D \typebuffer \start \getbuffer \stop
-
-% \starttabulatie[|mc|]
-% \NC \digits{100.000,00} \NC\NR
-% \NC \digits{@10.000,00} \NC\NR
-% \NC \digits{@@@.100,00} \NC\NR
-% \NC \digits{@@@.@10,@@} \NC\NR
-% \NC \digits{@@@.@@1,@@} \NC\NR
-% \stoptabulatie
-%
-% \starttabulatie[|mc|]
-% \ND 100.000,00 \NC\NR
-% \ND @10.000,00 \NC\NR
-% \ND @@@.100,00 \NC\NR
-% \ND @@@.@10,@@ \NC\NR
-% \ND @@@.@@1,@@ \NC\NR
-% \stoptabulatie
-%
-% \starttabulatie[|c|]
-% \ND $100.000,00$ \NC\NR
-% \ND $@10.000,00$ \NC\NR
-% \ND $@@@.100,00$ \NC\NR
-% \ND $@@@.@10,@@$ \NC\NR
-% \ND $@@@.@@1,@@$ \NC\NR
-% \stoptabulatie
-%
-% \starttabulatie[|c|]
-% \NC $\digits 100.000,00 $ \NC\NR
-% \NC $\digits @10.000,00 $ \NC\NR
-% \NC $\digits @@@.100,00 $ \NC\NR
-% \NC $\digits @@@.@10,@@ $ \NC\NR
-% \NC $\digits @@@.@@1,@@ $ \NC\NR
-% \stoptabulatie
-%
-% \starttabulatie[|c|]
-% \NC \digits $100.000,00$ \NC\NR
-% \NC \digits $@10.000,00$ \NC\NR
-% \NC \digits $@@@.100,00$ \NC\NR
-% \NC \digits $@@@.@10,@@$ \NC\NR
-% \NC \digits $@@@.@@1,@@$ \NC\NR
-% \stoptabulatie
-
-%D Predefined categories (moved from core-mis):
-
-\definetabulate
- [\v!legend]
- [|emj1|i1|mR|]
-
-\setuptabulate
- [\v!legend]
- [\c!unit=.75em,\c!inner=\setquicktabulate\leg,EQ={=}]
-
-\definetabulate
- [\v!legend][\v!two]
- [|emj1|emk1|i1|mR|]
-
-\definetabulate
- [\v!fact]
- [|R|ecmj1|i1mR|]
-
-\setuptabulate
- [\v!fact]
- [\c!unit=.75em,\c!inner=\setquicktabulate\fact,EQ={=}]
-
-%D Another example:
-%D
-%D \starttyping
-%D \definetabulate
-%D [whatever]
-%D [|l|r|]
-%D
-%D \definetabulate
-%D [whatever][else]
-%D [|l|c|r|]
-%D
-%D \startwhatever
-%D \NC l \NC r \NC \NR
-%D \NC left \NC right \NC \NR
-%D \stopwhatever
-%D
-%D \startwhatever[else]
-%D \NC l \NC m \NC r \NC \NR
-%D \NC left \NC middle \NC right \NC \NR
-%D \stopwhatever
-%D
-%D \startwhatever[else][format={|c|c|c|c|}]
-%D \NC l \NC m \NC m \NC r \NC \NR
-%D \NC left \NC middle \NC middle \NC right \NC \NR
-%D \stopwhatever
-%D \stoptyping
-
-%D This is needed because we sometimes use the english command in tracing macros. In
-%D fact, most detailed tracing macros that are done with \LUA\ only work in the
-%D english interface anyway.
-
-% \definetabulate[tabulate] \setuptabulate[tabulate][\c!format=\v!none] % so no \v! here
-
-\newconditional\c_tabl_generic
-
-\unexpanded\setuvalue{starttabulate}%
- {\bgroup % whole thing
- \settrue\c_tabl_generic
- \let\currenttabulationparent\empty
- \dodoubleempty\tabl_start_regular}
-
-\letvalue{stoptabulate}\relax
-
-%D The following helpers are just there because we also have them at the \LUA\ end:
-%D
-%D \startbuffer
-%D \starttabulate[|l|c|r|]
-%D \tabulaterow {a,b,c}
-%D \tabulaterowbold{aa,bb,cc}
-%D \tabulaterowtype{aaa,bbb,ccc}
-%D \tabulaterowtyp {aaaa,bbbb,cccc}
-%D \stoptabulate
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-
-\def\tabl_tabulate_compact_row#1#2%
- {\NC\tabl_tabulate_compact_step#1#2,\end,}
-
-\def\tabl_tabulate_compact_step#1#2#3,%
- {\ifx#2\end
- \NR
- \expandafter\gobbleoneargument
- \else
- #1{#2#3}\NC
- \expandafter\tabl_tabulate_compact_step
- \fi#1}
-
-\unexpanded\def\tabulaterow {\tabl_tabulate_compact_row\relax}
-\unexpanded\def\tabulaterowbold{\tabl_tabulate_compact_row\bold}
-\unexpanded\def\tabulaterowtype{\tabl_tabulate_compact_row\type}
-\unexpanded\def\tabulaterowtyp {\tabl_tabulate_compact_row\typ}
-
-%D Here we plug in a row background feature. As we only have support for
-%D \type {frame=name} we can use these variables.
-%D
-%D \starttyping
-%D \startuseMPgraphic{foo}
-%D fill unitsquare
-%D xyscaled (RuleWidth,RuleHeight+RuleDepth) enlarged (ExHeight/4,ExHeight/8)
-%D randomized ExHeight
-%D shifted (-ExHeight/8,ExHeight/16)
-%D withcolor RuleColor ;
-%D \stopuseMPgraphic
-%D
-%D \setuptabulate % wel only have frame=name so we can use these:
-%D [background=foo,
-%D backgroundcolor=darkred,
-%D foregroundcolor=white]
-%D
-%D \definelinefiller[foo][mp=foo,color=darkgreen]
-%D \definelinefiller[bar][mp=foo,color=darkred]
-%D
-%D \starttabulate[|||]
-%D \DB foo \BC bar \BC \NR
-%D \NC foo \NC bar \NC \NR
-%D \NC foo \NC bar \NC \NR
-%D \NC foo \NC bar \NC \NR
-%D \NC foo \NC bar \NC \NR
-%D \stoptabulate
-%D
-%D \starttabulate[|||]
-%D \PB foo \BC bar \BC \NR
-%D \NC foo \NC bar \NC \NR
-%D \NC foo \NC bar \NC \NR
-%D \NC foo \NC bar \NC \NR
-%D \NC foo \NC bar \NC \NR
-%D \stoptabulate
-%D
-%D \starttabulate[|||]
-%D \FB[bar] foo \BC bar \BC \NR
-%D \NC foo \NC bar \NC \NR
-%D \NC foo \NC bar \NC \NR
-%D \NC foo \NC bar \NC \NR
-%D \NC foo \NC bar \NC \NR
-%D \stoptabulate
-%D
-%D \startnarrower
-%D \starttabulate[|||]
-%D \DB foo \DB bar \BC \NR
-%D \NC foo \NC bar \NC \NR
-%D \NC foo \NC bar \NC \NR
-%D \NC foo \NC bar \NC \NR
-%D \NC foo \NC bar \NC \NR
-%D \stoptabulate
-%D \stopnarrower
-%D
-%D \starttabulate[|||]
-%D \BC foo \BC bar \BC \NR
-%D \NL[magenta] foo \NC bar \NC \NR
-%D \NL[yellow] foo \NC bar \NC \NR
-%D \NL[cyan] foo \NC bar \NC \NR
-%D \NL[gray] foo \NC bar \NC \NR
-%D \stoptabulate
-%D
-%D \starttabulate
-%D \NL[red] foo \NC bar \NC \NR
-%D \NL[green] foo \NL[red] bar \NC \NR
-%D \NC foo \NC bar \NC \NR
-%D \NL[blue] foo \NC \input tufte \NC \NR
-%D \NL[gray] foo \NC bar \NC \NR
-%D \NL[yellow] foo \NC bar \NC \NR
-%D \stoptabulate
-%D \stoptyping
-
-% \setuptabulate
-% [\c!background=,
-% \c!backgroundcolor=,
-% \c!foregroundcolor=,
-% \c!foregroundstyle=]
-
-\let\m_table_current_row_background \empty
-\let\m_table_current_row_background_default \empty
-\let\m_table_current_row_background_filler \empty
-\let\m_table_current_row_background_defaultfiller\empty
-\let\m_table_current_row_background_auto \empty
-
-\unexpanded\def\tabl_register_row_background#1%
- {\xdef\m_table_current_row_background{#1}}
-
-\unexpanded\def\tabl_register_row_background_filler#1%
- {\xdef\m_table_current_row_background_filler{#1}}
-
-\unexpanded\def\tabl_synchronize_row_background
- {\iftrialtypesetting\else
- \ifx\m_table_current_row_background_filler\empty
- \ifx\m_table_current_row_background\empty
- % nothing
- \tabl_synchronize_row_background_dummy
- \else
- \tabl_synchronize_row_background_indeed\m_table_current_row_background
- \fi
- \else
- \tabl_synchronize_row_background_filler_indeed\m_table_current_row_background_filler
- \fi
- \fi}
-
-\unexpanded\def\tabl_synchronize_row_background_dummy
- {\iftrialtypesetting\else
- \begingroup
- %\clf_setbackgroundrowdata\numexpr\c_tabl_tabulate_nofrealrows+\minusone\relax\zerocount\zeropoint
- \clf_setbackgroundrowdata\c_tabl_tabulate_nofrealrows\zerocount\zeropoint
- \endgroup
- \fi}
-
-\unexpanded\def\tabl_synchronize_row_background_indeed#1%
- {\iftrialtypesetting\else
- \begingroup
- \clf_enablebackgroundalign % can be moved into \clf_setbackgroundrowdata
- \dousecolorparameter{#1}%
- \setbox\scratchbox\hpack{}%
- %\clf_setbackgroundrowdata\numexpr\c_tabl_tabulate_nofrealrows+\minusone\relax\scratchbox\d_tabl_tabulate_indent
- \clf_setbackgroundrowdata\c_tabl_tabulate_nofrealrows\scratchbox\d_tabl_tabulate_indent
- \endgroup
- \fi}
-
-\unexpanded\def\tabl_synchronize_row_background_filler_indeed#1%
- {\iftrialtypesetting\else
- \begingroup
- \clf_enablebackgroundalign % can be moved into \clf_setbackgroundrowdata
- \node_linefiller_set{#1}%
- \setbox\scratchbox\hpack{}%
- %\clf_setbackgroundrowdata\numexpr\c_tabl_tabulate_nofrealrows+\minusone\relax\scratchbox\d_tabl_tabulate_indent
- \clf_setbackgroundrowdata\c_tabl_tabulate_nofrealrows\scratchbox\d_tabl_tabulate_indent
- \endgroup
- \fi}
-
-\appendtoks
- \glet\m_table_current_row_background\empty
- \glet\m_table_current_row_background_filler\empty
- \global\c_tabl_tabulate_nofrealrows\zerocount
- \global\c_tabl_tabulate_autocolor\zerocount
- \clf_resetbackgroundrowdata
-\to \t_tabl_tabulate_initializers_first
-
-\appendtoks
- \glet\m_table_current_row_background\empty
- \glet\m_table_current_row_background_filler\empty
- \global\c_tabl_tabulate_nofrealrows\zerocount
- \global\c_tabl_tabulate_autocolor\zerocount
- \clf_resetbackgroundrowdata
-\to \t_tabl_tabulate_initializers_second
-
-\appendtoks
- \tabl_synchronize_row_background
-\to \t_tabl_tabulate_every_real_row
-
-\appendtoks
- \glet\m_table_current_row_background\empty
- \glet\m_table_current_row_background_filler\empty
-\to \t_tabl_tabulate_every_after_row
-
-\unexpanded\def\tabl_tabulate_NL_first[#1]%
- {\tabl_tabulate_column_normal\zerocount\zerocount\relax
- \ifcase\c_tabl_tabulate_column\or
- \tabl_register_row_background{#1}%
- \fi
- \ignorespaces}
-
-\unexpanded\def\tabl_tabulate_ND_first
- {\tabl_tabulate_column_normal\zerocount\zerocount\relax
- \ifcase\c_tabl_tabulate_column\or
- \tabl_register_row_background\m_table_current_row_background_default
- \fi
- \ignorespaces}
-
-\unexpanded\def\tabl_tabulate_LB_first[#1]%
- {\tabl_tabulate_column_normal\plusone\zerocount\relax
- \ifcase\c_tabl_tabulate_column\or
- \tabl_register_row_background{#1}%
- \fi
- \usetabulationstyleandcolor\c!foregroundstyle\c!foregroundcolor
- \ignorespaces}
-
-\unexpanded\def\tabl_tabulate_DB_first
- {\tabl_tabulate_column_normal\plusone\zerocount\relax
- \ifcase\c_tabl_tabulate_column\or
- \tabl_register_row_background\m_table_current_row_background_default
- \fi
- \let\fontstyle\globalfontstyle
- \usetabulationstyleandcolor\c!foregroundstyle\c!foregroundcolor
- \ignorespaces}
-
-\unexpanded\def\tabl_tabulate_NF_first[#1]%
- {\tabl_tabulate_column_normal\zerocount\zerocount\relax
- \ifcase\c_tabl_tabulate_column\or
- \tabl_register_row_background_filler{#1}%
- \fi
- \ignorespaces}
-
-\unexpanded\def\tabl_tabulate_NP_first
- {\tabl_tabulate_column_normal\zerocount\zerocount\relax
- \ifcase\c_tabl_tabulate_column\or
- \tabl_register_row_background_filler\m_table_current_row_background_default_filler
- \fi
- \ignorespaces}
-
-\unexpanded\def\tabl_tabulate_FB_first[#1]%
- {\tabl_tabulate_column_normal\plusone\zerocount\relax
- \ifcase\c_tabl_tabulate_column\or
- \tabl_register_row_background_filler{#1}%
- \fi
- \usetabulationstyleandcolor\c!foregroundstyle\c!foregroundcolor
- \ignorespaces}
-
-\unexpanded\def\tabl_tabulate_PB_first
- {\tabl_tabulate_column_normal\plusone\zerocount\relax
- \ifcase\c_tabl_tabulate_column\or
- \tabl_register_row_background_filler\m_table_current_row_background_default_filler
- \fi
- \let\fontstyle\globalfontstyle
- \usetabulationstyleandcolor\c!foregroundstyle\c!foregroundcolor
- \ignorespaces}
-
-\unexpanded\def\tabl_tabulate_BC_first % overloaded
- {\tabl_tabulate_column_normal\plusone\zerocount
- \let\fontstyle\globalfontstyle
- \ifx\m_table_current_row_background\empty
- \ifx\m_table_current_row_background_filler\empty
- \usetabulationstyleandcolor\c!headstyle\c!headcolor
- \else
- \usetabulationstyleandcolor\c!foregroundstyle\c!foregroundcolor
- \fi
- \else
- \usetabulationstyleandcolor\c!foregroundstyle\c!foregroundcolor
- \fi}
-
-\unexpanded\def\tabl_tabulate_A_first
- {\global\advance\c_tabl_tabulate_autocolor\plusone
- \edef\m_table_current_row_background_auto{\tabulateparameter{\c!backgroundcolor:\number\c_tabl_tabulate_autocolor}}%
- \ifx\m_table_current_row_background_auto\empty
- \global\c_tabl_tabulate_autocolor\plusone
- \edef\m_table_current_row_background_auto{\tabulateparameter{\c!backgroundcolor:\number\c_tabl_tabulate_autocolor}}%
- \fi
- \ifx\m_table_current_row_background_auto\empty
- \let\m_table_current_row_background_auto\empty % \m_table_current_row_background_default
- \fi
- \tabl_register_row_background{\m_table_current_row_background_auto}}
-
-\unexpanded\def\tabl_tabulate_NA_first
- {\tabl_tabulate_column_normal\zerocount\zerocount\relax
- \iftrialtypesetting\else
- \ifcase\c_tabl_tabulate_column\or
- \tabl_tabulate_A_first
- \fi
- \fi
- \ignorespaces}
-
-\unexpanded\def\tabl_tabulate_BA_first
- {\tabl_tabulate_column_normal\plusone\zerocount\relax
- \iftrialtypesetting\else
- \ifcase\c_tabl_tabulate_column\or
- \tabl_tabulate_A_first
- \fi
- \fi
- \usetabulationstyleandcolor\c!foregroundstyle\c!foregroundcolor
- \ignorespaces}
-
-\appendtoks
- \let\NL\tabl_tabulate_NL_first % NC with Line
- \let\ND\tabl_tabulate_ND_first % NC with Default Line
- \let\LB\tabl_tabulate_LB_first % BC with Line
- \let\DB\tabl_tabulate_DB_first % BC with Default Line
- \let\NF\tabl_tabulate_NF_first % NC with Filler
- \let\NP\tabl_tabulate_NP_first % NC with Predefined Filler
- \let\FB\tabl_tabulate_FB_first % BC with Filler
- \let\PB\tabl_tabulate_PB_first % BC with Predefined Filler
- \let\NA\tabl_tabulate_NA_first % NC with Auto Line
- \let\BA\tabl_tabulate_BA_first % NC with Auto Line
-\to \t_tabl_tabulate_initializers_first
-
-\appendtoks
- \edef\m_table_current_row_background_default {\tabulateparameter\c!backgroundcolor}%
- \edef\m_table_current_row_background_default_filler{\tabulateparameter\c!background}%
- \let \m_table_current_row_background_auto \empty
-\to \everytabulate
-
-\setuptabulate
- [\c!headcolor=,
- \c!headstyle=\bf,
- \c!backgroundcolor=\tabulationparameter\c!rulecolor,
- \c!foregroundcolor=,
- \c!foregroundstyle=\tabulationparameter\c!headstyle]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/tabl-xtb.lua b/Master/texmf-dist/tex/context/base/mkiv/tabl-xtb.lua
index 2ff87e21abe..c9dd1e4e519 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/tabl-xtb.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/tabl-xtb.lua
@@ -900,7 +900,7 @@ function xtables.construct()
end
nofr = nofr + 1
local rp = rowproperties[r]
- -- we have a direction issue here but hpack_node_list(list,0,"exactly","TLT") cannot be used
+ -- we have a direction issue here but hpack_node_list(list,0,"exactly") cannot be used
-- due to the fact that we need the width
local hbox = hpack_node_list(list)
setdirection(hbox,lefttoright_code)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/tabl-xtb.mkvi b/Master/texmf-dist/tex/context/base/mkiv/tabl-xtb.mkvi
index e8279589276..c5042a405bd 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/tabl-xtb.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/tabl-xtb.mkvi
@@ -67,7 +67,7 @@
%
% cells: option=fixed : nils autostretch (not yet complete)
-% \setbox\scratchbox\hbox attr \taggedattribute \attribute\taggedattribute {...}
+% \setbox\scratchbox\hbox attr \taggedattribute \c_attr_tagged {...}
%
% \let\tsplitbeforeresult\donothing
% \let\tsplitafterresult \donothing
diff --git a/Master/texmf-dist/tex/context/base/mkiv/task-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/task-ini.lua
index 19fff66b8f4..3e78fb2f9c8 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/task-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/task-ini.lua
@@ -53,7 +53,7 @@ appendaction("processors", "fonts", "typesetters.fontkerns.handler",
appendaction("processors", "fonts", "nodes.handlers.protectglyphs", nil, "nonut", "enabled" )
appendaction("processors", "fonts", "builders.kernel.ligaturing", nil, "nut", "disabled" )
appendaction("processors", "fonts", "builders.kernel.kerning", nil, "nut", "disabled" )
-appendaction("processors", "fonts", "builders.kernel.cleanup", nil, "nut", "enabled" )
+appendaction("processors", "fonts", "nodes.handlers.show", nil, "nut", "disabled" )
appendaction("processors", "fonts", "nodes.handlers.stripping", nil, "nut", "disabled" )
appendaction("processors", "fonts", "nodes.handlers.flatten", nil, "nut", "disabled" )
appendaction("processors", "fonts", "fonts.goodies.colorschemes.coloring", nil, "nut", "disabled" )
@@ -66,11 +66,17 @@ appendaction("processors", "lists", "typesetters.digits.handler",
appendaction("processors", "lists", "typesetters.italics.handler", nil, "nut", "disabled" )
appendaction("processors", "lists", "languages.visualizediscretionaries", nil, "nut", "disabled" )
+if CONTEXTLMTXMODE == 0 then
+
+appendaction("processors", "lists", "nodes.handlers.migrate", nil, "nut", "disabled" )
+
+end
+
appendaction("processors", "after", "typesetters.marksuspects", nil, "nut", "disabled" )
+appendaction("shipouts", "normalizers", "nodes.handlers.cleanuppage", nil, "nut", "production")
appendaction("shipouts", "normalizers", "typesetters.showsuspects", nil, "nut", "disabled" )
appendaction("shipouts", "normalizers", "typesetters.margins.finalhandler", nil, "nut", "disabled" )
-------------("shipouts", "normalizers", "nodes.handlers.cleanuppage", nil, "nut", "disabled" )
appendaction("shipouts", "normalizers", "builders.paragraphs.expansion.trace", nil, "nut", "disabled" )
appendaction("shipouts", "normalizers", "typesetters.alignments.handler", nil, "nut", "disabled" )
appendaction("shipouts", "normalizers", "nodes.references.handler", nil, "nut", "production")
@@ -89,6 +95,7 @@ appendaction("shipouts", "finishers", "attributes.transparencies.handler",
appendaction("shipouts", "finishers", "attributes.colorintents.handler", nil, "nut", "disabled" )
appendaction("shipouts", "finishers", "attributes.negatives.handler", nil, "nut", "disabled" )
appendaction("shipouts", "finishers", "attributes.effects.handler", nil, "nut", "disabled" )
+appendaction("shipouts", "finishers", "attributes.alternates.handler", nil, "nut", "disabled" )
appendaction("shipouts", "finishers", "attributes.viewerlayers.handler", nil, "nut", "disabled" )
appendaction("shipouts", "wrapup", "nodes.handlers.export", nil, "nut", "disabled" ) -- always last
@@ -118,7 +125,12 @@ appendaction("math", "builders", "typesetters.directions.processmath"
appendaction("math", "builders", "noads.handlers.makeup", nil, "nonut", "disabled" )
appendaction("math", "builders", "noads.handlers.align", nil, "nonut", "enabled" )
+if CONTEXTLMTXMODE == 0 then
+
appendaction("finalizers", "lists", "typesetters.paragraphs.normalize", nil, "nut", "enabled" ) -- "disabled"
+
+end
+
appendaction("finalizers", "lists", "typesetters.margins.localhandler", nil, "nut", "disabled" )
appendaction("finalizers", "lists", "builders.paragraphs.keeptogether", nil, "nut", "disabled" )
appendaction("finalizers", "fonts", "builders.paragraphs.solutions.splitters.optimize", nil, "nonut", "disabled" )
diff --git a/Master/texmf-dist/tex/context/base/mkiv/toks-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/toks-ini.lua
index eef26574e0e..7120b47c3cd 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/toks-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/toks-ini.lua
@@ -18,63 +18,53 @@ local printtable = table.print
local concat = table.concat
local format = string.format
-if token.commands then
-
- local commands = token.commands()
-
- tokens.commands = utilities.storage.allocate(table.swapped(commands,commands))
-
-else
-
- tokens.commands = { }
-
-end
-
-local scan_toks = token.scan_toks
-local scan_string = token.scan_string
-local scan_argument = token.scan_argument
-local scan_tokenlist = token.scan_tokenlist
-local scan_int = token.scan_int
-local scan_code = token.scan_code
-local scan_token_code = token.scan_token_code
-local scan_dimen = token.scan_dimen
-local scan_glue = token.scan_glue
-local scan_keyword = token.scan_keyword
-local scan_keyword_cs = token.scan_keyword_cs or scan_keyword
-local scan_token = token.scan_token
-local scan_box = token.scan_box
-local scan_word = token.scan_word
-local scan_key = token.scan_key
-local scan_value = token.scan_value
-local scan_char = token.scan_char
-local scan_number = token.scan_number
-local scan_csname = token.scan_csname
-local scan_real = token.scan_real
-local scan_float = token.scan_float
-
-local get_next = token.get_next
-local get_next_token = token.get_next_token
-local skip_next = token.skip_next
-local peek_next_char = token.peek_next_char
-local is_next_char = token.is_next_char
-
-local set_macro = token.set_macro
-local get_macro = token.get_macro
-local get_meaning = token.get_meaning
-local get_cmdname = token.get_cmdname
-local set_char = token.set_char
-local set_lua = token.set_lua
-
-local create_token = token.create
-local new_token = token.new
-local is_defined = token.is_defined
-local is_token = token.is_token
-
-tokens.new = new_token
-tokens.create = create_token
-tokens.istoken = is_token
-tokens.isdefined = is_defined
-tokens.defined = is_defined
+local commands = token.commands()
+tokens.commands = utilities.storage.allocate(table.swapped(commands,commands))
+tokens.values = { }
+
+local scan_toks = token.scan_toks
+local scan_string = token.scan_string
+local scan_argument = token.scan_argument
+local scan_delimited = token.scan_delimited
+local scan_tokenlist = token.scan_tokenlist or scan_string
+local scan_integer = token.scan_integer or token.scan_int
+local scan_cardinal = token.scan_cardinal
+local scan_code = token.scan_code
+local scan_token_code = token.scan_token_code
+local scan_dimen = token.scan_dimen
+local scan_glue = token.scan_glue
+local scan_skip = token.scan_skip
+local scan_keyword = token.scan_keyword
+local scan_keyword_cs = token.scan_keyword_cs or scan_keyword
+local scan_token = token.scan_token
+local scan_box = token.scan_box
+local scan_word = token.scan_word
+local scan_letters = token.scan_letters or scan_word -- lmtx
+local scan_key = token.scan_key
+local scan_value = token.scan_value
+local scan_char = token.scan_char
+local scan_number = token.scan_number -- not defined
+local scan_csname = token.scan_csname
+local scan_real = token.scan_real
+local scan_float = token.scan_float
+local scan_luanumber = token.scan_luanumber or scan_float -- only lmtx
+local scan_luainteger = token.scan_luainteger or scan_integer -- only lmtx
+local scan_luacardinal = token.scan_luacardinal or scan_cardinal -- only lmtx
+
+local set_macro = token.set_macro
+local set_char = token.set_char
+local set_lua = token.set_lua
+
+local create_token = token.create
+local new_token = token.new
+local is_defined = token.is_defined
+local is_token = token.is_token
+
+tokens.new = new_token
+tokens.create = create_token
+tokens.istoken = is_token
+tokens.isdefined = is_defined
+tokens.defined = is_defined
local bits = {
escape = 0x00000001, -- 2^00
@@ -147,6 +137,7 @@ if not scan_box then
if s == "hbox" or s == "vbox" or s == "vtop" then
put_next(create_token(s))
end
+ return scan_list()
end
token.scan_box = scan_box
@@ -154,45 +145,65 @@ if not scan_box then
end
tokens.scanners = { -- these expand
- token = scan_token,
- toks = scan_toks,
- tokens = scan_toks,
- box = scan_box,
- hbox = function() return scan_box("hbox") end,
- vbox = function() return scan_box("vbox") end,
- vtop = function() return scan_box("vtop") end,
- dimen = scan_dimen,
- dimension = scan_dimen,
- glue = scan_glue,
- skip = scan_glue,
- integer = scan_int,
- real = scan_real,
- float = scan_float,
- count = scan_int,
- string = scan_string,
- argument = scan_argument,
- tokenlist = scan_tokenlist,
- verbatim = scan_verbatim,
- code = scan_code,
- tokencode = scan_token_code,
- word = scan_word,
- key = scan_key,
- value = scan_value,
- char = scan_char,
- number = scan_number,
- boolean = scan_boolean,
- keyword = scan_keyword,
- keywordcs = scan_keyword_cs,
- csname = scan_csname,
- peek = peek_next_char,
- skip = skip_next,
- ischar = is_next_char,
+ token = scan_token,
+ toks = scan_toks,
+ tokens = scan_toks,
+ box = scan_box,
+ hbox = function() return scan_box("hbox") end,
+ vbox = function() return scan_box("vbox") end,
+ vtop = function() return scan_box("vtop") end,
+ dimen = scan_dimen,
+ dimension = scan_dimen,
+ glue = scan_glue,
+ gluevalues = function() return scan_glue(false,false,true) end,
+ gluespec = scan_skip,
+ integer = scan_integer,
+ cardinal = scan_cardinal,
+ real = scan_real,
+ float = scan_float,
+ luanumber = scan_luanumber,
+ luainteger = scan_luainteger,
+ luacardinal = scan_luacardinal,
+ count = scan_integer,
+ string = scan_string,
+ argument = scan_argument,
+ delimited = scan_delimited,
+ tokenlist = scan_tokenlist,
+ verbatim = scan_verbatim, -- detokenize
+ code = scan_code,
+ tokencode = scan_token_code,
+ word = scan_word,
+ letters = scan_letters,
+ key = scan_key,
+ value = scan_value,
+ char = scan_char,
+ number = scan_number,
+ boolean = scan_boolean,
+ keyword = scan_keyword,
+ keywordcs = scan_keyword_cs,
+ csname = scan_csname,
+
+ next = token.scan_next,
+ nextexpanded = token.scan_next_expanded,
+
+ peek = token.peek_next,
+ peekexpanded = token.peek_next_expanded,
+ peekchar = token.peek_next_char,
+
+ skip = token.skip_next,
+ skipexpanded = token.skip_next_expanded,
+
+ cmdchr = token.scan_cmdchr,
+ cmdchrexpanded = token.scan_cmdchr_expanded,
+
+ ischar = token.is_next_char,
}
tokens.getters = { -- these don't expand
- meaning = get_meaning,
- macro = get_macro,
- token = get_next,
+ meaning = token.get_meaning,
+ macro = token.get_macro,
+ token = token.scan_next or token.get_next, -- not here, use scanners.next or token
+ cstoken = token.get_cstoken,
count = tex.getcount,
dimen = tex.getdimen,
skip = tex.getglue,
@@ -215,6 +226,23 @@ tokens.setters = {
box = tex.setbox,
}
+token.accessors = {
+ command = token.get_command,
+ cmd = token.get_command,
+ cmdname = token.get_cmdname,
+ name = token.get_cmdname,
+ csname = token.get_csname,
+ index = token.get_index,
+ active = token.get_active,
+ frozen = token.get_frozen,
+ protected = token.get_protected,
+ expandable = token.get_protected,
+ user = token.get_user,
+ cmdchrcs = token.get_cmdchrcs,
+ active = token.get_active,
+ range = token.get_range,
+}
+
-- static int run_scan_token(lua_State * L)
-- {
-- saved_tex_scanner texstate;
@@ -240,12 +268,13 @@ if setinspector then
local simple = { letter = "letter", other_char = "other" }
- local function astable(t)
+ local astable = function(t)
if t and is_token(t) then
local cmdname = t.cmdname
local simple = simple[cmdname]
if simple then
return {
+ id = t.id,
category = simple,
character = utfchar(t.mode) or nil,
}
@@ -261,6 +290,7 @@ if setinspector then
frozen = t.frozen,
mode = t.mode,
index = t.index,
+ user = t.user,
cmdname = cmdname,
}
end
@@ -281,3 +311,18 @@ tokens.cache = table.setmetatableindex(function(t,k)
t[k] = v
return v
end)
+
+if LUATEXVERSION < 114 then
+
+ local d = tokens.defined
+ local c = tokens.create
+
+ function tokens.defined(s,b)
+ if b then
+ return d(s)
+ else
+ return c(s).cmd_name == "undefined_cmd"
+ end
+ end
+
+end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/toks-scn.lua b/Master/texmf-dist/tex/context/base/mkiv/toks-scn.lua
index 2d20d5a8b31..98d2f66c08d 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/toks-scn.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/toks-scn.lua
@@ -22,17 +22,24 @@ local tokenbits = tokens.bits
local scanstring = scanners.string
local scanargument = scanners.argument
+local scandelimited = scanners.delimited -- lmtx
local scanverbatim = scanners.verbatim
local scantokenlist = scanners.tokenlist
+local scantoks = scanners.toks
local scaninteger = scanners.integer
+local scancardinal = scanners.cardinal
local scannumber = scanners.number
local scankeyword = scanners.keyword
local scankeywordcs = scanners.keywordcs
local scanword = scanners.word
+local scanletters = scanners.letters
local scankey = scanners.key
local scancode = scanners.code
local scanboolean = scanners.boolean
local scandimen = scanners.dimen
+local scanglue = scanners.glue
+local scangluevalues = scanners.gluevalues
+local scangluespec = scanners.gluespec
local scancsname = scanners.csname
local todimen = number.todimen
@@ -113,22 +120,24 @@ local function scantable(t,data)
if not data then
data = { }
end
- local wrapped = scanopen()
- while true do
- local key = scanword()
- if key then
- local get = t[key]
- if get then
- data[key] = get()
+ if t then
+ local wrapped = scanopen()
+ while true do
+ local key = scanword(true)
+ if key then
+ local get = t[key]
+ if get then
+ data[key] = get()
+ else
+ -- catch all we can get
+ end
else
- -- catch all we can get
+ break
end
- else
- break
end
- end
- if wrapped then
- scanclose()
+ if wrapped then
+ scanclose()
+ end
end
return data
end
@@ -165,42 +174,89 @@ function scanners.whd()
end
end
+-- begin lmtx
+
+local l = utf.byte("[")
+local r = utf.byte("]")
+
+local function scanbracketed()
+ local s = scandelimited(l, r)
+ if s then
+ return s
+ else
+ local readstate = status.getreadstate()
+ report_scan("missing argument in line %i of %a", readstate.linenumber, readstate.filename)
+ return ""
+ end
+end
+
+local function scanoptional()
+ return scandelimited(l, r) or ""
+end
+
+local function scanbracketedasis()
+ return scandelimited(l, r, false)
+end
+
+local function scanargumentasis()
+ return scanargument(false)
+end
+
+scanners.bracketed = scanbracketed
+scanners.optional = scanoptional
+scanners.bracketedasis = scanbracketedasis
+scanners.argumentasis = scanargumentasis
+
+-- end lmtx
+
local shortcuts = {
- tokens = tokens,
- bits = tokenbits,
- open = open,
- close = close,
- scanners = scanners,
- scanstring = scanstring,
- scanargument = scanargument,
- scanverbatim = scanverbatim,
- scantokenlist = scantokenlist,
- scaninteger = scaninteger,
- scannumber = scannumber,
- scantable = scantable,
- scankeyword = scankeyword,
- scankeywordcs = scankeywordcs,
- scanword = scanword,
- -- scankey = scankey,
- scancode = scancode,
- scanboolean = scanboolean,
- scandimen = scandimen,
- scandimension = scandimen,
- scanbox = scanners.box,
- scanhbox = scanners.hbox,
- scanvbox = scanners.vbox,
- scanvtop = scanners.vtop,
- scanconditional = scanconditional,
- scanopen = scanopen,
- scanclose = scanclose,
- scanlist = scanlist,
- scancsname = scancsname,
- todimen = todimen,
- tonumber = tonumber,
- tostring = tostring,
- toboolean = toboolean,
- inspect = inspect,
- report = report_scan,
+ tokens = tokens,
+ bits = tokenbits,
+ open = open,
+ close = close,
+ scanners = scanners,
+ scanstring = scanstring,
+ scanargument = scanargument,
+ scanverbatim = scanverbatim,
+ scantokenlist = scantokenlist,
+ scantoks = scantoks,
+ scaninteger = scaninteger,
+ scancardinal = scancardinal,
+ scannumber = scannumber,
+ scantable = scantable, -- not directly useable
+ scankeyword = scankeyword,
+ scankeywordcs = scankeywordcs,
+ scanword = scanword,
+ scanletters = scanletters,
+ -- scankey = scankey,
+ scancode = scancode,
+ scanboolean = scanboolean,
+ scanglue = scanglue, -- list
+ scangluespec = scangluespec,
+ scangluevalues = scangluevalues,
+ scandimen = scandimen,
+ scandimension = scandimen,
+ scanbox = scanners.box,
+ scanhbox = scanners.hbox,
+ scanvbox = scanners.vbox,
+ scanvtop = scanners.vtop,
+ scanconditional = scanconditional,
+ scanopen = scanopen,
+ scanclose = scanclose,
+ scanlist = scanlist,
+ scancsname = scancsname,
+ todimen = todimen,
+ tonumber = tonumber,
+ tostring = tostring,
+ toboolean = toboolean,
+ inspect = inspect,
+ report = report_scan,
+ -- lmtx
+ scandelimited = scandelimited, -- not directly useable
+ scanbracketed = scanbracketed,
+ scanoptional = scanoptional,
+ scanbracketedasis = scanbracketedasis,
+ scanargumentasis = scanargumentasis,
}
tokens.shortcuts = shortcuts
@@ -221,22 +277,20 @@ tokens.converters = {
toglue = "todimen",
}
--- We could just pickup a keyword but then we really need to make sure
--- that no number follows it when that is the assignment and adding
--- an optional = defeats the gain in speed. Currently we have sources
--- with no spaces (\startcontextdefinitioncode ...) so it fails there.
+-- We could just pickup a keyword but then we really need to make sure that no number
+-- follows it when that is the assignment and adding an optional = defeats the gain
+-- in speed. Currently we have sources with no spaces (\startcontextdefinitioncode
+-- ...) so it fails there.
--
--- Another drawback is that we then need to use { } instead of ending
--- with \relax (as we can do now) but that is no big deal. It's just
--- that I then need to check the TeX end. More pain than gain and a bit
--- risky too.
+-- Another drawback is that we then need to use { } instead of ending with \relax (as
+-- we can do now) but that is no big deal. It's just that I then need to check the TeX
+-- end. More pain than gain and a bit risky too. Using scanletters works better, but
+-- the gain is only some 10 percent but if we don't have keywords with numbers it might
+-- make sense in the end, some day.
local f_if = formatters[ " if scankeywordcs('%s') then data['%s'] = scan%s()"]
local f_elseif = formatters[" elseif scankeywordcs('%s') then data['%s'] = scan%s()"]
------ f_if = formatters[" local key = scanword() if key == '' then break elseif key == '%s' then data['%s'] = scan%s()"]
------ f_elseif = formatters[" elseif key == '%s' then data['%s'] = scan%s()"]
-
----- f_if_x = formatters[ " if not data['%s'] and scankeywordcs('%s') then data['%s'] = scan%s()"]
----- f_elseif_x = formatters[" elseif not data['%s'] and scankeywordcs('%s') then data['%s'] = scan%s()"]
@@ -249,52 +303,23 @@ local f_elseif_c = formatters[" elseif scankeywordcs('%s') then data['%s'] = %s
local f_scan_c = formatters["%s(scan%s())"]
-- see above
---
------ f_if_c = formatters[" local key = scanword() if key == '' then break elseif key == '%s' then data['%s'] = %s(scan%s())"]
------ f_elseif_c = formatters[" elseif k == '%s' then data['%s'] = %s(scan%s())"]
-local f_any = formatters[" else local key = scanword() if key then data[key] = scan%s() else break end end"]
-local f_any_c = formatters[" else local key = scanword() if key then data[key] = %s(scan%s()) else break end end"]
+local f_any = formatters[" else local key = scanword(true) if key then data[key] = scan%s() else break end end"]
+local f_any_c = formatters[" else local key = scanword(true) if key then data[key] = %s(scan%s()) else break end end"]
local s_done = " else break end"
-local f_any_all = formatters[" local key = scanword() if key then data[key] = scan%s() else break end"]
-local f_any_all_c= formatters[" local key = scanword() if key then data[key] = %s(scan%s()) else break end"]
+local f_any_all = formatters[" local key = scanword(true) if key then data[key] = scan%s() else break end"]
+local f_any_all_c= formatters[" local key = scanword(true) if key then data[key] = %s(scan%s()) else break end"]
local f_table = formatters["%\nt\nreturn function()\n local data = { }\n%s\n return %s\nend\n"]
local f_sequence = formatters["%\nt\n%\nt\n%\nt\nreturn function()\n return %s\nend\n"]
+local f_singular = formatters["%\nt\n%\nt\n\nreturn function(%s)\n return %s\nend\n"]
local f_simple = formatters["%\nt\nreturn function()\n return %s\nend\n"]
local f_string = formatters["%q"]
local f_action_f = formatters["action%s(%s)"]
local f_action_s = formatters["local action%s = tokens._action[%s]"]
local f_nested = formatters["local function scan%s()\n local data = { }\n%s\n return data\nend\n"]
--- local f_check = formatters[ [[
--- local wrapped = false
--- while true do
--- local c = scancode(open)
--- if c == 123 then
--- wrapped = true
--- break
--- elseif c ~= 32 then
--- break
--- end
--- end
--- while true do
--- ]] .. "%\nt\n" .. [[
--- %s
--- end
--- if wrapped then
--- while true do
--- local c = scancode(close)
--- if c == 125 then
--- break
--- elseif c ~= 32 then
--- break
--- end
--- end
--- end
--- ]] ]
-
local f_check = formatters[ [[
local wrapped = scanopen()
while true do
@@ -317,6 +342,11 @@ local presets = {
["6 strings"] = { "string", "string", "string", "string", "string", "string" },
["7 strings"] = { "string", "string", "string", "string", "string", "string", "string" },
["8 strings"] = { "string", "string", "string", "string", "string", "string", "string", "string" },
+
+ ["1 argument" ] = { "argument" },
+ ["2 arguments"] = { "argument", "argument" },
+ ["3 arguments"] = { "argument", "argument", "argument" },
+ ["4 arguments"] = { "argument", "argument", "argument", "argument" },
}
tokens.presets = presets
@@ -331,6 +361,7 @@ function tokens.compile(specification)
a = { a }
end
local code
+ local args
local function compile(t,nested)
local done = s_done
local r = { }
@@ -437,6 +468,23 @@ function tokens.compile(specification)
else
return scanners[ti]
end
+ elseif #t == 0 then
+ if specification.usage == "value" then
+ code = "b"
+ args = "_,b"
+ else
+ code = ""
+ args = ""
+ end
+ if a then
+ tokens._action = a
+ for i=1,#a do
+ code = f_action_f(i,code)
+ n = n + 1
+ f[n] = f_action_s(i,i)
+ end
+ end
+ code = f_singular(c,f,args,code)
else
local r = { }
local p = { }
@@ -522,7 +570,7 @@ end
-- { "nature", "boolean" },
-- { "escape", "string" },
-- { "escape" },
--- }
+-- },
-- "boolean",
-- }
--
diff --git a/Master/texmf-dist/tex/context/base/mkiv/toks-scn.mkiv b/Master/texmf-dist/tex/context/base/mkiv/toks-scn.mkiv
index 49edf0c242a..12abf0cb85f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/toks-scn.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/toks-scn.mkiv
@@ -19,4 +19,8 @@
\registerctxluafile{cldf-scn}{}
\registerctxluafile{cldf-stp}{}
+\ifcase \contextlmtxmode \else
+ \registerctxluafile{cldf-lmt}{}
+\fi
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/toks-tra.lua b/Master/texmf-dist/tex/context/base/mkiv/toks-tra.lua
deleted file mode 100644
index 3a5bc130635..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/toks-tra.lua
+++ /dev/null
@@ -1,293 +0,0 @@
-if not modules then modules = { } end modules ['toks-ini'] = {
- version = 1.001,
- author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
- copyright = "PRAGMA ADE / ConTeXt Development Team",
- license = "see context related readme files"
-}
-
--- this will become a module
-
-local utfbyte, utfchar, utfvalues = utf.byte, utf.char, utf.values
-local format, gsub = string.format, string.gsub
-local tostring = tostring
-
-local tokens = tokens
-local token = token -- the built in one
-local tex = tex
-local context = context
-local commands = commands
-
-tokens.collectors = tokens.collectors or { }
-local collectors = tokens.collectors
-
-collectors.data = collectors.data or { }
-local collectordata = collectors.data
-
-collectors.registered = collectors.registered or { }
-local registered = collectors.registered
-
-local report = logs.reporter("tokens","collectors")
-
--- todo:
---
--- register : macros that will be expanded (only for demo-ing)
--- flush : print back to tex
--- test : fancy stuff
-
-local get_next = token.get_next
-local create_token = token.create
-
-function collectors.install(tag,end_cs)
- local data, d = { }, 0
- collectordata[tag] = data
- end_cs = gsub(end_cs,"^\\","")
- while true do
- local t = get_next()
- if t.csname == end_cs then
- context[end_cs]()
- return
- else
- d = d + 1
- data[d] = t
- end
- end
-end
-
-local simple = { letter = "letter", other_char = "other" }
-
-function collectors.show(data)
- -- We no longer have methods as we only used (in demos) method a
- -- so there is no need to burden the core with this. We have a
- -- different table anyway.
- if type(data) == "string" then
- data = collectordata[data]
- end
- if not data then
- return
- end
- local ctx_NC = context.NC
- local ctx_NR = context.NR
- local ctx_bold = context.bold
- local ctx_verbatim = context.verbatim
- context.starttabulate { "|Tl|Tc|Tl|" }
- ctx_NC() ctx_bold("cmd")
- ctx_NC() ctx_bold("meaning")
- ctx_NC() ctx_bold("properties")
- ctx_NC() ctx_NR()
- context.HL()
- for i=1,#data do
- local token = data[i]
- local cmdname = token.cmdname
- local simple = simple[cmdname]
- ctx_NC()
- ctx_verbatim(simple or cmdname)
- ctx_NC()
- ctx_verbatim(simple and utfchar(token.mode) or token.csname)
- ctx_NC()
- if token.active then context("active ") end
- if token.expandable then context("expandable ") end
- if token.protected then context("protected ") end
- ctx_NC()
- ctx_NR()
- end
- context.stoptabulate()
-end
-
-local function printlist(data)
- if data and #data > 0 then
- report("not supported (yet): printing back to tex")
- end
-end
-
-tokens.printlist = printlist -- will change to another namespace
-
-function collectors.flush(tag)
- printlist(collectordata[tag])
-end
-
-function collectors.test(tag,handle)
- report("not supported (yet): testing")
-end
-
-function collectors.register(name)
- report("not supported (yet): registering")
-end
-
--- -- old token code
---
--- -- 1 = command, 2 = modifier (char), 3 = controlsequence id
---
--- local create = token.create
--- local csname_id = token.csname_id
--- local command_id = token.command_id
--- local command_name = token.command_name
--- local get_next = token.get_next
--- local expand = token.expand
--- local csname_name = token.csname_name
---
--- local function printlist(data)
--- if data and #data > 0 then
--- callbacks.push('token_filter', function ()
--- callbacks.pop('token_filter') -- tricky but the nil assignment helps
--- return data
--- end)
--- end
--- end
---
--- tokens.printlist = printlist -- will change to another namespace
---
--- function collectors.flush(tag)
--- printlist(collectordata[tag])
--- end
---
--- function collectors.register(name)
--- registered[csname_id(name)] = name
--- end
---
--- local call = command_id("call")
--- local letter = command_id("letter")
--- local other = command_id("other_char")
---
--- function collectors.install(tag,end_cs)
--- local data, d = { }, 0
--- collectordata[tag] = data
--- end_cs = gsub(end_cs,"^\\","")
--- local endcs = csname_id(end_cs)
--- while true do
--- local t = get_next()
--- local a, b = t[1], t[3]
--- if b == endcs then
--- context[end_cs]()
--- return
--- elseif a == call and registered[b] then
--- expand()
--- else
--- d = d + 1
--- data[d] = t
--- end
--- end
--- end
---
--- function collectors.show(data)
--- -- We no longer have methods as we only used (in demos) method a
--- -- so there is no need to burden the core with this.
--- if type(data) == "string" then
--- data = collectordata[data]
--- end
--- if not data then
--- return
--- end
--- local ctx_NC = context.NC
--- local ctx_NR = context.NR
--- local ctx_bold = context.bold
--- local ctx_verbatim = context.verbatim
--- context.starttabulate { "|T|Tr|cT|Tr|T|" }
--- ctx_NC() ctx_bold("cmd")
--- ctx_NC() ctx_bold("chr")
--- ctx_NC()
--- ctx_NC() ctx_bold("id")
--- ctx_NC() ctx_bold("name")
--- ctx_NC() ctx_NR()
--- context.HL()
--- for i=1,#data do
--- local token = data[i]
--- local cmd = token[1]
--- local chr = token[2]
--- local id = token[3]
--- local name = command_name(token)
--- ctx_NC()
--- ctx_verbatim(name)
--- ctx_NC()
--- if tonumber(chr) >= 0 then
--- ctx_verbatim(chr)
--- end
--- ctx_NC()
--- if cmd == letter or cmd == other then
--- ctx_verbatim(utfchar(chr))
--- end
--- ctx_NC()
--- if id > 0 then
--- ctx_verbatim(id)
--- end
--- ctx_NC()
--- if id > 0 then
--- ctx_verbatim(csname_name(token) or "")
--- end
--- ctx_NC() ctx_NR()
--- end
--- context.stoptabulate()
--- end
---
--- function collectors.test(tag,handle)
--- local t, w, tn, wn = { }, { }, 0, 0
--- handle = handle or collectors.defaultwords
--- local tagdata = collectordata[tag]
--- for k=1,#tagdata do
--- local v = tagdata[k]
--- if v[1] == letter then
--- wn = wn + 1
--- w[wn] = v[2]
--- else
--- if wn > 0 then
--- handle(t,w)
--- wn = 0
--- end
--- tn = tn + 1
--- t[tn] = v
--- end
--- end
--- if wn > 0 then
--- handle(t,w)
--- end
--- collectordata[tag] = t
--- end
-
--- Interfacing:
-
-commands.collecttokens = collectors.install
-commands.showtokens = collectors.show
-commands.flushtokens = collectors.flush
-commands.testtokens = collectors.test
-commands.registertoken = collectors.register
-
--- Redundant:
-
--- function collectors.test(tag)
--- printlist(collectordata[tag])
--- end
-
--- For old times sake:
-
-collectors.dowithwords = collectors.test
-
--- This is only used in old articles ... will move to a module:
-
-tokens.vbox = create_token("vbox")
-tokens.hbox = create_token("hbox")
-tokens.vtop = create_token("vtop")
-tokens.bgroup = create_token(utfbyte("{"),1)
-tokens.egroup = create_token(utfbyte("}"),2)
-
-tokens.letter = function(chr) return create_token(utfbyte(chr),11) end
-tokens.other = function(chr) return create_token(utfbyte(chr),12) end
-
-tokens.letters = function(str)
- local t, n = { }, 0
- for chr in utfvalues(str) do
- n = n + 1
- t[n] = create_token(chr, 11)
- end
- return t
-end
-
-function collectors.defaultwords(t,str)
- if t then
- local n = #t
- n = n + 1 ; t[n] = tokens.bgroup
- n = n + 1 ; t[n] = create_token("red")
- for i=1,#str do
- n = n + 1 ; t[n] = tokens.other('*')
- end
- n = n + 1 ; t[n] = tokens.egroup
- end
-end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/toks-tra.mkiv b/Master/texmf-dist/tex/context/base/mkiv/toks-tra.mkiv
deleted file mode 100644
index 04f837f1cf9..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/toks-tra.mkiv
+++ /dev/null
@@ -1,34 +0,0 @@
-%D \module
-%D [ file=toks-tra, % was toks-ini
-%D version=2007.03.03,
-%D title=\CONTEXT\ Token Support,
-%D subtitle=Initialization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Token Support / Tracing}
-
-\registerctxluafile{toks-tra}{}
-
-\unprotect
-
-%D Handy for manuals \unknown\ but not really used in practice, so it might
-%D become a runtime loaded module instead.
-
-\unexpanded\def\starttokens [#1]{\ctxcommand{collecttokens("#1","stoptokens")}}
- \let\stoptokens \relax
-\unexpanded\def\flushtokens [#1]{\ctxcommand{flushtokens("#1")}}
-\unexpanded\def\showtokens [#1]{\ctxcommand{showtokens("#1")}}
-\unexpanded\def\testtokens [#1]{\ctxcommand{testtokens("#1")}}
-\unexpanded\def\registertoken #1{\ctxcommand{registertoken("#1")}}
-
-\let\toks_show\showtokens % we also support the primitive
-
-\unexpanded\def\showtokens{\doifelsenextoptional\toks_show\normalshowtokens}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/trac-ctx.lua b/Master/texmf-dist/tex/context/base/mkiv/trac-ctx.lua
index 6681be51c5f..a808778b316 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/trac-ctx.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/trac-ctx.lua
@@ -8,18 +8,21 @@ if not modules then modules = { } end modules ['trac-ctx'] = {
local next = next
-local context = context
-local implement = interfaces.implement
-local register = trackers.register
+local context = context
+local implement = interfaces.implement
+local register = trackers.register
-local textrackers = tex.trackers or { }
-local texdirectives = tex.directives or { }
+local textrackers = tex.trackers or { }
+local texdirectives = tex.directives or { }
+local texexperiments = tex.experiments or { }
-tex.trackers = textrackers
-tex.directives = texdirectives
+tex.trackers = textrackers
+tex.directives = texdirectives
+tex.experiments = texexperiments
-storage.register("tex/trackers", textrackers, "tex.trackers")
-storage.register("tex/directives",texdirectives,"tex.directives")
+storage.register("tex/trackers", textrackers, "tex.trackers")
+storage.register("tex/directives", texdirectives, "tex.directives")
+storage.register("tex/experiments",texexperiments,"tex.experiments")
local function doit(category,tag,v)
local tt = category[tag]
@@ -56,6 +59,13 @@ implement {
}
implement {
+ name = "initializetexexperiments",
+ actions = function()
+ initialize(texexperiments,experiments.register)
+ end
+}
+
+implement {
name = "installtextracker",
arguments = "3 strings",
actions = function(tag,enable,disable)
@@ -71,6 +81,14 @@ implement {
end,
}
+implement {
+ name = "installtexexperiment",
+ arguments = "3 strings",
+ actions = function(tag,enable,disable)
+ install(texexperiments,experiments.register,tag,enable,disable)
+ end,
+}
+
-- this one might move
interfaces.implement {
diff --git a/Master/texmf-dist/tex/context/base/mkiv/trac-ctx.mkiv b/Master/texmf-dist/tex/context/base/mkiv/trac-ctx.mkiv
index 66b5ef1ee7a..77e4a4f0ff7 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/trac-ctx.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/trac-ctx.mkiv
@@ -23,9 +23,13 @@
\unexpanded\def\installtexdirective#1#2#3%
{\clf_installtexdirective{#1}{\detokenize{#2}}{\detokenize{#3}}}
+\unexpanded\def\installtexexperiment#1#2#3%
+ {\clf_installtexexperiment{#1}{\detokenize{#2}}{\detokenize{#3}}}
+
\appendtoks
\clf_initializetextrackers
\clf_initializetexdirectives
+ \clf_initializetexexperiments
\to \everyjob
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/trac-deb.lua b/Master/texmf-dist/tex/context/base/mkiv/trac-deb.lua
index 71055eafac9..07865e4bf50 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/trac-deb.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/trac-deb.lua
@@ -13,100 +13,13 @@ local status = status
local tonumber, tostring, type = tonumber, tostring, type
local format, concat, match, find, gsub = string.format, table.concat, string.match, string.find, string.gsub
-local lpegmatch = lpeg.match
--- maybe tracers -> tracers.tex (and tracers.lua for current debugger)
+local report_nl = logs.newline
+local report_str = logs.writer
------ report_tex = logs.reporter("tex error")
------ report_lua = logs.reporter("lua error")
-local report_nl = logs.newline
-local report_str = logs.writer
-
-tracers = tracers or { }
-local tracers = tracers
-
-tracers.lists = { }
-local lists = tracers.lists
-
-tracers.strings = { }
-local strings = tracers.strings
-
-local texgetdimen = tex.getdimen
-local texgettoks = tex.gettoks
-local texgetcount = tex.getcount
-local texgethelp = tex.gethelptext or function() end
-local fatalerror = tex.fatalerror
-
-local implement = interfaces.implement
-
--- this is used in lmx files but needs to be redone
-
-strings.undefined = "undefined"
-
-function tracers.dimen(name)
- local d = texgetdimen(name)
- return d and number.topoints(d) or strings.undefined
-end
-
-function tracers.count(name)
- return texgetcount(name) or strings.undefined
-end
-
-function tracers.toks(name,limit)
- local t = texgettoks(name)
- return t and string.limit(t,tonumber(limit) or 40) or strings.undefined
-end
-
-function tracers.primitive(name)
- return tex[name] or strings.undefined
-end
-
-lists.scratch = {
- 0, 2, 4, 6, 8
-}
-
-lists.internals = {
- 'p:hsize', 'p:parindent', 'p:leftskip','p:rightskip',
- 'p:vsize', 'p:parskip', 'p:baselineskip', 'p:lineskip', 'p:topskip'
-}
-
-lists.context = {
- 'd:lineheight',
- 'c:realpageno', 'c:userpageno', 'c:pageno', 'c:subpageno'
-}
-
-local types = {
- ['d'] = tracers.dimen,
- ['c'] = tracers.count,
- ['t'] = tracers.toks,
- ['p'] = tracers.primitive
-}
-
-local splitboth = lpeg.splitat(":")
-
-function tracers.type(csname)
- local tag, name = lpegmatch(splitboth,csname)
- return tag or ""
-end
-
-function tracers.name(csname)
- local tag, name = lpegmatch(splitboth,csname)
- return name or csname
-end
-
-function tracers.cs(csname)
- local tag, name = lpegmatch(splitboth,csname)
- if name and types[tag] then
- return types[tag](name)
- else
- return tracers.primitive(csname)
- end
-end
-
-function tracers.knownlist(name)
- local l = lists[name]
- return l and #l > 0
-end
+tracers = tracers or { }
+local tracers = tracers
+local implement = interfaces.implement
local savedluaerror = nil
local usescitelexer = nil
@@ -179,19 +92,12 @@ end
-- todo: some nested errors have two line numbers
-- todo: collect errorcontext in string (after code cleanup)
-- todo: have a separate status.lualinenumber
-
-- todo: \starttext bla \blank[foo] bla \stoptext
local nop = function() end
local resetmessages = status.resetmessages or nop
-local function processerror(offset)
- -- print("[[ last tex error: " .. tostring(status.lasterrorstring or "<unset>") .. " ]]")
- -- print("[[ last lua error: " .. tostring(status.lastluaerrorstring or "<unset>") .. " ]]")
- -- print("[[ last warning : " .. tostring(status.lastwarningstring or "<unset>") .. " ]]")
- -- print("[[ last location : " .. tostring(status.lastwarninglocation or "<unset>") .. " ]]")
- -- print("[[ last context : " .. tostring(status.lasterrorcontext or "<unset>") .. " ]]")
-
+local function processerror(offset,eof)
local filename = status.filename
local linenumber = tonumber(status.linenumber) or 0
local lastcontext = status.lasterrorcontext
@@ -211,26 +117,15 @@ local function processerror(offset)
luaerrorline = luaerrorline,
lastcontext = lastcontext,
lasttexhelp = tex.gethelptext and tex.gethelptext() or nil,
+ endoffile = eof,
}
-end
-
--- so one can overload the printer if (really) needed
-
-if fatalerror then
- callback.register("terminal_input",function(what)
- if what == "*" then
- fatalerror("some kind of input expected, file ends too soon, quitting now")
- else
- fatalerror("bad input, quitting now")
- end
- end)
-else
- -- tex.print("\\nonstopmode")
+ if job and type(job.disablesave) == "function" then
+ job.disablesave()
+ end
end
directives.register("system.quitonerror",function(v)
quitonerror = toboolean(v)
- -- tex.print("\\errorstopmode")
end)
directives.register("system.usescitelexer",function(v)
@@ -251,9 +146,15 @@ function tracers.printerror(specification)
local luaerrorline = specification.luaerrorline
local errortype = specification.errortype
local offset = specification.offset
+ local endoffile = specification.endoffile
local report = errorreporter(luaerrorline)
- if not filename then
- report("error not related to input file:")
+ if endoffile then
+ report("runaway error: %s",lasttexerror or "-")
+ if not quitonerror and texio.terminal then
+ texio.terminal() -- not well tested
+ end
+ elseif not filename then
+ report("fuzzy error:")
report(" tex: %s",lasttexerror or "-")
report(" lua: %s",lastluaerror or "-")
report(" mps: %s",lastmpserror or "-")
@@ -281,6 +182,10 @@ function tracers.printerror(specification)
report_nl()
tex.show_context()
end
+ if lastluaerror and not match(lastluaerror,"^%s*[%?]*%s*$") then
+ print("\nlua error:\n\n",lastluaerror,"\n")
+ quitonerror = true
+ end
end
report_nl()
report_str(tracers.showlines(filename,linenumber,offset,tonumber(luaerrorline)))
@@ -322,9 +227,9 @@ directives.register("system.errorcontext", function(v)
local register = callback.register
if v then
register('show_error_message', nop)
- register('show_warning_message',function() processwarning(v) end)
- register('show_error_hook', function() processerror(v) end)
- register('show_lua_error_hook', function() processerror(v) end)
+ register('show_warning_message',function() processwarning(v) end)
+ register('show_error_hook', function(eof) processerror(v,eof) end)
+ register('show_lua_error_hook', function() processerror(v) end)
else
register('show_error_message', nil)
register('show_error_hook', nil)
@@ -351,15 +256,6 @@ local function reportback(lmxname,default,variables)
end
end
-function lmx.showdebuginfo(lmxname)
- local variables = {
- ['title'] = 'ConTeXt Debug Information',
- ['color-background-one'] = lmx.get('color-background-green'),
- ['color-background-two'] = lmx.get('color-background-blue'),
- }
- reportback(lmxname,"context-debug.lmx",variables)
-end
-
local function showerror(lmxname)
local filename, linenumber, errorcontext = status.filename, tonumber(status.linenumber) or 0, ""
if not filename then
@@ -390,6 +286,7 @@ function lmx.overloaderror(v)
end
callback.register('show_error_hook', function() showerror() end) -- prevents arguments being passed
callback.register('show_lua_error_hook', function() showerror() end) -- prevents arguments being passed
+ callback.register('show_tex_error_hook', function() showerror() end) -- prevents arguments being passed
end
directives.register("system.showerror", lmx.overloaderror)
@@ -429,8 +326,6 @@ directives.register("system.showerror", lmx.overloaderror)
-- end
-- end)
-local implement = interfaces.implement
-
implement { name = "showtrackers", actions = trackers.show }
implement { name = "enabletrackers", actions = trackers.enable, arguments = "string" }
implement { name = "disabletrackers", actions = trackers.disable, arguments = "string" }
@@ -444,7 +339,6 @@ implement { name = "showexperiments", actions = experiments.show }
implement { name = "enableexperiments", actions = experiments.enable, arguments = "string" }
implement { name = "disableexperiments", actions = experiments.disable, arguments = "string" }
-implement { name = "showdebuginfo", actions = lmx.showdebuginfo }
implement { name = "overloaderror", actions = lmx.overloaderror }
implement { name = "showlogcategories", actions = logs.show }
diff --git a/Master/texmf-dist/tex/context/base/mkiv/trac-deb.mkiv b/Master/texmf-dist/tex/context/base/mkiv/trac-deb.mkiv
index b5366d88c73..fcbacfb9e24 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/trac-deb.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/trac-deb.mkiv
@@ -13,12 +13,10 @@
\writestatus{loading}{ConTeXt Tracing Macros / Debugger}
-\unprotect
-
%registerctxluafile{trac-lmx}{}
-\registerctxluafile{trac-deb}{}
+\registerctxluafile{trac-deb}{autosuffix}
-\unexpanded\def\breakpoint {\showdebuginfo\wait}
+\unprotect
\unexpanded\def\showtrackers {\clf_showtrackers}
\unexpanded\def\enabletrackers [#1]{\clf_enabletrackers{#1}}
@@ -33,7 +31,6 @@
\unexpanded\def\enableexperiments [#1]{\clf_enableexperiments{#1}}
\unexpanded\def\disableexperiments[#1]{\clf_disableexperiments{#1}}
-\unexpanded\def\showdebuginfo {\clf_showdebuginfo}
\unexpanded\def\overloaderror {\clf_overloaderror}
\unexpanded\def\showlogcategories {\clf_showlogcategories}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/trac-inf.lua b/Master/texmf-dist/tex/context/base/mkiv/trac-inf.lua
index 244ba4604a3..e2736cfb6eb 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/trac-inf.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/trac-inf.lua
@@ -129,10 +129,8 @@ local function stoptiming(instance)
timer.loadtime = timer.loadtime + loadtime
timer.timing = 0
timer.starttime = 0
- return loadtime
end
end
- return 0
end
local function benchmarktimer(instance)
@@ -223,21 +221,11 @@ function statistics.show()
return format("%s, type: %s, binary subtree: %s",
os.platform or "unknown",os.type or "unknown", environment.texos or "unknown")
end)
- -- register("luatex banner", function()
- -- return lower(status.banner)
- -- end)
- if LUATEXENGINE == "luametatex" then
- register("used engine", function()
- return format("%s version: %s, functionality level: %s, format id: %s, compiler: %s",
- LUATEXENGINE, LUATEXVERSION, LUATEXFUNCTIONALITY, LUATEXFORMATID, status.used_compiler)
- end)
- else
- register("used engine", function()
- return format("%s version: %s, functionality level: %s, banner: %s",
- LUATEXENGINE, LUATEXVERSION, LUATEXFUNCTIONALITY, lower(status.banner))
- end)
- end
- register("control sequences", function()
+ register("used engine", function()
+ return format("%s version: %s, functionality level: %s, banner: %s",
+ LUATEXENGINE, LUATEXVERSION, LUATEXFUNCTIONALITY, lower(status.banner))
+ end)
+ register("used hash slots", function()
return format("%s of %s + %s", status.cs_count, status.hash_size,status.hash_extra)
end)
register("callbacks", statistics.callbacks)
@@ -251,17 +239,11 @@ function statistics.show()
end
end
-- so far
- -- collectgarbage("collect")
register("lua properties",function()
- local hashchar = tonumber(status.luatex_hashchars)
- local mask = lua.mask or "ascii"
+ local hash = 2^status.luatex_hashchars
+ local mask = load([[τεχ = 1]]) and "utf" or "ascii"
return format("engine: %s %s, used memory: %s, hash chars: min(%i,40), symbol mask: %s (%s)",
- jit and "luajit" or "lua",
- LUAVERSION,
- statistics.memused(),
- hashchar and 2^hashchar or "unknown",
- mask,
- mask == "utf" and "τεχ" or "tex")
+ jit and "luajit" or "lua", LUAVERSION, statistics.memused(), hash, mask, mask == "utf" and "τεχ" or "tex")
end)
register("runtime",statistics.runtime)
logs.newline() -- initial newline
@@ -328,3 +310,12 @@ function statistics.tracefunction(base,tag,...)
statistics.register(formatters["%s.%s"](tag,name),function() return serialize(stat,"calls") end)
end
end
+
+function status.getreadstate()
+ return {
+ filename = status.filename or "?",
+ linenumber = status.linenumber or 0,
+ iocode = status.inputid or 0,
+ }
+end
+
diff --git a/Master/texmf-dist/tex/context/base/mkiv/trac-log.lua b/Master/texmf-dist/tex/context/base/mkiv/trac-log.lua
index bb154067f70..96b69a73e0f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/trac-log.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/trac-log.lua
@@ -8,6 +8,11 @@ if not modules then modules = { } end modules ['trac-log'] = {
-- In fact all writes could go through lua and we could write the console and
-- terminal handler in lua then. Ok, maybe it's slower then, so a no-go.
+--
+-- This is the version for mtxrun. The alternative functions for the TeX engines
+-- have been separated. In order to keep in sync we use tex specific witer names.
+--
+-- Todo: some cleanup (less local needed).
local next, type, select, print = next, type, select, print
local format, gmatch, find = string.format, string.gmatch, string.find
@@ -17,30 +22,16 @@ local utfchar = utf.char
local datetime = os.date
local openfile = io.open
-local runningtex = tex and (tex.jobname or tex.formatname)
--- local write_nl = texio and texio.write_nl or print
--- local write = texio and texio.write or io.write
-
-local write_nl = runningtex and texio and texio.write_nl or print
-local write = runningtex and texio and texio.write or io.write
+local write_nl = print
+local write = io.write
local setmetatableindex = table.setmetatableindex
local formatters = string.formatters
local settings_to_hash = utilities.parsers.settings_to_hash
local sortedkeys = table.sortedkeys
--- variant is set now
-
local variant = "default"
--- local variant = "ansi"
-
--- todo: less categories, more subcategories (e.g. nodes)
--- todo: split into basics and ctx specific
-
---[[ldx--
-<p>This is a prelude to a more extensive logging module. We no longer
-provide <l n='xml'/> based logging as parsing is relatively easy anyway.</p>
---ldx]]--
+----- variant = "ansi"
logs = logs or { }
local logs = logs
@@ -53,23 +44,6 @@ webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
wiki : http://contextgarden.net
]]
--- -- we extend the formatters:
---
--- function utilities.strings.unichr(s) return "U+" .. format("%05X",s) .. " (" .. utfchar(s) .. ")" end
--- function utilities.strings.chruni(s) return utfchar(s) .. " (U+" .. format("%05X",s) .. ")" end
---
--- utilities.strings.formatters.add (
--- string.formatters, "unichr",
--- [[unichr(%s)]],
--- [[local unichr = utilities.strings.unichr]]
--- )
---
--- utilities.strings.formatters.add (
--- string.formatters, "chruni",
--- [[chruni(%s)]],
--- [[local chruni = utilities.strings.chruni]]
--- )
-
formatters.add (
formatters, "unichr",
[["U+" .. format("%%05X",%s) .. " (" .. utfchar(%s) .. ")"]]
@@ -80,26 +54,6 @@ formatters.add (
[[utfchar(%s) .. " (U+" .. format("%%05X",%s) .. ")"]]
)
--- function utilities.strings.unichk(s) return s <= 0xFFFF and ("U+" .. format("%05X",s) .. " (" .. utfchar(s) .. ")") or ("U+" .. format("%05X",s)) end
--- function utilities.strings.chkuni(s) return s <= 0xFFFF and (utfchar(s) .. " (U+" .. format("%05X",s) .. ")") or ("U+" .. format("%05X",s)) end
---
--- utilities.strings.formatters.add (
--- string.formatters, "unichk",
--- [[unichk(%s)]],
--- [[local unichk = utilities.strings.unichk]]
--- )
---
--- utilities.strings.formatters.add (
--- string.formatters, "chkuni",
--- [[chkuni(%s)]],
--- [[local chkuni = utilities.strings.chkuni]]
--- )
---
--- print(formatters["Missing character %!chruni! in font."](234))
--- print(formatters["Missing character %!unichr! in font."](234))
--- print(formatters["Missing character %!chkuni! in font."](234))
--- print(formatters["Missing character %!unichk! in font."](234))
-
-- basic loggers
local function ignore() end
@@ -124,322 +78,7 @@ local function ansisupported(specification)
end
end
-if runningtex and texio then
-
- if texio.setescape then
- texio.setescape(0) -- or (false)
- end
-
- if arg and ansisupported then
- -- we're don't have environment.arguments yet
- for k, v in next, arg do -- k can be negative !
- if v == "--ansi" or v == "--c:ansi" then
- if ansisupported("ansi") then
- variant = "ansi"
- end
- break
- elseif v == "--ansilog" or v == "--c:ansilog" then
- if ansisupported("ansilog") then
- variant = "ansilog"
- end
- break
- end
- end
- end
-
- local function useluawrites()
-
- -- quick hack, awaiting speedup in engine (8 -> 6.4 sec for --make with console2)
- -- still needed for luajittex .. luatex should not have that ^^ mess
-
- local texio_write_nl = texio.write_nl
- local texio_write = texio.write
- local io_write = io.write
-
- write_nl = function(target,...)
- if not io_write then
- io_write = io.write
- end
- if target == "term and log" then
- texio_write_nl("log",...)
- texio_write_nl("term","")
- io_write(...)
- elseif target == "log" then
- texio_write_nl("log",...)
- elseif target == "term" then
- texio_write_nl("term","")
- io_write(...)
- elseif type(target) == "number" then
- texio_write_nl(target,...) -- a tex output channel
- elseif target ~= "none" then
- texio_write_nl("log",target,...)
- texio_write_nl("term","")
- io_write(target,...)
- end
- end
-
- write = function(target,...)
- if not io_write then
- io_write = io.write
- end
- if target == "term and log" then
- texio_write("log",...)
- io_write(...)
- elseif target == "log" then
- texio_write("log",...)
- elseif target == "term" then
- io_write(...)
- elseif type(target) == "number" then
- texio_write(target,...) -- a tex output channel
- elseif target ~= "none" then
- texio_write("log",target,...)
- io_write(target,...)
- end
- end
-
- texio.write = write
- texio.write_nl = write_nl
-
- useluawrites = ignore
-
- end
-
- -- local format = string.formatter
-
- local whereto = "both"
- local target = nil
- local targets = nil
-
- local formats = table.setmetatableindex("self")
- local translations = table.setmetatableindex("self")
-
- local report_yes, subreport_yes, direct_yes, subdirect_yes, status_yes
- local report_nop, subreport_nop, direct_nop, subdirect_nop, status_nop
-
- local variants = {
- default = {
- formats = {
- report_yes = formatters["%-15s > %s\n"],
- report_nop = formatters["%-15s >\n"],
- direct_yes = formatters["%-15s > %s"],
- direct_nop = formatters["%-15s >"],
- subreport_yes = formatters["%-15s > %s > %s\n"],
- subreport_nop = formatters["%-15s > %s >\n"],
- subdirect_yes = formatters["%-15s > %s > %s"],
- subdirect_nop = formatters["%-15s > %s >"],
- status_yes = formatters["%-15s : %s\n"],
- status_nop = formatters["%-15s :\n"],
- },
- targets = {
- logfile = "log",
- log = "log",
- file = "log",
- console = "term",
- terminal = "term",
- both = "term and log",
- },
- },
- ansi = {
- formats = {
- report_yes = formatters["%-15s > %s\n"],
- report_nop = formatters["%-15s >\n"],
- direct_yes = formatters["%-15s > %s"],
- direct_nop = formatters["%-15s >"],
- subreport_yes = formatters["%-15s > %s > %s\n"],
- subreport_nop = formatters["%-15s > %s >\n"],
- subdirect_yes = formatters["%-15s > %s > %s"],
- subdirect_nop = formatters["%-15s > %s >"],
- status_yes = formatters["%-15s : %s\n"],
- status_nop = formatters["%-15s :\n"],
- },
- targets = {
- logfile = "none",
- log = "none",
- file = "none",
- console = "term",
- terminal = "term",
- both = "term",
- },
- }
- }
-
- variants.ansilog = {
- formats = variants.ansi.formats,
- targets = variants.default.targets,
- }
-
- logs.flush = io.flush
-
- writer = function(...)
- write_nl(target,...)
- end
-
- newline = function()
- write_nl(target,"\n")
- end
-
- report = function(a,b,c,...)
- if c ~= nil then
- write_nl(target,report_yes(translations[a],formatters[formats[b]](c,...)))
- elseif b then
- write_nl(target,report_yes(translations[a],formats[b]))
- elseif a then
- write_nl(target,report_nop(translations[a]))
- else
- write_nl(target,"\n")
- end
- end
-
- direct = function(a,b,c,...)
- if c ~= nil then
- return direct_yes(translations[a],formatters[formats[b]](c,...))
- elseif b then
- return direct_yes(translations[a],formats[b])
- elseif a then
- return direct_nop(translations[a])
- else
- return ""
- end
- end
-
- subreport = function(a,s,b,c,...)
- if c ~= nil then
- write_nl(target,subreport_yes(translations[a],translations[s],formatters[formats[b]](c,...)))
- elseif b then
- write_nl(target,subreport_yes(translations[a],translations[s],formats[b]))
- elseif a then
- write_nl(target,subreport_nop(translations[a],translations[s]))
- else
- write_nl(target,"\n")
- end
- end
-
- subdirect = function(a,s,b,c,...)
- if c ~= nil then
- return subdirect_yes(translations[a],translations[s],formatters[formats[b]](c,...))
- elseif b then
- return subdirect_yes(translations[a],translations[s],formats[b])
- elseif a then
- return subdirect_nop(translations[a],translations[s])
- else
- return ""
- end
- end
-
- status = function(a,b,c,...)
- if c ~= nil then
- write_nl(target,status_yes(translations[a],formatters[formats[b]](c,...)))
- elseif b then
- write_nl(target,status_yes(translations[a],formats[b]))
- elseif a then
- write_nl(target,status_nop(translations[a]))
- else
- write_nl(target,"\n")
- end
- end
-
- settarget = function(askedwhereto)
- whereto = askedwhereto or whereto or "both"
- target = targets[whereto]
- if not target then
- whereto = "both"
- target = targets[whereto]
- end
- if target == "term" or target == "term and log" then
- logs.flush = io.flush
- else
- logs.flush = ignore
- end
- end
-
- local stack = { }
-
- pushtarget = function(newtarget)
- insert(stack,target)
- settarget(newtarget)
- end
-
- poptarget = function()
- if #stack > 0 then
- settarget(remove(stack))
- end
- end
-
- setformats = function(f)
- formats = f
- end
-
- settranslations = function(t)
- translations = t
- end
-
- setprocessor = function(f)
- local writeline = write_nl
- write_nl = function(target,...)
- writeline(target,f(...))
- end
- end
-
- setformatters = function(specification)
- local t = nil
- local f = nil
- local d = variants.default
- if not specification then
- --
- elseif type(specification) == "table" then
- t = specification.targets
- f = specification.formats or specification
- else
- if not ansisupported(specification) then
- specification = "default"
- end
- local v = variants[specification]
- if v then
- t = v.targets
- f = v.formats
- variant = specification
- end
- end
- targets = t or d.targets
- target = targets[whereto] or target
- if f then
- d = d.formats
- else
- f = d.formats
- d = f
- end
- setmetatableindex(f,d)
- report_yes = f.report_yes
- report_nop = f.report_nop
- subreport_yes = f.subreport_yes
- subreport_nop = f.subreport_nop
- direct_yes = f.direct_yes
- direct_nop = f.direct_nop
- subdirect_yes = f.subdirect_yes
- subdirect_nop = f.subdirect_nop
- status_yes = f.status_yes
- status_nop = f.status_nop
- if variant == "ansi" or variant == "ansilog" then
- useluawrites() -- because tex escapes ^^, not needed in lmtx
- end
- settarget(whereto)
- end
-
- setformatters(variant)
-
- setlogfile = ignore
- settimedlog = ignore
-
- -- settimedlog = function()
- -- local localtime = os.localtime
- -- local writeline = write_nl
- -- write_nl = function(f,...)
- -- writeline(f,localtime() .. " | " .. concat { ... })
- -- end
- -- settimedlog = ignore
- -- end
-
-else
+do
local report_yes, subreport_yes, status_yes
local report_nop, subreport_nop, status_nop
@@ -788,56 +427,6 @@ directives.register("logs.target", function(v)
settarget(v)
end)
--- tex specific loggers (might move elsewhere)
-
-if tex then
-
- local report = logs.reporter("pages") -- not needed but saves checking when we grep for it
- local texgetcount = tex and tex.getcount
-
- local real, user, sub = 0, 0, 0
-
- function logs.start_page_number()
- real = texgetcount("realpageno")
- user = texgetcount("userpageno")
- sub = texgetcount("subpageno")
- end
-
- local timing = false
- local lasttime = nil
-
- trackers.register("pages.timing", function(v) -- only for myself (diagnostics)
- timing = ""
- end)
-
- function logs.stop_page_number() -- the first page can includes the initialization so we omit this in average
- if timing then
- local elapsed = statistics.currenttime(statistics)
- local average, page
- if not lasttime or real < 2 then
- average = elapsed
- page = elapsed
- else
- average = elapsed / (real - 1)
- page = elapsed - lasttime
- end
- lasttime = elapsed
- timing = formatters[", total %0.03f, page %0.03f, average %0.03f"](elapsed,page,average)
- end
- if real <= 0 then
- report("flushing page%s",timing)
- elseif user <= 0 then
- report("flushing realpage %s%s",real,timing)
- elseif sub <= 0 then
- report("flushing realpage %s, userpage %s%s",real,user,timing)
- else
- report("flushing realpage %s, userpage %s, subpage %s%s",real,user,sub,timing)
- end
- logs.flush()
- end
-
-end
-
-- we don't have show_open and show_close callbacks yet
----- report_files = logs.reporter("files")
@@ -864,14 +453,6 @@ logs.help = ignore -- obsolete
-- applications
--- local function reportlines(t,str)
--- if str then
--- for line in gmatch(str,"([^\n\r]*)[\n\r]") do
--- t.report(line)
--- end
--- end
--- end
-
local Carg, C, lpegmatch = lpeg.Carg, lpeg.C, lpeg.match
local p_newline = lpeg.patterns.newline
@@ -926,12 +507,12 @@ local function reportexport(t,method)
end
local reporters = {
- lines = reportlines, -- not to be overloaded
- banner = reportbanner,
- version = reportversion,
- help = reporthelp,
- info = reportinfo,
- export = reportexport,
+ lines = reportlines, -- not to be overloaded
+ banner = reportbanner,
+ version = reportversion,
+ help = reporthelp,
+ info = reportinfo,
+ export = reportexport,
}
local exporters = {
@@ -1000,47 +581,10 @@ end
local report_system = logs.reporter("system","logs")
-function logs.obsolete(old,new)
- local o = loadstring("return " .. new)()
- if type(o) == "function" then
- return function(...)
- report_system("function %a is obsolete, use %a",old,new)
- loadstring(old .. "=" .. new .. " return ".. old)()(...)
- end
- elseif type(o) == "table" then
- local t, m = { }, { }
- m.__index = function(t,k)
- report_system("table %a is obsolete, use %a",old,new)
- m.__index, m.__newindex = o, o
- return o[k]
- end
- m.__newindex = function(t,k,v)
- report_system("table %a is obsolete, use %a",old,new)
- m.__index, m.__newindex = o, o
- o[k] = v
- end
- if libraries then
- libraries.obsolete[old] = t -- true
- end
- setmetatable(t,m)
- return t
- end
-end
-
if utilities then
utilities.report = report_system
end
-if tex and tex.error then
- function logs.texerrormessage(...) -- for the moment we put this function here
- tex.error(format(...))
- end
-else
- function logs.texerrormessage(...)
- print(format(...))
- end
-end
-
-- this is somewhat slower but prevents out-of-order messages when print is mixed
-- with texio.write
@@ -1053,104 +597,3 @@ end
if package.helpers.report then
package.helpers.report = logs.reporter("package loader") -- when used outside mtxrun
end
-
-if tex then
-
- local finalactions = { }
- local fatalerrors = { }
- local possiblefatal = { }
- local loggingerrors = false
-
- function logs.loggingerrors()
- return loggingerrors
- end
-
- directives.register("logs.errors",function(v)
- loggingerrors = v
- if type(v) == "string" then
- fatalerrors = settings_to_hash(v)
- else
- fatalerrors = { }
- end
- end)
-
- function logs.registerfinalactions(...)
- insert(finalactions,...) -- so we can force an order if needed
- end
-
- local what = nil
- local report = nil
- local state = nil
- local target = nil
-
- local function startlogging(t,r,w,s)
- target = t
- state = force
- force = true
- report = type(r) == "function" and r or logs.reporter(r)
- what = w
- pushtarget(target)
- newline()
- if s then
- report("start %s: %s",what,s)
- else
- report("start %s",what)
- end
- if target == "logfile" then
- newline()
- end
- return report
- end
-
- local function stoplogging()
- if target == "logfile" then
- newline()
- end
- report("stop %s",what)
- if target == "logfile" then
- newline()
- end
- poptarget()
- state = oldstate
- end
-
- function logs.startfilelogging(...)
- return startlogging("logfile", ...)
- end
-
- logs.stopfilelogging = stoplogging
-
- local done = false
-
- function logs.starterrorlogging(r,w,...)
- if not done then
- pushtarget("terminal")
- newline()
- logs.report("error logging","start possible issues")
- poptarget()
- done = true
- end
- if fatalerrors[w] then
- possiblefatal[w] = true
- end
- return startlogging("terminal",r,w,...)
- end
-
- logs.stoperrorlogging = stoplogging
-
- function logs.finalactions()
- if #finalactions > 0 then
- for i=1,#finalactions do
- finalactions[i]()
- end
- if done then
- pushtarget("terminal")
- newline()
- logs.report("error logging","stop possible issues")
- poptarget()
- end
- return next(possiblefatal) and sortedkeys(possiblefatal) or false
- end
- end
-
-end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/trac-set.lua b/Master/texmf-dist/tex/context/base/mkiv/trac-set.lua
index 960c4ef84a6..3974830fab0 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/trac-set.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/trac-set.lua
@@ -33,7 +33,7 @@ local data = { }
local trace_initialize = false -- only for testing during development
local frozen = true -- this needs checking
-function setters.initialize(filename,name,values) -- filename only for diagnostics
+local function initialize_setter(filename,name,values) -- filename only for diagnostics
local setter = data[name]
if setter then
-- trace_initialize = true
@@ -81,8 +81,8 @@ end
-- user interface code
local function set(t,what,newvalue)
- local data = t.data
- if not data.frozen then
+ local data = t.data -- somehow this can be nil
+ if data and not data.frozen then
local done = t.done
if type(what) == "string" then
what = settings_to_hash(what) -- inefficient but ok
@@ -120,7 +120,7 @@ end
local function reset(t)
local data = t.data
- if not data.frozen then
+ if data and not data.frozen then
for name, functions in sortedthash(data) do
for i=1,#functions do
functions[i](false)
@@ -144,7 +144,7 @@ local function disable(t,what)
end
end
-function setters.register(t,what,...)
+local function register_setter(t,what,...)
local data = t.data
what = lower(what)
local functions = data[what]
@@ -182,26 +182,27 @@ function setters.register(t,what,...)
return false -- so we can use it in an assignment
end
-function setters.enable(t,what)
+local function enable_setter(t,what)
local e = t.enable
t.enable, t.done = enable, { }
+ set(t,what,true)
enable(t,what)
t.enable, t.done = e, { }
end
-function setters.disable(t,what)
+local function disable_setter(t,what)
local e = t.disable
t.disable, t.done = disable, { }
disable(t,what)
t.disable, t.done = e, { }
end
-function setters.reset(t)
+local function reset_setter(t)
t.done = { }
reset(t)
end
-function setters.list(t) -- pattern
+local function list_setter(t) -- pattern
local list = table.sortedkeys(t.data)
local user, system = { }, { }
for l=1,#list do
@@ -215,8 +216,8 @@ function setters.list(t) -- pattern
return user, system
end
-function setters.show(t)
- local list = setters.list(t)
+local function show_setter(t)
+ local list = list_setter(t)
t.report()
for k=1,#list do
local name = list[k]
@@ -253,44 +254,56 @@ end
-- we could make this into a module but we also want the rest avaliable
-local enable, disable, register, list, show = setters.enable, setters.disable, setters.register, setters.list, setters.show
-
function setters.report(setter,fmt,...)
- print(formatters["%-15s : %s\n"](setter.name,formatters[fmt](...)))
+ if fmt then
+ print(formatters["%-15s : %s"](setter.name,formatters[fmt](...)))
+ else
+ print("")
+ end
end
-local function default(setter,name)
+local function setter_default(setter,name)
local d = setter.data[name]
return d and d.default
end
-local function value(setter,name)
+local function setter_value(setter,name)
local d = setter.data[name]
return d and (d.value or d.default)
end
-function setters.new(name) -- we could use foo:bar syntax (but not used that often)
+local function new_setter(name) -- we could use foo:bar syntax (but not used that often)
local setter -- we need to access it in setter itself
setter = {
data = allocate(), -- indexed, but also default and value fields
name = name,
- report = function(...) setters.report (setter,...) end,
- enable = function(...) enable (setter,...) end,
- disable = function(...) disable (setter,...) end,
- reset = function(...) reset (setter,...) end, -- can be dangerous
- register = function(...) register(setter,...) end,
- list = function(...) return list (setter,...) end,
- show = function(...) show (setter,...) end,
- default = function(...) return default (setter,...) end,
- value = function(...) return value (setter,...) end,
+ report = function(...) setters.report (setter,...) end, -- setters.report gets implemented later
+ enable = function(...) enable_setter (setter,...) end,
+ disable = function(...) disable_setter (setter,...) end,
+ reset = function(...) reset_setter (setter,...) end, -- can be dangerous
+ register = function(...) register_setter(setter,...) end,
+ list = function(...) return list_setter (setter,...) end,
+ show = function(...) show_setter (setter,...) end,
+ default = function(...) return setter_default (setter,...) end,
+ value = function(...) return setter_value (setter,...) end,
}
data[name] = setter
return setter
end
-trackers = setters.new("trackers")
-directives = setters.new("directives")
-experiments = setters.new("experiments")
+setters.enable = enable_setter
+setters.disable = disable_setter
+-------.report = report_setter -- todo: adapt after call (defaults to print)
+setters.register = register_setter
+setters.list = list_setter
+setters.show = show_setter
+setters.reset = reset_setter
+setters.new = new_setter
+setters.initialize = initialize_setter
+
+trackers = new_setter("trackers")
+directives = new_setter("directives")
+experiments = new_setter("experiments")
local t_enable, t_disable = trackers .enable, trackers .disable
local d_enable, d_disable = directives .enable, directives .disable
@@ -361,12 +374,12 @@ if environment then
if engineflags then
local list = engineflags["c:trackers"] or engineflags["trackers"]
if type(list) == "string" then
- setters.initialize("commandline flags","trackers",settings_to_hash(list))
+ initialize_setter("commandline flags","trackers",settings_to_hash(list))
-- t_enable(list)
end
local list = engineflags["c:directives"] or engineflags["directives"]
if type(list) == "string" then
- setters.initialize("commandline flags","directives", settings_to_hash(list))
+ initialize_setter("commandline flags","directives", settings_to_hash(list))
-- d_enable(list)
end
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/trac-vis.lua b/Master/texmf-dist/tex/context/base/mkiv/trac-vis.lua
index 0ca50899bf6..fb5ef98d939 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/trac-vis.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/trac-vis.lua
@@ -1,12 +1,13 @@
if not modules then modules = { } end modules ['trac-vis'] = {
version = 1.001,
+ optimize = true,
comment = "companion to trac-vis.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
}
-local node, nodes, attributes, fonts, tex = node, nodes, attributes, fonts, tex
+local node, nodes, attributes, tex = node, nodes, attributes, tex
local type, tonumber, next, rawget = type, tonumber, next, rawget
local gmatch = string.gmatch
local formatters = string.formatters
@@ -27,14 +28,13 @@ local round = math.round
-- todo: maybe also xoffset, yoffset of glyph
-- todo: inline concat (more efficient)
-- todo: tags can also be numbers (just add to hash)
+-- todo: make a lmtx variant (a few more efficient fetchers)
local nodecodes = nodes.nodecodes
local nuts = nodes.nuts
local tonut = nuts.tonut
-local tonode = nuts.tonode
------ setfield = nuts.setfield
local setboth = nuts.setboth
local setlink = nuts.setlink
local setdisc = nuts.setdisc
@@ -63,6 +63,8 @@ local getwidth = nuts.getwidth
local getdepth = nuts.getdepth
local getshift = nuts.getshift
local getexpansion = nuts.getexpansion
+local getdirection = nuts.getdirection
+local getstate = nuts.getstate
local isglyph = nuts.isglyph
@@ -77,8 +79,6 @@ local apply_to_nodes = nuts.apply
local find_tail = nuts.tail
local effectiveglue = nuts.effective_glue
-local nextnode = nuts.traversers.node
-
local hpack_string = nuts.typesetters.tohpack
local texgetattribute = tex.getattribute
@@ -166,10 +166,14 @@ local modes = {
space = 0x040000,
depth = 0x080000,
marginkern = 0x100000,
+ mathlistkern = 0x200000,
+ dir = 0x400000,
+ par = 0x800000,
}
local usedfont, exheight, emwidth
-local l_penalty, l_glue, l_kern, l_fontkern, l_hbox, l_vbox, l_vtop, l_strut, l_whatsit, l_glyph, l_user, l_math, l_marginkern, l_italic, l_origin, l_discretionary, l_expansion, l_line, l_space, l_depth
+local l_penalty, l_glue, l_kern, l_fontkern, l_hbox, l_vbox, l_vtop, l_strut, l_whatsit, l_glyph, l_user, l_math, l_marginkern, l_mathlistkern, l_italic, l_origin, l_discretionary, l_expansion, l_line, l_space, l_depth,
+ l_dir, l_whatsit
local enabled = false
local layers = { }
@@ -178,7 +182,9 @@ local preset_boxes = modes.hbox + modes.vbox + modes.origin
local preset_makeup = preset_boxes
+ modes.kern + modes.glue + modes.penalty
local preset_all = preset_makeup
- + modes.fontkern + modes.marginkern + modes.whatsit + modes.glyph + modes.user + modes.math
+ + modes.fontkern + modes.marginkern + modes.mathlistkern
+ + modes.whatsit + modes.glyph + modes.user + modes.math
+ + modes.dir + modes.whatsit
function visualizers.setfont(id)
usedfont = id or current_font()
@@ -223,12 +229,15 @@ local function initialize()
l_math = layers.math
l_italic = layers.italic
l_marginkern = layers.marginkern
+ l_mathlistkern = layers.mathlistkern
l_origin = layers.origin
l_discretionary = layers.discretionary
l_expansion = layers.expansion
l_line = layers.line
l_space = layers.space
l_depth = layers.depth
+ l_dir = layers.dir
+ l_par = layers.par
--
if not userrule then
userrule = nuts.rules.userrule
@@ -366,10 +375,6 @@ for mode, value in next, modes do
trackers.register(formatters["visualizers.%s"](mode), function(v) set(mode,v) end)
end
-local raisepenalties = false
-
-directives.register("visualizers.raisepenalties",function(v) raisepenalties = v end)
-
local fraction = 10
trackers .register("visualizers.reset", function(v) set("reset", v) end)
@@ -389,10 +394,10 @@ local c_skip_b = "trace:m"
local c_glyph = "trace:o"
local c_ligature = "trace:s"
local c_white = "trace:w"
-local c_math = "trace:s"
-local c_origin = "trace:o"
-local c_discretionary = "trace:d"
-local c_expansion = "trace:o"
+----- c_math = "trace:s"
+----- c_origin = "trace:o"
+----- c_discretionary = "trace:d"
+----- c_expansion = "trace:o"
local c_depth = "trace:o"
local c_indent = "trace:s"
@@ -410,8 +415,9 @@ local c_white_d = "trace:dw"
local c_math_d = "trace:dr"
local c_origin_d = "trace:do"
local c_discretionary_d = "trace:dd"
-local c_expansion_d = "trace:do"
-local c_depth_d = "trace:do"
+----- c_expansion_d = "trace:do"
+----- c_depth_d = "trace:do"
+----- c_indent_d = "trace:ds"
local function sometext(str,layer,color,textcolor,lap) -- we can just paste verbatim together .. no typesteting needed
local text = hpack_string(str,usedfont)
@@ -463,11 +469,12 @@ end
local caches = setmetatableindex("table")
-local fontkern, italickern, marginkern do
+local fontkern, italickern, marginkern, mathlistkern do
local f_cache = caches["fontkern"]
local i_cache = caches["italickern"]
local m_cache = caches["marginkern"]
+ local l_cache = caches["mathlistkern"]
local function somekern(head,current,cache,color,layer)
local width = getkern(current)
@@ -509,6 +516,10 @@ local fontkern, italickern, marginkern do
return somekern(head,current,m_cache,c_glyph_d,l_marginkern)
end
+ mathlistkern = function(head,current)
+ return somekern(head,current,l_cache,c_glyph_d,l_mathlistkern)
+ end
+
end
local glyphexpansion do
@@ -549,6 +560,8 @@ local kernexpansion do
local f_cache = caches["kernexpansion"]
+ -- in mkiv we actually need to reconstruct but let's not do that now
+
kernexpansion = function(head,current)
local extra = getexpansion(current)
if extra ~= 0 then
@@ -604,9 +617,7 @@ local whatsit do
if info then
-- print("hit whatsit")
else
- local tag = whatsitcodes[what]
- -- maybe different text colors per tag
- info = sometext(formatters["W:%s"](tag and tags[tag] or what),usedfont,nil,c_white)
+ info = sometext(formatters["W:%s"](what),usedfont,nil,c_white)
setattr(info,a_layer,l_whatsit)
w_cache[what] = info
end
@@ -616,6 +627,59 @@ local whatsit do
end
+local dir, par do
+
+ local dircodes = nodes.dircodes
+ local dirvalues = nodes.dirvalues
+
+ local cancel_code = dircodes.cancel
+ local l2r_code = dirvalues.l2r
+ local r2l_code = dirvalues.r2l
+
+ local d_cache = caches["dir"]
+
+ local tags = {
+ l2r = "L2R",
+ r2l = "R2L",
+ cancel = "CAN",
+ par = "PAR",
+ }
+
+ par = function(head,current)
+ local what = "par" -- getsubtype(current)
+ local info = d_cache[what]
+ if info then
+ -- print("hit par")
+ else
+ info = sometext(formatters["L:%s"](what),usedfont,nil,c_white)
+ setattr(info,a_layer,l_dir)
+ d_cache[what] = info
+ end
+ return head, current
+ end
+
+ dir = function(head,current)
+ local what = getsubtype(current)
+ if what == cancelcode then
+ what = "cancel"
+ elseif getdirection(current) == r2l_code then
+ what = "r2l"
+ else
+ what = "l2r"
+ end
+ local info = d_cache[what]
+ if info then
+ -- print("hit dir")
+ else
+ info = sometext(formatters["D:%s"](what),usedfont,nil,c_white)
+ setattr(info,a_layer,l_dir)
+ d_cache[what] = info
+ end
+ return head, current
+ end
+
+end
+
local user do
local u_cache = caches["user"]
@@ -865,26 +929,26 @@ end
local ruledglue do
- local gluecodes = nodes.gluecodes
- local leadercodes = nodes.gluecodes
+ local gluecodes = nodes.gluecodes
- local userskip_code = gluecodes.userskip
- local spaceskip_code = gluecodes.spaceskip
- local xspaceskip_code = gluecodes.xspaceskip
- local leftskip_code = gluecodes.leftskip
- local rightskip_code = gluecodes.rightskip
- local parfillskip_code = gluecodes.parfillskip
- local indentskip_code = gluecodes.indentskip
- local correctionskip_code = gluecodes.correctionskip
-
- local cleaders_code = leadercodes.cleaders
+ local userskip_code = gluecodes.userskip
+ local spaceskip_code = gluecodes.spaceskip
+ local xspaceskip_code = gluecodes.xspaceskip
+ local zerospaceskip_code = gluecodes.zerospaceskip or gluecodes.userskip
+ -- local keepskip_code = gluecodes.keepskip or gluecodes.userskip
+ local leftskip_code = gluecodes.leftskip
+ local rightskip_code = gluecodes.rightskip
+ local parfillleftskip_code = gluecodes.parfillleftskip or parfillskip_code
+ local parfillrightskip_code = gluecodes.parfillrightskip or parfillskip_code
+ local indentskip_code = gluecodes.indentskip
+ local correctionskip_code = gluecodes.correctionskip
local g_cache_v = caches["vglue"]
local g_cache_h = caches["hglue"]
local tags = {
-- [userskip_code] = "US",
- [gluecodes.lineskip] = "LS",
+ [gluecodes.lineskip] = "LI",
[gluecodes.baselineskip] = "BS",
[gluecodes.parskip] = "PS",
[gluecodes.abovedisplayskip] = "DA",
@@ -900,18 +964,21 @@ local ruledglue do
[gluecodes.medmuskip] = "MM",
[gluecodes.thickmuskip] = "ML",
[gluecodes.intermathskip] = "IM",
+ [gluecodes.keepskip or 99] = "KS",
[gluecodes.mathskip] = "MT",
- [leadercodes.leaders] = "NL",
- [leadercodes.cleaders] = "CL",
- [leadercodes.xleaders] = "XL",
- [leadercodes.gleaders] = "GL",
+ [gluecodes.leaders] = "NL",
+ [gluecodes.cleaders] = "CL",
+ [gluecodes.xleaders] = "XL",
+ [gluecodes.gleaders] = "GL",
-- true = "VS",
-- false = "HS",
[leftskip_code] = "LS",
[rightskip_code] = "RS",
[spaceskip_code] = "SP",
[xspaceskip_code] = "XS",
- [parfillskip_code] = "PF",
+ [zerospaceskip_code] = "ZS",
+ [parfillleftskip_code] = "PL",
+ [parfillrightskip_code] = "PR",
[indentskip_code] = "IN",
[correctionskip_code] = "CS",
}
@@ -926,11 +993,11 @@ local ruledglue do
if info then
-- print("glue hit")
else
- if subtype == spaceskip_code or subtype == xspaceskip_code then
+ if subtype == spaceskip_code or subtype == xspaceskip_code or subtype == zerospaceskip_code then
info = sometext(amount,l_glue,c_space)
elseif subtype == leftskip_code or subtype == rightskip_code then
info = sometext(amount,l_glue,c_skip_a)
- elseif subtype == parfillskip_code or subtype == indentskip_code or subtype == correctionskip_code then
+ elseif subtype == parfillleftskip_code or subtype == parfillrightskip_code or subtype == indentskip_code or subtype == correctionskip_code then
info = sometext(amount,l_glue,c_indent)
elseif subtype == userskip_code then
if width > 0 then
@@ -955,7 +1022,7 @@ local ruledglue do
-- ruledspace = function(head,current,parent)
-- local subtype = getsubtype(current)
- -- if subtype == spaceskip_code or subtype == xspaceskip_code then
+ -- if subtype == spaceskip_code or subtype == xspaceskip_code or subtype == zerospaceskip_code then
-- local width = effectiveglue(current,parent)
-- local amount = formatters["%s:%0.3f"](tags[subtype] or "HS",width*pt_factor)
-- local info = g_cache_h[amount]
@@ -978,7 +1045,7 @@ local ruledglue do
ruledspace = function(head,current,parent)
local subtype = getsubtype(current)
- if subtype == spaceskip_code or subtype == xspaceskip_code then -- not yet all space
+ if subtype == spaceskip_code or subtype == xspaceskip_code or subtype == zerospaceskip_code then -- not yet all space
local width = effectiveglue(current,parent)
local info
if subtype == spaceskip_code then
@@ -1084,6 +1151,31 @@ local ruledmarginkern do
end
+local ruledmathlistkern do
+
+ local l_cache = caches["mathlistkern"]
+
+ ruledmathlistkern = function(head,current)
+ local kern = getkern(current)
+ local info = l_cache[kern]
+ if not info then
+ local amount = formatters["%s:%0.3f"]("LK",kern*pt_factor)
+ if kern > 0 then
+ info = sometext(amount,l_mathlistkern,c_positive)
+ elseif kern < 0 then
+ info = sometext(amount,l_mathlistkern,c_negative)
+ else
+ info = sometext(amount,l_mathlistkern,c_zero)
+ end
+ l_cache[kern] = info
+ end
+ info = copy_list(info)
+ head, current = insert_node_before(head,current,info)
+ return head, getnext(current)
+ end
+
+end
+
local ruleddiscretionary do
local d_cache = caches["discretionary"]
@@ -1111,6 +1203,10 @@ local ruledpenalty do
local p_cache_v = caches["vpenalty"]
local p_cache_h = caches["hpenalty"]
+ local raisepenalties = false
+
+ directives.register("visualizers.raisepenalties",function(v) raisepenalties = v end)
+
ruledpenalty = function(head,current,vertical)
local penalty = getpenalty(current)
local info = (vertical and p_cache_v or p_cache_h)[penalty]
@@ -1141,27 +1237,31 @@ end
do
- local disc_code = nodecodes.disc
- local kern_code = nodecodes.kern
- local glyph_code = nodecodes.glyph
- local glue_code = nodecodes.glue
- local penalty_code = nodecodes.penalty
- local whatsit_code = nodecodes.whatsit
- local user_code = nodecodes.user
- local math_code = nodecodes.math
- local hlist_code = nodecodes.hlist
- local vlist_code = nodecodes.vlist
- local marginkern_code = nodecodes.marginkern
+ local disc_code = nodecodes.disc
+ local kern_code = nodecodes.kern
+ local glyph_code = nodecodes.glyph
+ local glue_code = nodecodes.glue
+ local penalty_code = nodecodes.penalty
+ local whatsit_code = nodecodes.whatsit
+ local user_code = nodecodes.user
+ local math_code = nodecodes.math
+ local hlist_code = nodecodes.hlist
+ local vlist_code = nodecodes.vlist
+ local marginkern_code = nodecodes.marginkern
+ local mathlistkern_code = nodecodes.mathlistkern
+ local dir_code = nodecodes.dir
+ local par_code = nodecodes.par
local kerncodes = nodes.kerncodes
local fontkern_code = kerncodes.fontkern
local italickern_code = kerncodes.italiccorrection
local leftmarginkern_code = kerncodes.leftmarginkern
local rightmarginkern_code = kerncodes.rightmarginkern
+ local mathlistkern_code = kerncodes.mathlistkern
----- userkern_code = kerncodes.userkern
- local listcodes = nodes.listcodes
- local linelist_code = listcodes.line
+ local listcodes = nodes.listcodes
+ local linelist_code = listcodes.line
local cache
@@ -1186,73 +1286,27 @@ do
local trace_line = false
local trace_space = false
local trace_depth = false
+ local trace_dir = false
+ local trace_par = false
local current = head
local previous = nil
local attr = unsetvalue
local prev_trace_fontkern = nil
- local prev_trace_marginkern = nil
local prev_trace_italic = nil
+ local prev_trace_marginkern = nil
+-- local prev_trace_mathlist = nil
local prev_trace_expansion = nil
- -- local function setthem(t,k)
- -- local v_trace_hbox = band(k, 1) ~= 0
- -- local v_trace_vbox = band(k, 2) ~= 0
- -- local v_trace_vtop = band(k, 4) ~= 0
- -- local v_trace_kern = band(k, 8) ~= 0
- -- local v_trace_glue = band(k, 16) ~= 0
- -- local v_trace_penalty = band(k, 32) ~= 0
- -- local v_trace_fontkern = band(k, 64) ~= 0
- -- local v_trace_strut = band(k, 128) ~= 0
- -- local v_trace_whatsit = band(k, 256) ~= 0
- -- local v_trace_glyph = band(k, 512) ~= 0
- -- local v_trace_simple = band(k, 1024) ~= 0
- -- local v_trace_user = band(k, 2048) ~= 0
- -- local v_trace_math = band(k, 4096) ~= 0
- -- local v_trace_italic = band(k, 8192) ~= 0
- -- local v_trace_origin = band(k, 16384) ~= 0
- -- local v_trace_discretionary = band(k, 32768) ~= 0
- -- local v_trace_expansion = band(k, 65536) ~= 0
- -- local v_trace_line = band(k,131072) ~= 0
- -- local v_trace_space = band(k,262144) ~= 0
- -- local v_trace_depth = band(k,524288) ~= 0
- -- local v = function()
- -- trace_hbox = v_trace_hbox
- -- trace_vbox = v_trace_vbox
- -- trace_vtop = v_trace_vtop
- -- trace_kern = v_trace_kern
- -- trace_glue = v_trace_glue
- -- trace_penalty = v_trace_penalty
- -- trace_fontkern = v_trace_fontkern
- -- trace_strut = v_trace_strut
- -- trace_whatsit = v_trace_whatsit
- -- trace_glyph = v_trace_glyph
- -- trace_simple = v_trace_simple
- -- trace_user = v_trace_user
- -- trace_math = v_trace_math
- -- trace_italic = v_trace_italic
- -- trace_origin = v_trace_origin
- -- trace_discretionary = v_trace_discretionary
- -- trace_expansion = v_trace_expansion
- -- trace_line = v_trace_line
- -- trace_space = v_trace_space
- -- trace_depth = v_trace_depth
- -- end
- -- t[k] = v
- -- return v
- -- end
- --
- -- if not cache then
- -- cache = setmetatableindex(setthem)
- -- end
-
while current do
local id = getid(current)
local a = forced or getattr(current,a_visual) or unsetvalue
+ local subtype
if a ~= attr then
- prev_trace_fontkern = trace_fontkern
- prev_trace_italic = trace_italic
- prev_trace_marginkern = trace_marginkern
- prev_trace_expansion = trace_expansion
+ prev_trace_fontkern = trace_fontkern
+ prev_trace_italic = trace_italic
+ prev_trace_marginkern = trace_marginkern
+-- prev_trace_mathlistkern = trace_mathlistkern
+ prev_trace_expansion = trace_expansion
attr = a
if a == unsetvalue then
trace_hbox = false
@@ -1276,7 +1330,14 @@ do
trace_space = false
trace_depth = false
trace_marginkern = false
- goto list
+ trace_mathlistkern = false
+ trace_dir = false
+ trace_par = false
+ if id == kern_code then
+ goto kern
+ else
+ goto list
+ end
else -- dead slow:
-- cache[a]()
trace_hbox = band(a,0x000001) ~= 0
@@ -1300,6 +1361,9 @@ do
trace_space = band(a,0x040000) ~= 0
trace_depth = band(a,0x080000) ~= 0
trace_marginkern = band(a,0x100000) ~= 0
+ trace_mathlistkern = band(a,0x200000) ~= 0
+ trace_dir = band(a,0x400000) ~= 0
+ trace_whatsit = band(a,0x800000) ~= 0
end
elseif a == unsetvalue then
goto list
@@ -1329,31 +1393,7 @@ do
end
setdisc(current,pre,post,replace)
elseif id == kern_code then
- local subtype = getsubtype(current)
- if subtype == fontkern_code then
- if trace_fontkern or prev_trace_fontkern then
- head, current = fontkern(head,current)
- end
- if trace_expansion or prev_trace_expansion then
- head, current = kernexpansion(head,current)
- end
- elseif subtype == italickern_code then
- if trace_italic or prev_trace_italic then
- head, current = italickern(head,current)
- elseif trace_kern then
- head, current = ruleditalic(head,current)
- end
- elseif subtype == leftmarginkern_code or subtype == rightmarginkern_code then
- if trace_marginkern or prev_trace_marginkern then
- head, current = marginkern(head,current)
- elseif trace_kern then
- head, current = ruledmarginkern(head,current)
- end
- else
- if trace_kern then
- head, current = ruledkern(head,current,vertical)
- end
- end
+ goto kern
elseif id == glue_code then
local content = getleader(current)
if content then
@@ -1385,8 +1425,49 @@ do
if trace_kern then
head, current = ruledkern(head,current,vertical,true)
end
+ elseif id == dir_code then
+ if trace_dir then
+ head, current = dir(head,current)
+ end
+ elseif id == par_code then
+ if trace_par then
+ head, current = par(head,current)
+ end
end
goto next
+ ::kern::
+ subtype = getsubtype(current)
+ if subtype == fontkern_code then
+ if trace_fontkern or prev_trace_fontkern then
+ head, current = fontkern(head,current)
+ end
+ if trace_expansion or prev_trace_expansion then
+ head, current = kernexpansion(head,current)
+ end
+ elseif subtype == italickern_code then
+ if trace_italic or prev_trace_italic then
+ head, current = italickern(head,current)
+ elseif trace_kern then
+ head, current = ruleditalic(head,current)
+ end
+ elseif subtype == leftmarginkern_code or subtype == rightmarginkern_code then
+ if trace_marginkern or prev_trace_marginkern then
+ head, current = marginkern(head,current)
+ elseif trace_kern then
+ head, current = ruledmarginkern(head,current)
+ end
+ elseif subtype == mathlistkern_code then
+ if trace_mathlist then -- or prev_trace_mathlist then
+ head, current = mathlistkern(head,current)
+ elseif trace_kern then
+ head, current = ruledmathlistkern(head,current)
+ end
+ else
+ if trace_kern then
+ head, current = ruledkern(head,current,vertical)
+ end
+ end
+ goto next;
::list::
if id == hlist_code then
local content = getlist(current)
@@ -1430,7 +1511,9 @@ do
end
end
- local function handler(head)
+ luatex.registerstopactions(cleanup)
+
+ function visualizers.handler(head)
if usedfont then
starttiming(visualizers)
head = visualize(head,true)
@@ -1441,10 +1524,6 @@ do
end
end
- visualizers.handler = handler
-
- luatex.registerstopactions(cleanup)
-
function visualizers.box(n)
if usedfont then
starttiming(visualizers)
@@ -1465,6 +1544,7 @@ do
local hlist_code = nodecodes.hlist
local vlist_code = nodecodes.vlist
+ local nextnode = nuts.traversers.node
local last = nil
local used = nil
diff --git a/Master/texmf-dist/tex/context/base/mkiv/trac-vis.mkiv b/Master/texmf-dist/tex/context/base/mkiv/trac-vis.mkiv
index 570e6a7c730..5357c841470 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/trac-vis.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/trac-vis.mkiv
@@ -44,15 +44,16 @@
% no, but can become an option:
%
% \appendtoks
-% \attribute\visualattribute\attributeunsetvalue
+% \c_attr_visual\attributeunsetvalue
% \to \everybeforepagebody
%D We only provide box visualizers as they can come in handy for testing
%D macros. In due time we will move some of the m-visual code here too.
-\let\syst_visualizers_hbox\hbox
-\let\syst_visualizers_vbox\vbox
-\let\syst_visualizers_vtop\vtop
+\let\syst_visualizers_hbox \hbox
+\let\syst_visualizers_vbox \vbox
+\let\syst_visualizers_vtop \vtop
+\let\syst_visualizers_vcenter\vcenter
\let\syst_visualizers_hpack\hpack
\let\syst_visualizers_vpack\vpack
@@ -69,6 +70,19 @@
\unexpanded\def\ruledmbox#1{\ruledhbox{\startimath#1\stopimath}}
+\unexpanded\def\sys_ruled_vcenter{\syst_visualizers_vcenter attr \visualattribute \clf_getvisual {simplevbox}}
+
+\unexpanded\def\ruledvcenter
+ {\ruledvbox\bgroup
+ \dowithnextboxcs\syst_boxes_ruled_vcenter_finish\ruledvbox}
+
+\def\syst_boxes_ruled_vcenter_finish
+ {\ruledhpack{\normalstartimath\ruledvcenter{\box\nextbox}\normalstopimath}%
+ \egroup}
+
+\prependtoks \let\ruledvcenter\sys_ruled_vcenter \to \everymath
+\prependtoks \let\ruledvcenter\sys_ruled_vcenter \to \everydisplay
+
\appendtoks
\ifcase\c_syst_visualizers_state\else
\syst_visualizers_speedup
@@ -140,7 +154,7 @@
\endgroup}
\unexpanded\def\resetvisualizers
- {\attribute\visualattribute\attributeunsetvalue}
+ {\c_attr_visual\attributeunsetvalue}
%D New (these might also be a visualizers):
diff --git a/Master/texmf-dist/tex/context/base/mkiv/type-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/type-ini.lua
index a2e19725ed0..771cf39c056 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/type-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/type-ini.lua
@@ -17,9 +17,6 @@ local implement = interfaces.implement
local uselibrary = resolvers.uselibrary
-local name_one = nil
-local name_two = nil
-
local p_strip = Cs((P("type-") * (P("imp-")^0))^0/"" * P(1)^0)
local report = logs.reporter("fonts","typescripts")
@@ -29,6 +26,7 @@ local function action(name,foundname)
end
local patterns = {
+ "type-imp-%s.mkxl",
"type-imp-%s.mkiv",
"type-imp-%s.tex"
}
@@ -56,6 +54,7 @@ implement {
}
local patterns = {
+ "type-imp-%s.mkxl",
"type-imp-%s.mkiv",
"type-imp-%s.tex",
-- obsolete
@@ -63,6 +62,9 @@ local patterns = {
"type-%s.tex"
}
+-- local name_one = nil
+-- local name_two = nil
+--
-- local function failure_two(name)
-- report("unknown library %a or %a",name_one,name_two)
-- end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/type-ini.mklx b/Master/texmf-dist/tex/context/base/mkiv/type-ini.mklx
deleted file mode 100644
index 5470c9016ce..00000000000
--- a/Master/texmf-dist/tex/context/base/mkiv/type-ini.mklx
+++ /dev/null
@@ -1,618 +0,0 @@
-%D \module
-%D [ file=type-ini,
-%D version=2001.03.05,
-%D title=\CONTEXT\ Typescript Macros,
-%D subtitle=Initialization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Typescript Macros / Initialization}
-
-\registerctxluafile{type-ini}{}
-
-%D The default fontclass is empty. We could demand always using fontclasses, and
-%D then make the calling macros simplier (always assume fontclass) but apart from
-%D downward compatibility issues, it would make global, class spanning definitions a
-%D pain. Some day we will introduce a default class.
-%D
-%D The \type {type-ini} and \type {font-ini} modules come as a pair and have mutual
-%D dependencies.
-%D
-%D At some point we will only store in memory so some code can go away.
-
-\unprotect
-
-\definesystemvariable {ts} % TypeScript / for the moment we keep this one
-
-\newcount \c_font_typescripts_n_of_preloaded
-\newconditional\c_font_typescripts_quit
-\newtoks \c_font_typescripts_document
-\newconditional\c_font_typescripts_preload
-\newconditional\c_font_typescripts_first_pass \settrue\c_font_typescripts_first_pass
-
-\newif \iftypescriptfound % will become a mode
-\newif \iftracetypescripts
-
-\newtoks \everybeforedefinetypeface
-\newtoks \everyafterdefinetypeface
-
-\let\typescriptfiles \empty
-\let\currenttypescripts\empty
-\let\currenttypefile \empty
-
-\installmacrostack\currenttypefile
-
-\let\typescriptone \empty % public, used in typescripts
-\let\typescripttwo \empty % public, used in typescripts
-\let\typescriptthree\empty % public, used in typescripts
-
-\installmacrostack\typescriptone
-\installmacrostack\typescripttwo
-\installmacrostack\typescriptthree
-
-\let\fontclassstyle \empty
-
-\installmacrostack\fontclassstyle
-
-\let\m_font_typescripts_one \empty
-\let\m_font_typescripts_two \empty
-\let\m_font_typescripts_three\empty
-\let\m_font_typescripts_check\empty
-\let\m_font_typescripts_match\empty
-
-\installmacrostack\m_font_typescripts_one
-\installmacrostack\m_font_typescripts_two
-\installmacrostack\m_font_typescripts_three
-
-\let\t_font_typescripts\relax % uses as synonym
-
-\installcorenamespace{typescriptcache}
-\installcorenamespace{typescriptfiles}
-\installcorenamespace{typescriptonce}
-\installcorenamespace{typescriptsynonyms}
-\installcorenamespace{typescriptprefix}
-\installcorenamespace{typescriptinheritances}
-\installcorenamespace{typescriptdefaultstyles}
-\installcorenamespace{typescriptrelatives}
-
-\definesystemvariable{ts} % TypeScript
-
-% tricky ... here we push/pop ... so \let
-
-\let\typescriptmethod\plusone % 1: empty==all==true 2: empty==false
-\let\typescriptstate \plustwo % 1: process 2: store
-
-\installmacrostack\typescriptmethod
-\installmacrostack\typescriptstate
-
-\unexpanded\def\starttypescriptcollection
- {\dosingleempty\font_typescripts_collection_start}
-
-\def\font_typescripts_collection_start[#tag]%
- {}
-
-\let\stoptypescriptcollection\relax
-
-\unexpanded\def\usetypescriptfile[#filename]%
- {\doifelse{#filename}\v!reset
- {\let\typescriptfiles\empty}
- {\splitfilename{#filename}%
- \addtocommalist\splitoffbase\typescriptfiles}}
-
-\unexpanded\def\usetypescript {\dotripleempty\font_typescripts_use_one}
-\unexpanded\def\usetypescriptexact{\dotripleempty\font_typescripts_use_two}
-
-\def\font_typescripts_use_one{\let\typescriptmethod\plusone\font_typescripts_use}
-\def\font_typescripts_use_two{\let\typescriptmethod\plustwo\font_typescripts_use}
-
-\installmacrostack\stoptypescript
-
-\unexpanded\def\font_typescripts_use[#one][#two][#three]%
- {\push_macro_m_font_typescripts_one
- \push_macro_m_font_typescripts_two
- \push_macro_m_font_typescripts_three
- \edef\m_font_typescripts_one {\truetypescript{#one}}%
- \edef\m_font_typescripts_two {\truetypescript{#two}}%
- \edef\m_font_typescripts_three{\truetypescript{#three}}%
- \push_macro_typescriptone
- \push_macro_typescripttwo
- \push_macro_typescriptthree
- \push_macro_typescriptmethod
- \push_macro_typescriptstate
- \push_macro_stoptypescript
- \typescriptfoundfalse
- \let\typescriptstate\plusone % why
- \iftracetypescripts
- \writestatus\m!fonts{request: [\m_font_typescripts_one] [\m_font_typescripts_two] [\m_font_typescripts_three]}%
- \fi
- \ifhmode
- \font_typescripts_use_inline
- \else
- \font_typescripts_use_display
- \fi
- \setfalse\c_font_typescripts_first_pass
- \pop_macro_stoptypescript
- \pop_macro_typescriptstate
- \pop_macro_typescriptmethod
- \pop_macro_typescriptthree
- \pop_macro_typescripttwo
- \pop_macro_typescriptone
- \pop_macro_m_font_typescripts_three
- \pop_macro_m_font_typescripts_two
- \pop_macro_m_font_typescripts_one}
-
-\def\font_typescripts_use_display
- {\processcommacommand[\typescriptfiles]\font_typescripts_load_file
- \the\c_font_typescripts_document}
-
-\let\font_typescripts_use_inline\font_typescripts_use_display
-
-\unexpanded\def\preloadtypescripts
- {\ifproductionrun\settrue\c_font_typescripts_preload\fi}
-
-\prependtoks
- \preloadtypescripts
-\to \everyjob
-
-\unexpanded\def\loadtypescriptfile[#1]%
- {\push_macro_typescriptstate
- \let\typescriptstate\plustwo % assumes 2 at the outer level
- \clf_loadtypescriptfile{#1}%
- \pop_macro_typescriptstate}
-
-\unexpanded\def\loadfoundtypescriptfile#1#2% name foundname / not a user command
- {\startreadingfile
- \unprotect
- \pushendofline
- \input{#2}%
- \popendofline
- \protect
- \stopreadingfile}
-
-\unexpanded\def\quittypescriptscanning
- {\settrue\c_font_typescripts_quit} % public
-
-\def\font_typescripts_start_store#definitions\stoptypescript
- {\global\advance\c_font_typescripts_n_of_preloaded\plusone
- \expandafter\normalgdef\csname\??typescriptcache\the\c_font_typescripts_n_of_preloaded\endcsname
- {\starttypescript#definitions\stoptypescript}%
- \gtoksapp\t_font_typescripts\expandafter
- {\csname\??typescriptcache\the\c_font_typescripts_n_of_preloaded\endcsname}}
-
-\def\font_typescripts_collection_start_store#definitions\stoptypescriptcollection
- {\global\advance\c_font_typescripts_n_of_preloaded\plusone
- \expandafter\normalgdef\csname\??typescriptcache\the\c_font_typescripts_n_of_preloaded\endcsname
- {\starttypescriptcollection#definitions\stoptypescriptcollection}%
- \gtoksapp\t_font_typescripts\expandafter
- {\csname\??typescriptcache\the\c_font_typescripts_n_of_preloaded\endcsname}}
-
-\def\font_typescripts_load_file#filename%
- {\setfalse\c_font_typescripts_quit
- \push_macro_currenttypefile
- \def\currenttypefile{#filename}%
- \ifconditional\c_font_typescripts_preload
- \font_typescript_process_typescript_file_and_store
- \else
- \font_typescript_process_typescript_file
- \fi
- \pop_macro_currenttypefile
- \ifconditional\c_font_typescripts_quit
- \quitcommalist
- \setfalse\c_font_typescripts_quit
- \fi}
-
-\def\font_typescript_process_typescript_file_and_store
- {\expandafter\let\expandafter\t_font_typescripts\csname\??typescriptfiles\currenttypefile\endcsname
- \ifx\t_font_typescripts\relax
- \font_typescript_process_typescript_store_indeed
- \fi
- \the\t_font_typescripts}
-
-\def\font_typescript_process_typescript_store_indeed
- {\newtoks\t_font_typescripts % is \relaxed elsewhere
- \begingroup
- \let\starttypescript \font_typescripts_start_store
- \let\starttypescriptcollection\font_typescripts_collection_start_store
- \font_typescript_process_typescript_file
- \endgroup
- \expandafter\let\csname\??typescriptfiles\currenttypefile\endcsname\t_font_typescripts}
-
-\def\font_typescript_process_typescript_file
- {\clf_doprocesstypescriptfile{\currenttypefile}}
-
-\unexpanded\def\usetypescriptonce
- {\dotripleempty\font_typescripts_use_once}
-
-\def\font_typescripts_use_once[#one][#two][#three]%
- {\ifcsname\??typescriptonce#one:#two:#three\endcsname
- \writestatus\m!fonts{once (#one) (#two) (#three)}%
- \else
- \expandafter\let\csname\??typescriptonce#one:#two:#three\endcsname\relax
- \font_typescripts_use[#one][#two][#three]%
- \fi}
-
-% \definetypescriptsynonym[lbr][cmr]
-
-\unexpanded\def\definetypescriptsynonym
- {\dodoubleempty\font_typescripts_synonym_define}
-
-\def\font_typescripts_synonym_define[#name][#synonym]%
- {\ifsecondargument\setevalue{\??typescriptsynonyms#name}{#synonym}\fi}
-
-\def\truetypescript#name% recursive so no \lastnamedcs
- {\ifcsname\??typescriptsynonyms#name\endcsname
- %\expandafter\truetypescript\csname\??typescriptsynonyms#name\endcsname
- \expandafter\truetypescript\lastnamedcs
- \else
- #name%
- \fi}
-
-% script [serif] [default] [size]
-% script [serif] [computer-modern] [size]
-% script [serif] [computer-modern] [ec]
-% script [serif] [computer-modern] [name]
-% script [serif] [computer-modern] [special]
-
-\prependtoks
- \settrue\c_font_typescripts_first_pass
-\to \everyjob
-
-\unexpanded\def\starttypescript
- {\ifcase\typescriptstate
- % 0 = skip
- \expandafter\font_typescripts_start_gobble
- \or
- % 1 = process
- \expandafter\font_typescripts_start_process
- \or
- % 2 = store
- \expandafter\font_typescripts_start_document
- \else
- % ? = skip
- \expandafter\font_typescripts_start_gobble
- \fi}
-
-\def\font_typescripts_start_gobble#definitions\stoptypescript{}
-
-\def\font_typescripts_start_document#definitions\stoptypescript
- {\toksapp\c_font_typescripts_document{\starttypescript#definitions\stoptypescript}}
-
-\def\font_typescripts_start_process % could be a faster \doifelsenextoptionalif needed
- {\let\typescriptone \m_font_typescripts_one
- \let\typescripttwo \m_font_typescripts_two
- \let\typescriptthree\m_font_typescripts_three
- \let\m_font_typescripts_match\empty
- \doifelsenextoptionalcs\font_typescripts_start_process_one\font_typescripts_start_process_all}
-
-\def\font_typescripts_start_process_all % could be a \let
- {\ifconditional\c_font_typescripts_first_pass
- \expandafter\font_typescripts_start_process_indeed
- \else
- % skip this since it may do unwanted resets, like
- % setting symbolic font names to unknown, especially
- % in run time user type scripts
- \expandafter\font_typescripts_start_gobble
- \fi}
-
-\def\font_typescripts_show_match
- {\writestatus\m!fonts{match:\ifx\currenttypefile\relax\space *\fi \m_font_typescripts_match}}
-
-\def\font_typescripts_start_process_yes
- {\ifdone
- \typescriptfoundtrue
- \iftracetypescripts\font_typescripts_show_match\fi
- \expandafter\font_typescripts_start_process_indeed
- \else
- \expandafter\font_typescripts_start_gobble
- \fi}
-
-\def\font_typescripts_start_process_one
- {\font_typescripts_check\m_font_typescripts_one\typescriptone\font_typescripts_start_process_again_one}
-
-\def\font_typescripts_start_process_two
- {\font_typescripts_check\m_font_typescripts_two\typescripttwo\font_typescripts_start_process_again_two}
-
-\def\font_typescripts_start_process_three
- {\font_typescripts_check\m_font_typescripts_three\typescriptthree\font_typescripts_start_process_again_three}
-
-\def\font_typescripts_start_process_again_one
- {\doifelsenextoptionalcs\font_typescripts_start_process_two\font_typescripts_start_process_yes}
-
-\def\font_typescripts_start_process_again_two
- {\doifelsenextoptionalcs\font_typescripts_start_process_three\font_typescripts_start_process_yes}
-
-\let\font_typescripts_start_process_again_three\font_typescripts_start_process_yes
-
-\def\font_typescripts_start_process_indeed
- {\push_macro_fontclass}
-
-\unexpanded\def\stoptypescript
- {\pop_macro_fontclass}
-
-\def\font_typescripts_check#asked#target#followup[#value]% script use value next
- {\donefalse
- \edef\m_font_typescripts_check{#value}%
- \ifx\m_font_typescripts_check\empty % no longer needed / met
- \ifcase\typescriptmethod\or\donetrue\fi
- \orelse\ifx#asked\s!all
- \donetrue
- \orelse\ifx\m_font_typescripts_check\s!all
- \donetrue
- \orelse\ifx#asked\m_font_typescripts_check % saves 10% trace so probably faster too
- \donetrue
- \let#target\m_font_typescripts_check
- \else
- \doifelsecommon\m_font_typescripts_check#asked\donetrue\donefalse
- \ifdone
- \let#target\commalistelement
- \fi
- \fi
- \ifdone
- \iftracetypescripts\extendtypescriptmatch\fi
- \expandafter#followup%
- \else
- \expandafter\font_typescripts_start_gobble
- \fi}
-
-\def\extendtypescriptmatch
- {\edef\m_font_typescripts_match{\m_font_typescripts_match\space[\m_font_typescripts_check]}}
-
-%D Map files will go away in \LUATEX, but till that happens we use stripped down
-%D support for loading them.
-
-\unexpanded\def\loadmapfile{\dosingleempty\font_map_load_file}
-\unexpanded\def\loadmapline{\dodoubleempty\font_map_load_line}
-
-\def\font_map_load_file[#filename]%
- {\clf_loadmapfile{#filename}}
-
-\def\font_map_load_line[#kind][#data]%
- {\clf_loadmapline{#kind}{#data}}
-
-\unexpanded\def\forgetmapfiles
- {\clf_resetmapfiles}
-
-% \prependtoks
-% \loadmapfile[mkiv-base.map]% can't we preload this one?
-% \to \everystarttext
-
-%D A handy shortcut:
-
-% \definetypescriptprefix[serif][Serif]
-% \definetypescriptprefix[sans] [Sans]
-% \definetypescriptprefix[mono] [Mono]
-%
-% \starttypescript [serif,sans,mono] [handling,hanging,hz] [pure,normal,hz,quality]
-% \setupfontsynonym [\typescriptprefix\typescriptone] [handling=\typescriptthree]
-% \stoptypescript
-
-\unexpanded\def\definetypescriptprefix
- {\dodoubleargument\font_typescripts_define_prefix}
-
-\def\font_typescripts_define_prefix[#name][#prefix]%
- {\setgvalue{\??typescriptprefix#name}{#prefix}} % made global
-
-\def\typescriptprefix#name%
- %{\ifcsname\??typescriptprefix#name\endcsname\csname\??typescriptprefix#name\endcsname\else#name\fi}
- {\ifcsname\??typescriptprefix#name\endcsname\lastnamedcs\else#name\fi}
-
-% defining typefaces:
-%
-% \definetypeface [joke] [rm]
-% \definetypeface [joke] [rm] [settings]
-% \definetypeface [joke] [rm] [serif] [lucida]
-% \definetypeface [joke] [rm] [serif] [lucida] [size]
-% \definetypeface [joke] [rm] [serif] [lucida] [size] [settings]
-% \definetypeface [joke] [specification]
-
-\unexpanded\def\definetypeface
- {\dosixtupleargument\font_typefaces_define}
-
-\appendtoks
- \font_helpers_reset_fontclass_math_families\fontclass
-\to \everybeforedefinetypeface
-
-%D This hooks into the font switcher:
-
-\settrue\autotypescripts
-
-\unexpanded\def\trycurrentfontclass#typeface%
- {\ifconditional\autotypescripts
- \usetypescript[#typeface]%
- \ifcsname\??fontclassyes#typeface\endcsname
- \edef\fontclass{#typeface}%
- \else
- \iftracetypescripts\writestatus\m!fonts{auto load typescript file 1: [#typeface]}\fi
- \usetypescriptfile[#typeface]%
- \usetypescript[#typeface]%
- \ifcsname\??fontclassyes#typeface\endcsname
- \edef\fontclass{#typeface}%
- \else
- % todo: message
- \letvalueempty{\??fontclassnop#typeface}%
- \fi
- \fi
- \else
- % todo: message
- \letvalueempty{\??fontclassnop#typeface}%
- \fi}
-
-%D Now we define:
-
-\def\font_typefaces_define
- {\iffifthargument
- \expandafter\font_typefaces_define_a
- \orelse\iffourthargument
- \expandafter\font_typefaces_define_b
- \orelse\ifthirdargument
- \expandafter\font_typefaces_define_c
- \else
- \expandafter\font_typefaces_define_d
- \fi}
-
-\def\font_typefaces_define_a[#name][#style][#fontshape][#fontname][#fontsize][#settings]%
- {\iftracetypescripts\writestatus\m!fonts{define: [#name] [#style] [#fontshape] [#fontname]}\fi
- \font_typefaces_define_indeed[#name][#style]%
- \font_typefaces_defining_start{#name}{#style}{#settings}%
- \font_typescripts_use_one[#fontshape][#fontname][\s!name]% [\s!name,\s!default]%
- \iftypescriptfound
- % we're okay
- \orelse\ifconditional\autotypescripts
- \iftracetypescripts\writestatus\m!fonts{auto load typescript file 2: [#fontname]}\fi
- \usetypescriptfile[#fontname]%
- \font_typescripts_use_one[#fontshape][#fontname][\s!name]% [\s!name,\s!default]%
- \fi
- \font_typescripts_use_one[#fontshape][#fontsize][\s!size]%
- \font_typefaces_defining_stop}
-
-\def\font_typefaces_define_b[#name][#style][#fontshape][#fontname][#dummya][#dummyb]%
- {\font_typefaces_define_a[#name][#style][#fontshape][#fontname][\s!default][#dummyb]}
-
-\def\font_typefaces_define_c[#name][#style][#dummya][#dummyb][#dummyc][#dummyd]%
- {\font_typefaces_define_indeed[#name][#style]}
-
-\def\font_typefaces_define_d[#name][#specification][#dummya][#dummyb][#dummyc][#dummyd]% use definitions in lfg file
- {\clf_definetypeface{#name}{#specification}}
-
-\def\font_typefaces_define_indeed[#name][#style]% saveguard against redefinition
- {\doifsomething{#name}
- {\ifcsname\??typescriptdefaultstyles#name\endcsname \else
- \registerfontclass{#name}%
- \setxvalue{\??typescriptdefaultstyles#name}{#style}%
- \fi
- \ifcsname#name\endcsname \else
- \setugvalue{#name}{\switchtotypeface[#name][#style]}%
- \fi}}
-
-\def\font_typefaces_defining_start#name#style#settings%
- {\let\@@tsrscale \!!plusone % as we push/pop
- \let\@@tsfeatures \empty
- \let\@@tsfallbacks \empty
- \let\@@tsgoodies \empty
- \let\@@tsdirection \empty
- \let\@@tsdesignsize\empty
- \geteparameters[\??ts][#settings]% todo raw
- \push_macro_fontclass
- \push_macro_fontclassstyle
- \setcurrentfontclass{#name}%
- \savefontclassparameters{#style}\@@tsrscale\@@tsfeatures\@@tsfallbacks\@@tsgoodies\@@tsdesignsize\@@tsdirection
- \the\everybeforedefinetypeface}
-
-\def\tsvar#key#default% undocumented and unofficial
- {\expandafter\ifx\csname\??ts#key\endcsname\empty
- #default%
- \else
- \csname\??ts#key\endcsname
- \fi}
-
-\def\font_typefaces_defining_stop
- {\the\everyafterdefinetypeface
- \pop_macro_fontclassstyle
- \pop_macro_fontclass}
-
-\def\dofastdefinetypeface#name#style#fontshape#fontsize#settings% called from the lua end (via case d)
- {\font_typefaces_define_indeed[#name][#style]%
- \font_typefaces_defining_start{#name}{#style}{#settings}%
- \font_typescripts_use_one[#fontshape][#fontsize][\s!size]%
- \font_typefaces_defining_stop}
-
-\unexpanded\def\setuptypeface% [class] [settings]
- {\dodoubleempty\font_typefaces_setup}
-
-\unexpanded\def\switchtotypeface% [class] [settings]
- {\dodoubleempty\font_typefaces_switch}
-
-\def\font_typefaces_setup[#class][#settings]%
- {\setcurrentfontclass{#class}%
- \let\globalfontclass\fontclass
- \ifsecondargument
- \setupbodyfont[#settings]%
- \orelse\ifx\fontclass\empty
- \setupbodyfont[\s!rm]%
- \orelse\ifcsname\??typescriptdefaultstyles\fontclass\endcsname
- %\setupbodyfont[\csname\??typescriptdefaultstyles\fontclass\endcsname]%
- \expandafter\setupbodyfont\expandafter[\lastnamedcs]%
- \else
- \setupbodyfont[\s!rm]%
- \fi
- \ifmmode\mr\else\tf\fi} % needed ?
-
-\def\font_typefaces_switch[#class][#settings]%
- {\setcurrentfontclass{#class}%
- \let\globalfontclass\globalfontclass
- \ifsecondargument
- \switchtobodyfont[#settings]%
- \orelse\ifx\fontclass\empty
- \switchtobodyfont[\s!rm]%
- \orelse\ifcsname\??typescriptdefaultstyles\fontclass\endcsname
- %\switchtobodyfont[\csname\??typescriptdefaultstyles\fontclass\endcsname]%
- \expandafter\switchtobodyfont\expandafter[\lastnamedcs]%
- \else
- \switchtobodyfont[\s!rm]%
- \fi
- \ifmmode\mr\else\tf\fi} % needed ?
-
-%D For Taco:
-%D
-%D \starttyping
-%D \inherittypeface[palatino][rm][postscript]
-%D \inherittypeface[palatino][rm][\fontclass]
-%D \inherittypeface[palatino][rm] % == \fontclass
-%D \inherittypeface[palatino] % == [rm,ss,tt,mm]
-%D \stoptyping
-
-\unexpanded\def\inherittypeface
- {\dotripleempty\font_typescripts_inherit_indeed}
-
-\def\font_typescripts_inherit_indeed[#name][#styles][#parentclass]%
- {\doifelsenothing{#styles}
- {\font_typescripts_inherit_indeed[#name][\s!rm,\s!ss,\s!tt,\s!mm][\fontclass]}
- {\doifnot{#name}{#parentclass}
- {\glet\font_typescripts_inherit_check\font_typescripts_inherit_check_indeed
- \def\font_typescripts_inherit_check_step#style{\setevalue{\??typescriptinheritances#name:#style}{#parentclass}}%
- \processcommalist[#styles]\font_typescripts_inherit_check_step}}}
-
-\let\font_typescripts_inherit_check_step\relax
-
-%D This hooks into the font mechanism with:
-
-\def\font_typescripts_inherit_check_indeed#name% called often
- {\ifcsname\??typescriptinheritances\fontclass:#name\endcsname
- %\expandafter\let\expandafter\fontclass\csname\??typescriptinheritances\fontclass:#name\endcsname
- \expandafter\let\expandafter\fontclass\lastnamedcs
- \fi}
-
-\let\font_typescripts_inherit_check\gobbleoneargument
-
-% not yet:
-%
-% \def\font_helpers_check_relative_font_id
-% {\ifcsname\??typescriptrelatives\fontclass\endcsname
-% \expandafter\let\expandafter\relativefontid\csname\??typescriptrelatives\fontclass\endcsname
-% \else
-% \expandafter\normalxdef\csname\??typescriptrelatives\fontclass\endcsname{\the\lastfontid}%
-% \let\relativefontid\minusone
-% \fi}
-
-\def\v_font_string_d % default fontstyle (expands to \s!Serif in font-ini)
- {\expandafter\ifx\csname\??typescriptdefaultstyles\fontclass\endcsname\s!rm \s!Serif \else
- \expandafter\ifx\csname\??typescriptdefaultstyles\fontclass\endcsname\s!ss \s!Sans \else
- \expandafter\ifx\csname\??typescriptdefaultstyles\fontclass\endcsname\s!tt \s!Mono \else
- \s!Serif \fi\fi\fi}
-
-\unexpanded\def\font_helpers_set_fontstyle_of_fontclass
- {\ifx\fontclass\empty
- \let\fontstyle\s!rm
- \orelse\ifcsname\??typescriptdefaultstyles\fontclass\endcsname
- %\edef\fontstyle{\csname\??typescriptdefaultstyles\fontclass\endcsname}%
- \edef\fontstyle{\lastnamedcs}%
- \else
- \let\fontstyle\s!rm
- \fi}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-bld.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-bld.lua
index 6874d385a9b..30503277212 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-bld.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-bld.lua
@@ -243,10 +243,9 @@ end
-- the check can go away
function builders.buildpage_filter(groupcode)
- -- the next check saves 1% runtime on 1000 tufte pages
local head = texlists.contrib_head
- local done = false
if head then
+ local done = false
-- called quite often ... maybe time to remove timing
starttiming(builders)
if trace_page_builder then
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-brk.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-brk.lua
index d670c53196f..89eb7e52d33 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-brk.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-brk.lua
@@ -33,7 +33,7 @@ local getid = nuts.getid
----- getattr = nuts.getattr
local getattrlist = nuts.getattrlist
local takeattr = nuts.takeattr
-local getlang = nuts.getlang
+local getlanguage = nuts.getlanguage
local isglyph = nuts.isglyph
local setattr = nuts.setattr
@@ -168,7 +168,7 @@ methods[2] = function(head,start) -- ( => (-
head, start, replace = remove_node(head,start)
local post = copy_node(replace)
local hyphen = copy_node(post)
- setchar(hyphen,languages.prehyphenchar(getlang(post)))
+ setchar(hyphen,languages.prehyphenchar(getlanguage(post)))
setlink(post,hyphen)
head, start = insert_node_before(head,start,new_disc(nil,post,replace))
setattrlist(start,replace)
@@ -184,7 +184,7 @@ methods[3] = function(head,start) -- ) => -)
head, start, replace = remove_node(head,start)
local pre = copy_node(replace)
local hyphen = copy_node(pre)
- setchar(hyphen,languages.prehyphenchar(getlang(pre)))
+ setchar(hyphen,languages.prehyphenchar(getlanguage(pre)))
setlink(hyphen,pre)
head, start = insert_node_before(head,start,new_disc(hyphen,nil,replace)) -- so not pre !
setattrlist(start,tmp)
@@ -264,7 +264,7 @@ function breakpoints.handler(head)
-- setattr(current,a_breakpoints,unsetvalue) -- should not be needed
-- for now we collect but when found ok we can move the handler here
-- although it saves nothing in terms of performance
- local lang = getlang(current)
+ local lang = getlanguage(current)
local smap = lang and lang >= 0 and lang < 0x7FFF and (cmap[languages.numbers[lang]] or cmap[""])
if smap then
local skip = smap.skip
@@ -322,7 +322,7 @@ function breakpoints.handler(head)
local cmap = data[3]
local smap = data[4]
-- we do a sanity check for language
- -- local lang = getlang(start)
+ -- local lang = getlanguage(start)
-- local smap = lang and lang >= 0 and lang < 0x7FFF and (cmap[numbers[lang]] or cmap[""])
-- if smap then
local nleft = smap.nleft
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-brk.mkiv b/Master/texmf-dist/tex/context/base/mkiv/typo-brk.mkiv
index 6071221dd43..23ab414fe03 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-brk.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-brk.mkiv
@@ -64,7 +64,7 @@
\unexpanded\def\resetbreakpoints
{\exhyphenchar\hyphenasciicode % 2020.03.05
- \attribute\breakpointattribute\attributeunsetvalue}
+ \c_attr_breakpoint\attributeunsetvalue}
\definebreakpoints[compound]
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-cap.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-cap.lua
index c1666a9f119..3d0d6055a77 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-cap.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-cap.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['typo-cap'] = {
version = 1.001,
+ optimize = true,
comment = "companion to typo-cap.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-cap.mkiv b/Master/texmf-dist/tex/context/base/mkiv/typo-cap.mkiv
index 20e2eb7a945..3dea50c99e1 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-cap.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-cap.mkiv
@@ -228,8 +228,11 @@
\unexpanded\def\autocap{\ifmmode\expandafter\normalcap\else\expandafter\smallcapped\fi}
-\appendtoks
+\prependtoks
\let\normalcap\cap % mathmode cap
+\to \everydump
+
+\appendtoks
\let\cap\autocap
\to \everydump
@@ -298,9 +301,9 @@
%
% \definestartstop[randomized][\c!before=\dosetattribute{case}{8},\c!after=]
-% \unexpanded\def\randomizetext{\groupedcommand{\attribute\caseattribute\pluseight}{}}
+% \unexpanded\def\randomizetext{\groupedcommand{\c_attr_case\pluseight}{}}
-\unexpanded\def\randomizetext{\triggergroupedcommand{\attribute\caseattribute\pluseight}}
+\unexpanded\def\randomizetext{\triggergroupedcommand{\c_attr_case\pluseight}}
\definestartstop[randomized][\c!before=\dosetattribute{case}{8},\c!after=]
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-chr.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-chr.lua
index 7a0f1fd7521..bb3883b3308 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-chr.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-chr.lua
@@ -91,7 +91,7 @@ local boundarycodes = nodes.boundarycodes
local subtypes = nodes.subtypes
local glyph_code = nodecodes.glyph
-local localpar_code = nodecodes.localpar
+local par_code = nodecodes.par
local boundary_code = nodecodes.boundary
local wordboundary_code = boundarycodes.word
@@ -175,7 +175,7 @@ local function pickup(head,tail,str)
while true do
local prev = first.prev
if prev and prev[a_marked] == attr then
- if prev.id == localpar_code then -- and start_of_par(prev)
+ if prev.id == par_code then -- and start_of_par(prev)
break
else
first = prev
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-cln.mkiv b/Master/texmf-dist/tex/context/base/mkiv/typo-cln.mkiv
index efc278cfa05..bdda1942410 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-cln.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-cln.mkiv
@@ -27,7 +27,7 @@
{\clf_setcharactercleaning{#1}} % also accepts "reset"
% \appendtoks
-% \attribute\cleanerattribute\attributeunsetvalue
+% \c_attr_cleaner\attributeunsetvalue
% \to \everyforgetall
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-del.mkiv b/Master/texmf-dist/tex/context/base/mkiv/typo-del.mkiv
index 9320c37ee6f..9720326be14 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-del.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-del.mkiv
@@ -142,8 +142,8 @@
[\c!rightsubsentence]
[\rightboundarycharacter\c!rightsubsentence{sentence}]
-\newsignal \d_typo_subsentence_signal
-\newcount \c_typo_subsentence_nesting
+\newsignal\d_typo_subsentence_signal
+\newcount \c_typo_subsentence_nesting
\let\beforesubsentence\donothing
\let\aftersubsentence \donothing
@@ -179,7 +179,7 @@
\fi
\global\advance\c_typo_subsentence_nesting\plusone
\ifnum\c_typo_subsentence_nesting=\plusone
- \dontleavehmode % was \leaveoutervmode
+ \dontleavehmode
\fi
\dostarttagged\t!subsentence\empty % no chain
\dostarttagged\t!subsentencesymbol\empty
@@ -420,7 +420,7 @@
\typo_delimited_push{#1}{#2}%
\dostarttaggedchained\t!delimitedblock\currentdelimitedtext\??delimitedtext
\edef\p_delimited_method{\delimitedtextparameter\c!method}%
- \ifx\p_delimited_method\s!font
+ \ifx\p_delimited_method\v!font
\expandafter\typo_delimited_start_font
\else
\expandafter\typo_delimited_start_other
@@ -524,6 +524,7 @@
\begingroup
\usedelimitedtextstyleandcolor\c!style\c!color
%
+ \begingroup
\edef\p_delimited_left {\delimitedtextparameter{\c!left}}%
\edef\p_delimited_right {\delimitedtextparameter{\c!right}}%
\edef\p_delimited_nextleft {\delimitedtextparameter{\c!nextleft}}%
@@ -539,7 +540,10 @@
\def\typo_delimited_stop_par
{\typo_delimited_stop_content
\rightdelimitedtextmark
- \carryoverpar\endgroup % new per 2013-01-21 ... please left floats
+ \rightdelimitedtextmark
+ \carryoverpar\endgroup
+ \endgraf
+ \endgroup
\pop_macro_checkindentation
\typo_delimited_stop_par_indeed
\delimitedtextparameter\c!after
@@ -575,7 +579,7 @@
{\dontleavehmode % following ones can be omited
\typo_delimited_push{#1}{#2}%
\edef\p_delimited_method{\delimitedtextparameter\c!method}%
- \ifx\p_delimited_method\s!font
+ \ifx\p_delimited_method\v!font
\expandafter\typo_delimited_fontdriven
\else
\expandafter\typo_delimited_other
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-dha.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-dha.lua
index 7d5c7751b35..ac72ae39488 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-dha.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-dha.lua
@@ -14,12 +14,12 @@ if not modules then modules = { } end modules ['typo-dha'] = {
--
-- Then we have, with input: LATIN ARAB
--
--- \textdir TLT LATIN ARAB => LATIN BARA
--- \textdir TRT LATIN ARAB => LATIN BARA
--- \textdir TRT LRO LATIN ARAB => LATIN ARAB
--- \textdir TLT LRO LATIN ARAB => LATIN ARAB
--- \textdir TLT RLO LATIN ARAB => NITAL ARAB
--- \textdir TRT RLO LATIN ARAB => NITAL ARAB
+-- \textdirection 1 LATIN ARAB => LATIN BARA
+-- \textdirection 1 LATIN ARAB => LATIN BARA
+-- \textdirection 1 LRO LATIN ARAB => LATIN ARAB
+-- \textdirection 1 LRO LATIN ARAB => LATIN ARAB
+-- \textdirection 1 RLO LATIN ARAB => NITAL ARAB
+-- \textdirection 1 RLO LATIN ARAB => NITAL ARAB
-- elseif d == "es" then -- European Number Separator
-- elseif d == "et" then -- European Number Terminator
@@ -78,7 +78,7 @@ local math_code = nodecodes.math
local kern_code = nodecodes.kern
local glue_code = nodecodes.glue
local dir_code = nodecodes.dir
-local localpar_code = nodecodes.localpar
+local par_code = nodecodes.par
local dirvalues = nodes.dirvalues
local lefttoright_code = dirvalues.lefttoright
@@ -272,12 +272,12 @@ local function process(start)
stack[top] = { override, embedded }
override = 1
obsolete[#obsolete+1] = current
- elseif direction == "lre" then -- Left-to-Right Embedding -> TLT
+ elseif direction == "lre" then -- Left-to-Right Embedding -> lefttoright_code
top = top + 1
stack[top] = { override, embedded }
embedded = 1
obsolete[#obsolete+1] = current
- elseif direction == "rle" then -- Right-to-Left Embedding -> TRT
+ elseif direction == "rle" then -- Right-to-Left Embedding -> righttoleft_code
top = top + 1
stack[top] = { override, embedded }
embedded = -1
@@ -332,7 +332,7 @@ local function process(start)
end
textdir = autodir
setprop(current,"direction",true)
- elseif id == localpar_code and start_of_par(current) then
+ elseif id == par_code and start_of_par(current) then
local direction = getdirection(current)
if direction == righttoleft_code then
autodir = -1
@@ -382,7 +382,7 @@ local function process(start)
if cp == "n" then
local swap = state == "r"
if swap then
- head = insert_node_before(head,current,startdir("TLT"))
+ head = insert_node_before(head,current,startdir(lefttoright_code))
end
setprop(current,"direction",true)
while true do
@@ -395,14 +395,14 @@ local function process(start)
end
end
if swap then
- head, current = insert_node_after(head,current,stopdir("TLT"))
+ head, current = insert_node_after(head,current,stopdir(lefttoright_code))
end
elseif cp == "l" then
if state ~= "l" then
if state == "r" then
- head = insert_node_before(head,last or current,stopdir("TRT"))
+ head = insert_node_before(head,last or current,stopdir(righttoleft_code))
end
- head = insert_node_before(head,current,startdir("TLT"))
+ head = insert_node_before(head,current,startdir(lefttoright_code))
state = "l"
done = true
end
@@ -410,9 +410,9 @@ local function process(start)
elseif cp == "r" then
if state ~= "r" then
if state == "l" then
- head = insert_node_before(head,last or current,stopdir("TLT"))
+ head = insert_node_before(head,last or current,stopdir(lefttoright_code))
end
- head = insert_node_before(head,current,startdir("TRT"))
+ head = insert_node_before(head,current,startdir(righttoleft_code))
state = "r"
done = true
end
@@ -425,9 +425,9 @@ local function process(start)
end
else
if state == "r" then
- head = insert_node_before(head,current,stopdir("TRT"))
+ head = insert_node_before(head,current,stopdir(righttoleft_code))
elseif state == "l" then
- head = insert_node_before(head,current,stopdir("TLT"))
+ head = insert_node_before(head,current,stopdir(lefttoright_code))
end
state = false
last = false
@@ -438,7 +438,7 @@ local function process(start)
if next then
current = next
else
- local sd = (state == "r" and stopdir("TRT")) or (state == "l" and stopdir("TLT"))
+ local sd = (state == "r" and stopdir(righttoleft_code)) or (state == "l" and stopdir(lefttoright_code))
if sd then
if id == glue_code and getsubtype(current) == parfillskip_code then
head = insert_node_before(head,current,sd)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-dig.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-dig.lua
index 175fc0cc7ef..a9294a38dae 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-dig.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-dig.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['typo-dig'] = {
version = 1.001,
+ optimize = true,
comment = "companion to typo-dig.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-dig.mkiv b/Master/texmf-dist/tex/context/base/mkiv/typo-dig.mkiv
index 0f957fbc1d6..26e35c19928 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-dig.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-dig.mkiv
@@ -42,7 +42,7 @@
{\clf_setdigitsmanipulation{#1}}
\unexpanded\def\resetdigitsmanipulation
- {\attribute\digitsattribute\attributeunsetvalue}
+ {\c_attr_digits\attributeunsetvalue}
\appendtoks
\resetdigitsmanipulation
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-dir.mkiv b/Master/texmf-dist/tex/context/base/mkiv/typo-dir.mkiv
index 7449a705323..d9fb3b050a7 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-dir.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-dir.mkiv
@@ -45,7 +45,7 @@
% is in fact:
\unexpanded\def\resetdirection
- {\attribute\directionsattribute\attributeunsetvalue}
+ {\c_attr_directions\attributeunsetvalue}
\newconstant\directionsbidimode % this one might become pivate
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-drp.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-drp.lua
index 50eb765f221..ddc6d68ae82 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-drp.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-drp.lua
@@ -82,7 +82,7 @@ local glyph_code = nodecodes.glyph
local hlist_code = nodecodes.hlist
local glue_code = nodecodes.glue
local kern_code = nodecodes.kern
-local localpar_code = nodecodes.localpar
+local par_code = nodecodes.par
local actions = { }
initials.actions = actions
@@ -270,7 +270,7 @@ actions[v_default] = function(head,setting)
end
-- We pack so that successive handling cannot touch the dropped cap. Packaging
-- in a hlist is also needed because we cannot locally adapt e.g. parindent (not
- -- yet stored in with localpar).
+ -- yet stored in with par).
local prev = getprev(first)
local next = getnext(last)
--
@@ -334,7 +334,7 @@ end
-- we can count ... when all done, we can disable ...
function initials.handler(head)
- if getid(head) == localpar_code and start_of_par(head) then
+ if getid(head) == par_code and start_of_par(head) then
local settings = getprop(head,a_initial)
if settings then
disableaction("processors","typesetters.initials.handler")
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-drp.mkiv b/Master/texmf-dist/tex/context/base/mkiv/typo-drp.mkiv
index 25b006b2f0f..e774b6796c4 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-drp.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-drp.mkiv
@@ -22,7 +22,7 @@
\definesystemattribute[initial][public]
\appendtoks
- \attribute\initialattribute\attributeunsetvalue
+ \c_attr_initial\attributeunsetvalue
\to \everyforgetall
%D For the moment here: dropped caps redone. In addition to the
@@ -59,9 +59,9 @@
\c!n=3,
\c!m=1,
\c!method=\v!none,
- % \s!font=Bold sa 4,
- % \s!font=Bold ht \measure{initial:n},
- \s!font=Bold cp \measure{initial:n},
+ % \c!font=Bold sa 4,
+ % \c!font=Bold ht \measure{initial:n},
+ \c!font=Bold cp \measure{initial:n},
\c!distance=.125\emwidth,
\c!hoffset=\zeropoint,
\c!voffset=\v!line, % \dimexp\lineheight*\initialparameter\c!n-\lineheight\relax]
@@ -90,7 +90,7 @@
\setupcurrentinitial[#2]%
\resetfontfeature % might be needed in more places
\doifelsenothing{\initialparameter\c!style}
- {\definedfont[\initialparameter\s!font]}
+ {\definedfont[\initialparameter\c!font]}
{\useinitialstyleparameter\c!style}%
\useinitialcolorparameter\c!color
\edef\p_voffset{\initialparameter\c!voffset}%
@@ -105,13 +105,13 @@
distance \dimexpr\initialparameter\c!distance\relax
hoffset \dimexpr\initialparameter\c!hoffset\relax
voffset \scratchvoffset
- ma \attribute\colormodelattribute
- ca \attribute\colorattribute
- ta \attribute\transparencyattribute
+ ma \c_attr_colormodel
+ ca \c_attr_color
+ ta \c_attr_transparency
font \fontid\font
dynamic \font_dynamic_value % it's a bit over the top to support this here
\relax
- \attribute\initialattribute\plusone
+ \c_attr_initial\plusone
\initialparameter\c!text
\endgroup
\glet\typo_initial_handle\relax}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-dua.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-dua.lua
index 0cec0e08e1e..5e1d4c109ae 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-dua.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-dua.lua
@@ -99,7 +99,7 @@ local hlist_code = nodecodes.hlist
local vlist_code = nodecodes.vlist
local math_code = nodecodes.math
local dir_code = nodecodes.dir
-local localpar_code = nodecodes.localpar
+local par_code = nodecodes.par
local parfillskip_code = gluecodes.parfillskip
@@ -337,18 +337,12 @@ local function get_baselevel(head,list,size,direction)
-- This is an adapted version:
if direction == lefttoright_code or direction == righttoleft_code then
return direction, true
- elseif getid(head) == localpar_code and start_of_par(head) then
+ elseif getid(head) == par_code and start_of_par(head) then
direction = getdirection(head)
if direction == lefttoright_code or direction == righttoleft_code then
return direction, true
end
end
- -- for old times sake we we handle strings too
- if direction == "TLT" then
- return lefttoright_code, true
- elseif direction == "TRT" then
- return righttoleft_code, true
- end
-- P2, P3
for i=1,size do
local entry = list[i]
@@ -775,8 +769,8 @@ local function apply_to_list(list,size,head,pardir)
enddir = false
end
elseif begindir then
- if id == localpar_code and start_of_par(current) then
- -- localpar should always be the 1st node
+ if id == par_code and start_of_par(current) then
+ -- par should always be the 1st node
local d = new_direction(begindir)
-- setprop(d,"directions",true)
-- setattrlist(d,current)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-dub.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-dub.lua
index f1bd38fcc5d..88b3361da4a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-dub.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-dub.lua
@@ -87,7 +87,7 @@ local hlist_code = nodecodes.hlist
local vlist_code = nodecodes.vlist
local math_code = nodecodes.math
local dir_code = nodecodes.dir
-local localpar_code = nodecodes.localpar
+local par_code = nodecodes.par
local parfillskip_code = gluecodes.parfillskip
@@ -398,18 +398,12 @@ end
local function get_baselevel(head,list,size,direction)
if direction == lefttoright_code or direction == righttoleft_code then
return direction, true
- elseif getid(head) == localpar_code and start_of_par(head) then
+ elseif getid(head) == par_code and start_of_par(head) then
direction = getdirection(head)
if direction == lefttoright_code or direction == righttoleft_code then
return direction, true
end
end
- -- for old times sake we we handle strings too
- if direction == "TLT" then
- return lefttoright_code, true
- elseif direction == "TRT" then
- return righttoleft_code, true
- end
-- P2, P3
for i=1,size do
local entry = list[i]
@@ -908,8 +902,8 @@ local function apply_to_list(list,size,head,pardir)
enddir = false
end
elseif begindir then
- if id == localpar_code and start_of_par(current) then
- -- localpar should always be the 1st node
+ if id == par_code and start_of_par(current) then
+ -- par should always be the 1st node
local d = new_direction(begindir)
-- setprop(d,"directions",true)
-- setattrlist(d,current)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-duc.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-duc.lua
index d4c56e3008d..6e4f27de257 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-duc.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-duc.lua
@@ -51,70 +51,73 @@ local utfchar = utf.char
local setmetatable = setmetatable
local formatters = string.formatters
-local directiondata = characters.directions
-local mirrordata = characters.mirrors
-local textclassdata = characters.textclasses
+local directiondata = characters.directions
+local mirrordata = characters.mirrors
+local textclassdata = characters.textclasses
-local nuts = nodes.nuts
+local nuts = nodes.nuts
-local getnext = nuts.getnext
-local getid = nuts.getid
-local getsubtype = nuts.getsubtype
-local getlist = nuts.getlist
-local getchar = nuts.getchar
-local getattr = nuts.getattr
-local getprop = nuts.getprop
-local getdirection = nuts.getdirection
-local isglyph = nuts.isglyph
+local getnext = nuts.getnext
+local getprev = nuts.getprev
+local getid = nuts.getid
+local getsubtype = nuts.getsubtype
+local getlist = nuts.getlist
+local getchar = nuts.getchar
+local getattr = nuts.getattr
+local getprop = nuts.getprop
+local getdirection = nuts.getdirection
+local isglyph = nuts.isglyph
-local setprop = nuts.setprop
-local setchar = nuts.setchar
-local setdirection = nuts.setdirection
-local setattrlist = nuts.setattrlist
+local setprop = nuts.setprop
+local setchar = nuts.setchar
+local setdirection = nuts.setdirection
+local setattrlist = nuts.setattrlist
-local properties = nodes.properties.data
+local properties = nodes.properties.data
-local remove_node = nuts.remove
-local insert_node_after = nuts.insert_after
-local insert_node_before = nuts.insert_before
-local start_of_par = nuts.start_of_par
+local remove_node = nuts.remove
+local insert_node_after = nuts.insert_after
+local insert_node_before = nuts.insert_before
+local start_of_par = nuts.start_of_par
-local nodepool = nuts.pool
-local new_direction = nodepool.direction
+local nodepool = nuts.pool
+local new_direction = nodepool.direction
-local nodecodes = nodes.nodecodes
-local gluecodes = nodes.gluecodes
+local nodecodes = nodes.nodecodes
+local gluecodes = nodes.gluecodes
-local glyph_code = nodecodes.glyph
-local glue_code = nodecodes.glue
-local hlist_code = nodecodes.hlist
-local vlist_code = nodecodes.vlist
-local math_code = nodecodes.math
-local dir_code = nodecodes.dir
-local localpar_code = nodecodes.localpar
+local glyph_code = nodecodes.glyph
+local glue_code = nodecodes.glue
+local hlist_code = nodecodes.hlist
+local vlist_code = nodecodes.vlist
+local math_code = nodecodes.math
+local dir_code = nodecodes.dir
+local par_code = nodecodes.par
+local penalty_code = nodecodes.penalty
-local parfillskip_code = gluecodes.parfillskip
+local parfillskip_code = gluecodes.parfillskip
+local parfillleftskip_code = gluecodes.parfillleftskip
-local dirvalues = nodes.dirvalues
-local lefttoright_code = dirvalues.lefttoright
-local righttoleft_code = dirvalues.righttoleft
+local dirvalues = nodes.dirvalues
+local lefttoright_code = dirvalues.lefttoright
+local righttoleft_code = dirvalues.righttoleft
-local maximum_stack = 0xFF
+local maximum_stack = 0xFF
-local a_directions = attributes.private('directions')
+local a_directions = attributes.private('directions')
-local directions = typesetters.directions
-local setcolor = directions.setcolor
-local getfences = directions.getfences
+local directions = typesetters.directions
+local setcolor = directions.setcolor
+local getfences = directions.getfences
-local remove_controls = true directives.register("typesetters.directions.removecontrols",function(v) remove_controls = v end)
------ analyze_fences = true directives.register("typesetters.directions.analyzefences", function(v) analyze_fences = v end)
+local remove_controls = true directives.register("typesetters.directions.removecontrols",function(v) remove_controls = v end)
+----- analyze_fences = true directives.register("typesetters.directions.analyzefences", function(v) analyze_fences = v end)
-local report_directions = logs.reporter("typesetting","directions three")
+local report_directions = logs.reporter("typesetting","directions three")
-local trace_directions = false trackers.register("typesetters.directions", function(v) trace_directions = v end)
-local trace_details = false trackers.register("typesetters.directions.details", function(v) trace_details = v end)
-local trace_list = false trackers.register("typesetters.directions.list", function(v) trace_list = v end)
+local trace_directions = false trackers.register("typesetters.directions", function(v) trace_directions = v end)
+local trace_details = false trackers.register("typesetters.directions.details", function(v) trace_details = v end)
+local trace_list = false trackers.register("typesetters.directions.list", function(v) trace_list = v end)
-- strong (old):
--
@@ -413,18 +416,12 @@ end
local function get_baselevel(head,list,size,direction)
if direction == lefttoright_code or direction == righttoleft_code then
return direction, true
- elseif getid(head) == localpar_code and start_of_par(head) then
+ elseif getid(head) == par_code and start_of_par(head) then
direction = getdirection(head)
if direction == lefttoright_code or direction == righttoleft_code then
return direction, true
end
end
- -- for old times sake we we handle strings too
- if direction == "TLT" then
- return lefttoright_code, true
- elseif direction == "TRT" then
- return righttoleft_code, true
- end
-- P2, P3
for i=1,size do
local entry = list[i]
@@ -949,14 +946,25 @@ local function apply_to_list(list,size,head,pardir)
elseif id == hlist_code or id == vlist_code then
setdirection(current,pardir) -- is this really needed?
elseif id == glue_code then
+ -- Maybe I should also fix dua and dub but on the other hand ... why?
if enddir and getsubtype(current) == parfillskip_code then
-- insert the last enddir before \parfillskip glue
- head = insert_node_before(head,current,new_direction(enddir,true))
+ local c = current
+ local p = getprev(c)
+ if p and getid(p) == glue_code and getsubtype(p) == parfillleftskip_code then
+ c = p
+ p = getprev(c)
+ end
+ if p and getid(p) == penalty_code then -- linepenalty
+ c = p
+ end
+ -- there is always a par nodes so head will stay
+ head = insert_node_before(head,c,new_direction(enddir,true))
enddir = false
end
elseif begindir then
- if id == localpar_code and start_of_par(current) then
- -- localpar should always be the 1st node
+ if id == par_code and start_of_par(current) then
+ -- par should always be the 1st node
head, current = insert_node_after(head,current,new_direction(begindir))
begindir = nil
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-fkr.mkiv b/Master/texmf-dist/tex/context/base/mkiv/typo-fkr.mkiv
index 7444db511eb..ec1b2907f3e 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-fkr.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-fkr.mkiv
@@ -29,7 +29,7 @@
{\clf_setextrafontkerns{#1}}
\unexpanded\def\resetextrafontkerns
- {\attribute\extrafontkernattribute\attributeunsetvalue}
+ {\c_attr_extrafontkern\attributeunsetvalue}
\appendtoks
\resetextrafontkerns
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-fln.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-fln.lua
index 326d3acf570..3941e65efaa 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-fln.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-fln.lua
@@ -56,7 +56,7 @@ local glyph_code = nodecodes.glyph
local disc_code = nodecodes.disc
local kern_code = nodecodes.kern
local glue_code = nodecodes.glue
-local localpar_code = nodecodes.localpar
+local par_code = nodecodes.par
local spaceskip_code = nodes.gluecodes.spaceskip
@@ -136,7 +136,7 @@ actions[v_line] = function(head,setting)
local temp = copy_node_list(head)
local linebreaks = { }
- set = function(head)
+ local set = function(head)
for g in nextglyph, head do
if dynamic > 0 then
setglyphdata(g,dynamic)
@@ -180,9 +180,9 @@ actions[v_line] = function(head,setting)
-- nodes.handlers.protectglyphs(temp) -- not needed as we discard
-- temp = typesetters.spacings.handler(temp) -- maybe when enabled
-- temp = typesetters.kerns.handler(temp) -- maybe when enabled
--- temp = typesetters.cases.handler(temp) -- maybe when enabled
-flush_node_list(temp);
+ -- temp = typesetters.cases.handler(temp) -- maybe when enabled
local width = getdimensions(temp)
+ flush_node_list(temp)
return width
end
@@ -372,7 +372,7 @@ end
actions[v_default] = actions[v_line]
function firstlines.handler(head)
- if getid(head) == localpar_code and start_of_par(head) then
+ if getid(head) == par_code and start_of_par(head) then
local settings = getprop(head,a_firstline)
if settings then
disableaction("processors","typesetters.firstlines.handler")
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-fln.mkiv b/Master/texmf-dist/tex/context/base/mkiv/typo-fln.mkiv
index 6cca39f91c2..64ec092d6ea 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-fln.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-fln.mkiv
@@ -55,7 +55,7 @@
\definesystemattribute[firstline][public]
\appendtoks
- \attribute\firstlineattribute\attributeunsetvalue
+ \c_attr_firstline\attributeunsetvalue
\to \everyforgetall
\installcorenamespace {firstline}
@@ -81,9 +81,9 @@
\usefirstlinestyleandcolor\c!style\c!color
\clf_setfirstline
alternative {\firstlineparameter\c!alternative}%
- ma \attribute\colormodelattribute
- ca \attribute\colorattribute
- ta \attribute\transparencyattribute
+ ma \c_attr_colormodel
+ ca \c_attr_color
+ ta \c_attr_transparency
n \numexpr\firstlineparameter\c!n\relax
font \fontid\font
dynamic \font_dynamic_value
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-itc.mkvi b/Master/texmf-dist/tex/context/base/mkiv/typo-itc.mkvi
index 5aeb6723971..2bde63857f7 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-itc.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-itc.mkvi
@@ -35,10 +35,14 @@
\fi
\unexpanded\def\italiccorrection
- {\ifnum\attribute\italicsattribute<\plusone\normalitaliccorrection\fi}
+ {\ifnum\c_attr_italics<\plusone\normalitaliccorrection\fi}
+
+\pushoverloadmode
\let\/\italiccorrection
+\popoverloadmode
+
% 1 = end of word
% 2 = end of word and end of a list
@@ -57,7 +61,7 @@
{\clf_setupitaliccorrection{#settings}}
\appendtoks
- \attribute\italicsattribute\attributeunsetvalue
+ \c_attr_italics\attributeunsetvalue
\to \everymathematics
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-itm.mkiv b/Master/texmf-dist/tex/context/base/mkiv/typo-itm.mkiv
index 0bb8170c721..18619957bd7 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-itm.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-itm.mkiv
@@ -122,7 +122,7 @@
\edef\p_typo_items_n{\itemsparameter\c!n}%
\ifx\p_typo_items_n\empty
\getcommalistsize[#2]%
- \c_typo_items_n\commalistsize\relax
+ \c_typo_items_n\commalistsize\relax % \commalistcounter
\else
\c_typo_items_n\p_typo_items_n\relax
\fi
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-krn.mkiv b/Master/texmf-dist/tex/context/base/mkiv/typo-krn.mkiv
index fedbce4d15b..80c71932f94 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-krn.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-krn.mkiv
@@ -41,7 +41,7 @@
\clf_setcharacterkerning{\characterkerningparameter\c!factor}}
\unexpanded\def\resetcharacterkerning % fast one
- {\attribute\kernattribute\attributeunsetvalue}
+ {\c_attr_kern\attributeunsetvalue}
\appendtoks
\resetcharacterkerning
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-lig.mkiv b/Master/texmf-dist/tex/context/base/mkiv/typo-lig.mkiv
index 6171441d6d3..ea1b27b73b2 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-lig.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-lig.mkiv
@@ -24,7 +24,7 @@
\unexpanded\def\noligature#1%
{\dontleavehmode
\begingroup
- \attribute\noligatureattribute\plusone
+ \c_attr_noligature\plusone
#1%
\endgroup}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-lin.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-lin.lua
index 15e543c52e5..84d622e1e9c 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-lin.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-lin.lua
@@ -38,7 +38,7 @@ if not modules then modules = { } end modules ['typo-lin'] = {
-- But, maybe there are good reasons for having just that anchor (mostly for educational purposes
-- I guess.)
--
--- At this stage the localpar node is no longer of any use so we remove it (each line has the
+-- At this stage the par node is no longer of any use so we remove it (each line has the
-- direction attached). We might at some point also strip the disc nodes as they no longer serve
-- a purpose but that can better be a helper. Anchoring left has advantage of keeping page
-- stream.
@@ -65,7 +65,7 @@ local hlist_code = nodecodes.hlist
local glue_code = nodecodes.glue
local kern_code = nodecodes.kern
local linelist_code = listcodes.line
------ localpar_code = nodecodes.localpar
+----- par_code = nodecodes.par
local leftskip_code = gluecodes.leftskip
local rightskip_code = gluecodes.rightskip
local parfillskip_code = gluecodes.parfillskip
@@ -123,10 +123,10 @@ local getreserved = jobpositions.getreserved
local paragraphs = { }
typesetters.paragraphs = paragraphs
-local addskips = false
+local addskips = false -- todo: use engine normalizer
local noflines = 0
--- This is the third version, a mix between immediate (prestice lines) and delayed
+-- This is the third version, a mix between immediate (prestine lines) and delayed
-- as we don't want anchors that are not used.
-- I will make a better variant once lmtx is stable i.e. less clutter.
@@ -185,7 +185,7 @@ local function normalize(line,islocal) -- assumes prestine lines, nothing pre/ap
id = getid(current)
end
-- no:
- -- if id == localpar_code then
+ -- if id == par_code then
-- head = remove_node(head,head,true)
-- end
local tail = find_tail(head)
@@ -236,6 +236,8 @@ function paragraphs.checkline(n)
return getprop(n,"line") or normalize(n,true)
end
+-- do we still need this:
+
function paragraphs.normalize(head,islocal)
if texgetcount("pagebodymode") > 0 then
-- can be an option, maybe we need a proper state in lua itself ... is this check still needed?
@@ -482,7 +484,7 @@ function paragraphs.calculatedelta(n,width,delta,atleft,islocal,followshape,area
addanchortoline(line,setanchor(number))
line.hanchor = true
end
- local blob = getposition(s_anchor,number)
+ local blob = getposition("md:h",number)
if blob then
local reference = getreserved(area,blob.c)
if reference then
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-mar.mkiv b/Master/texmf-dist/tex/context/base/mkiv/typo-mar.mkiv
index 921f1f230c3..95010ab8eaa 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-mar.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-mar.mkiv
@@ -161,8 +161,6 @@
% trialtypesetting: no need for margin stuff while trialing as
% is has no dimensions
-\definesystemconstant{margintext}
-
\newcount\nofmargintexts
\definepagestate[\s!margintext]
@@ -337,7 +335,7 @@
{\endgraf\ifhmode\space\fi}
\appendtoks
- \let\\\spaceorpar
+ \enforced\let\\\spaceorpar
\to \everymargindatacontent
%D Another one:
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-ovl.mkiv b/Master/texmf-dist/tex/context/base/mkiv/typo-ovl.mkiv
index 025ae8a8f9c..767ba3569d4 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-ovl.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-ovl.mkiv
@@ -55,7 +55,7 @@
{\ifcsname\??overloads#1\endcsname\else
\typo_overloads_define{#1}%
\fi
- \attribute\overloadsattribute\csname\??overloads#1\endcsname}
+ \c_attr_overloads\csname\??overloads#1\endcsname}
\unexpanded\def\registeroverloads[#1]%
{\ifcsname\??overloads#1\endcsname\else
@@ -63,7 +63,7 @@
\fi}
\unexpanded\def\resetoverloads
- {\overloadsattribute\attributeunsetvalue}
+ {\c_attr_overloads\attributeunsetvalue}
%D We hook this into the replacement module, probably the only place where it makes
%D sense. Here is an adapted version of an example:
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-plc.mkiv b/Master/texmf-dist/tex/context/base/mkiv/typo-plc.mkiv
new file mode 100644
index 00000000000..dbc9f081db6
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-plc.mkiv
@@ -0,0 +1,39 @@
+%D \module
+%D [ file=typo-plc,
+%D version=2020.07.01,
+%D title=\CONTEXT\ Typesetting Macros,
+%D subtitle=Placeholders,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{ConTeXt Typesetting Macros / Placeholders}
+
+\unprotect
+
+\installcorenamespace {placeholder}
+
+\installcommandhandler \??placeholder {placeholder} \??placeholder
+
+\unexpanded\def\placeholder[#1]%
+ {\begingroup
+ \edef\currentplaceholder{#1}%
+ \placeholderparameter\c!before
+ \useplaceholderstyleandcolor\c!style\c!color
+ \placeholderparameter\c!text
+ \placeholderparameter\c!after
+ \endgroup}
+
+\defineplaceholder
+ [todo]
+ %[\c!text={Still to be written!},
+ [\c!text=todo, % labeltext ?
+ \c!style=\v!bold,
+ \c!before=\blank,
+ \c!after=\blank]
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-pnc.mkiv b/Master/texmf-dist/tex/context/base/mkiv/typo-pnc.mkiv
index 39d0c85f438..f2c588912f4 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-pnc.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-pnc.mkiv
@@ -39,7 +39,7 @@
{\clf_setperiodkerning{\periodkerningparameter\c!factor}}
\unexpanded\def\resetperiodkerning % fast one
- {\attribute\periodkernattribute\attributeunsetvalue}
+ {\c_attr_periodkern\attributeunsetvalue}
\appendtoks
\resetperiodkerning
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-rep.mkiv b/Master/texmf-dist/tex/context/base/mkiv/typo-rep.mkiv
index df840899914..71ab9ffa9d1 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-rep.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-rep.mkiv
@@ -41,7 +41,7 @@
{\clf_setcharacterstripping{#1}}
\unexpanded\def\resetcharacterstripping
- {\attribute\strippingattribute\attributeunsetvalue}
+ {\c_attr_stripping\attributeunsetvalue}
% maybe .. this might disappear, but is handy for testing
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-rub.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-rub.lua
index da63d7b64e9..6c6ab9a3334 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-rub.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-rub.lua
@@ -63,7 +63,7 @@ local glue_code = nodecodes.glue
local penalty_code = nodecodes.penalty
local hlist_code = nodecodes.hlist
local vlist_code = nodecodes.vlist
-local localpar_code = nodecodes.localpar
+local par_code = nodecodes.par
local dir_code = nodecodes.dir
local kerncodes = nodes.kerncodes
@@ -310,7 +310,7 @@ local function whatever(current)
-- go on
elseif id == hlist_code and getwidth(c) == 0 then
-- go on
- elseif id == whatsit_code or id == localpar_code or id == dir_code then
+ elseif id == whatsit_code or id == par_code or id == dir_code then
-- go on
else
l = false
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-spa.mkiv b/Master/texmf-dist/tex/context/base/mkiv/typo-spa.mkiv
index fc73ef02185..682830150fb 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-spa.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-spa.mkiv
@@ -58,7 +58,7 @@
{\clf_setcharacterspacing{#1}}
\unexpanded\def\resetcharacterspacing % fast one
- {\attribute\spacingattribute\attributeunsetvalue}
+ {\c_attr_spacing\attributeunsetvalue}
\appendtoks
\resetcharacterspacing
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-tal.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-tal.lua
index ff10fb12103..db605a4916d 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-tal.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-tal.lua
@@ -51,7 +51,6 @@ local insert_node_before = nuts.insert_before
local insert_node_after = nuts.insert_after
local nextglyph = nuts.traversers.glyph
local getdimensions = nuts.dimensions
-local first_glyph = nuts.first_glyph
local setglue = nuts.setglue
@@ -174,7 +173,6 @@ function characteralign.handler(head,where)
if not datasets then
return head
end
- -- local first = first_glyph(head) -- we could do that once
local first
for n in nextglyph, head do
first = n
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-tal.mkiv b/Master/texmf-dist/tex/context/base/mkiv/typo-tal.mkiv
index 33e071e7537..36e78aee05c 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-tal.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-tal.mkiv
@@ -56,10 +56,10 @@
% D
% D \typebuffer \blank \getbuffer \blank
-\unexpanded\def\signalcharacteralign #1#2{\attribute\characteralignattribute\numexpr#1*\maxcardminusone+#2\relax} % 0xFFFF
+\unexpanded\def\signalcharacteralign #1#2{\c_attr_characteralign\numexpr#1*\maxcardminusone+#2\relax} % 0xFFFF
\unexpanded\def\setcharacteralign #1#2{\clf_setcharacteralign#1{#2}}
\unexpanded\def\resetcharacteralign {\clf_resetcharacteralign}
-\unexpanded\def\nocharacteralign {\attribute\characteralignattribute\attributeunsetvalue}
+\unexpanded\def\nocharacteralign {\c_attr_characteralign\attributeunsetvalue}
\unexpanded\def\setcharacteraligndetail#1#2#3#4{\clf_setcharacteraligndetail#1{#2}#3#4\relax}
%D Mostly downward compatible:
diff --git a/Master/texmf-dist/tex/context/base/mkiv/unic-ini.mkiv b/Master/texmf-dist/tex/context/base/mkiv/unic-ini.mkiv
index 684e3aa0491..a48bd6ad7f5 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/unic-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/unic-ini.mkiv
@@ -17,7 +17,7 @@
\unprotect
-\def\unicodenumber #1{\the \numexpr#1\relax} % no lookahead
+\def\unicodenumber #1{\the\numexpr#1\relax} % no lookahead
\def\unicodehexnumber#1{\cldcontext{number.toevenhex(\number#1))}}
%D \startbuffer
diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-dim.lua b/Master/texmf-dist/tex/context/base/mkiv/util-dim.lua
index 76b5fd20bb3..bb9eca96688 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/util-dim.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/util-dim.lua
@@ -44,8 +44,8 @@ local dimenfactors = allocate {
["pc"] = ( 1/ 12)/65536,
["dd"] = ( 1157/ 1238)/65536,
["cc"] = ( 1157/14856)/65536,
- ["nd"] = (20320/21681)/65536,
- ["nc"] = ( 5080/65043)/65536
+ -- ["nd"] = (20320/21681)/65536,
+ -- ["nc"] = ( 5080/65043)/65536
}
-- print(table.serialize(dimenfactors))
@@ -61,9 +61,9 @@ local dimenfactors = allocate {
-- ["ex"]=6.103515625e-005,
-- ["in"]=2.1113586636917117e-007,
-- ["mm"]=5.3628510057769473e-008,
--- ["nc"]=1.1917446679504327e-006,
--- ["nd"]=1.4300936015405194e-005,
--- ["pc"]=1.2715657552083333e-006,
+-- --["nc"]=1.1917446679504327e-006,
+-- --["nd"]=1.4300936015405194e-005,
+-- --["pc"]=1.2715657552083333e-006,
-- ["pt"]=1.52587890625e-005,
-- ["sp"]=1,
-- }
@@ -79,8 +79,8 @@ local dimenfactors = allocate {
-- ["ex"]=0.00006103515625,
-- ["in"]=0.00000021113587,
-- ["mm"]=0.00000005362851,
--- ["nc"]=0.00000119174467,
--- ["nd"]=0.00001430093602,
+-- --["nc"]=0.00000119174467,
+-- --["nd"]=0.00001430093602,
-- ["pc"]=0.00000127156576,
-- ["pt"]=0.00001525878906,
-- ["sp"]=1,
@@ -128,8 +128,8 @@ function number.tobasepoints (n,fmt) return numbertodimen(n,"bp",fmt) end
function number.topicas (n,fmt) return numbertodimen(n "pc",fmt) end
function number.todidots (n,fmt) return numbertodimen(n,"dd",fmt) end
function number.tociceros (n,fmt) return numbertodimen(n,"cc",fmt) end
-function number.tonewdidots (n,fmt) return numbertodimen(n,"nd",fmt) end
-function number.tonewciceros (n,fmt) return numbertodimen(n,"nc",fmt) end
+-------- number.tonewdidots (n,fmt) return numbertodimen(n,"nd",fmt) end
+-------- number.tonewciceros (n,fmt) return numbertodimen(n,"nc",fmt) end
--[[ldx--
<p>More interesting it to implement a (sort of) dimen datatype, one
diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-fil.lua b/Master/texmf-dist/tex/context/base/mkiv/util-fil.lua
index 79af277437b..183f7bea81f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/util-fil.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/util-fil.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['util-fil'] = {
version = 1.001,
+ optimize = true,
comment = "companion to luat-lib.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-lib.lua b/Master/texmf-dist/tex/context/base/mkiv/util-lib.lua
index a49507c6060..be763d92e91 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/util-lib.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/util-lib.lua
@@ -6,6 +6,8 @@ if not modules then modules = { } end modules ['util-lib'] = {
license = "see context related readme files",
}
+-- not used in context any more
+
--[[
The problem with library bindings is manyfold. They are of course platform
diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-prs.lua b/Master/texmf-dist/tex/context/base/mkiv/util-prs.lua
index 3154bf6c28d..6d2f8c19e06 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/util-prs.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/util-prs.lua
@@ -10,7 +10,7 @@ local lpeg, table, string = lpeg, table, string
local P, R, V, S, C, Ct, Cs, Carg, Cc, Cg, Cf, Cp = lpeg.P, lpeg.R, lpeg.V, lpeg.S, lpeg.C, lpeg.Ct, lpeg.Cs, lpeg.Carg, lpeg.Cc, lpeg.Cg, lpeg.Cf, lpeg.Cp
local lpegmatch, lpegpatterns = lpeg.match, lpeg.patterns
local concat, gmatch, find = table.concat, string.gmatch, string.find
-local tostring, type, next, rawset = tostring, type, next, rawset
+local tonumber, tostring, type, next, rawset = tonumber, tostring, type, next, rawset
local mod, div = math.mod, math.div
utilities = utilities or {}
@@ -373,6 +373,8 @@ hashes.settings_to_set = table.setmetatableindex(function(t,k) -- experiment, n
return v
end)
+-- as we use a next, we are not sure when the gc kicks in
+
getmetatable(hashes.settings_to_set).__mode = "kv" -- could be an option (maybe sharing makes sense)
function parsers.simple_hash_to_string(h, separator)
@@ -538,13 +540,15 @@ function parsers.csvsplitter(specification)
specification = specification and setmetatableindex(specification,defaultspecification) or defaultspecification
local separator = specification.separator
local quotechar = specification.quote
+ local numbers = specification.numbers
local separator = S(separator ~= "" and separator or ",")
local whatever = C((1 - separator - newline)^0)
if quotechar and quotechar ~= "" then
local quotedata = nil
for chr in gmatch(quotechar,".") do
local quotechar = P(chr)
- local quoteword = quotechar * C((1 - quotechar)^0) * quotechar
+ local quoteitem = (1 - quotechar)^0
+ local quoteword = quotechar * (numbers and (quoteitem/tonumber) or C(quoteitem)) * quotechar
if quotedata then
quotedata = quotedata + quoteword
else
@@ -559,29 +563,29 @@ function parsers.csvsplitter(specification)
end
end
--- and this is a slightly patched version of a version posted by Philipp Gesang
-
--- local mycsvsplitter = parsers.rfc4180splitter()
-
-- local crap = [[
-- first,second,third,fourth
-- "1","2","3","4"
--- "a","b","c","d"
--- "foo","bar""baz","boogie","xyzzy"
+-- "5","6","7","8"
-- ]]
+--
+-- local mycsvsplitter = parsers.csvsplitter { numbers = true }
+--
+-- local list = mycsvsplitter(crap) inspect(list)
--- local list, names = mycsvsplitter(crap,true) inspect(list) inspect(names)
--- local list, names = mycsvsplitter(crap) inspect(list) inspect(names)
+-- and this is a slightly patched version of a version posted by Philipp Gesang
function parsers.rfc4180splitter(specification)
specification = specification and setmetatableindex(specification,defaultspecification) or defaultspecification
+ local numbers = specification.numbers
local separator = specification.separator --> rfc: COMMA
local quotechar = P(specification.quote) --> DQUOTE
local dquotechar = quotechar * quotechar --> 2DQUOTE
/ specification.quote
local separator = S(separator ~= "" and separator or ",")
+ local whatever = (dquotechar + (1 - quotechar))^0
local escaped = quotechar
- * Cs((dquotechar + (1 - quotechar))^0)
+ * (numbers and (whatever/tonumber) or Cs(whatever))
* quotechar
local non_escaped = C((1 - quotechar - newline - separator)^1)
local field = escaped + non_escaped + Cc("")
@@ -601,6 +605,18 @@ function parsers.rfc4180splitter(specification)
end
end
+-- local mycsvsplitter = parsers.rfc4180splitter { numbers = true }
+--
+-- local crap = [[
+-- first,second,third,fourth
+-- "1","2","3","4"
+-- "a","b","c","d"
+-- "foo","bar""baz","boogie","xyzzy"
+-- ]]
+--
+-- local list, names = mycsvsplitter(crap,true) inspect(list) inspect(names)
+-- local list, names = mycsvsplitter(crap) inspect(list) inspect(names)
+
-- parsers.stepper("1,7-",9,function(i) print(">>>",i) end)
-- parsers.stepper("1-3,7,8,9")
-- parsers.stepper("1-3,6,7",function(i) print(">>>",i) end)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-sac.lua b/Master/texmf-dist/tex/context/base/mkiv/util-sac.lua
index 47c753ab18b..a8851f4c835 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/util-sac.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/util-sac.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['util-sac'] = {
version = 1.001,
+ optimize = true,
comment = "companion to luat-lib.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-soc-imp-http.lua b/Master/texmf-dist/tex/context/base/mkiv/util-soc-imp-http.lua
index c3a28be822a..d8f45880e7f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/util-soc-imp-http.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/util-soc-imp-http.lua
@@ -59,7 +59,7 @@ local function receiveheaders(sock, headers)
headers = { }
end
-- get first line
- local line, err = sock:receive()
+ local line, err = sock:receive("*l") -- this seems to be wrong!
if err then
return nil, err
end
@@ -72,14 +72,14 @@ local function receiveheaders(sock, headers)
end
name = lower(name)
-- get next line (value might be folded)
- line, err = sock:receive()
+ line, err = sock:receive("*l")
if err then
return nil, err
end
-- unfold any folded values
while find(line, "^%s") do
value = value .. line
- line = sock:receive()
+ line = sock:receive("*l")
if err then
return nil, err
end
@@ -103,7 +103,7 @@ socket.sourcet["http-chunked"] = function(sock, headers)
dirty = function() return sock:dirty() end,
}, {
__call = function()
- local line, err = sock:receive()
+ local line, err = sock:receive("*l")
if err then
return nil, err
end
@@ -114,7 +114,7 @@ socket.sourcet["http-chunked"] = function(sock, headers)
if size > 0 then
local chunk, err, part = sock:receive(size)
if chunk then
- sock:receive()
+ sock:receive("*a")
end
return chunk, err
else
diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-str.lua b/Master/texmf-dist/tex/context/base/mkiv/util-str.lua
index aba7859c31e..0d1f39de9d7 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/util-str.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/util-str.lua
@@ -70,27 +70,63 @@ local function points(n)
n = n * ptf
if n % 1 == 0 then
return format("%ipt",n)
+ else
+ return lpegmatch(stripzeros,format("%.5fpt",n)) -- plural as we need to keep the pt
+ end
+end
+
+local function nupoints(n)
+ if n == 0 then
+ return "0"
+ end
+ n = tonumber(n)
+ if not n or n == 0 then
+ return "0"
+ end
+ n = n * ptf
+ if n % 1 == 0 then
+ return format("%i",n)
+ else
+ return format("%.5f",n) -- no strip
end
- return lpegmatch(stripzeros,format("%.5fpt",n)) -- plural as we need to keep the pt
end
local function basepoints(n)
if n == 0 then
- return "0pt"
+ return "0bp"
end
n = tonumber(n)
if not n or n == 0 then
- return "0pt"
+ return "0bp"
end
n = n * bpf
if n % 1 == 0 then
return format("%ibp",n)
+ else
+ return lpegmatch(stripzeros,format("%.5fbp",n)) -- plural as we need to keep the pt
end
- return lpegmatch(stripzeros,format("%.5fbp",n)) -- plural as we need to keep the pt
end
-number.points = points
-number.basepoints = basepoints
+local function nubasepoints(n)
+ if n == 0 then
+ return "0"
+ end
+ n = tonumber(n)
+ if not n or n == 0 then
+ return "0"
+ end
+ n = n * bpf
+ if n % 1 == 0 then
+ return format("%i",n)
+ else
+ return format("%.5f",n) -- no strip
+ end
+end
+
+number.points = points
+number.nupoints = nupoints
+number.basepoints = basepoints
+number.nubasepoints = nubasepoints
-- str = " \n \ntest \n test\ntest "
-- print("["..string.gsub(string.collapsecrlf(str),"\n","+").."]")
@@ -357,7 +393,9 @@ end
-- U+hexadecimal %...u character number
-- U+HEXADECIMAL %...U character number
-- points %p number (scaled points)
+-- nupoints %P number (scaled points) / without unit / always 5 decimals
-- basepoints %b number (scaled points)
+-- nubasepoints %B number (scaled points) / without unit / always 5 decimals
-- table concat %...t table
-- table concat %{.}t table
-- serialize %...T sequenced (no nested tables)
@@ -616,7 +654,9 @@ local environment = {
concat = table.concat,
signed = number.signed,
points = number.points,
+ nupoints = number.nupoints,
basepoints = number.basepoints,
+ nubasepoints = number.nubasepoints,
utfchar = utf.char,
utfbyte = utf.byte,
lpegmatch = lpeg.match,
@@ -879,11 +919,21 @@ local format_p = function()
return format("points(a%s)",n)
end
+local format_P = function()
+ n = n + 1
+ return format("nupoints(a%s)",n)
+end
+
local format_b = function()
n = n + 1
return format("basepoints(a%s)",n)
end
+local format_B = function()
+ n = n + 1
+ return format("nubasepoints(a%s)",n)
+end
+
local format_t = function(f)
n = n + 1
if f and f ~= "" then
@@ -1057,76 +1107,44 @@ local format_rest = function(s)
return format("%q",s) -- catches " and \n and such
end
--- local format_extension = function(extensions,f,name)
--- local extension = extensions[name] or "tostring(%s)"
--- local f = tonumber(f) or 1
--- local w = find(extension,"%.%.%.")
--- if f == 0 then
--- if w then
--- extension = gsub(extension,"%.%.%.","")
--- end
--- return extension
--- elseif f == 1 then
--- if w then
--- extension = gsub(extension,"%.%.%.","%%s")
--- end
--- n = n + 1
--- local a = "a" .. n
--- return format(extension,a,a) -- maybe more times?
--- elseif f < 0 then
--- local a = "a" .. (n + f + 1)
--- return format(extension,a,a)
--- else
--- if w then
--- extension = gsub(extension,"%.%.%.",rep("%%s,",f-1).."%%s")
--- end
--- -- we could fill an array and then n = n + 1 unpack(t,n,n+f) but as we
--- -- cache we don't save much and there are hardly any extensions anyway
--- local t = { }
--- for i=1,f do
--- n = n + 1
--- -- t[#t+1] = "a" .. n
--- t[i] = "a" .. n
--- end
--- return format(extension,unpack(t))
--- end
--- end
-
local format_extension = function(extensions,f,name)
local extension = extensions[name] or "tostring(%s)"
local f = tonumber(f) or 1
local w = find(extension,"%.%.%.")
- if w then
- -- we have a wildcard
- if f == 0 then
+ if f == 0 then
+ if w then
extension = gsub(extension,"%.%.%.","")
- return extension
- elseif f == 1 then
+ end
+ return extension
+ elseif f == 1 then
+ if w then
extension = gsub(extension,"%.%.%.","%%s")
- n = n + 1
- local a = "a" .. n
- return format(extension,a,a) -- maybe more times?
- elseif f < 0 then
+ end
+ n = n + 1
+ local a = "a" .. n
+ return format(extension,a,a) -- maybe more times?
+ elseif f < 0 then
+ if w then
+ -- not supported
+ extension = gsub(extension,"%.%.%.","")
+ return extension
+ else
local a = "a" .. (n + f + 1)
return format(extension,a,a)
- else
- extension = gsub(extension,"%.%.%.",rep("%%s,",f-1).."%%s")
- -- we could fill an array and then n = n + 1 unpack(t,n,n+f) but as we
- -- cache we don't save much and there are hardly any extensions anyway
- local t = { }
- for i=1,f do
- n = n + 1
- -- t[#t+1] = "a" .. n
- t[i] = "a" .. n
- end
- return format(extension,unpack(t))
end
else
- extension = gsub(extension,"%%s",function()
+ if w then
+ extension = gsub(extension,"%.%.%.",rep("%%s,",f-1).."%%s")
+ end
+ -- we could fill an array and then n = n + 1 unpack(t,n,n+f) but as we
+ -- cache we don't save much and there are hardly any extensions anyway
+ local t = { }
+ for i=1,f do
n = n + 1
- return "a" .. n
- end)
- return extension
+ -- t[#t+1] = "a" .. n
+ t[i] = "a" .. n
+ end
+ return format(extension,unpack(t))
end
end
@@ -1157,7 +1175,7 @@ local builder = Cs { "start",
--
+ V("r")
+ V("h") + V("H") + V("u") + V("U")
- + V("p") + V("b")
+ + V("p") + V("P") + V("b") + V("B")
+ V("t") + V("T")
+ V("l") + V("L")
+ V("I")
@@ -1206,8 +1224,10 @@ local builder = Cs { "start",
["H"] = (prefix_any * P("H")) / format_H, -- %H => 0x0A1B2 (when - no 0x) was V
["u"] = (prefix_any * P("u")) / format_u, -- %u => u+0a1b2 (when - no u+)
["U"] = (prefix_any * P("U")) / format_U, -- %U => U+0A1B2 (when - no U+)
- ["p"] = (prefix_any * P("p")) / format_p, -- %p => 12.345pt / maybe: P (and more units)
- ["b"] = (prefix_any * P("b")) / format_b, -- %b => 12.342bp / maybe: B (and more units)
+ ["p"] = (prefix_any * P("p")) / format_p, -- %p => 12.345pt
+ ["P"] = (prefix_any * P("P")) / format_P, -- %p => 12.345
+ ["b"] = (prefix_any * P("b")) / format_b, -- %b => 12.342bp
+ ["B"] = (prefix_any * P("B")) / format_B, -- %b => 12.342
["t"] = (prefix_tab * P("t")) / format_t, -- %t => concat
["T"] = (prefix_tab * P("T")) / format_T, -- %t => sequenced
["l"] = (prefix_any * P("l")) / format_l, -- %l => boolean
diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-tab.lua b/Master/texmf-dist/tex/context/base/mkiv/util-tab.lua
index 4dafb2acd65..9f7112eb915 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/util-tab.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/util-tab.lua
@@ -961,3 +961,12 @@ function table.ordered(t)
return function() end
end
end
+
+-- function table.randomremove(t,n)
+-- if not n then
+-- n = #t
+-- end
+-- if n > 0 then
+-- return remove(t,random(1,n))
+-- end
+-- end